1{ pkgs, ... }:
2let
3 testUser = "alice";
4in
5{
6 name = "opentabletdriver";
7 meta = {
8 maintainers = with pkgs.lib.maintainers; [ thiagokokada ];
9 };
10
11 nodes.machine =
12 { pkgs, ... }:
13 {
14 imports = [
15 ./common/user-account.nix
16 ./common/x11.nix
17 ];
18 test-support.displayManager.auto.user = testUser;
19 hardware.opentabletdriver.enable = true;
20 };
21
22 testScript = ''
23 machine.start()
24 machine.wait_for_x()
25
26 machine.wait_for_unit('graphical.target')
27 machine.wait_for_unit("opentabletdriver.service", "${testUser}")
28
29 machine.succeed("cat /etc/udev/rules.d/70-opentabletdriver.rules")
30 # Will fail if service is not running
31 # Needs to run as the same user that started the service
32 machine.succeed("su - ${testUser} -c 'otd detect'")
33 '';
34}