-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The .config option used to be types.attrs which (mostly) worked but introduced problems when merging (#62). Now config is using the pkgs.format.yaml along with standard machinery for generation. New directory in repo -- "checka" -- will contain automated tests that can be executed on supported systems to run unattended NixOS tests. For now the only implemented test checks that basic remapping works without any desktop environment. Fixes #22 #62 Progress on #16
- Loading branch information
1 parent
91e3bc4
commit a064ca6
Showing
4 changed files
with
74 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ self, pkgs, lib, ... }: | ||
let | ||
checks = [ | ||
./xremap-no-features-root-test.nix | ||
]; | ||
in | ||
lib.pipe checks | ||
[ | ||
(map (checkFile: | ||
{ | ||
name = builtins.toString checkFile; | ||
value = pkgs.testers.runNixOSTest (import checkFile { inherit self; }); | ||
} | ||
)) | ||
builtins.listToAttrs | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ self, ... }: | ||
{ | ||
name = "xremap-no-features-root-test"; | ||
nodes.machine1 = | ||
{ config, pkgs, ... }: | ||
{ | ||
services.getty.autologinUser = "root"; | ||
imports = [ | ||
self.nixosModules.default | ||
{ services.xremap.config.keymap = [{ name = "First remap"; remap = { "9" = "0"; }; }]; } | ||
{ services.xremap.config.keymap = [{ name = "Other remap"; remap = { "z" = "q"; }; }]; } | ||
]; | ||
|
||
}; | ||
|
||
# This test makes sure that both remaps are applied | ||
testScript = | ||
# python | ||
'' | ||
output_file = "/tmp/xremap-output" | ||
start_all() | ||
machine.wait_for_unit("xremap.service") | ||
machine.sleep(2) | ||
machine.send_chars(f"echo -n 'z' > {output_file}\n") | ||
machine.sleep(2) | ||
output = machine.execute(f"cat {output_file}")[1] | ||
assert output == "q", "Not the expected symbol!" | ||
machine.send_chars(f"echo -n '9' > {output_file}\n") | ||
machine.sleep(2) | ||
output = machine.execute(f"cat {output_file}")[1] | ||
assert output == "0", "Not the expected symbol!" | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters