mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-10 01:17:44 +03:00
test-capability: skip tests that need CAP_NET_RAW if cap is not passed
See: #19746
This commit is contained in:
parent
ffc36c276c
commit
e80cb4cba4
@ -159,9 +159,15 @@ static void test_drop_privileges_fail(void) {
|
||||
}
|
||||
|
||||
static void test_drop_privileges(void) {
|
||||
fork_test(test_drop_privileges_fail);
|
||||
|
||||
if (have_effective_cap(CAP_NET_RAW) == 0) /* The remaining two tests only work if we have CAP_NET_RAW
|
||||
* in the first place. If we are run in some restricted
|
||||
* container environment we might not. */
|
||||
return;
|
||||
|
||||
fork_test(test_drop_privileges_keep_net_raw);
|
||||
fork_test(test_drop_privileges_dontkeep_net_raw);
|
||||
fork_test(test_drop_privileges_fail);
|
||||
}
|
||||
|
||||
static void test_have_effective_cap(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user