From b1afa5a67bacd36a5a359f07c761eb1a5cfcf129 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 2 Dec 2022 12:12:07 +0100 Subject: [PATCH] test: update TEST-73-LOCALE to define several locale settings in initial PID1 environment --- test/units/testsuite-73.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/units/testsuite-73.sh b/test/units/testsuite-73.sh index f9e2dce1bf1..a4fda36da06 100755 --- a/test/units/testsuite-73.sh +++ b/test/units/testsuite-73.sh @@ -92,6 +92,19 @@ test_locale() { return fi + # start with a known default environment and make sure to also give a + # default value to LC_CTYPE= since we're about to also set/unset it. We + # also reload PID1 configuration to make sure that PID1 environment itself + # is updated as it's not always been the case. + assert_rc 0 localectl set-locale "LANG=en_US.UTF-8" "LC_CTYPE=C" + systemctl daemon-reload + output=$(localectl) + assert_in "System Locale: LANG=en_US.UTF-8" "$output" + assert_in "LC_CTYPE=C" "$output" + output=$(systemctl show-environment) + assert_in "LANG=en_US.UTF-8" "$output" + assert_in "LC_CTYPE=C" "$output" + # warn when kernel command line has locale settings output=$(SYSTEMD_PROC_CMDLINE="locale.LANG=C.UTF-8 locale.LC_CTYPE=ja_JP.UTF-8" localectl 2>&1) assert_in "Warning:" "$output" -- 2.47.3