]> git.scottworley.com Git - syncthing-autoregister/commitdiff
Copy a's file over to b
authorScott Worley <scottworley@scottworley.com>
Mon, 27 Jul 2020 23:11:55 +0000 (16:11 -0700)
committerScott Worley <scottworley@scottworley.com>
Mon, 27 Jul 2020 23:11:55 +0000 (16:11 -0700)
tests/automatic-enrollment.nix

index 803013d4dab2881615cd5345c0dd3333d6f245c9..4ff3670a3df0c35a53522b48f2c3ffe1730cfaa3 100644 (file)
@@ -49,6 +49,9 @@ import <nixpkgs/nixos/tests/make-test-python.nix> ({ pkgs, lib, ... }:
     };
 
     testScript = ''
     };
 
     testScript = ''
+      import os
+
+
       def setConfig(machine, config):
           machine.copy_from_host(config, "/etc/nixos/configuration.nix")
 
       def setConfig(machine, config):
           machine.copy_from_host(config, "/etc/nixos/configuration.nix")
 
@@ -67,5 +70,17 @@ import <nixpkgs/nixos/tests/make-test-python.nix> ({ pkgs, lib, ... }:
       a.wait_for_unit("syncthing-autoregister.service")
       setConfig(a, configurationWithDeviceIDs)
       verifyDeviceIDSet(a, "a")
       a.wait_for_unit("syncthing-autoregister.service")
       setConfig(a, configurationWithDeviceIDs)
       verifyDeviceIDSet(a, "a")
+      a.copy_from_vm("${deviceIDFilename}")
+
+      b.copy_from_host(
+          os.path.join(
+              os.environ["out"],
+              os.path.basename("${deviceIDFilename}"),
+          ),
+          "${deviceIDFilename}",
+      )
+      b.succeed("chown syncthing ${deviceIDFilename}")
+      setConfig(b, configurationWithDeviceIDs)
+      verifyDeviceIDSet(b, "a")
     '';
   })
     '';
   })