mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 23:36:17 +01:00
30 lines
757 B
Nix
30 lines
757 B
Nix
import ./make-test.nix ({ lib, pkgs, ... }: let
|
|
|
|
testId = "7CFNTQM-IMTJBHJ-3UWRDIU-ZGQJFR6-VCXZ3NB-XUH3KZO-N52ITXR-LAIYUAU";
|
|
|
|
in {
|
|
name = "syncthing-init";
|
|
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ lassulus ];
|
|
|
|
machine = {
|
|
services.syncthing = {
|
|
enable = true;
|
|
declarative = {
|
|
devices.testDevice = {
|
|
id = testId;
|
|
};
|
|
folders.testFolder = {
|
|
path = "/tmp/test";
|
|
devices = [ "testDevice" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
$machine->waitForUnit("syncthing-init.service");
|
|
$machine->succeed("cat /var/lib/syncthing/config.xml") =~ /${testId}/ or die;
|
|
$machine->succeed("cat /var/lib/syncthing/config.xml") =~ /testFolder/ or die;
|
|
'';
|
|
})
|
|
|