git: 0966fb1b74b3 - main - Extend the length of dirpath to fix failure in kyua test
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 12 Apr 2022 16:26:50 UTC
The branch main has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=0966fb1b74b38b31dc83e3cca48701ec796bf73a commit 0966fb1b74b38b31dc83e3cca48701ec796bf73a Author: David Bright <dab@FreeBSD.org> AuthorDate: 2022-04-12 16:15:06 +0000 Commit: David Bright <dab@FreeBSD.org> CommitDate: 2022-04-12 16:23:56 +0000 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);