summaryrefslogtreecommitdiffstats
path: root/tests/functions.sh
diff options
context:
space:
mode:
authorRuediger Meier2014-05-10 07:04:11 +0200
committerRuediger Meier2014-05-10 09:08:31 +0200
commitc08863ff72554b5449a371d1808e4e8fc1bb61de (patch)
treefb4ebdef9af0afd97486b27dd2d2614e90ac8b05 /tests/functions.sh
parenttests: allow test options to be overridden by env (diff)
downloadkernel-qcow2-util-linux-c08863ff72554b5449a371d1808e4e8fc1bb61de.tar.gz
kernel-qcow2-util-linux-c08863ff72554b5449a371d1808e4e8fc1bb61de.tar.xz
kernel-qcow2-util-linux-c08863ff72554b5449a371d1808e4e8fc1bb61de.zip
tests: fix var names
Translate "." and "-" to "_". We assume that nobody will add completely stupid test file names. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r--tests/functions.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index 0366f163b..6631de49d 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -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"