public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top
Subject: [PATCH 12/15] tests: Explicitly list test files in test/run, remove "onlyfor" support
Date: Wed, 06 Jul 2022 17:29:06 +1000	[thread overview]
Message-ID: <20220706072909.596805-13-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20220706072909.596805-1-david@gibson.dropbear.id.au>

[-- Attachment #1: Type: text/plain, Size: 12584 bytes --]

Currently test/run uses wildcards to run all of the tests in a directory.
However, that wildcard list is filtered down by the "onlyfor" directives
in the test files... usually to a single file.

Therefore, just explicitly list the files we *really* want to run for this
test mode.  This makes it easier to see at the top level what tests will
be executed, and to change that list temporarily while debugging specific
failures.

This means the "onlyfor" directive no longer has any purpose, and we can
remove it.  "onlyfor" was also the only used of the $MODE variable, so we
can remove that too.

Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au>
---
 test/demo/passt           |  1 -
 test/demo/pasta           |  1 -
 test/demo/podman          |  2 --
 test/dhcp/passt           |  1 -
 test/dhcp/pasta           |  1 -
 test/icmp/passt_in_ns     |  1 -
 test/lib/setup            | 10 -------
 test/lib/test             |  9 ------
 test/ndp/passt            |  1 -
 test/ndp/pasta            |  1 -
 test/perf/passt_tcp       |  1 -
 test/perf/passt_udp       |  1 -
 test/perf/pasta_tcp       |  1 -
 test/perf/pasta_udp       |  1 -
 test/run                  | 58 +++++++++++++++++++++------------------
 test/tcp/passt            |  1 -
 test/tcp/passt_in_ns      |  1 -
 test/tcp/pasta            |  1 -
 test/udp/passt            |  1 -
 test/udp/passt_in_ns      |  1 -
 test/udp/pasta            |  1 -
 test/valgrind/passt       |  1 -
 test/valgrind/passt_in_ns |  1 -
 23 files changed, 31 insertions(+), 67 deletions(-)

diff --git a/test/demo/passt b/test/demo/passt
index b67ed26..f71392b 100644
--- a/test/demo/passt
+++ b/test/demo/passt
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt
 say	This is a short introduction to 
 em	passt
 say	.
diff --git a/test/demo/pasta b/test/demo/pasta
index 754b320..f4b7da2 100644
--- a/test/demo/pasta
+++ b/test/demo/pasta
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	pasta
 say	This is a short introduction to 
 em	pasta
 say	.
diff --git a/test/demo/podman b/test/demo/podman
index 3a73784..540e456 100644
--- a/test/demo/podman
+++ b/test/demo/podman
@@ -11,8 +11,6 @@
 # Copyright (c) 2022 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	podman
-
 set	OPTS -Z -w 4M -l 1M -P 2 -t10 --pacing-timer 10000
 
 say	This is an overview of 
diff --git a/test/dhcp/passt b/test/dhcp/passt
index 4648821..00047a9 100644
--- a/test/dhcp/passt
+++ b/test/dhcp/passt
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt passt_in_ns
 gtools	ip jq dhclient sed tr
 htools	ip jq sed tr head
 
diff --git a/test/dhcp/pasta b/test/dhcp/pasta
index 4652d09..65b1d42 100644
--- a/test/dhcp/pasta
+++ b/test/dhcp/pasta
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	pasta
 nstools	ip jq /sbin/dhclient
 htools	ip jq
 
diff --git a/test/icmp/passt_in_ns b/test/icmp/passt_in_ns
index e1d9f7b..e4ac4ff 100644
--- a/test/icmp/passt_in_ns
+++ b/test/icmp/passt_in_ns
@@ -16,7 +16,6 @@
 # to create "ping" sockets. Inside the namespace, there's a single group, which
 # is allowed by default to create them.
 
-onlyfor	passt_in_ns
 nstools	ip jq sleep
 gtools	ping ip jq
 
diff --git a/test/lib/setup b/test/lib/setup
index 604cfee..0d0f3cf 100755
--- a/test/lib/setup
+++ b/test/lib/setup
@@ -20,15 +20,11 @@ VMEM="$((${__mem_kib} / 1024 / 4))"
 
 # setup_build() - Set up pane layout for build tests
 setup_build() {
-	MODE=build
-
 	layout_host
 }
 
 # setup_passt() - Start qemu and passt
 setup_passt() {
-	MODE=passt
-
 	layout_passt
 
 	# Ports:
@@ -65,8 +61,6 @@ setup_passt() {
 
 # setup_pasta() - Create a network and user namespace, connect pasta to it
 setup_pasta() {
-	MODE=pasta
-
 	layout_pasta
 
 	pane_run NS 'echo $$'
@@ -98,8 +92,6 @@ setup_pasta() {
 
 # setup_passt_in_ns() - Set up namespace (with pasta), run qemu and passt into it
 setup_passt_in_ns() {
-	MODE=passt_in_ns
-
 	layout_passt_in_pasta
 
 	# Ports:
@@ -180,8 +172,6 @@ setup_passt_in_ns() {
 
 # setup_two_guests() - Set up two namespace, run qemu and passt in both of them
 setup_two_guests() {
-	MODE=passt_in_ns
-
 	layout_two_guests
 
 	# Ports:
diff --git a/test/lib/test b/test/lib/test
index 12f2588..cb89e0b 100755
--- a/test/lib/test
+++ b/test/lib/test
@@ -13,9 +13,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-# Empty, 'passt' or 'pasta', to match against 'onlyfor' directive
-MODE=
-
 # test_iperf3() - Ugly helper for iperf3c/iperf3s directives
 # $1:	Role: client or server
 # $2:	Pane name, can be lowercase
@@ -426,12 +423,6 @@ test() {
 			__list="$(list_add "${__list}" "${__f}")"
 			continue
 		fi
-
-		if [ -n "$(file_def "${__f}" onlyfor)" ] && \
-			   ! list_has "$(file_def "${__f}" onlyfor)" "${MODE}"; then
-			continue
-		fi
-
 		__list="$(list_add "${__list}" "${__f}")"
 	done
 	cd ..
diff --git a/test/ndp/passt b/test/ndp/passt
index 155ff26..d6b4c40 100644
--- a/test/ndp/passt
+++ b/test/ndp/passt
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt passt_in_ns
 gtools	ip jq sipcalc grep
 htools	ip jq sipcalc grep cut
 
diff --git a/test/ndp/pasta b/test/ndp/pasta
index ef9dee7..2a2dd1a 100644
--- a/test/ndp/pasta
+++ b/test/ndp/pasta
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	pasta
 nstools	ip jq sipcalc grep cut
 htools	ip jq sipcalc grep cut
 
diff --git a/test/perf/passt_tcp b/test/perf/passt_tcp
index c97178e..74a39ba 100644
--- a/test/perf/passt_tcp
+++ b/test/perf/passt_tcp
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt_in_ns
 gtools	sysctl ip jq nproc seq sleep bc iperf3 tcp_rr tcp_crr # From neper
 nstools	sysctl ip jq nproc seq sleep bc iperf3 tcp_rr tcp_crr
 htools	bc head sed seq
diff --git a/test/perf/passt_udp b/test/perf/passt_udp
index 5155099..a22a550 100644
--- a/test/perf/passt_udp
+++ b/test/perf/passt_udp
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt_in_ns
 gtools	sysctl ip jq nproc sleep iperf3 udp_rr # From neper
 nstools	ip jq sleep iperf3 udp_rr
 htools	bc head sed
diff --git a/test/perf/pasta_tcp b/test/perf/pasta_tcp
index 5ef0f69..f4e97cb 100644
--- a/test/perf/pasta_tcp
+++ b/test/perf/pasta_tcp
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt_in_ns
 htools	head ip seq bc sleep iperf3 tcp_rr tcp_crr jq sed
 nstools	sysctl nproc ip seq bc sleep iperf3 tcp_rr tcp_crr jq sed
 
diff --git a/test/perf/pasta_udp b/test/perf/pasta_udp
index 114a9bc..5f750b5 100644
--- a/test/perf/pasta_udp
+++ b/test/perf/pasta_udp
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt_in_ns
 htools	bc head ip sleep iperf3 udp_rr jq sed
 nstools	ip sleep iperf3 udp_rr jq sed
 
diff --git a/test/run b/test/run
index 342d99e..3e5d56b 100755
--- a/test/run
+++ b/test/run
@@ -60,43 +60,50 @@ run() {
 	[ ${CI} -eq 1 ]   && video_start ci
 
 	setup build
-	test $(cd test && echo build/*)
-	test $(cd test && echo distro/*)
+	test build/all
+	test build/static_checkers
+	test distro/debian
+	test distro/fedora
+	test distro/opensuse
+	test distro/ubuntu
 
 	setup pasta
-	test $(cd test && echo ndp/*)
-	test $(cd test && echo dhcp/*)
-	test $(cd test && echo tcp/*)
-	test $(cd test && echo udp/*)
+	test ndp/pasta
+	test dhcp/pasta
+	test tcp/pasta
+	test udp/pasta
 	teardown pasta
 
 	setup passt
-	test $(cd test && echo ndp/*)
-	test $(cd test && echo dhcp/*)
-	test $(cd test && echo tcp/*)
-	test $(cd test && echo udp/*)
-	test $(cd test && echo valgrind/*)
+	test ndp/passt
+	test dhcp/passt
+	test tcp/passt
+	test udp/passt
+	test valgrind/passt
 	teardown passt
 
 	VALGRIND=1
 	setup passt_in_ns
-	test $(cd test && echo ndp/*)
-	test $(cd test && echo dhcp/*)
-	test $(cd test && echo icmp/*)
-	test $(cd test && echo tcp/*)
-	test $(cd test && echo udp/*)
-	test $(cd test && echo valgrind/*)
+	test ndp/passt
+	test dhcp/passt
+	test icmp/passt_in_ns
+	test tcp/passt_in_ns
+	test udp/passt_in_ns
+	test valgrind/passt_in_ns
 	teardown passt_in_ns
 
 	VALGRIND=0
 	setup passt_in_ns
-	test $(cd test && echo ndp/*)
-	test $(cd test && echo dhcp/*)
-	test $(cd test && echo perf/*)
+	test ndp/passt
+	test dhcp/passt
+	test perf/passt_tcp
+	test perf/passt_udp
+	test perf/pasta_tcp
+	test perf/pasta_udp
 	teardown passt_in_ns
 
 	setup two_guests
-	test $(cd test && echo two_guests/*)
+	test two_guests/basic
 	teardown two_guests
 
 	perf_finish
@@ -124,22 +131,19 @@ demo() {
 
 	layout_demo_passt
 	video_start demo_passt
-	MODE=passt
-	test $(cd test && echo demo/*)
+	test demo/passt
 	video_stop
 	teardown demo_passt
 
 	layout_demo_pasta
 	video_start demo_pasta
-	MODE=pasta
-	test $(cd test && echo demo/*)
+	test demo/pasta
 	video_stop
 	teardown demo_pasta
 
 	layout_demo_podman
 	video_start demo_podman
-	MODE=podman
-	test $(cd test && echo demo/*)
+	test demo/podman
 	video_stop
 	teardown_demo_podman
 
diff --git a/test/tcp/passt b/test/tcp/passt
index b47a36d..4baa610 100644
--- a/test/tcp/passt
+++ b/test/tcp/passt
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt
 gtools	nc ip jq cat md5sum cut
 htools	dd nc ip jq cat md5sum cut
 
diff --git a/test/tcp/passt_in_ns b/test/tcp/passt_in_ns
index 4229a3a..2a11e0b 100644
--- a/test/tcp/passt_in_ns
+++ b/test/tcp/passt_in_ns
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt_in_ns
 gtools	nc ip jq cat md5sum cut
 htools	dd nc ip jq cat md5sum cut
 nstools	nc ip jq cat md5sum cut
diff --git a/test/tcp/pasta b/test/tcp/pasta
index 531da04..068393a 100644
--- a/test/tcp/pasta
+++ b/test/tcp/pasta
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	pasta
 htools	dd ncat ip jq cat md5sum cut
 nstools	ncat ip jq cat md5sum cut
 
diff --git a/test/udp/passt b/test/udp/passt
index 492fb12..8a848bd 100644
--- a/test/udp/passt
+++ b/test/udp/passt
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt
 gtools	nc tee grep cat ip jq md5sum cut
 htools	printf dd nc tee grep cat ip jq md5sum cut
 
diff --git a/test/udp/passt_in_ns b/test/udp/passt_in_ns
index 71bda04..3607251 100644
--- a/test/udp/passt_in_ns
+++ b/test/udp/passt_in_ns
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt_in_ns
 gtools	nc tee grep cat ip jq md5sum cut
 nstools	nc tee grep cat ip jq md5sum cut
 htools	printf dd nc tee grep cat ip jq md5sum cut
diff --git a/test/udp/pasta b/test/udp/pasta
index 3123c42..a7e5015 100644
--- a/test/udp/pasta
+++ b/test/udp/pasta
@@ -11,7 +11,6 @@
 # Copyright (c) 2021 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	pasta
 nstools	ncat tee grep cat ip jq md5sum cut
 htools	printf dd ncat tee grep cat ip jq md5sum cut
 
diff --git a/test/valgrind/passt b/test/valgrind/passt
index 3af943a..f8bcf00 100644
--- a/test/valgrind/passt
+++ b/test/valgrind/passt
@@ -11,7 +11,6 @@
 # Copyright (c) 2022 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt
 test	valgrind: exit code
 
 hout	PASST_PID cat passt.pid
diff --git a/test/valgrind/passt_in_ns b/test/valgrind/passt_in_ns
index bf50c7e..d28e251 100644
--- a/test/valgrind/passt_in_ns
+++ b/test/valgrind/passt_in_ns
@@ -11,7 +11,6 @@
 # Copyright (c) 2022 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt_in_ns
 test	valgrind: exit code
 
 nsout	PASST_PID cat passt.pid
-- 
@@ -11,7 +11,6 @@
 # Copyright (c) 2022 Red Hat GmbH
 # Author: Stefano Brivio <sbrivio(a)redhat.com>
 
-onlyfor	passt_in_ns
 test	valgrind: exit code
 
 nsout	PASST_PID cat passt.pid
-- 
2.36.1


  parent reply	other threads:[~2022-07-06  7:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06  7:28 [PATCH 00/15] Test fixes, batch 4 David Gibson
2022-07-06  7:28 ` [PATCH 01/15] test: Add external mbuto profile, drop udhcpc, and switch to it David Gibson
2022-07-06  7:28 ` [PATCH 02/15] Handle the case of a DNS server on localhost David Gibson
2022-07-06  7:28 ` [PATCH 03/15] tests: qemu-system-ppc64le isn't a thing David Gibson
2022-07-06  7:28 ` [PATCH 04/15] Invoke specific qemu-system-* binaries David Gibson
2022-07-06  7:28 ` [PATCH 05/15] tests: Introduce makefile for building test assets David Gibson
2022-07-06  7:29 ` [PATCH 06/15] tests: Move mbuto download and execution to asset build David Gibson
2022-07-06  7:29 ` [PATCH 07/15] tests: Search multiple places for aarch64 EDK2 bios image David Gibson
2022-07-06  7:29 ` [PATCH 08/15] Clean up passt.pid file David Gibson
2022-07-06  7:29 ` [PATCH 09/15] tests: Remove unused set_mode() function David Gibson
2022-07-06  7:29 ` [PATCH 10/15] tests: Remove not-very-useful "req" directive David Gibson
2022-07-06  7:29 ` [PATCH 11/15] tests: Don't automatically traverse directories of test files David Gibson
2022-07-06  7:29 ` David Gibson [this message]
2022-07-06  7:29 ` [PATCH 13/15] tests: Move distro image download to asset build makefile David Gibson
2022-07-06  7:29 ` [PATCH 14/15] tests: Prepare distro images during asset build phase David Gibson
2022-07-06  7:29 ` [PATCH 15/15] tests: Remove unused DNS6 calculation from fedora tests David Gibson
2022-07-07 14:53 ` [PATCH 00/15] Test fixes, batch 4 Stefano Brivio
2022-07-11  9:42   ` Stefano Brivio
2022-07-12  8:26     ` David Gibson
2022-07-12 12:13       ` Stefano Brivio
2022-07-13  2:11         ` David Gibson
2022-07-13  6:04           ` Stefano Brivio
2022-07-13 10:19             ` David Gibson
2022-07-13 23:39 ` Stefano Brivio

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=20220706072909.596805-13-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).