Page MenuHomeFreeBSD

Do not run cap_fileargs tests if build without capsicum capabilities
AcceptedPublic

Authored by olivier on Jan 25 2021, 10:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 15 2025, 1:21 PM
Unknown Object (File)
Oct 13 2025, 4:36 PM
Unknown Object (File)
Oct 13 2025, 12:42 PM
Unknown Object (File)
Oct 13 2025, 11:25 AM
Unknown Object (File)
Sep 25 2025, 1:39 AM
Unknown Object (File)
Sep 11 2025, 5:26 PM
Unknown Object (File)
Jul 26 2025, 11:37 AM
Unknown Object (File)
Jun 22 2025, 6:15 PM
Subscribers

Details

Reviewers
oshogbo
Summary

Check if CAPABILITY_MODE and CAPABILITIES are presents, and skip (in place of fail) the test if not

Test Plan

On a kernel without CAPABILITY, test results before:

lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__fopen_create  ->  failed: /usr/src/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c:215: cap_rights_get(fd, &fdrights) == 0 not met [0.004s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__fopen_read  ->  failed: /usr/src/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c:215: cap_rights_get(fd, &fdrights) == 0 not met  [0.034s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__fopen_write  ->  failed: /usr/src/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c:215: cap_rights_get(fd, &fdrights) == 0 not met  [0.033s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__open_create  ->  failed: /usr/src/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c:215: cap_rights_get(fd, &fdrights) == 0 not met  [0.004s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__open_lstat  ->  failed: /usr/src/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c:215: cap_rights_get(fd, &fdrights) == 0 not met  [0.034s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__open_read  ->  failed: /usr/src/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c:215: cap_rights_get(fd, &fdrights) == 0 not met  [0.033s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__open_realpath  ->  failed: /usr/src/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c:215: cap_rights_get(fd, &fdrights) == 0 not met  [0.033s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__open_write  ->  failed: /usr/src/lib/libcasper/services/cap_fileargs/tests/fileargs_test.c:215: cap_rights_get(fd, &fdrights) == 0 not met  [0.033s]

And test results after this patch:

PREPROD.cache.netflix# kyua test lib/libcasper/services/cap_fileargs/fileargs_test
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__fopen_create  ->  skipped: kernel feature (security_capabilities) not present  [0.002s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__fopen_read  ->  skipped: kernel feature (security_capabilities) not present  [0.002s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__fopen_write  ->  skipped: kernel feature (security_capabilities) not present  [0.002s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__lstat  ->  skipped: kernel feature (security_capabilities) not present  [0.002s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__open_create  ->  skipped: kernel feature (security_capabilities) not present  [0.002s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__open_lstat  ->  skipped: kernel feature (security_capabilities) not present  [0.002s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__open_read  ->  skipped: kernel feature (security_capabilities) not present  [0.002s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__open_realpath  ->  skipped: kernel feature (security_capabilities) not present [0.002s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__open_with_casper  ->  skipped: kernel feature (security_capabilities) not present  [0.002s]
lib/libcasper/services/cap_fileargs/fileargs_test:fileargs__open_write  ->  skipped: kernel feature (security_capabilities) not present  [0.002s]

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped