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)
Tue, Mar 18, 4:22 PM
Unknown Object (File)
Fri, Mar 14, 3:09 AM
Unknown Object (File)
Mon, Mar 10, 3:41 PM
Unknown Object (File)
Mon, Mar 10, 2:09 PM
Unknown Object (File)
Mon, Mar 10, 10:01 AM
Unknown Object (File)
Dec 2 2024, 10:48 PM
Unknown Object (File)
Oct 31 2024, 6:57 PM
Unknown Object (File)
Oct 18 2024, 6:35 AM
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