From: Scott Worley Date: Mon, 27 Jul 2020 21:29:36 +0000 (-0700) Subject: Test reads device ID out of system config X-Git-Url: http://git.scottworley.com/syncthing-autoregister/commitdiff_plain/80f1294c2d073643352fba816691d816aad4ff44 Test reads device ID out of system config --- diff --git a/tests/automatic-enrollment.nix b/tests/automatic-enrollment.nix index 870e6ee..92c90b7 100644 --- a/tests/automatic-enrollment.nix +++ b/tests/automatic-enrollment.nix @@ -17,6 +17,14 @@ import ({ pkgs, lib, ... }: environment.systemPackages = with pkgs; [ nix ]; } ''; + configurationWithDeviceIDs = pkgs.writeText "configuration-with-device-ids.nix" '' + { + imports = [ + ${configuration} + /tmp/syncthing-auto-register-test-device-ids.nix + ]; + } + ''; in { name = "syncthing"; @@ -29,8 +37,12 @@ import ({ pkgs, lib, ... }: "/etc/nixos/configuration.nix", ) machine.wait_for_unit("syncthing-autoregister.service") + machine.copy_from_host( + "${configurationWithDeviceIDs}", + "/etc/nixos/configuration.nix", + ) machine.succeed( - '(( "$(nix eval --raw -f /tmp/syncthing-auto-register-test-device-ids.nix services.syncthing.declarative.devices.machine.id | wc -c)" == 63 ))' + '(( "$(nix eval --raw -f "" config.services.syncthing.declarative.devices.machine.id | wc -c)" == 63 ))' ) ''; })