From 244d31d15af5c5ae09b6d6fbb7ffa2d3248c82b1 Mon Sep 17 00:00:00 2001 From: Piotr Kwiecinski <2151333+piotrkwiecinski@users.noreply.github.com> Date: Wed, 2 Apr 2025 17:26:41 +0200 Subject: [PATCH] nixosTests.mpv: migrate to runTest Part of #386873 --- nixos/tests/all-tests.nix | 2 +- nixos/tests/mpv.nix | 48 +++++++++++++++++++-------------------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 0d75a616e23a..f27cff355afe 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -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 { }; diff --git a/nixos/tests/mpv.nix b/nixos/tests/mpv.nix index 6ec24ae78cd4..07d8b9fb3b96 100644 --- a/nixos/tests/mpv.nix +++ b/nixos/tests/mpv.nix @@ -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 "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}") + ''; +}