mirror of
https://passt.top/passt
synced 2024-12-23 06:05:23 +00:00
tests: Explicitly list test files in test/run, remove "onlyfor" support
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@gibson.dropbear.id.au>
This commit is contained in:
parent
544f790bf8
commit
a832a44e67
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt
|
|
||||||
say This is a short introduction to
|
say This is a short introduction to
|
||||||
em passt
|
em passt
|
||||||
say .
|
say .
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor pasta
|
|
||||||
say This is a short introduction to
|
say This is a short introduction to
|
||||||
em pasta
|
em pasta
|
||||||
say .
|
say .
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
# Copyright (c) 2022 Red Hat GmbH
|
# Copyright (c) 2022 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor podman
|
|
||||||
|
|
||||||
set OPTS -Z -w 4M -l 1M -P 2 -t10 --pacing-timer 10000
|
set OPTS -Z -w 4M -l 1M -P 2 -t10 --pacing-timer 10000
|
||||||
|
|
||||||
say This is an overview of
|
say This is an overview of
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt passt_in_ns
|
|
||||||
gtools ip jq dhclient sed tr
|
gtools ip jq dhclient sed tr
|
||||||
htools ip jq sed tr head
|
htools ip jq sed tr head
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor pasta
|
|
||||||
nstools ip jq /sbin/dhclient
|
nstools ip jq /sbin/dhclient
|
||||||
htools ip jq
|
htools ip jq
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
# to create "ping" sockets. Inside the namespace, there's a single group, which
|
# to create "ping" sockets. Inside the namespace, there's a single group, which
|
||||||
# is allowed by default to create them.
|
# is allowed by default to create them.
|
||||||
|
|
||||||
onlyfor passt_in_ns
|
|
||||||
nstools ip jq sleep
|
nstools ip jq sleep
|
||||||
gtools ping ip jq
|
gtools ping ip jq
|
||||||
|
|
||||||
|
@ -20,15 +20,11 @@ VMEM="$((${__mem_kib} / 1024 / 4))"
|
|||||||
|
|
||||||
# setup_build() - Set up pane layout for build tests
|
# setup_build() - Set up pane layout for build tests
|
||||||
setup_build() {
|
setup_build() {
|
||||||
MODE=build
|
|
||||||
|
|
||||||
layout_host
|
layout_host
|
||||||
}
|
}
|
||||||
|
|
||||||
# setup_passt() - Start qemu and passt
|
# setup_passt() - Start qemu and passt
|
||||||
setup_passt() {
|
setup_passt() {
|
||||||
MODE=passt
|
|
||||||
|
|
||||||
layout_passt
|
layout_passt
|
||||||
|
|
||||||
# Ports:
|
# Ports:
|
||||||
@ -65,8 +61,6 @@ setup_passt() {
|
|||||||
|
|
||||||
# setup_pasta() - Create a network and user namespace, connect pasta to it
|
# setup_pasta() - Create a network and user namespace, connect pasta to it
|
||||||
setup_pasta() {
|
setup_pasta() {
|
||||||
MODE=pasta
|
|
||||||
|
|
||||||
layout_pasta
|
layout_pasta
|
||||||
|
|
||||||
pane_run NS 'echo $$'
|
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() - Set up namespace (with pasta), run qemu and passt into it
|
||||||
setup_passt_in_ns() {
|
setup_passt_in_ns() {
|
||||||
MODE=passt_in_ns
|
|
||||||
|
|
||||||
layout_passt_in_pasta
|
layout_passt_in_pasta
|
||||||
|
|
||||||
# Ports:
|
# 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() - Set up two namespace, run qemu and passt in both of them
|
||||||
setup_two_guests() {
|
setup_two_guests() {
|
||||||
MODE=passt_in_ns
|
|
||||||
|
|
||||||
layout_two_guests
|
layout_two_guests
|
||||||
|
|
||||||
# Ports:
|
# Ports:
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
# Empty, 'passt' or 'pasta', to match against 'onlyfor' directive
|
|
||||||
MODE=
|
|
||||||
|
|
||||||
# test_iperf3() - Ugly helper for iperf3c/iperf3s directives
|
# test_iperf3() - Ugly helper for iperf3c/iperf3s directives
|
||||||
# $1: Role: client or server
|
# $1: Role: client or server
|
||||||
# $2: Pane name, can be lowercase
|
# $2: Pane name, can be lowercase
|
||||||
@ -426,12 +423,6 @@ test() {
|
|||||||
__list="$(list_add "${__list}" "${__f}")"
|
__list="$(list_add "${__list}" "${__f}")"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$(file_def "${__f}" onlyfor)" ] && \
|
|
||||||
! list_has "$(file_def "${__f}" onlyfor)" "${MODE}"; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
__list="$(list_add "${__list}" "${__f}")"
|
__list="$(list_add "${__list}" "${__f}")"
|
||||||
done
|
done
|
||||||
cd ..
|
cd ..
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt passt_in_ns
|
|
||||||
gtools ip jq sipcalc grep
|
gtools ip jq sipcalc grep
|
||||||
htools ip jq sipcalc grep cut
|
htools ip jq sipcalc grep cut
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor pasta
|
|
||||||
nstools ip jq sipcalc grep cut
|
nstools ip jq sipcalc grep cut
|
||||||
htools ip jq sipcalc grep cut
|
htools ip jq sipcalc grep cut
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt_in_ns
|
|
||||||
gtools sysctl ip jq nproc seq sleep bc iperf3 tcp_rr tcp_crr # From neper
|
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
|
nstools sysctl ip jq nproc seq sleep bc iperf3 tcp_rr tcp_crr
|
||||||
htools bc head sed seq
|
htools bc head sed seq
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt_in_ns
|
|
||||||
gtools sysctl ip jq nproc sleep iperf3 udp_rr # From neper
|
gtools sysctl ip jq nproc sleep iperf3 udp_rr # From neper
|
||||||
nstools ip jq sleep iperf3 udp_rr
|
nstools ip jq sleep iperf3 udp_rr
|
||||||
htools bc head sed
|
htools bc head sed
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt_in_ns
|
|
||||||
htools head ip seq bc sleep iperf3 tcp_rr tcp_crr jq sed
|
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
|
nstools sysctl nproc ip seq bc sleep iperf3 tcp_rr tcp_crr jq sed
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt_in_ns
|
|
||||||
htools bc head ip sleep iperf3 udp_rr jq sed
|
htools bc head ip sleep iperf3 udp_rr jq sed
|
||||||
nstools ip sleep iperf3 udp_rr jq sed
|
nstools ip sleep iperf3 udp_rr jq sed
|
||||||
|
|
||||||
|
58
test/run
58
test/run
@ -60,43 +60,50 @@ run() {
|
|||||||
[ ${CI} -eq 1 ] && video_start ci
|
[ ${CI} -eq 1 ] && video_start ci
|
||||||
|
|
||||||
setup build
|
setup build
|
||||||
test $(cd test && echo build/*)
|
test build/all
|
||||||
test $(cd test && echo distro/*)
|
test build/static_checkers
|
||||||
|
test distro/debian
|
||||||
|
test distro/fedora
|
||||||
|
test distro/opensuse
|
||||||
|
test distro/ubuntu
|
||||||
|
|
||||||
setup pasta
|
setup pasta
|
||||||
test $(cd test && echo ndp/*)
|
test ndp/pasta
|
||||||
test $(cd test && echo dhcp/*)
|
test dhcp/pasta
|
||||||
test $(cd test && echo tcp/*)
|
test tcp/pasta
|
||||||
test $(cd test && echo udp/*)
|
test udp/pasta
|
||||||
teardown pasta
|
teardown pasta
|
||||||
|
|
||||||
setup passt
|
setup passt
|
||||||
test $(cd test && echo ndp/*)
|
test ndp/passt
|
||||||
test $(cd test && echo dhcp/*)
|
test dhcp/passt
|
||||||
test $(cd test && echo tcp/*)
|
test tcp/passt
|
||||||
test $(cd test && echo udp/*)
|
test udp/passt
|
||||||
test $(cd test && echo valgrind/*)
|
test valgrind/passt
|
||||||
teardown passt
|
teardown passt
|
||||||
|
|
||||||
VALGRIND=1
|
VALGRIND=1
|
||||||
setup passt_in_ns
|
setup passt_in_ns
|
||||||
test $(cd test && echo ndp/*)
|
test ndp/passt
|
||||||
test $(cd test && echo dhcp/*)
|
test dhcp/passt
|
||||||
test $(cd test && echo icmp/*)
|
test icmp/passt_in_ns
|
||||||
test $(cd test && echo tcp/*)
|
test tcp/passt_in_ns
|
||||||
test $(cd test && echo udp/*)
|
test udp/passt_in_ns
|
||||||
test $(cd test && echo valgrind/*)
|
test valgrind/passt_in_ns
|
||||||
teardown passt_in_ns
|
teardown passt_in_ns
|
||||||
|
|
||||||
VALGRIND=0
|
VALGRIND=0
|
||||||
setup passt_in_ns
|
setup passt_in_ns
|
||||||
test $(cd test && echo ndp/*)
|
test ndp/passt
|
||||||
test $(cd test && echo dhcp/*)
|
test dhcp/passt
|
||||||
test $(cd test && echo perf/*)
|
test perf/passt_tcp
|
||||||
|
test perf/passt_udp
|
||||||
|
test perf/pasta_tcp
|
||||||
|
test perf/pasta_udp
|
||||||
teardown passt_in_ns
|
teardown passt_in_ns
|
||||||
|
|
||||||
setup two_guests
|
setup two_guests
|
||||||
test $(cd test && echo two_guests/*)
|
test two_guests/basic
|
||||||
teardown two_guests
|
teardown two_guests
|
||||||
|
|
||||||
perf_finish
|
perf_finish
|
||||||
@ -124,22 +131,19 @@ demo() {
|
|||||||
|
|
||||||
layout_demo_passt
|
layout_demo_passt
|
||||||
video_start demo_passt
|
video_start demo_passt
|
||||||
MODE=passt
|
test demo/passt
|
||||||
test $(cd test && echo demo/*)
|
|
||||||
video_stop
|
video_stop
|
||||||
teardown demo_passt
|
teardown demo_passt
|
||||||
|
|
||||||
layout_demo_pasta
|
layout_demo_pasta
|
||||||
video_start demo_pasta
|
video_start demo_pasta
|
||||||
MODE=pasta
|
test demo/pasta
|
||||||
test $(cd test && echo demo/*)
|
|
||||||
video_stop
|
video_stop
|
||||||
teardown demo_pasta
|
teardown demo_pasta
|
||||||
|
|
||||||
layout_demo_podman
|
layout_demo_podman
|
||||||
video_start demo_podman
|
video_start demo_podman
|
||||||
MODE=podman
|
test demo/podman
|
||||||
test $(cd test && echo demo/*)
|
|
||||||
video_stop
|
video_stop
|
||||||
teardown_demo_podman
|
teardown_demo_podman
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt
|
|
||||||
gtools nc ip jq cat md5sum cut
|
gtools nc ip jq cat md5sum cut
|
||||||
htools dd nc ip jq cat md5sum cut
|
htools dd nc ip jq cat md5sum cut
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt_in_ns
|
|
||||||
gtools nc ip jq cat md5sum cut
|
gtools nc ip jq cat md5sum cut
|
||||||
htools dd nc ip jq cat md5sum cut
|
htools dd nc ip jq cat md5sum cut
|
||||||
nstools nc ip jq cat md5sum cut
|
nstools nc ip jq cat md5sum cut
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor pasta
|
|
||||||
htools dd ncat ip jq cat md5sum cut
|
htools dd ncat ip jq cat md5sum cut
|
||||||
nstools ncat ip jq cat md5sum cut
|
nstools ncat ip jq cat md5sum cut
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt
|
|
||||||
gtools nc tee grep cat ip jq md5sum cut
|
gtools nc tee grep cat ip jq md5sum cut
|
||||||
htools printf dd nc tee grep cat ip jq md5sum cut
|
htools printf dd nc tee grep cat ip jq md5sum cut
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt_in_ns
|
|
||||||
gtools nc tee grep cat ip jq md5sum cut
|
gtools nc tee grep cat ip jq md5sum cut
|
||||||
nstools 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
|
htools printf dd nc tee grep cat ip jq md5sum cut
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2021 Red Hat GmbH
|
# Copyright (c) 2021 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor pasta
|
|
||||||
nstools ncat tee grep cat ip jq md5sum cut
|
nstools ncat tee grep cat ip jq md5sum cut
|
||||||
htools printf dd ncat tee grep cat ip jq md5sum cut
|
htools printf dd ncat tee grep cat ip jq md5sum cut
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2022 Red Hat GmbH
|
# Copyright (c) 2022 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt
|
|
||||||
test valgrind: exit code
|
test valgrind: exit code
|
||||||
|
|
||||||
hout PASST_PID cat passt.pid
|
hout PASST_PID cat passt.pid
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# Copyright (c) 2022 Red Hat GmbH
|
# Copyright (c) 2022 Red Hat GmbH
|
||||||
# Author: Stefano Brivio <sbrivio@redhat.com>
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
||||||
|
|
||||||
onlyfor passt_in_ns
|
|
||||||
test valgrind: exit code
|
test valgrind: exit code
|
||||||
|
|
||||||
nsout PASST_PID cat passt.pid
|
nsout PASST_PID cat passt.pid
|
||||||
|
Loading…
Reference in New Issue
Block a user