Changeset View
Changeset View
Standalone View
Standalone View
head/tests/sys/audit/network.c
Show First 20 Lines • Show All 1,091 Lines • ▼ Show 20 Lines | |||||
ATF_TC_HEAD(setfib_success, tc) | ATF_TC_HEAD(setfib_success, tc) | ||||
{ | { | ||||
atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " | atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " | ||||
"setfib(2) call"); | "setfib(2) call"); | ||||
} | } | ||||
ATF_TC_BODY(setfib_success, tc) | ATF_TC_BODY(setfib_success, tc) | ||||
{ | { | ||||
/* BSM conversion requested for unknown event 43228 */ | |||||
atf_tc_expect_fail("PR 228374: setfib(2) does not get audited in success mode"); | |||||
pid = getpid(); | pid = getpid(); | ||||
snprintf(extregex, sizeof(extregex), "setfib.*%d.*return,success", pid); | snprintf(extregex, sizeof(extregex), "setfib.*%d.*return,success", pid); | ||||
FILE *pipefd = setup(fds, auclass); | FILE *pipefd = setup(fds, auclass); | ||||
ATF_REQUIRE_EQ(0, setfib(0)); | ATF_REQUIRE_EQ(0, setfib(0)); | ||||
check_audit(fds, extregex, pipefd); | check_audit(fds, extregex, pipefd); | ||||
} | } | ||||
ATF_TC_CLEANUP(setfib_success, tc) | ATF_TC_CLEANUP(setfib_success, tc) | ||||
{ | { | ||||
cleanup(); | cleanup(); | ||||
} | } | ||||
ATF_TC_WITH_CLEANUP(setfib_failure); | ATF_TC_WITH_CLEANUP(setfib_failure); | ||||
ATF_TC_HEAD(setfib_failure, tc) | ATF_TC_HEAD(setfib_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 " | ||||
"setfib(2) call"); | "setfib(2) call"); | ||||
} | } | ||||
ATF_TC_BODY(setfib_failure, tc) | ATF_TC_BODY(setfib_failure, tc) | ||||
{ | { | ||||
/* BSM conversion requested for unknown event 43228 */ | |||||
atf_tc_expect_fail("PR 228374: setfib(2) does not get audited in failure mode"); | |||||
pid = getpid(); | pid = getpid(); | ||||
snprintf(extregex, sizeof(extregex), "setfib.*%d.*return,failure", pid); | snprintf(extregex, sizeof(extregex), "setfib.*%d.*return,failure", pid); | ||||
FILE *pipefd = setup(fds, auclass); | FILE *pipefd = setup(fds, auclass); | ||||
ATF_REQUIRE_EQ(-1, setfib(-1)); | ATF_REQUIRE_EQ(-1, setfib(-1)); | ||||
check_audit(fds, extregex, pipefd); | check_audit(fds, extregex, pipefd); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |