From a3e7e1bbc8e4fea44fa2bdaac74a2371f1989a82 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 21 Apr 2019 23:05:07 +0200 Subject: nixos/syncthing: add options for declarative device/folder config --- nixos/tests/syncthing-init.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 nixos/tests/syncthing-init.nix (limited to 'nixos/tests/syncthing-init.nix') diff --git a/nixos/tests/syncthing-init.nix b/nixos/tests/syncthing-init.nix new file mode 100644 index 00000000000..811a466ff94 --- /dev/null +++ b/nixos/tests/syncthing-init.nix @@ -0,0 +1,30 @@ +import ./make-test.nix ({ lib, pkgs, ... }: let + + testId = "7CFNTQM-IMTJBHJ-3UWRDIU-ZGQJFR6-VCXZ3NB-XUH3KZO-N52ITXR-LAIYUAU"; + +in { + name = "syncthing-init"; + meta.maintainers = with pkgs.stdenv.lib.maintainers; [ lassulus ]; + + machine = { + services.syncthing = { + enable = true; + declarative = { + devices.testDevice = { + id = testId; + }; + folders.testFolder = { + path = "/tmp/test"; + devices = [ "testDevice" ]; + }; + }; + }; + }; + + testScript = '' + $machine->waitForUnit("syncthing-init.service"); + $machine->succeed("cat /var/lib/syncthing/config.xml") =~ /${testId}/ or die; + $machine->succeed("cat /var/lib/syncthing/config.xml") =~ /testFolder/ or die; + ''; +}) + -- cgit 1.4.1