summaryrefslogtreecommitdiffstats
path: root/nixos/tests
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-11-19 00:01:26 +0000
committerGitHub <noreply@github.com>2021-11-19 00:01:26 +0000
commitc83cfc58e584b2a84fe6e7668620214d40e256f5 (patch)
treefdf1e6e737abee520e94a1f65e76cb2b5a13e598 /nixos/tests
parent91e24d05d70d791873b046072e690341b13aa26d (diff)
parent76f5b6bb9cf88fe7db02e26f1a387ec56cb763a0 (diff)
Merge master into staging-next
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix3
-rw-r--r--nixos/tests/libinput.nix38
2 files changed, 40 insertions, 1 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 985dbd3b6767..a74792d3d2eb 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -228,9 +228,10 @@ in
kubernetes = handleTestOn ["x86_64-linux"] ./kubernetes {};
latestKernel.login = handleTest ./login.nix { latestKernel = true; };
leaps = handleTest ./leaps.nix {};
+ libinput = handleTest ./libinput.nix {};
libreddit = handleTest ./libreddit.nix {};
- lidarr = handleTest ./lidarr.nix {};
libreswan = handleTest ./libreswan.nix {};
+ lidarr = handleTest ./lidarr.nix {};
lightdm = handleTest ./lightdm.nix {};
limesurvey = handleTest ./limesurvey.nix {};
litestream = handleTest ./litestream.nix {};
diff --git a/nixos/tests/libinput.nix b/nixos/tests/libinput.nix
new file mode 100644
index 000000000000..2f84aaadcd0b
--- /dev/null
+++ b/nixos/tests/libinput.nix
@@ -0,0 +1,38 @@
+import ./make-test-python.nix ({ ... }:
+
+{
+ name = "libinput";
+
+ machine = { ... }:
+ {
+ imports = [
+ ./common/x11.nix
+ ./common/user-account.nix
+ ];
+
+ test-support.displayManager.auto.user = "alice";
+
+ services.xserver.libinput = {
+ enable = true;
+ mouse = {
+ naturalScrolling = true;
+ leftHanded = true;
+ middleEmulation = false;
+ horizontalScrolling = false;
+ };
+ };
+ };
+
+ testScript = ''
+ def expect_xserver_option(option, value):
+ machine.succeed(f"""cat /var/log/X.0.log | grep -F 'Option "{option}" "{value}"'""")
+
+ machine.start()
+ machine.wait_for_x()
+ machine.succeed("""cat /var/log/X.0.log | grep -F "Using input driver 'libinput'" """)
+ expect_xserver_option("NaturalScrolling", "on")
+ expect_xserver_option("LeftHanded", "on")
+ expect_xserver_option("MiddleEmulation", "off")
+ expect_xserver_option("HorizontalScrolling", "off")
+ '';
+})