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
This commit is contained in:
David Bright 2022-04-12 09:15:06 -07:00
parent bd1eafcdd0
commit 0966fb1b74

View File

@ -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);