2019-11-25 08:36:37 +00:00
|
|
|
import ./make-test-python.nix ({ lib, pkgs, ... }: let
|
2019-04-21 21:05:07 +00:00
|
|
|
|
|
|
|
testId = "7CFNTQM-IMTJBHJ-3UWRDIU-ZGQJFR6-VCXZ3NB-XUH3KZO-N52ITXR-LAIYUAU";
|
2023-06-23 18:12:19 +00:00
|
|
|
testName = "testDevice foo'bar";
|
2019-04-21 21:05:07 +00:00
|
|
|
|
|
|
|
in {
|
|
|
|
name = "syncthing-init";
|
2021-01-10 19:08:30 +00:00
|
|
|
meta.maintainers = with pkgs.lib.maintainers; [ lassulus ];
|
2019-04-21 21:05:07 +00:00
|
|
|
|
2022-03-20 23:15:30 +00:00
|
|
|
nodes.machine = {
|
2019-04-21 21:05:07 +00:00
|
|
|
services.syncthing = {
|
|
|
|
enable = true;
|
2023-05-22 14:56:23 +00:00
|
|
|
settings.devices.testDevice = {
|
2023-05-22 08:28:27 +00:00
|
|
|
id = testId;
|
2019-04-21 21:05:07 +00:00
|
|
|
};
|
2023-05-22 14:56:23 +00:00
|
|
|
settings.folders.testFolder = {
|
2023-05-22 08:28:27 +00:00
|
|
|
path = "/tmp/test";
|
2023-05-22 14:56:23 +00:00
|
|
|
devices = [ "testDevice" ];
|
2023-05-22 08:28:27 +00:00
|
|
|
};
|
2023-05-22 14:56:23 +00:00
|
|
|
settings.gui.user = "guiUser";
|
2019-04-21 21:05:07 +00: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 09:25:04 +00:00
|
|
|
|
2019-11-25 08:36:37 +00:00
|
|
|
assert "testFolder" in config
|
|
|
|
assert "${testId}" in config
|
2021-07-27 16:15:41 +00:00
|
|
|
assert "guiUser" in config
|
2019-04-21 21:05:07 +00:00
|
|
|
'';
|
|
|
|
})
|