tests/snapserver: Add test of connection and buffer size setting
This addition will cover part of the issue, that was fixed in #112295 and @mweinelt asked to improve the tests.
This commit is contained in:
parent
9de9838986
commit
c4b5a703ab
|
@ -5,6 +5,7 @@ let
|
||||||
tcpPort = 10005;
|
tcpPort = 10005;
|
||||||
httpPort = 10080;
|
httpPort = 10080;
|
||||||
tcpStreamPort = 10006;
|
tcpStreamPort = 10006;
|
||||||
|
bufferSize = 742;
|
||||||
in {
|
in {
|
||||||
name = "snapcast";
|
name = "snapcast";
|
||||||
meta = with pkgs.lib.maintainers; {
|
meta = with pkgs.lib.maintainers; {
|
||||||
|
@ -18,6 +19,7 @@ in {
|
||||||
port = port;
|
port = port;
|
||||||
tcp.port = tcpPort;
|
tcp.port = tcpPort;
|
||||||
http.port = httpPort;
|
http.port = httpPort;
|
||||||
|
buffer = bufferSize;
|
||||||
streams = {
|
streams = {
|
||||||
mpd = {
|
mpd = {
|
||||||
type = "pipe";
|
type = "pipe";
|
||||||
|
@ -35,6 +37,9 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
client = {
|
||||||
|
environment.systemPackages = [ pkgs.snapcast ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
|
@ -61,5 +66,12 @@ in {
|
||||||
server.succeed(
|
server.succeed(
|
||||||
"curl --fail http://localhost:${toString httpPort}/jsonrpc -d '{json.dumps(get_rpc_version)}'"
|
"curl --fail http://localhost:${toString httpPort}/jsonrpc -d '{json.dumps(get_rpc_version)}'"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
with subtest("test a connection"):
|
||||||
|
client.execute("systemd-run snapclient -h server -p ${toString port}")
|
||||||
|
server.wait_until_succeeds(
|
||||||
|
"journalctl -o cat -u snapserver.service | grep -q 'Hello from'"
|
||||||
|
)
|
||||||
|
client.wait_until_succeeds("journalctl -o cat -u run-\* | grep -q ${toString bufferSize}")
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue