Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/audit/administrative.c
Show First 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | |||||
ATF_TC_CLEANUP(auditctl_success, tc) | ATF_TC_CLEANUP(auditctl_success, tc) | ||||
{ | { | ||||
/* | /* | ||||
* auditctl(2) disables audit log at /var/audit and initiates auditing | * auditctl(2) disables audit log at /var/audit and initiates auditing | ||||
* at the configured path. To reset this, we need to stop and start the | * at the configured path. To reset this, we need to stop and start the | ||||
* auditd(8) again. Here, we check if auditd(8) was running already | * auditd(8) again. Here, we check if auditd(8) was running already | ||||
* before the test started. If so, we stop and start it again. | * before the test started. If so, we stop and start it again. | ||||
* | |||||
* TODO: should we skip this test if auditd(8) is already running to | |||||
* avoid restarting it? | |||||
*/ | */ | ||||
if (!atf_utils_file_exists("started_fake_auditd")) { | |||||
system("service auditd onestop > /dev/null 2>&1"); | system("service auditd onestop > /dev/null 2>&1"); | ||||
if (!atf_utils_file_exists("started_auditd")) | |||||
system("service auditd onestart > /dev/null 2>&1"); | system("service auditd onestart > /dev/null 2>&1"); | ||||
} else { | |||||
cleanup(); | |||||
} | |||||
} | } | ||||
ATF_TC_WITH_CLEANUP(auditctl_failure); | ATF_TC_WITH_CLEANUP(auditctl_failure); | ||||
ATF_TC_HEAD(auditctl_failure, tc) | ATF_TC_HEAD(auditctl_failure, tc) | ||||
{ | { | ||||
atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " | atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " | ||||
"auditctl(2) call"); | "auditctl(2) call"); | ||||
▲ Show 20 Lines • Show All 1,333 Lines • Show Last 20 Lines |