nixpkgs/nixos/tests/syncthing-init.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
824 B
Nix
Raw Normal View History

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