From: Franck Bui Date: Fri, 2 Dec 2022 11:12:07 +0000 (+0100) Subject: test: update TEST-73-LOCALE to define several locale settings in initial PID1 environment X-Git-Tag: v253-rc1~277^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b1afa5a67bacd36a5a359f07c761eb1a5cfcf129;p=thirdparty%2Fsystemd.git test: update TEST-73-LOCALE to define several locale settings in initial PID1 environment --- 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"