]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: skip firstboot --prompt-keymap check if keymaps are missing
authorMichael Biebl <biebl@debian.org>
Wed, 25 Jan 2023 08:13:37 +0000 (09:13 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 25 Jan 2023 19:46:33 +0000 (19:46 +0000)
Fixes: #26165
test/units/testsuite-74.firstboot.sh

index 36e265edfee7384ff1b4d2f329f247fade7f6097..c3be8f1cf6c1bc53961932c0dabc1ddcc309252f 100755 (executable)
@@ -148,8 +148,14 @@ touch "$ROOT/bin/fooshell" "$ROOT/bin/barshell"
 echo -ne "\nfoo\nbar\n" | systemd-firstboot --root="$ROOT" --prompt-locale
 grep -q "LANG=foo" "$ROOT$LOCALE_PATH"
 grep -q "LC_MESSAGES=bar" "$ROOT$LOCALE_PATH"
-echo -ne "\nfoo\n" | systemd-firstboot --root="$ROOT" --prompt-keymap
-grep -q "KEYMAP=foo" "$ROOT/etc/vconsole.conf"
+# systemd-firstboot in prompt-keymap mode requires keymaps to be installed so
+# it can present them as a list to the user. As Debian does not ship/provide
+# compatible keymaps (from the kbd package), skip this test if the keymaps are
+# missing.
+if [ -d "/usr/share/keymaps/" ] || [ -d "/usr/share/kbd/keymaps/" ] || [ -d "/usr/lib/kbd/keymaps/" ] ; then
+   echo -ne "\nfoo\n" | systemd-firstboot --root="$ROOT" --prompt-keymap
+   grep -q "KEYMAP=foo" "$ROOT/etc/vconsole.conf"
+fi
 echo -ne "\nEurope/Berlin\n" | systemd-firstboot --root="$ROOT" --prompt-timezone
 readlink "$ROOT/etc/localtime" | grep -q "Europe/Berlin$"
 echo -ne "\nfoobar\n" | systemd-firstboot --root="$ROOT" --prompt-hostname