nixosTests.syncthing*: port to python
This commit is contained in:
parent
6e38def213
commit
7398211601
|
@ -1,4 +1,4 @@
|
||||||
import ./make-test.nix ({ lib, pkgs, ... }: let
|
import ./make-test-python.nix ({ lib, pkgs, ... }: let
|
||||||
|
|
||||||
testId = "7CFNTQM-IMTJBHJ-3UWRDIU-ZGQJFR6-VCXZ3NB-XUH3KZO-N52ITXR-LAIYUAU";
|
testId = "7CFNTQM-IMTJBHJ-3UWRDIU-ZGQJFR6-VCXZ3NB-XUH3KZO-N52ITXR-LAIYUAU";
|
||||||
|
|
||||||
|
@ -22,13 +22,11 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
my $config;
|
machine.wait_for_unit("syncthing-init.service")
|
||||||
|
config = machine.succeed("cat /var/lib/syncthing/.config/syncthing/config.xml")
|
||||||
$machine->waitForUnit("syncthing-init.service");
|
|
||||||
$config = $machine->succeed("cat /var/lib/syncthing/.config/syncthing/config.xml");
|
|
||||||
|
|
||||||
$config =~ /${testId}/ or die;
|
assert "testFolder" in config
|
||||||
$config =~ /testFolder/ or die;
|
assert "${testId}" in config
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import ./make-test.nix ({ lib, pkgs, ... }: {
|
import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||||
name = "syncthing-relay";
|
name = "syncthing-relay";
|
||||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ delroth ];
|
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ delroth ];
|
||||||
|
|
||||||
|
@ -14,9 +14,13 @@ import ./make-test.nix ({ lib, pkgs, ... }: {
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
$machine->waitForUnit("syncthing-relay.service");
|
machine.wait_for_unit("syncthing-relay.service")
|
||||||
$machine->waitForOpenPort(12345);
|
machine.wait_for_open_port(12345)
|
||||||
$machine->waitForOpenPort(12346);
|
machine.wait_for_open_port(12346)
|
||||||
$machine->succeed("curl http://localhost:12346/status | jq -r '.options.\"provided-by\"'") =~ /nixos-test/ or die;
|
|
||||||
|
out = machine.succeed(
|
||||||
|
"curl -sS http://localhost:12346/status | jq -r '.options.\"provided-by\"'"
|
||||||
|
)
|
||||||
|
assert "nixos-test" in out
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue