]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: drop the precondition check for inherited flag
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 8 Nov 2018 08:40:13 +0000 (09:40 +0100)
committerLukáš Nykrýn <lnykryn@redhat.com>
Tue, 15 Jan 2019 10:02:01 +0000 (11:02 +0100)
Docker's default capability set has the inherited flag already
set - that breaks tests which expect otherwise. Let's just
drop the check and run the test anyway.

Fixes #10663

Cherry-picked from: c446b8486d9ed18d1bc780948ae9ee8a53fa4c3f

src/test/test-capability.c

index af6d808b6dabcb5b13e67345defee1b72eaa1d0e..72975cef94719b19d8c928dda5062a94bb193099 100644 (file)
@@ -180,8 +180,6 @@ static void test_update_inherited_set(void) {
 
         caps = cap_get_proc();
         assert_se(caps);
-        assert_se(!cap_get_flag(caps, CAP_CHOWN, CAP_INHERITABLE, &fv));
-        assert(fv == CAP_CLEAR);
 
         set = (UINT64_C(1) << CAP_CHOWN);
 
@@ -197,12 +195,6 @@ static void test_set_ambient_caps(void) {
         uint64_t set = 0;
         cap_flag_value_t fv;
 
-        caps = cap_get_proc();
-        assert_se(caps);
-        assert_se(!cap_get_flag(caps, CAP_CHOWN, CAP_INHERITABLE, &fv));
-        assert(fv == CAP_CLEAR);
-        cap_free(caps);
-
         assert_se(prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_IS_SET, CAP_CHOWN, 0, 0) == 0);
 
         set = (UINT64_C(1) << CAP_CHOWN);