mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 4/6] test: sandbox: support testing with Labgrid
Date: Mon, 12 Aug 2024 11:15:20 +0200	[thread overview]
Message-ID: <20240812091522.3035469-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240812091522.3035469-1-a.fatoum@pengutronix.de>

From: Bastian Krause <bst@pengutronix.de>

It turns out there is already support in Labgrid to execute an
interactive console application and run tests against it.

Switch our test/sandbox/sandbox_defconfig.yaml to use this, so we can
eventually test sandbox in CI as well.

For proper operation, we require that labgrid doesn't buffer output
of the barebox sandbox process, which was recently fixed in [1].

[1]: https://github.com/labgrid-project/labgrid/pull/1440

Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/emulate.pl                     |  6 +++---
 test/sandbox/sandbox_defconfig.yaml | 17 ++++++++++-------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/test/emulate.pl b/test/emulate.pl
index 086fae0f7708..df21d5c727bf 100755
--- a/test/emulate.pl
+++ b/test/emulate.pl
@@ -340,12 +340,12 @@ sub emulate {
 
 	    vsystem($temu{temu_bin}, "tinyemu.cfg", @OPTS) == 0
 		or die "Error running emulator: $?\n";
-    } elsif (defined $target{drivers}{NativeExecutableDriver}) {
-	    my %exec = %{$target{drivers}{NativeExecutableDriver}};
+    } elsif (defined $target{drivers}{ExternalConsoleDriver}) {
+	    my %exec = %{$target{drivers}{ExternalConsoleDriver}};
 
 	    pushd($args{builddir}) if $tuxmake;
 
-	    vsystem($exec{command}, @OPTS) == 0 or die "Error running emulator: $?\n";
+	    vsystem($exec{cmd}, @OPTS) == 0 or die "Error running emulator: $?\n";
     }
 
     popd() if $tuxmake;
diff --git a/test/sandbox/sandbox_defconfig.yaml b/test/sandbox/sandbox_defconfig.yaml
index 784f49146605..eb9ab7f17a55 100644
--- a/test/sandbox/sandbox_defconfig.yaml
+++ b/test/sandbox/sandbox_defconfig.yaml
@@ -1,12 +1,15 @@
 targets:
   main:
     drivers:
-      NativeExecutableDriver: # not yet supported by labgrid, only for interactive use
-        command: ./barebox
-        image: barebox
+      ExternalConsoleDriver:
+        cmd: !template "$LG_BUILDDIR/barebox"
+      ExternalPowerDriver:
+        cmd_on: 'true'
+        cmd_off: 'true'
+      BareboxDriver:
+        prompt: "barebox@[^:]+:[^ ]+ "
+      BareboxTestStrategy: {}
     runner:
       tuxmake_arch: um
-images:
-  barebox: !template "$LG_BUILDDIR/barebox"
-tools:
-  qemu: /usr/local/bin/temu
+imports:
+  -  ../strategy.py
-- 
2.39.2




  parent reply	other threads:[~2024-08-12  9:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-12  9:15 [PATCH 1/6] ci: container: update to Debian Bookworm with GCC v14.2.0 Ahmad Fatoum
2024-08-12  9:15 ` [PATCH 2/6] ci: container: add kvx-elf- toolchain Ahmad Fatoum
2024-08-12  9:29   ` Yann Sionneau
2024-08-12  9:15 ` [PATCH 3/6] ci: container: update to newer Labgrid Ahmad Fatoum
2024-08-12 12:52   ` Yann Sionneau
2024-08-12 13:30     ` Ahmad Fatoum
2024-08-12  9:15 ` Ahmad Fatoum [this message]
2024-08-12  9:15 ` [PATCH 5/6] ci: pytest: test sandbox configuration with labgrid Ahmad Fatoum
2024-08-12  9:15 ` [PATCH 6/6] ci: build: add kvx build test Ahmad Fatoum

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=20240812091522.3035469-4-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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