From 72609f73cd95749e27f50f2c5a52bacdbb1a3c5a Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Tue, 3 Aug 2021 11:59:56 -0400 Subject: tests: add support for the LIBSECCOMP_TSTCFG_BATCHES env variable This allows us to specify the test batches via environment variables like we do other parts of the test configuration. Acked-by: Tom Hromatka Signed-off-by: Paul Moore --- tests/regression | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/regression b/tests/regression index 09ac643..d28b848 100755 --- a/tests/regression +++ b/tests/regression @@ -104,6 +104,7 @@ optional arguments: can also be set via LIBSECCOMP_TSTCFG_MODE_LIST env variable -a specifies all tests are to be run -b BATCH_NAME specifies batch of tests to be run + can also be set via LIBSECCOMP_TSTCFG_BATCHES env variable -l [LOG] specifies log file to write test results to -s SINGLE_TEST specifies individual test number to be run -t [TEMP_DIR] specifies directory to create temporary files in @@ -1158,6 +1159,14 @@ if [[ -z $mode_list ]]; then fi fi +# check if we specified a list of tests via the environment variable +if [[ -n $LIBSECCOMP_TSTCFG_BATCHES ]]; then + for i in $(echo "$LIBSECCOMP_TSTCFG_BATCHES" | sed 's/,/ /g'); do + batch_list[batch_count]="$i" + batch_count=$(($batch_count+1)) + done +fi + # default to all tests if batch or single tests not requested if [[ -z $batch_list ]] && [[ -z $single_list ]]; then runall=1 -- cgit v1.2.1