2022-08-09 14:44:47 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
source vars
|
2022-12-19 20:35:27 +01:00
|
|
|
|
2023-01-31 10:34:18 +01:00
|
|
|
args=
|
|
|
|
single_test=0
|
|
|
|
persist_set=0
|
2023-02-27 16:52:57 +01:00
|
|
|
unconfigure_set=0
|
2023-02-28 18:59:15 +01:00
|
|
|
debug_set=0
|
2023-09-05 15:36:28 +02:00
|
|
|
vppsrc=
|
2023-01-31 10:34:18 +01:00
|
|
|
|
|
|
|
for i in "$@"
|
2022-12-19 20:35:27 +01:00
|
|
|
do
|
2023-01-31 10:34:18 +01:00
|
|
|
case "${i}" in
|
|
|
|
--persist=*)
|
|
|
|
persist="${i#*=}"
|
|
|
|
if [ $persist = "true" ]; then
|
|
|
|
args="$args -persist"
|
|
|
|
persist_set=1
|
|
|
|
fi
|
|
|
|
;;
|
2023-02-28 18:59:15 +01:00
|
|
|
--debug=*)
|
|
|
|
debug="${i#*=}"
|
|
|
|
if [ $debug = "true" ]; then
|
|
|
|
args="$args -debug"
|
|
|
|
debug_set=1
|
|
|
|
fi
|
|
|
|
;;
|
2023-01-31 10:34:18 +01:00
|
|
|
--verbose=*)
|
|
|
|
verbose="${i#*=}"
|
|
|
|
if [ $verbose = "true" ]; then
|
|
|
|
args="$args -verbose"
|
|
|
|
fi
|
|
|
|
;;
|
2023-02-27 16:52:57 +01:00
|
|
|
--unconfigure=*)
|
|
|
|
unconfigure="${i#*=}"
|
|
|
|
if [ $unconfigure = "true" ]; then
|
|
|
|
args="$args -unconfigure"
|
|
|
|
unconfigure_set=1
|
|
|
|
fi
|
|
|
|
;;
|
2023-04-28 10:29:47 +02:00
|
|
|
--cpus=*)
|
|
|
|
args="$args -cpus ${i#*=}"
|
|
|
|
;;
|
2023-09-05 15:36:28 +02:00
|
|
|
--vppsrc=*)
|
|
|
|
args="$args -vppsrc ${i#*=}"
|
|
|
|
;;
|
2023-01-31 10:34:18 +01:00
|
|
|
--test=*)
|
|
|
|
tc_name="${i#*=}"
|
|
|
|
if [ $tc_name != "all" ]; then
|
|
|
|
single_test=1
|
2023-09-05 15:58:28 +02:00
|
|
|
args="$args -run $tc_name -verbose"
|
2023-01-31 10:34:18 +01:00
|
|
|
fi
|
|
|
|
esac
|
2022-12-19 20:35:27 +01:00
|
|
|
done
|
|
|
|
|
2023-01-31 10:34:18 +01:00
|
|
|
if [ $single_test -eq 0 ] && [ $persist_set -eq 1 ]; then
|
2023-02-27 16:52:57 +01:00
|
|
|
echo "persist flag is not supported while running all tests!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $unconfigure_set -eq 1 ] && [ $single_test -eq 0 ]; then
|
|
|
|
echo "a single test has to be specified when unconfigure is set"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $persist_set -eq 1 ] && [ $unconfigure_set -eq 1 ]; then
|
|
|
|
echo "setting persist flag and unconfigure flag is not allowed"
|
2023-01-31 10:34:18 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-02-28 18:59:15 +01:00
|
|
|
if [ $single_test -eq 0 ] && [ $debug_set -eq 1 ]; then
|
|
|
|
echo "VPP debug flag is not supperted while running all tests!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-06-08 18:30:37 +02:00
|
|
|
sudo -E go test -timeout=20m -buildvcs=false -v $args
|