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";
|
2023-07-15 17:15:38 +00:00
|
|
|
testName = "testDevice foo'bar";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
nodes.machine = {
|
2020-04-24 23:36:52 +00:00
|
|
|
services.syncthing = {
|
|
|
|
enable = true;
|
2023-08-04 22:07:22 +00:00
|
|
|
settings.devices.testDevice = {
|
2021-08-05 21:33:18 +00:00
|
|
|
id = testId;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-08-04 22:07:22 +00:00
|
|
|
settings.folders.testFolder = {
|
2021-08-05 21:33:18 +00:00
|
|
|
path = "/tmp/test";
|
2023-08-04 22:07:22 +00:00
|
|
|
devices = [ "testDevice" ];
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
2023-08-04 22:07:22 +00:00
|
|
|
settings.gui.user = "guiUser";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
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
|
2021-08-05 21:33:18 +00:00
|
|
|
assert "guiUser" in config
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
})
|