at 21.11-pre 742 B view raw
1import ./make-test-python.nix ({ lib, pkgs, ... }: let 2 3 testId = "7CFNTQM-IMTJBHJ-3UWRDIU-ZGQJFR6-VCXZ3NB-XUH3KZO-N52ITXR-LAIYUAU"; 4 5in { 6 name = "syncthing-init"; 7 meta.maintainers = with pkgs.lib.maintainers; [ lassulus ]; 8 9 machine = { 10 services.syncthing = { 11 enable = true; 12 declarative = { 13 devices.testDevice = { 14 id = testId; 15 }; 16 folders.testFolder = { 17 path = "/tmp/test"; 18 devices = [ "testDevice" ]; 19 }; 20 }; 21 }; 22 }; 23 24 testScript = '' 25 machine.wait_for_unit("syncthing-init.service") 26 config = machine.succeed("cat /var/lib/syncthing/.config/syncthing/config.xml") 27 28 assert "testFolder" in config 29 assert "${testId}" in config 30 ''; 31})