From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202508 header.b=pqmd+o6u; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 70A1B5A0271 for ; Wed, 20 Aug 2025 05:10:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1755659413; bh=1cxiL2j3PcTJlZXAYUJYtsCEG4y2XJeHrs7WY7FPnO4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pqmd+o6u3GT5Tlu8EEiRQXyMlF9g04IfgFTKXrlEQuSAhO+RzCvP2pp4f8Vklz2u1 +kj0SZva4SnHcri1BTCI2+TARGCiczRct92Z1FtYsQjSrOxe4kJJWUwjPARPTrYhNM jo+iItTNyySymz+7BB1C4ny2sN7vZuB+PPc81c3+ig6fjNUhVSW7JhlvxJM/OMhadW mltu0K6KFleRAkY2P0TY81xSDIC2qQj7J7LsnHPbYjxmzrPfhyrPsmrQXbXTHbhkD9 Wd29OSI0v9GUJm5FWSCTmtE3GELcMXK/UH+Z1sT33JMbdanoye5A16UYrIOAEi+t9F 4KsHkrdZGoETg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4c6BK13ygNz4wcn; Wed, 20 Aug 2025 13:10:13 +1000 (AEST) Date: Wed, 20 Aug 2025 12:55:58 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v4 1/3] test: Extend test scripts to allow running exeter tests. Message-ID: References: <20250807113237.548294-1-david@gibson.dropbear.id.au> <20250807113237.548294-2-david@gibson.dropbear.id.au> <20250819162738.36d35d52@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="e7aRuvoNJaHdc5tX" Content-Disposition: inline In-Reply-To: <20250819162738.36d35d52@elisabeth> Message-ID-Hash: WCSVTCJNJWSXB4F2DQPI6KAU4EGWTV6Q X-Message-ID-Hash: WCSVTCJNJWSXB4F2DQPI6KAU4EGWTV6Q X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --e7aRuvoNJaHdc5tX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 19, 2025 at 04:27:38PM +0200, Stefano Brivio wrote: > On Thu, 7 Aug 2025 21:32:35 +1000 > David Gibson wrote: >=20 > > Introduce some trivial testcases based on the exeter library. These run > > passt and pasta with --help and --version options. Extend our test > > scripts to run these tests. > >=20 > > Signed-off-by: David Gibson > > --- > > test/.gitignore | 1 + > > test/Makefile | 5 ++++- > > test/lib/exeter | 46 +++++++++++++++++++++++++++++++++++++++++++++ > > test/run | 9 ++++++++- > > test/smoke/smoke.sh | 27 ++++++++++++++++++++++++++ > > 5 files changed, 86 insertions(+), 2 deletions(-) > > create mode 100644 test/lib/exeter > > create mode 100755 test/smoke/smoke.sh > >=20 > > diff --git a/test/.gitignore b/test/.gitignore > > index 3573444f..cf48b885 100644 > > --- a/test/.gitignore > > +++ b/test/.gitignore > > @@ -11,3 +11,4 @@ nstool > > rampstream > > guest-key > > guest-key.pub > > +/exeter/ > > diff --git a/test/Makefile b/test/Makefile > > index bf63db87..332f3f3e 100644 > > --- a/test/Makefile > > +++ b/test/Makefile > > @@ -50,7 +50,7 @@ UBUNTU_NEW_IMGS =3D xenial-server-cloudimg-powerpc-di= sk1.img \ > > jammy-server-cloudimg-s390x.img > > UBUNTU_IMGS =3D $(UBUNTU_OLD_IMGS) $(UBUNTU_NEW_IMGS) > > =20 > > -DOWNLOAD_ASSETS =3D mbuto podman \ > > +DOWNLOAD_ASSETS =3D exeter mbuto podman \ > > $(DEBIAN_IMGS) $(FEDORA_IMGS) $(OPENSUSE_IMGS) $(UBUNTU_IMGS) >=20 > Pre-existing, but this broke a while after you switched the image > preparation to Makefile targets, so you can't really expect people to > issue 'make' at the moment. Sorry, I'm not quite sure what the problem is you're getting at. > I ran 'make exeter' to get further. It would be nice to update > test/README.md (or fix the Makefile... or both). Hrm.. "make check" already depends on "make assets" which should (now) include exeter. I'm not sure why that's not working for you. > > TESTDATA_ASSETS =3D small.bin big.bin medium.bin \ > > rampstream > > @@ -70,6 +70,9 @@ assets: $(ASSETS) > > pull-%: % > > git -C $* pull > > =20 > > +exeter: > > + git clone https://gitlab.com/dgibson/exeter.git > > + > > mbuto: > > git clone git://mbuto.sh/mbuto > > =20 > > diff --git a/test/lib/exeter b/test/lib/exeter > > new file mode 100644 > > index 00000000..4f7bcff9 > > --- /dev/null > > +++ b/test/lib/exeter > > @@ -0,0 +1,46 @@ > > +#!/bin/sh > > +# > > +# SPDX-License-Identifier: GPL-2.0-or-later > > +# > > +# PASST - Plug A Simple Socket Transport > > +# for qemu/UNIX domain socket mode > > +# > > +# PASTA - Pack A Subtle Tap Abstraction > > +# for network namespace/tap device mode > > +# > > +# test/lib/exeter - Run exeter tests within the rest of passt's tests > > +# > > +# Copyright Red Hat > > +# Author: David Gibson > > + > > +exeter() { >=20 > It would be nice to have the usual arguments / function description > here. Good point, added. > > + STATESETUP=3D"${STATEBASE}/$1" > > + mkdir -p "${STATESETUP}" > > + > > + context_setup_host host > > + layout_host >=20 > Indentation here was done with tabs, this adds spaces instead. Oops. For some reason I'd added emacs configuration to explicitly *disable* tab indent mode for shell mode in the passt tree. Weird, and now reversed. > > + > > + cd test > > + > > + __ntests=3D$("$@" --list | wc -l) > > + if [ $? !=3D 0 ]; then > > + info "Failed to get exeter manifest for $@" > > + pause_continue \ > > + "Press any key to pause test session" \ > > + "Resuming in " \ > > + "Paused, press any key to continue" \ > > + 5 > > + return > > + fi > > + > > + status_file_start "Exeter tests: $*" ${__ntests} > > + > > + for __testid in $("$@" --list); do > > + status_test_start "${__testid}" > > + context_run host "$@" "${__testid}" && status_test_ok = || status_test_fail > > + done > > + > > + cd .. > > + > > + teardown_context_watch ${PANE_HOST} host > > +} > > diff --git a/test/run b/test/run > > index f73c3119..9e183682 100755 > > --- a/test/run > > +++ b/test/run > > @@ -53,6 +53,7 @@ COMMIT=3D"$(git log --oneline --no-decorate -1)" > > . lib/layout_ugly > > . lib/test > > . lib/video > > +. lib/exeter > > =20 > > # cleanup() - Remove temporary files > > cleanup() { > > @@ -67,6 +68,8 @@ run() { > > perf_init > > [ ${CI} -eq 1 ] && video_start ci > > =20 > > + exeter smoke/smoke.sh > > + > > setup build > > test build/all > > test build/cppcheck > > @@ -223,6 +226,10 @@ run_selected() { > > =20 > > __setup=3D > > for __test; do > > + if "test/${__test}" --list; then > > + exeter "${__test}" > > + continue > > + fi > > # HACK: the migrate tests need the setup repeated for > > # each test > > if [ "${__test%%/*}" !=3D "${__setup}" -o \ > > @@ -234,7 +241,7 @@ run_selected() { > > =20 > > test "${__test}" > > done > > - teardown "${__setup}" > > + [ -n "${__setup}" ] && teardown "${__setup}" > > =20 > > log "PASS: ${STATUS_PASS}, FAIL: ${STATUS_FAIL}, SKIPPED: ${STATUS_SK= IPPED}" > > =20 > > diff --git a/test/smoke/smoke.sh b/test/smoke/smoke.sh > > new file mode 100755 > > index 00000000..26a98d31 > > --- /dev/null > > +++ b/test/smoke/smoke.sh > > @@ -0,0 +1,27 @@ > > +#! /bin/sh >=20 > ...this is desirable, I think (and, for consistency, I'd use "#!/bin/sh") > as Bash is not universally available, but: So.. I believe "#! " (with the space) is actually the traditional / correct version. I did once encounter a situation where it mattered, although to be fair, that might have been with 25 year old SunOS or something equally obscure. Nonetheless I've habitually included the space ever since (see find-arm64-firmware.sh, prepare-distro-img.sh and rapstream-check.sh). > > +# > > +# SPDX-License-Identifier: GPL-2.0-or-later > > +# > > +# PASST - Plug A Simple Socket Transport > > +# for qemu/UNIX domain socket mode > > +# > > +# PASTA - Pack A Subtle Tap Abstraction > > +# for network namespace/tap device mode > > +# > > +# test/smoke/smoke.sh - Basic snoke tests >=20 > smoke Lol, oops. > > +# > > +# Copyright Red Hat > > +# Author: David Gibson > > + > > +source $(dirname $0)/../exeter/sh/exeter.sh >=20 > this is specific to Bash, so what I get with dash is: >=20 > smoke/smoke.sh: 16: source: not found > smoke/smoke.sh: 21: exeter_register: not found > smoke/smoke.sh: 22: exeter_register: not found > smoke/smoke.sh: 24: exeter_register: not found > smoke/smoke.sh: 25: exeter_register: not found > smoke/smoke.sh: 27: exeter_main: not found > ... Drat. I'm pretty sure I found that before, but I must have accidentally discarded with some fat-fingered gitting. Ok, fixed now. --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --e7aRuvoNJaHdc5tX Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmilOS4ACgkQzQJF27ox 2GcYExAAoWp72fHeYbGg6HwXf+NbSrUQGJ3PtYO5Gi2IMY/PWgQfxesecjJht6xu MVhxD09za/AQ+zhFUZxVxxexgEptT5Z9alv14C3gjA51BLWXGf19Y+EpPOfrh8bV yzNQ3PL8C+P5XhtWgjz8E4x8OIaCy4755eOMQvrND0kyllw9rD+/o17Ts1fX3sgx BhMWdISlxEFrOyKT/odE49sfSYruP7RLZpKezhbK189Y/FwIglEp6TLwTGxAilz0 +/xOtAJWWoGKwCu/UPKneWTh0yzB4XXjcfniS3jy52q8jGYPn0urRkkoiuvjMCgd tEMxZ55xEaKNXb4RIDJxNnlQl/UmiWDU/8g534c8FN40m1HTs5lMhCGcuhAJrUrv KYDx8EQzmyCmnKvWnHvFqRjV8jmfK0PS+wa7BQmvWkTEsl6+5X70ApEwjP7I5zrK ZAHaOZpXrsTDXlfig6PMzOHMJYEkQrDgYTANces3pvcq+NICbn6hA0dfOhFP84pY Q2rTAlbdV39dUbsNkzYgfI6/SEk4fWFyD+aXJfZyiOspmpyJQ7xJ+afLKLAsyhXD rcEoxlLDpr3JLIkUbfR3EBe6bPCu+1rvbx9bHTEWXmHLdTI6aQIt12YSFmiszyXr oOxc3DH+vxD5Sp3YsxJbeOhtYXI/o/hJJE7RP8wGcJTJ4yd1o84= =6zjx -----END PGP SIGNATURE----- --e7aRuvoNJaHdc5tX--