Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] tst_test.sh: Unset the locale concerned variables
@ 2022-10-13  5:58 Akihiko Odaki
  2022-10-13 12:24 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Akihiko Odaki @ 2022-10-13  5:58 UTC (permalink / raw)
  To: ltp; +Cc: Yan Vugenfirer, Yuri Benditovich

network/tcp_cmds/tracepath/tracepath01.sh fails with LANG=ja_JP.UTF-8
because it parses localized output.

To avoid such a problem, we can always unset the locale concerned
variables. network/stress/ns-tools/check_envval does that, but it is
limited to the network stress test. Add similar code to tst_test.sh
so that it can cover more tests.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 testcases/lib/tst_test.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 28b7d12ba..9a8b62f1e 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -831,3 +831,8 @@ if [ -z "$TST_NO_DEFAULT_RUN" ]; then
 		fi
 	fi
 fi
+
+# Unset the locale cocerned variables
+for env in $(locale | cut -f 1 -d =); do
+	unset $env
+done
-- 
2.37.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-13 12:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-13  5:58 [LTP] [PATCH] tst_test.sh: Unset the locale concerned variables Akihiko Odaki
2022-10-13 12:24 ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox