tests: Don't automatically traverse directories of test files
The top level listing control of which tests to run is in test/run, however it uses the test() function which runs an entire directory of test files, filtered by some criteria. This makes it awkward to narrow down to a subset of tests when debugging a specific failure. To make this easier, have test() take an explicit list of test files to run, and have the caller in test/run handle the directory traversal. The construct we use for this is pretty awkward to handle the fact that we're in the source tree root directory rather than test/ at this point in test/run. Later cleanups will improve that. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
5d7688d26f
commit
544f790bf8
2 changed files with 26 additions and 26 deletions
|
@ -415,12 +415,12 @@ test_one() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# test() - Build list of tests to run, in order, then issue test_one()
|
# test() - Build list of tests to run, in order, then issue test_one()
|
||||||
# $1: Name of directory containing set of test files, relative to test/
|
# $@: Test files to run, relative to test/
|
||||||
test() {
|
test() {
|
||||||
__list=
|
__list=
|
||||||
|
|
||||||
cd test
|
cd test
|
||||||
for __f in "${1}"/*; do
|
for __f; do
|
||||||
__type="$(file -b --mime-type ${__f})"
|
__type="$(file -b --mime-type ${__f})"
|
||||||
if [ "${__type}" = "text/x-shellscript" ]; then
|
if [ "${__type}" = "text/x-shellscript" ]; then
|
||||||
__list="$(list_add "${__list}" "${__f}")"
|
__list="$(list_add "${__list}" "${__f}")"
|
||||||
|
|
48
test/run
48
test/run
|
@ -60,43 +60,43 @@ run() {
|
||||||
[ ${CI} -eq 1 ] && video_start ci
|
[ ${CI} -eq 1 ] && video_start ci
|
||||||
|
|
||||||
setup build
|
setup build
|
||||||
test build
|
test $(cd test && echo build/*)
|
||||||
test distro
|
test $(cd test && echo distro/*)
|
||||||
|
|
||||||
setup pasta
|
setup pasta
|
||||||
test ndp
|
test $(cd test && echo ndp/*)
|
||||||
test dhcp
|
test $(cd test && echo dhcp/*)
|
||||||
test tcp
|
test $(cd test && echo tcp/*)
|
||||||
test udp
|
test $(cd test && echo udp/*)
|
||||||
teardown pasta
|
teardown pasta
|
||||||
|
|
||||||
setup passt
|
setup passt
|
||||||
test ndp
|
test $(cd test && echo ndp/*)
|
||||||
test dhcp
|
test $(cd test && echo dhcp/*)
|
||||||
test tcp
|
test $(cd test && echo tcp/*)
|
||||||
test udp
|
test $(cd test && echo udp/*)
|
||||||
test valgrind
|
test $(cd test && echo valgrind/*)
|
||||||
teardown passt
|
teardown passt
|
||||||
|
|
||||||
VALGRIND=1
|
VALGRIND=1
|
||||||
setup passt_in_ns
|
setup passt_in_ns
|
||||||
test ndp
|
test $(cd test && echo ndp/*)
|
||||||
test dhcp
|
test $(cd test && echo dhcp/*)
|
||||||
test icmp
|
test $(cd test && echo icmp/*)
|
||||||
test tcp
|
test $(cd test && echo tcp/*)
|
||||||
test udp
|
test $(cd test && echo udp/*)
|
||||||
test valgrind
|
test $(cd test && echo valgrind/*)
|
||||||
teardown passt_in_ns
|
teardown passt_in_ns
|
||||||
|
|
||||||
VALGRIND=0
|
VALGRIND=0
|
||||||
setup passt_in_ns
|
setup passt_in_ns
|
||||||
test ndp
|
test $(cd test && echo ndp/*)
|
||||||
test dhcp
|
test $(cd test && echo dhcp/*)
|
||||||
test perf
|
test $(cd test && echo perf/*)
|
||||||
teardown passt_in_ns
|
teardown passt_in_ns
|
||||||
|
|
||||||
setup two_guests
|
setup two_guests
|
||||||
test two_guests
|
test $(cd test && echo two_guests/*)
|
||||||
teardown two_guests
|
teardown two_guests
|
||||||
|
|
||||||
perf_finish
|
perf_finish
|
||||||
|
@ -125,21 +125,21 @@ demo() {
|
||||||
layout_demo_passt
|
layout_demo_passt
|
||||||
video_start demo_passt
|
video_start demo_passt
|
||||||
MODE=passt
|
MODE=passt
|
||||||
test demo
|
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
|
MODE=pasta
|
||||||
test demo
|
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
|
MODE=podman
|
||||||
test demo
|
test $(cd test && echo demo/*)
|
||||||
video_stop
|
video_stop
|
||||||
teardown_demo_podman
|
teardown_demo_podman
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue