2021-01-19 15:33:01 +01:00
|
|
|
import ./make-test-python.nix ( { pkgs, ... }: let
|
|
|
|
testUser = "alice";
|
|
|
|
in {
|
2021-01-08 17:48:00 +01:00
|
|
|
name = "opentabletdriver";
|
|
|
|
meta = {
|
2021-01-10 20:08:30 +01:00
|
|
|
maintainers = with pkgs.lib.maintainers; [ thiagokokada ];
|
2021-01-08 17:48:00 +01:00
|
|
|
};
|
|
|
|
|
2022-03-21 00:15:30 +01:00
|
|
|
nodes.machine = { pkgs, ... }:
|
2021-01-08 17:48:00 +01:00
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
./common/user-account.nix
|
|
|
|
./common/x11.nix
|
|
|
|
];
|
2021-01-19 15:33:01 +01:00
|
|
|
test-support.displayManager.auto.user = testUser;
|
2021-01-08 17:48:00 +01:00
|
|
|
hardware.opentabletdriver.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript =
|
|
|
|
''
|
|
|
|
machine.start()
|
|
|
|
machine.wait_for_x()
|
2023-12-23 10:36:32 +01:00
|
|
|
|
|
|
|
machine.wait_for_unit('graphical.target')
|
2021-01-19 15:33:01 +01:00
|
|
|
machine.wait_for_unit("opentabletdriver.service", "${testUser}")
|
2021-01-08 17:48:00 +01:00
|
|
|
|
2023-12-23 10:36:32 +01:00
|
|
|
machine.succeed("cat /etc/udev/rules.d/70-opentabletdriver.rules")
|
2021-01-08 17:48:00 +01:00
|
|
|
# Will fail if service is not running
|
2021-01-19 15:33:01 +01:00
|
|
|
# Needs to run as the same user that started the service
|
|
|
|
machine.succeed("su - ${testUser} -c 'otd detect'")
|
2021-01-08 17:48:00 +01:00
|
|
|
'';
|
|
|
|
})
|