2019-11-25 08:36:37 +00:00
|
|
|
import ./make-test-python.nix ({ lib, pkgs, ... }: let
|
2019-04-21 22:05:07 +01:00
|
|
|
|
|
|
|
testId = "7CFNTQM-IMTJBHJ-3UWRDIU-ZGQJFR6-VCXZ3NB-XUH3KZO-N52ITXR-LAIYUAU";
|
|
|
|
|
|
|
|
in {
|
|
|
|
name = "syncthing-init";
|
2021-01-10 19:08:30 +00:00
|
|
|
meta.maintainers = with pkgs.lib.maintainers; [ lassulus ];
|
2019-04-21 22:05:07 +01:00
|
|
|
|
|
|
|
machine = {
|
|
|
|
services.syncthing = {
|
|
|
|
enable = true;
|
2021-07-28 10:14:09 +01:00
|
|
|
devices.testDevice = {
|
|
|
|
id = testId;
|
2019-04-21 22:05:07 +01:00
|
|
|
};
|
2021-07-28 10:14:09 +01:00
|
|
|
folders.testFolder = {
|
|
|
|
path = "/tmp/test";
|
|
|
|
devices = [ "testDevice" ];
|
|
|
|
};
|
|
|
|
extraOptions.gui.user = "guiUser";
|
2019-04-21 22:05:07 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-11-25 08:36:37 +00:00
|
|
|
machine.wait_for_unit("syncthing-init.service")
|
|
|
|
config = machine.succeed("cat /var/lib/syncthing/.config/syncthing/config.xml")
|
2020-08-02 10:25:04 +01:00
|
|
|
|
2019-11-25 08:36:37 +00:00
|
|
|
assert "testFolder" in config
|
|
|
|
assert "${testId}" in config
|
2021-07-27 17:15:41 +01:00
|
|
|
assert "guiUser" in config
|
2019-04-21 22:05:07 +01:00
|
|
|
'';
|
|
|
|
})
|