summaryrefslogtreecommitdiffstats
path: root/nixos/tests/incron.nix
diff options
context:
space:
mode:
authorJan Hrnko <jan.hrnko@satoshilabs.com>2019-11-09 20:18:42 +0100
committerFlorian Klink <flokli@flokli.de>2019-11-22 20:38:56 +0100
commit1e70152489d36bdcacf3ded3ab73c48599a531e3 (patch)
treeb98715fe440675a6d4836a459f74bce74a1866e1 /nixos/tests/incron.nix
parent35f16042a2e1194f9a85bda97a83d0a8aed7871d (diff)
nixos/incron: port test to python
Diffstat (limited to 'nixos/tests/incron.nix')
-rw-r--r--nixos/tests/incron.nix32
1 files changed, 16 insertions, 16 deletions
diff --git a/nixos/tests/incron.nix b/nixos/tests/incron.nix
index e39bbb5f096b..b22ee4c9a037 100644
--- a/nixos/tests/incron.nix
+++ b/nixos/tests/incron.nix
@@ -1,4 +1,4 @@
-import ./make-test.nix ({ pkgs, lib, ... }:
+import ./make-test-python.nix ({ pkgs, lib, ... }:
{
name = "incron";
@@ -19,34 +19,34 @@ import ./make-test.nix ({ pkgs, lib, ... }:
};
testScript = ''
- startAll;
+ start_all()
- $machine->waitForUnit("multi-user.target");
- $machine->waitForUnit("incron.service");
+ machine.wait_for_unit("multi-user.target")
+ machine.wait_for_unit("incron.service")
- $machine->succeed("test -d /test");
+ machine.succeed("test -d /test")
# create some activity for incron to monitor
- $machine->succeed("touch /test/file");
- $machine->succeed("echo foo >> /test/file");
- $machine->succeed("mv /test/file /root");
- $machine->succeed("mv /root/file /test");
+ machine.succeed("touch /test/file")
+ machine.succeed("echo foo >> /test/file")
+ machine.succeed("mv /test/file /root")
+ machine.succeed("mv /root/file /test")
- $machine->sleep(1);
+ machine.sleep(1)
# touch /test/file
- $machine->succeed("grep '/test/file IN_CREATE' /root/incron.log");
+ machine.succeed("grep '/test/file IN_CREATE' /root/incron.log")
# echo foo >> /test/file
- $machine->succeed("grep '/test/file IN_MODIFY' /root/incron.log");
- $machine->succeed("grep '/test/file IN_CLOSE_WRITE' /root/incron.log");
+ machine.succeed("grep '/test/file IN_MODIFY' /root/incron.log")
+ machine.succeed("grep '/test/file IN_CLOSE_WRITE' /root/incron.log")
# mv /test/file /root
- $machine->succeed("grep '/test/file IN_MOVED_FROM' /root/incron.log");
+ machine.succeed("grep '/test/file IN_MOVED_FROM' /root/incron.log")
# mv /root/file /test
- $machine->succeed("grep '/test/file IN_MOVED_TO' /root/incron.log");
+ machine.succeed("grep '/test/file IN_MOVED_TO' /root/incron.log")
# ensure something unexpected is not present
- $machine->fail("grep 'IN_OPEN' /root/incron.log");
+ machine.fail("grep 'IN_OPEN' /root/incron.log")
'';
})