vuls: init at 0.27.0
[NixPkgs.git] / nixos / tests / libinput.nix
blobb002492b166570c48594af653617866592b03ba4
1 import ./make-test-python.nix ({ ... }:
4   name = "libinput";
6   nodes.machine = { ... }:
7     {
8       imports = [
9         ./common/x11.nix
10         ./common/user-account.nix
11       ];
13       test-support.displayManager.auto.user = "alice";
15       services.libinput = {
16         enable = true;
17         mouse = {
18           naturalScrolling = true;
19           leftHanded = true;
20           middleEmulation = false;
21           horizontalScrolling = false;
22         };
23       };
24     };
26   testScript = ''
27     def expect_xserver_option(option, value):
28         machine.succeed(f"""cat /var/log/X.0.log | grep -F 'Option "{option}" "{value}"'""")
30     machine.start()
31     machine.wait_for_x()
32     machine.succeed("""cat /var/log/X.0.log | grep -F "Using input driver 'libinput'" """)
33     expect_xserver_option("NaturalScrolling", "on")
34     expect_xserver_option("LeftHanded", "on")
35     expect_xserver_option("MiddleEmulation", "off")
36     expect_xserver_option("HorizontalScrolling", "off")
37   '';