]> git.scottworley.com Git - syncthing-autoregister/commitdiff
Two machines
authorScott Worley <scottworley@scottworley.com>
Mon, 27 Jul 2020 21:59:35 +0000 (14:59 -0700)
committerScott Worley <scottworley@scottworley.com>
Mon, 27 Jul 2020 21:59:35 +0000 (14:59 -0700)
tests/automatic-enrollment.nix

index 49325fa90e5f71d19270683c93f0964087b978fb..46940488a952c7d87319dc737ef5fdf720ba8759 100644 (file)
@@ -30,7 +30,10 @@ import <nixpkgs/nixos/tests/make-test-python.nix> ({ pkgs, lib, ... }:
 
     name = "syncthing";
 
-    machine = "${configuration}";
+    nodes = {
+      a = "${configuration}";
+      b = "${configuration}";
+    };
 
     testScript = ''
       def setConfig(machine, config):
@@ -42,11 +45,11 @@ import <nixpkgs/nixos/tests/make-test-python.nix> ({ pkgs, lib, ... }:
           "${configurationWithDeviceIDs}"
       )
 
-      setConfig(machine, initialConfiguration)
-      machine.wait_for_unit("syncthing-autoregister.service")
-      setConfig(machine, configurationWithDeviceIDs)
-      machine.succeed(
-          '(( "$(nix eval --raw -f "<nixos/nixos>" config.services.syncthing.declarative.devices.machine.id | wc -c)" == 63 ))'
+      setConfig(a, initialConfiguration)
+      a.wait_for_unit("syncthing-autoregister.service")
+      setConfig(a, configurationWithDeviceIDs)
+      a.succeed(
+          '(( "$(nix eval --raw -f "<nixos/nixos>" config.services.syncthing.declarative.devices.a.id | wc -c)" == 63 ))'
       )
     '';
   })