From 87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 22:49:53 +0200 Subject: Adding debian version 255.4-1. Signed-off-by: Daniel Baumann --- debian/tests/localed-x11-keymap | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 debian/tests/localed-x11-keymap (limited to 'debian/tests/localed-x11-keymap') diff --git a/debian/tests/localed-x11-keymap b/debian/tests/localed-x11-keymap new file mode 100755 index 0000000..1fd29d3 --- /dev/null +++ b/debian/tests/localed-x11-keymap @@ -0,0 +1,63 @@ +#!/bin/sh +set -e + +case "${DEB_BUILD_PROFILES:-}" in + *pkg.systemd.upstream*) ;; + *) + echo "keymapping not supported for now, SKIP test" + exit 77 +esac + +. `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 + +case "${DEB_BUILD_PROFILES:-}" in + *pkg.systemd.upstream*) + # 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`" + ;; + *) + # 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 ] + ;; +esac + +STATUS=`localectl --no-pager` +assert_in "X11 Layout: et" "$STATUS" +assert_in "X11 Model: pc101" "$STATUS" + +case "${DEB_BUILD_PROFILES:-}" in + *pkg.systemd.upstream*) ;; + *) + rm /etc/default/keyboard + systemctl stop systemd-localed + assert_in "X11 Layout: (unset)" "`localectl --no-pager`" + ;; +esac -- cgit v1.2.3