Changeset View
Changeset View
Standalone View
Standalone View
head/tests/sys/audit/file-attribute-access.c
Show First 20 Lines • Show All 377 Lines • ▼ Show 20 Lines | |||||
ATF_TC_HEAD(lgetfh_success, tc) | ATF_TC_HEAD(lgetfh_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 " | ||||
"lgetfh(2) call"); | "lgetfh(2) call"); | ||||
} | } | ||||
ATF_TC_BODY(lgetfh_success, tc) | ATF_TC_BODY(lgetfh_success, tc) | ||||
{ | { | ||||
/* BSM conversion requested for unknown event 43061 */ | |||||
atf_tc_expect_fail("PR 228374: lgetfh(2) does not get audited in success mode"); | |||||
/* Symbolic link needs to exist to get a file-handle */ | /* Symbolic link needs to exist to get a file-handle */ | ||||
ATF_REQUIRE_EQ(0, symlink("symlink", path)); | ATF_REQUIRE_EQ(0, symlink("symlink", path)); | ||||
const char *regex = "lgetfh.*return,success"; | const char *regex = "lgetfh.*return,success"; | ||||
FILE *pipefd = setup(fds, "fa"); | FILE *pipefd = setup(fds, "fa"); | ||||
ATF_REQUIRE_EQ(0, lgetfh(path, &fht)); | ATF_REQUIRE_EQ(0, lgetfh(path, &fht)); | ||||
check_audit(fds, regex, pipefd); | check_audit(fds, regex, pipefd); | ||||
} | } | ||||
ATF_TC_CLEANUP(lgetfh_success, tc) | ATF_TC_CLEANUP(lgetfh_success, tc) | ||||
{ | { | ||||
cleanup(); | cleanup(); | ||||
} | } | ||||
ATF_TC_WITH_CLEANUP(lgetfh_failure); | ATF_TC_WITH_CLEANUP(lgetfh_failure); | ||||
ATF_TC_HEAD(lgetfh_failure, tc) | ATF_TC_HEAD(lgetfh_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 " | ||||
"lgetfh(2) call"); | "lgetfh(2) call"); | ||||
} | } | ||||
ATF_TC_BODY(lgetfh_failure, tc) | ATF_TC_BODY(lgetfh_failure, tc) | ||||
{ | { | ||||
/* BSM conversion requested for unknown event 43061 */ | |||||
atf_tc_expect_fail("PR 228374: lgetfh(2) does not get audited in failure mode"); | |||||
const char *regex = "lgetfh.*return,failure"; | const char *regex = "lgetfh.*return,failure"; | ||||
FILE *pipefd = setup(fds, "fa"); | FILE *pipefd = setup(fds, "fa"); | ||||
/* Failure reason: symbolic link does not exist */ | /* Failure reason: symbolic link does not exist */ | ||||
ATF_REQUIRE_EQ(-1, lgetfh(errpath, &fht)); | ATF_REQUIRE_EQ(-1, lgetfh(errpath, &fht)); | ||||
check_audit(fds, regex, pipefd); | check_audit(fds, regex, pipefd); | ||||
} | } | ||||
ATF_TC_CLEANUP(lgetfh_failure, tc) | ATF_TC_CLEANUP(lgetfh_failure, tc) | ||||
▲ Show 20 Lines • Show All 825 Lines • Show Last 20 Lines |