mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
nixos/tests/mediamtx: make more robust, reformat
We're sleeping now until the timeout of the receive service is reached to check for its state since it might fail until the stream is available.
This commit is contained in:
parent
a8a3cf536e
commit
8e7ebfe4f5
@ -1,11 +1,12 @@
|
||||
import ./make-test-python.nix ({ pkgs, lib, ...} :
|
||||
import ./make-test-python.nix (
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
name = "mediamtx";
|
||||
meta.maintainers = with lib.maintainers; [ fpletz ];
|
||||
|
||||
nodes = {
|
||||
machine = { config, ... }: {
|
||||
machine = {
|
||||
services.mediamtx = {
|
||||
enable = true;
|
||||
settings = {
|
||||
@ -49,9 +50,11 @@ import ./make-test-python.nix ({ pkgs, lib, ...} :
|
||||
|
||||
machine.wait_for_unit("mediamtx.service")
|
||||
machine.wait_for_unit("rtmp-publish.service")
|
||||
machine.sleep(10)
|
||||
machine.wait_for_unit("rtmp-receive.service")
|
||||
machine.wait_for_open_port(9998)
|
||||
machine.succeed("curl http://localhost:9998/metrics | grep '^rtmp_conns.*state=\"publish\".*1$'")
|
||||
machine.succeed("curl http://localhost:9998/metrics | grep '^rtmp_conns.*state=\"read\".*1$'")
|
||||
'';
|
||||
})
|
||||
}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user