scripts: Support custom arguments to the test binary with dev_cli.sh

The dev container interface script (e.g. 'dev_cli.sh') now supports the
following arguments syntax for running tests:

`tests [--unit|--cargo|--all] [--libc musl|gnu] [-- [<test scripts args>] [-- [<test binary args>]]] `

In this way, we can pass custom arguments to the test binary (either
"cargo test" or "performance-metrics") with our dev container script.
For example:

`$ ./dev_cli.sh tests --metrics -- -- --report-file /tmp/metrics.json --test-filter latency`
`$ ./dev_cli.sh tests --integration -- --test-filter "test_serial"  -- --nocapture --test-threads=1`

Fixes: #3739

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen
2022-02-22 09:05:32 -08:00
committed by Sebastien Boeuf
parent ec7d4e727a
commit 4552d07a80
9 changed files with 23 additions and 14 deletions

View File

@@ -311,13 +311,13 @@ echo 6144 | sudo tee /proc/sys/vm/nr_hugepages
sudo chmod a+rwX /dev/hugepages
# Run all direct kernel boot (Device Tree) test cases in mod `parallel`
time cargo test $features "parallel::$test_filter"
time cargo test $features "parallel::$test_filter" -- ${test_binary_args[*]}
RES=$?
# Run some tests in sequence since the result could be affected by other tests
# running in parallel.
if [ $RES -eq 0 ]; then
time cargo test $features "sequential::$test_filter" -- --test-threads=1
time cargo test $features "sequential::$test_filter" -- --test-threads=1 ${test_binary_args[*]}
RES=$?
else
exit $RES
@@ -325,7 +325,7 @@ fi
# Run all ACPI test cases
if [ $RES -eq 0 ]; then
time cargo test $features "aarch64_acpi::$test_filter"
time cargo test $features "aarch64_acpi::$test_filter" -- ${test_binary_args[*]}
RES=$?
else
exit $RES
@@ -333,7 +333,7 @@ fi
# Run all test cases related to live migration
if [ $RES -eq 0 ]; then
time cargo test $features "live_migration::$test_filter" -- --test-threads=1
time cargo test $features "live_migration::$test_filter" -- --test-threads=1 ${test_binary_args[*]}
RES=$?
else
exit $RES