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
F170690068: D28341.id.diff
Sun, Sep 6, 1:18 AM
Unknown Object (File)
Sat, Sep 5, 7:27 PM
Unknown Object (File)
Thu, Sep 3, 9:24 PM
Unknown Object (File)
Thu, Sep 3, 6:14 PM
Unknown Object (File)
Thu, Sep 3, 6:13 PM
Unknown Object (File)
Thu, Sep 3, 5:48 PM
Unknown Object (File)
Thu, Sep 3, 5:19 PM
Unknown Object (File)
Tue, Sep 1, 7:12 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