diff options
author | Anthony Roussel <anthony@roussel.dev> | 2023-11-10 14:52:15 +0100 |
---|---|---|
committer | Anthony Roussel <anthony@roussel.dev> | 2023-11-10 15:11:28 +0100 |
commit | 0eeea808636d804e4022e6fa1661784f1a2b0074 (patch) | |
tree | 78b3938e3acc3fa3ec2749b747c48abba68203b4 /nixos/tests/sonic-server.nix | |
parent | b0d279d2193732c5ce3d5414a707f871a70c47be (diff) |
nixosTests.sonic-server: init
Diffstat (limited to 'nixos/tests/sonic-server.nix')
-rw-r--r-- | nixos/tests/sonic-server.nix | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nixos/tests/sonic-server.nix b/nixos/tests/sonic-server.nix new file mode 100644 index 0000000000000..bb98047619b2b --- /dev/null +++ b/nixos/tests/sonic-server.nix @@ -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]}'" + ''; +}) |