mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jonas Rebmann <jre@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 BAREBOX <barebox@lists.infradead.org>
Cc: Tobias Waldekranz <tobias@waldekranz.com>,
	 Jonas Rebmann <jre@pengutronix.de>
Subject: [PATCH v2 1/9] test: when testfs feature is available, always enable it
Date: Mon, 29 Sep 2025 10:03:52 +0200	[thread overview]
Message-ID: <20250929-tlv-integration-v2-1-55f75da7e670@pengutronix.de> (raw)
In-Reply-To: <20250929-tlv-integration-v2-0-55f75da7e670@pengutronix.de>

Add 9pfs devices to the qemu commandline on all platforms that support
it (multi_v7, multi_v8) so tests relying upon it can be ran without
specifying --fs testfs=${KBUILD_OUTPUT}/testfs.

Moving logic out of the github workflow into pytest makes integration
tests more accessible to developers.

Introduce the fixture in existing test and drop obsolete test.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
 .github/workflows/test-labgrid-pytest.yml | 3 ---
 conftest.py                               | 6 ++++++
 test/py/test_dm.py                        | 6 +-----
 test/py/test_fit.py                       | 4 ----
 4 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml
index ccf8ae172c..604f1db2fb 100644
--- a/.github/workflows/test-labgrid-pytest.yml
+++ b/.github/workflows/test-labgrid-pytest.yml
@@ -116,9 +116,6 @@ jobs:
           grep -wq '\(QEMUDriver\|ExternalConsoleDriver\):' "$i" || continue
 
           extraargs="${{matrix.lgargs}}"
-          if grep -wq 'testfs' "$i"; then
-            extraargs="${extraargs} --fs testfs=${KBUILD_OUTPUT}/testfs"
-          fi
 
           cfg=$(basename $i .yaml)
           echo "Testing $cfg"
diff --git a/conftest.py b/conftest.py
index 06321c938d..00969e62df 100644
--- a/conftest.py
+++ b/conftest.py
@@ -208,6 +208,12 @@ def strategy(request, target, pytestconfig):
     for arg in pytestconfig.option.qemu_arg:
         strategy.append_qemu_args(arg)
 
+    if "testfs" in features:
+        if not any(fs and fs[0] == "testfs" for fs in pytestconfig.option.qemu_fs):
+            testfs_path = os.path.join(os.environ["LG_BUILDDIR"], "testfs")
+            pytestconfig.option.qemu_fs.append(["testfs", testfs_path])
+            os.makedirs(testfs_path, exist_ok=True)
+
     for i, fs in enumerate(pytestconfig.option.qemu_fs):
         if virtio:
             path = fs.pop()
diff --git a/test/py/test_dm.py b/test/py/test_dm.py
index a9debd85b5..8bdacf7b4e 100644
--- a/test/py/test_dm.py
+++ b/test/py/test_dm.py
@@ -6,11 +6,7 @@ from .helper import of_get_property
 
 
 
-def test_dm_verity(barebox):
-    _, _, returncode = barebox.run("ls /mnt/9p/testfs")
-    if returncode != 0:
-        pytest.xfail("skipping test due to missing --fs testfs=")
-
+def test_dm_verity(barebox, testfs):
     barebox.run_check("cd /mnt/9p/testfs")
 
     # Since commands run in a subshell, export the root hash in a
diff --git a/test/py/test_fit.py b/test/py/test_fit.py
index 1a23a53a32..08d5feba5c 100644
--- a/test/py/test_fit.py
+++ b/test/py/test_fit.py
@@ -19,10 +19,6 @@ def test_fit(barebox, env, target, barebox_config):
     if 'testfs' not in env.get_target_features():
         pytest.xfail("testfs feature not specified")
 
-    _, _, returncode = barebox.run("ls /mnt/9p/testfs")
-    if returncode != 0:
-        pytest.xfail("skipping test due to missing --fs testfs=")
-
     _, _, returncode = barebox.run(f"ls {fit_name('gzipped')}")
     if returncode != 0:
         pytest.xfail("skipping test due to missing FIT image")

-- 
2.51.0.297.gca2559c1d6




  reply	other threads:[~2025-09-29  8:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29  8:03 [PATCH v2 0/9] TLV integration tests and test/py cleanup Jonas Rebmann
2025-09-29  8:03 ` Jonas Rebmann [this message]
2025-09-29  8:03 ` [PATCH v2 2/9] test: provide testfs via fixture Jonas Rebmann
2025-09-29  8:03 ` [PATCH v2 3/9] test: move dm-verity testdata generation to fixture Jonas Rebmann
2025-09-29  8:03 ` [PATCH v2 4/9] test: move fitimage testdata generation to fixture and drop script Jonas Rebmann
2025-09-29  8:03 ` [PATCH v2 5/9] test: py: test_bootchooser: remove dead code Jonas Rebmann
2025-09-29  8:03 ` [PATCH v2 6/9] commands: tlv: clarify error opening tlv Jonas Rebmann
2025-09-29  8:03 ` [PATCH v2 7/9] ci: container: install crcmod and cryptography Jonas Rebmann
2025-09-29  8:03 ` [PATCH v2 8/9] configs: enable tlv command for multi_v7 and multi_v8 Jonas Rebmann
2025-09-29  8:04 ` [PATCH v2 9/9] test: py: add TLV integration tests Jonas Rebmann

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=20250929-tlv-integration-v2-1-55f75da7e670@pengutronix.de \
    --to=jre@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --cc=tobias@waldekranz.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox