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