From: Yu Watanabe Date: Wed, 1 Feb 2023 19:29:43 +0000 (+0900) Subject: test: add test for invalid keymap setting X-Git-Tag: v254-rc1~916^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F26294%2Fhead;p=thirdparty%2Fsystemd.git test: add test for invalid keymap setting --- diff --git a/test/units/testsuite-73.sh b/test/units/testsuite-73.sh index 4f33cab8482..2aef7c779a4 100755 --- a/test/units/testsuite-73.sh +++ b/test/units/testsuite-73.sh @@ -552,6 +552,102 @@ test_convert() { assert_not_in "X11 Options:" "$output" } +test_validate() { + if [[ -z "$(localectl list-keymaps)" ]]; then + echo "No vconsole keymap installed, skipping test." + return + fi + + if [[ -z "$(localectl list-x11-keymap-layouts)" ]]; then + echo "No x11 keymap installed, skipping test." + return + fi + + backup_keymap + trap restore_keymap RETURN + + # clear previous settings + systemctl stop systemd-localed.service + wait_vconsole_setup + rm -f /etc/X11/xorg.conf.d/00-keyboard.conf /etc/default/keyboard + + # create invalid configs + cat >/etc/vconsole.conf </etc/vconsole.conf </etc/vconsole.conf </failed enable_debug @@ -559,6 +655,7 @@ test_locale test_vc_keymap test_x11_keymap test_convert +test_validate touch /testok rm /failed