Merge pull request #112344 from thelegy/tests-snapcast
tests/snapserver: Add test of connection and buffer size setting
This commit is contained in:
commit
e1fb00e77e
@ -5,6 +5,7 @@ let
|
||||
tcpPort = 10005;
|
||||
httpPort = 10080;
|
||||
tcpStreamPort = 10006;
|
||||
bufferSize = 742;
|
||||
in {
|
||||
name = "snapcast";
|
||||
meta = with pkgs.lib.maintainers; {
|
||||
@ -18,6 +19,7 @@ in {
|
||||
port = port;
|
||||
tcp.port = tcpPort;
|
||||
http.port = httpPort;
|
||||
buffer = bufferSize;
|
||||
streams = {
|
||||
mpd = {
|
||||
type = "pipe";
|
||||
@ -35,6 +37,9 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
client = {
|
||||
environment.systemPackages = [ pkgs.snapcast ];
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
@ -61,5 +66,12 @@ in {
|
||||
server.succeed(
|
||||
"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 New Issue
Block a user