Skip to content

Commit

Permalink
nixosTests.logiops: add
Browse files Browse the repository at this point in the history
There's no negative test due to runner limitations.

I tried to hack on the runner for a bit but it got out of scope and I'm
not interested in learning more Python. My 'fork' of nixpkgs has a
logiops-nixos-xtra branch for anyone interested in poking the testing
more.
  • Loading branch information
ckiee committed Oct 16, 2023
1 parent 46d9cbe commit d0eb378
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ in {
lldap = handleTest ./lldap.nix {};
locate = handleTest ./locate.nix {};
login = handleTest ./login.nix {};
logiops = handleTest ./logiops.nix {};
logrotate = handleTest ./logrotate.nix {};
loki = handleTest ./loki.nix {};
luks = handleTest ./luks.nix {};
Expand Down
56 changes: 56 additions & 0 deletions nixos/tests/logiops.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "logiops";
meta = with pkgs.lib.maintainers; {
maintainers = [ ckie ];
};

nodes = {
main = { ... }: {
services.logiops = {
enable = true;

settings = {
devices = [{
name = "Wireless Mouse MX Master 3";

smartshift = {
on = true;
threshold = 20;
};

hiresscroll = {
hires = true;
invert = false;
target = false;
};

dpi = 1500;

buttons = [
{
cid = "0x53";
action = {
type = "Keypress";
keys = [ "KEY_FORWARD" ];
};
}
{
cid = "0x56";
action = {
type = "Keypress";
keys = [ "KEY_BACK" ];
};
}
];
}];
};
};
};
};

testScript = ''
start_all()
with subtest("main machine should succeed"):
main.wait_for_unit("logid.service")
'';
})

0 comments on commit d0eb378

Please sign in to comment.