All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@buildroot.org
Cc: Julien Olivain <ju.o@free.fr>
Subject: [Buildroot] [PATCH 03/29] support/testing: test_acl.py: use assertRunNotOk()
Date: Thu, 18 Jun 2026 14:47:54 +0200	[thread overview]
Message-ID: <20260618124835.2935850-3-peter@korsgaard.com> (raw)
In-Reply-To: <20260618124835.2935850-1-peter@korsgaard.com>

Use the helper to simplify the test.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 support/testing/tests/package/test_acl.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

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)
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2026-06-18 12:50 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 12:47 [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 02/29] support/testing: test_systemd.py: use assertRun{, Not}Ok() Peter Korsgaard
2026-06-18 12:47 ` Peter Korsgaard [this message]
2026-06-18 12:47 ` [Buildroot] [PATCH 04/29] support/testing: test_audit.py: use assertRunNotOk() Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 05/29] support/testing: test_bitcoin.py: " Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 06/29] support/testing: test_connman.py: " Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 07/29] support/testing: test_cryptsetup.py: " Peter Korsgaard
2026-06-18 12:47 ` [Buildroot] [PATCH 08/29] support/testing: test_ddrescue.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 09/29] support/testing: test_dos2unix.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 10/29] support/testing: test_fping.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 11/29] support/testing: test_gnupg2.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 12/29] support/testing: test_iproute2.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 13/29] support/testing: test_iptables.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 14/29] support/testing: test_jq.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 15/29] support/testing: test_kmod.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 16/29] support/testing: test_libgpgme.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 17/29] support/testing: test_lsof.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 18/29] support/testing: test_mariadb.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 19/29] support/testing: test_mtools.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 20/29] support/testing: test_nftables.py: " Peter Korsgaard
2026-06-18 21:24   ` Fiona Klute via buildroot
2026-06-18 12:48 ` [Buildroot] [PATCH 21/29] support/testing: test_octave.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 22/29] support/testing: test_polkit.py: use assertRun{, Not}Ok() Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 23/29] support/testing: test_postgresql.py: use assertRunNotOk() Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 24/29] support/testing: test_rasdaemon.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 25/29] support/testing: test_screen.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 26/29] support/testing: test_swipl.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 27/29] support/testing: test_usbip.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 28/29] support/testing: test_weston.py: " Peter Korsgaard
2026-06-18 12:48 ` [Buildroot] [PATCH 29/29] support/testing: test_which.py: " Peter Korsgaard
2026-06-18 21:23 ` [Buildroot] [PATCH 01/29] support/testing: infra: add assertRunNotOk() Fiona Klute via buildroot
2026-06-19  9:02 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260618124835.2935850-3-peter@korsgaard.com \
    --to=peter@korsgaard.com \
    --cc=buildroot@buildroot.org \
    --cc=ju.o@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.