]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: fix var names
authorRuediger Meier <ruediger.meier@ga-group.nl>
Sat, 10 May 2014 05:04:11 +0000 (07:04 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Sat, 10 May 2014 07:08:31 +0000 (09:08 +0200)
Translate "." and "-" to "_". We assume that nobody will add
completely stupid test file names.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests/functions.sh

index 0366f163b502367094e69911da5adaeedfec01d3..6631de49d8cea8ad61cdf236f07ef508506e8c84 100644 (file)
@@ -100,8 +100,11 @@ function ts_has_option {
 
        # user may set options by env for a single test or whole component
        # e.g. TS_OPT_ipcs_limits2_fake="yes" or TS_OPT_ipcs_fake="yes"
-       eval local env_opt_test=\$TS_OPT_${TS_COMPONENT}_${TS_TESTNAME}_${NAME}
-       eval local env_opt_comp=\$TS_OPT_${TS_COMPONENT}_${NAME}
+       local v_test=${TS_TESTNAME//[-.]/_}
+       local v_comp=${TS_COMPONENT//[-.]/_}
+       local v_name=${NAME//[-.]/_}
+       eval local env_opt_test=\$TS_OPT_${v_comp}_${v_test}_${v_name}
+       eval local env_opt_comp=\$TS_OPT_${v_comp}_${v_name}
        if [ "$env_opt_test" = "yes" \
                -o "$env_opt_comp" = "yes" -a "$env_opt_test" != "no" ]; then
                echo "yes"