nixosTests.sonic-server: init
This commit is contained in:
parent
b0d279d219
commit
0eeea80863
2 changed files with 23 additions and 0 deletions
|
@ -758,6 +758,7 @@ in {
|
||||||
sogo = handleTest ./sogo.nix {};
|
sogo = handleTest ./sogo.nix {};
|
||||||
solanum = handleTest ./solanum.nix {};
|
solanum = handleTest ./solanum.nix {};
|
||||||
sonarr = handleTest ./sonarr.nix {};
|
sonarr = handleTest ./sonarr.nix {};
|
||||||
|
sonic-server = handleTest ./sonic-server.nix {};
|
||||||
sourcehut = handleTest ./sourcehut.nix {};
|
sourcehut = handleTest ./sourcehut.nix {};
|
||||||
spacecookie = handleTest ./spacecookie.nix {};
|
spacecookie = handleTest ./spacecookie.nix {};
|
||||||
spark = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./spark {};
|
spark = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./spark {};
|
||||||
|
|
22
nixos/tests/sonic-server.nix
Normal file
22
nixos/tests/sonic-server.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
||||||
|
name = "sonic-server";
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
maintainers = with lib.maintainers; [ anthonyroussel ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes.machine = { pkgs, ... }: {
|
||||||
|
services.sonic-server.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
machine.start()
|
||||||
|
|
||||||
|
machine.wait_for_unit("sonic-server.service")
|
||||||
|
machine.wait_for_open_port(1491)
|
||||||
|
|
||||||
|
with subtest("Check control mode"):
|
||||||
|
result = machine.succeed('(echo START control; sleep 1; echo PING; echo QUIT) | nc localhost 1491').splitlines()
|
||||||
|
assert result[2] == "PONG", f"expected 'PONG', got '{result[2]}'"
|
||||||
|
'';
|
||||||
|
})
|
Loading…
Reference in a new issue