From fcf8b80d1d58c72e9a26c21d4f945e85dcaf78b4 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 2 Feb 2023 04:29:43 +0900 Subject: [PATCH] test: add test for invalid keymap setting --- test/units/testsuite-73.sh | 97 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) 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 -- 2.47.3