2020-04-24 23:36:52 +00:00
|
|
|
import ./make-test-python.nix ({ lib, pkgs, ... }: let
|
|
|
|
|
|
|
|
testId = "7CFNTQM-IMTJBHJ-3UWRDIU-ZGQJFR6-VCXZ3NB-XUH3KZO-N52ITXR-LAIYUAU";
|
|
|
|
|
|
|
|
in {
|
|
|
|
name = "syncthing-init";
|
2021-01-15 22:18:51 +00:00
|
|
|
meta.maintainers = with pkgs.lib.maintainers; [ lassulus ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
machine = {
|
|
|
|
services.syncthing = {
|
|
|
|
enable = true;
|
|
|
|
declarative = {
|
|
|
|
devices.testDevice = {
|
|
|
|
id = testId;
|
|
|
|
};
|
|
|
|
folders.testFolder = {
|
|
|
|
path = "/tmp/test";
|
|
|
|
devices = [ "testDevice" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
machine.wait_for_unit("syncthing-init.service")
|
|
|
|
config = machine.succeed("cat /var/lib/syncthing/.config/syncthing/config.xml")
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
assert "testFolder" in config
|
|
|
|
assert "${testId}" in config
|
|
|
|
'';
|
|
|
|
})
|