From 0083087e01af2b336be1f5009c3bbdebd040458a Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 5 Sep 2019 01:31:44 +0200 Subject: [PATCH] xsession: verify setxkbmap service in test --- .../misc/xsession/basic-setxkbmap-expected.service | 12 ++++++++++++ tests/modules/misc/xsession/basic.nix | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/modules/misc/xsession/basic-setxkbmap-expected.service diff --git a/tests/modules/misc/xsession/basic-setxkbmap-expected.service b/tests/modules/misc/xsession/basic-setxkbmap-expected.service new file mode 100644 index 000000000..39f876dd6 --- /dev/null +++ b/tests/modules/misc/xsession/basic-setxkbmap-expected.service @@ -0,0 +1,12 @@ +[Install] +WantedBy=graphical-session.target + +[Service] +ExecStart=@setxkbmap@/bin/setxkbmap -layout 'us' -variant '' +RemainAfterExit=true +Type=oneshot + +[Unit] +After=graphical-session-pre.target +Description=Set up keyboard in X +PartOf=graphical-session.target diff --git a/tests/modules/misc/xsession/basic.nix b/tests/modules/misc/xsession/basic.nix index 81329afce..60623d1bf 100644 --- a/tests/modules/misc/xsession/basic.nix +++ b/tests/modules/misc/xsession/basic.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: with lib; @@ -25,6 +25,13 @@ with lib; home-files/.xsession \ ${./basic-xsession-expected.txt} + assertFileExists home-files/.config/systemd/user/setxkbmap.service + assertFileContent \ + home-files/.config/systemd/user/setxkbmap.service \ + ${pkgs.substituteAll { + src = ./basic-setxkbmap-expected.service; + inherit (pkgs.xorg) setxkbmap; + }} ''; }; }