From 0966fb1b74b38b31dc83e3cca48701ec796bf73a Mon Sep 17 00:00:00 2001 From: David Bright Date: Tue, 12 Apr 2022 09:15:06 -0700 Subject: [PATCH] Extend the length of dirpath to fix failure in kyua test When an overlength path is set as the temporary directory for test case sys/audit/inter-process:shm_unlink_success, the test will fail, e.g. ``` root@freebsd:/usr/tests/sys/audit # env TMPDIR=/var/tmp/tests/kyua kyua test inter-process:shm_unlink_success inter-process:shm_unlink_success -> failed: shm_unlink.*fileforaudit.*return,success not found in auditpipe within the time limit [10.452s] Results file id is usr_tests_sys_audit.20220412-221852-924310 Results saved to /root/.kyua/store/results.usr_tests_sys_audit.20220412-221852-924310.db 0/1 passed (1 failed) ``` The root cause is that dirpath is defined too small to handle it. Reviewers: vangyzen, dab Differential Revision: https://reviews.freebsd.org/D34885 Submitted by: Yongbo Yao (yongbo.yao@dell.com) Sponsored by: Dell Technologies --- tests/sys/audit/inter-process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/audit/inter-process.c b/tests/sys/audit/inter-process.c index f29c23a4326b..6a9111712bf2 100644 --- a/tests/sys/audit/inter-process.c +++ b/tests/sys/audit/inter-process.c @@ -1454,7 +1454,7 @@ ATF_TC_HEAD(shm_unlink_success, tc) ATF_TC_BODY(shm_unlink_success, tc) { /* Build an absolute path to a file in the test-case directory */ - char dirpath[50]; + char dirpath[PATH_MAX]; ATF_REQUIRE(getcwd(dirpath, sizeof(dirpath)) != NULL); strlcat(dirpath, path, sizeof(dirpath)); ATF_REQUIRE(shm_open(dirpath, O_CREAT | O_TRUNC | O_RDWR, 0600) != -1);