From 0a891269b963874eba0925fef84650ba47456421 Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Thu, 18 Jun 2026 14:47:55 +0200 Subject: [PATCH] support/testing: test_audit.py: use assertRunNotOk() Use the helper to simplify the test. Signed-off-by: Peter Korsgaard (cherry picked from commit eb0ef1fd987a6b599c03b3b99499b882867cb58f) Signed-off-by: Thomas Perale --- support/testing/tests/package/test_audit.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/support/testing/tests/package/test_audit.py b/support/testing/tests/package/test_audit.py index f68a4b6831..722542a845 100644 --- a/support/testing/tests/package/test_audit.py +++ b/support/testing/tests/package/test_audit.py @@ -80,8 +80,7 @@ class TestAudit(infra.basetest.BRTest): # normal user. This command is expected to fail (as only root # can root is supposed to read this file). cmd = f"su - {user} -c 'cat /etc/shadow'" - _, ret = self.emulator.run(cmd) - self.assertNotEqual(ret, 0) + self.assertRunNotOk(cmd) # Our last failed read attempt is supposed to have generated # an event. We check we can see it in the log.