public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v3] tst_test.sh: Normalize the locale
@ 2022-10-20 13:37 Akihiko Odaki
  2022-10-20 17:30 ` Petr Vorel
  0 siblings, 1 reply; 9+ messages in thread
From: Akihiko Odaki @ 2022-10-20 13:37 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Yan Vugenfirer, Yuri Benditovich, ltp

network/tcp_cmds/tracepath/tracepath01.sh fails with LANG=ja_JP.UTF-8
because it parses localized output. The below is an example of such
output:
$ tracepath localhost
 1?: [LOCALHOST]                        0.040ミリ秒 pmtu 65536
 1:  localhost                                             0.274ミリ秒 到達しました
 1:  localhost                                             0.261ミリ秒 到達しました
     要約: pmtu 65536 ホップ数 1 戻りホップ数 1

It is necessary to normalize the locale to avoid such a problem.
There are some tests do the normalization, but that is not
comprehensive. Add code to normalize the locale to tst_test.sh so
that it can cover more tests.

The added code does the normalization by setting LC_ALL, which
takes precedence to the other locale-related environment variables
and does not require that "locale" command exists.

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

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 28b7d12ba..5ebbe1d25 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -831,3 +831,5 @@ if [ -z "$TST_NO_DEFAULT_RUN" ]; then
 		fi
 	fi
 fi
+
+export LC_ALL=C
-- 
2.37.3


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

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

end of thread, other threads:[~2022-11-07 10:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-20 13:37 [LTP] [PATCH v3] tst_test.sh: Normalize the locale Akihiko Odaki
2022-10-20 17:30 ` Petr Vorel
2022-10-20 19:09   ` Akihiko Odaki
2022-10-21  9:11   ` Cyril Hrubis
2022-10-21 11:26     ` Petr Vorel
2022-10-21 12:42       ` Cyril Hrubis
2022-10-21 13:11         ` Petr Vorel
2022-10-21 13:24           ` Cyril Hrubis
2022-11-07 10:27             ` Richard Palethorpe

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