summaryrefslogtreecommitdiffstats
path: root/debian/tests/localed-x11-keymap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 13:00:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 13:00:48 +0000
commitf542925b701989ba6eed7b08b5226d4021b9b85f (patch)
tree57e14731f21a6d663326d30b7b88736e9d51c420 /debian/tests/localed-x11-keymap
parentAdding upstream version 247.3. (diff)
downloadsystemd-f542925b701989ba6eed7b08b5226d4021b9b85f.tar.xz
systemd-f542925b701989ba6eed7b08b5226d4021b9b85f.zip
Adding debian version 247.3-7+deb11u4.debian/247.3-7+deb11u4debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xdebian/tests/localed-x11-keymap52
1 files changed, 52 insertions, 0 deletions
diff --git a/debian/tests/localed-x11-keymap b/debian/tests/localed-x11-keymap
new file mode 100755
index 0000000..34f4808
--- /dev/null
+++ b/debian/tests/localed-x11-keymap
@@ -0,0 +1,52 @@
+#!/bin/sh
+set -e
+
+. `dirname $0`/assert.sh
+
+if [ -f /etc/default/keyboard ]; then
+ ORIG_KBD=`cat /etc/default/keyboard`
+else
+ ORIG_KBD=""
+fi
+
+cleanup() {
+ # reset locale to original
+ if [ -n "ORIG_KBD" ]; then
+ echo "$ORIG_KBD" > /etc/default/keyboard
+ else
+ rm -f /etc/default/keyboard
+ fi
+ rm -f /etc/X11/xorg.conf.d/00-keyboard.conf
+}
+trap cleanup EXIT INT QUIT PIPE
+
+# should activate daemon and work
+STATUS=`localectl`
+assert_in "X11 Layout:" "`localectl --no-pager`"
+
+# change layout
+assert_eq "`localectl --no-pager set-x11-keymap et pc101 2>&1`" ""
+sync
+
+if [ -n "$TEST_UPSTREAM" ]; then
+ # Upstream writes xorg.conf.d file
+ assert_in 'Option "XkbLayout" "et' "`cat /etc/X11/xorg.conf.d/00-keyboard.conf`"
+ assert_in 'Option "XkbModel" "pc101"' "`cat /etc/X11/xorg.conf.d/00-keyboard.conf`"
+else
+ # Debian console-setup config file
+ assert_in 'XKBLAYOUT="\?et"\?' "`cat /etc/default/keyboard`"
+ assert_in 'XKBMODEL="\?pc101"\?' "`cat /etc/default/keyboard`"
+
+ ! [ -f /etc/X11/xorg.conf.d/00-keyboard.conf ]
+fi
+
+STATUS=`localectl --no-pager`
+assert_in "X11 Layout: et" "$STATUS"
+assert_in "X11 Model: pc101" "$STATUS"
+
+# gets along without config file
+if [ -z "$TEST_UPSTREAM" ]; then
+ rm /etc/default/keyboard
+ systemctl stop systemd-localed
+ assert_in "X11 Layout: n/a" "`localectl --no-pager`"
+fi