diff options
author | Thomas Haller <thaller@redhat.com> | 2023-09-18 20:45:19 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2023-09-18 22:07:00 +0200 |
commit | 50867e134603348e3f8eeb8e4c1b171516212503 (patch) | |
tree | 9fa81bc7ef2bd1dc8b9047de7048b6ff70fc0870 | |
parent | d4e29e90d642fe143fd900b1e7a25741b291f428 (diff) |
tests/shell: set C locale in "run-tests.sh"
The tests should run always the same, regardless of the user's language
settings. Set LANG=C and LC_ALL=C and unset LANGUAGE. If some part wants
to test a different language, it would set it explicitly. They anyway
wouldn't want to depend on something from the user's environment.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
-rwxr-xr-x | tests/shell/run-tests.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh index 528646f5..79c818cb 100755 --- a/tests/shell/run-tests.sh +++ b/tests/shell/run-tests.sh @@ -1,5 +1,9 @@ #!/bin/bash +unset LANGUAGE +export LANG=C +export LC_ALL=C + GREEN="" YELLOW="" RED="" @@ -235,7 +239,7 @@ for file in "${F[@]}"; do msg_warn "Ignore feature file \"$file\"" fi done -_HAVE_OPTS=( $(printf '%s\n' "${_HAVE_OPTS[@]}" | LANG=C sort) ) +_HAVE_OPTS=( $(printf '%s\n' "${_HAVE_OPTS[@]}" | sort) ) for KEY in $(compgen -v | grep '^NFT_TEST_HAVE_' | sort) ; do if ! array_contains "${KEY#NFT_TEST_HAVE_}" "${_HAVE_OPTS[@]}" ; then @@ -336,7 +340,7 @@ while [ $# -gt 0 ] ; do done find_tests() { - find "$1" -type f -executable | LANG=C sort + find "$1" -type f -executable | sort } if [ "${#TESTS[@]}" -eq 0 ] ; then |