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)
Dec 31 2023, 11:16 PM
Unknown Object (File)
Dec 21 2023, 7:16 PM
Unknown Object (File)
Nov 19 2023, 1:42 AM
Unknown Object (File)
Nov 19 2023, 12:58 AM
Unknown Object (File)
Nov 13 2023, 4:55 AM
Unknown Object (File)
Nov 8 2023, 9:56 PM
Unknown Object (File)
Oct 8 2023, 3:54 AM
Unknown Object (File)
Oct 7 2023, 8:50 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