Changeset View
Changeset View
Standalone View
Standalone View
tests/sys/audit/file-close.c
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | |||||
ATF_TC_HEAD(closefrom_success, tc) | ATF_TC_HEAD(closefrom_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 " | ||||
"closefrom(2) call"); | "closefrom(2) call"); | ||||
} | } | ||||
ATF_TC_BODY(closefrom_success, tc) | ATF_TC_BODY(closefrom_success, tc) | ||||
{ | { | ||||
const char *regex = "closefrom.*return,success"; | const char *regex = "close_range\\(2\\),.*,0x7fffffff,lowfd,.*" | ||||
"0xffffffff,highfd,.*return,success"; | |||||
FILE *pipefd = setup(fds, auclass); | FILE *pipefd = setup(fds, auclass); | ||||
atf_tc_expect_fail("closefrom was converted to close_range"); | |||||
/* closefrom(2) returns 'void' */ | /* closefrom(2) returns 'void' */ | ||||
closefrom(INT_MAX); | closefrom(INT_MAX); | ||||
check_audit(fds, regex, pipefd); | check_audit(fds, regex, pipefd); | ||||
} | } | ||||
ATF_TC_CLEANUP(closefrom_success, tc) | ATF_TC_CLEANUP(closefrom_success, tc) | ||||
{ | { | ||||
cleanup(); | cleanup(); | ||||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |