1 import <nixpkgs/nixos/tests/make-test-python.nix> ({ pkgs, lib, ... }:
3 configuration = pkgs.writeText "configuration.nix" ''
6 ${../.}/modules/syncthing-autoregister.nix
7 <nixos/nixos/modules/installer/cd-dvd/channel.nix>
11 openDefaultPorts = true;
14 path = "/tmp/syncthing-auto-register-test-device-ids.nix";
17 environment.systemPackages = with pkgs; [ nix ];
20 configurationWithDeviceIDs = pkgs.writeText "configuration-with-device-ids.nix" ''
24 /tmp/syncthing-auto-register-test-device-ids.nix
32 machine = "${configuration}";
35 machine.copy_from_host(
37 "/etc/nixos/configuration.nix",
39 machine.wait_for_unit("syncthing-autoregister.service")
40 machine.copy_from_host(
41 "${configurationWithDeviceIDs}",
42 "/etc/nixos/configuration.nix",
45 '(( "$(nix eval --raw -f "<nixos/nixos>" config.services.syncthing.declarative.devices.machine.id | wc -c)" == 63 ))'