diff --git a/support/testing/tests/package/test_acl.py b/support/testing/tests/package/test_acl.py index e4827c7bec..4511c6db5b 100644 --- a/support/testing/tests/package/test_acl.py +++ b/support/testing/tests/package/test_acl.py @@ -52,8 +52,7 @@ class TestAcl(infra.basetest.BRTest): # Reading the file as the test user is expected to fail. test_read_cmd = f"su - {test_user} -c 'cat {test_file}'" - _, ret = self.emulator.run(test_read_cmd) - self.assertNotEqual(ret, 0) + self.assertRunNotOk(test_read_cmd) # We add a special read ACL for the test user. cmd = f"setfacl -m u:{test_user}:r {test_file}" @@ -73,8 +72,7 @@ class TestAcl(infra.basetest.BRTest): # Attempting to write to the file as the test user is expected # to fail (since we put an ACL only for reading). cmd = f"su - {test_user} -c 'echo WriteTest > {test_file}'" - _, ret = self.emulator.run(cmd) - self.assertNotEqual(ret, 0) + self.assertRunNotOk(cmd) # Remove all ACLs. This could have been done with the command # "setfacl -b". Instead, we use the "chacl -B" command which @@ -83,5 +81,4 @@ class TestAcl(infra.basetest.BRTest): self.assertRunOk(f"chacl -B {test_file}") # Reading the file as the test user is expected to fail again. - _, ret = self.emulator.run(test_read_cmd) - self.assertNotEqual(ret, 0) + self.assertRunNotOk(test_read_cmd)