tests/testthat/test-root.R

#these tests are only for root
context("root user tests")
if(getuid() == 0){
	test_that("setuid, setgid", {
		#test getuid
		expect_that(eval_safe(getuid(), uid=1000), equals(1000));
		expect_that(eval_safe(getuid(), gid=1000, uid=1000), equals(1000));
		
		#test getgid
		expect_that(eval_safe(getgid(), gid=1000), equals(1000));
		expect_that(eval_safe(getgid(), gid=1000, uid=1000), equals(1000));
		
		
	});
} else {
	cat("skip.")
}
jeroenooms/RAppArmor documentation built on Sept. 24, 2024, 1:45 p.m.