nixosTests.mpv: migrate to runTest

Part of #386873
This commit is contained in:
Piotr Kwiecinski 2025-04-02 17:26:41 +02:00
parent c241eb319f
commit 244d31d15a
No known key found for this signature in database
GPG key ID: EC0DE1CB9D5258B4
2 changed files with 24 additions and 26 deletions

View file

@ -805,7 +805,7 @@ in
moosefs = handleTest ./moosefs.nix { };
movim = discoverTests (import ./web-apps/movim { inherit handleTestOn; });
mpd = handleTest ./mpd.nix { };
mpv = handleTest ./mpv.nix { };
mpv = runTest ./mpv.nix;
mtp = handleTest ./mtp.nix { };
multipass = handleTest ./multipass.nix { };
mumble = handleTest ./mumble.nix { };

View file

@ -1,28 +1,26 @@
import ./make-test-python.nix (
{ lib, ... }:
{ lib, ... }:
let
port = toString 4321;
in
{
name = "mpv";
meta.maintainers = with lib.maintainers; [ zopieux ];
let
port = toString 4321;
in
{
name = "mpv";
meta.maintainers = with lib.maintainers; [ zopieux ];
nodes.machine =
{ pkgs, ... }:
{
environment.systemPackages = [
pkgs.curl
(pkgs.mpv.override {
scripts = [ pkgs.mpvScripts.simple-mpv-webui ];
})
];
};
nodes.machine =
{ pkgs, ... }:
{
environment.systemPackages = [
pkgs.curl
(pkgs.mpv.override {
scripts = [ pkgs.mpvScripts.simple-mpv-webui ];
})
];
};
testScript = ''
machine.execute("set -m; mpv --script-opts=webui-port=${port} --idle=yes >&2 &")
machine.wait_for_open_port(${port})
assert "<title>simple-mpv-webui" in machine.succeed("curl -s localhost:${port}")
'';
}
)
testScript = ''
machine.execute("set -m; mpv --script-opts=webui-port=${port} --idle=yes >&2 &")
machine.wait_for_open_port(${port})
assert "<title>simple-mpv-webui" in machine.succeed("curl -s localhost:${port}")
'';
}