From f99f026911c95af3f9d760582f3e2e457192a73f Mon Sep 17 00:00:00 2001 From: Jacek Galowicz Date: Tue, 21 Apr 2026 10:14:49 +0000 Subject: [PATCH] nixosTests: switch from deprecated copy_from_vm to copy_from_machine --- nixos/tests/cosmic.nix | 2 +- nixos/tests/cups-pdf.nix | 2 +- nixos/tests/firefox.nix | 2 +- nixos/tests/forgejo.nix | 2 +- nixos/tests/i18n.nix | 2 +- nixos/tests/marytts.nix | 2 +- nixos/tests/matrix/appservice-irc.nix | 2 +- nixos/tests/miracle-wm.nix | 4 ++-- nixos/tests/miriway.nix | 4 ++-- nixos/tests/mpd.nix | 4 ++-- nixos/tests/musescore.nix | 2 +- nixos/tests/sane.nix | 4 ++-- nixos/tests/searx.nix | 2 +- nixos/tests/sway.nix | 4 ++-- nixos/tests/swayfx.nix | 4 ++-- nixos/tests/syncthing/many-devices.nix | 6 +++--- nixos/tests/systemd-analyze.nix | 4 ++-- nixos/tests/systemd-capsules.nix | 2 +- nixos/tests/taskchampion-sync-server.nix | 4 ++-- nixos/tests/tinywl.nix | 4 ++-- nixos/tests/turbovnc-headless-server.nix | 8 ++++---- nixos/tests/web-apps/goupile/default.nix | 2 +- nixos/tests/wpa_supplicant.nix | 4 ++-- 23 files changed, 38 insertions(+), 38 deletions(-) diff --git a/nixos/tests/cosmic.nix b/nixos/tests/cosmic.nix index 3d2b838ab66e..f7fde6ca0e0f 100644 --- a/nixos/tests/cosmic.nix +++ b/nixos/tests/cosmic.nix @@ -140,7 +140,7 @@ machine.succeed(f"pkill {gui_app}", timeout=5) machine.succeed("echo 'test completed succeessfully' > /${testName}", timeout=5) - machine.copy_from_vm('/${testName}') + machine.copy_from_machine('/${testName}') machine.shutdown() ''; diff --git a/nixos/tests/cups-pdf.nix b/nixos/tests/cups-pdf.nix index 00623b14a9db..9d38313d570d 100644 --- a/nixos/tests/cups-pdf.nix +++ b/nixos/tests/cups-pdf.nix @@ -36,7 +36,7 @@ # wait until the pdf files are completely produced and readable by alice machine.wait_until_succeeds(f"su - alice -c 'pdfinfo /var/spool/cups-pdf-{name}/users/alice/*.pdf'") machine.succeed(f"cp /var/spool/cups-pdf-{name}/users/alice/*.pdf /tmp/{name}.pdf") - machine.copy_from_vm(f"/tmp/{name}.pdf", "") + machine.copy_from_machine(f"/tmp/{name}.pdf", "") run(f"${lib.getExe hostPkgs.imagemagickBig} -density 300 $out/{name}.pdf $out/{name}.jpeg", shell=True, check=True) assert text.encode() in run(f"${lib.getExe hostPkgs.tesseract} $out/{name}.jpeg stdout", shell=True, check=True, capture_output=True).stdout ''; diff --git a/nixos/tests/firefox.nix b/nixos/tests/firefox.nix index 636e8cef3b48..44aa0734ca14 100644 --- a/nixos/tests/firefox.nix +++ b/nixos/tests/firefox.nix @@ -91,7 +91,7 @@ "${exe} file://${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/phone-incoming-call.oga >&2 &" ) wait_for_sound(machine) - machine.copy_from_vm("/tmp/record.wav") + machine.copy_from_machine("/tmp/record.wav") with subtest("Close sound test tab"): machine.execute("xdotool key ctrl+w") diff --git a/nixos/tests/forgejo.nix b/nixos/tests/forgejo.nix index 3574b93edec5..1dc3f5a53843 100644 --- a/nixos/tests/forgejo.nix +++ b/nixos/tests/forgejo.nix @@ -270,7 +270,7 @@ let server.succeed("${serverSystem}/specialisation/dump/bin/switch-to-configuration test") server.systemctl("start forgejo-dump") assert "Zstandard compressed data" in server.succeed("file ${dumpFile}") - server.copy_from_vm("${dumpFile}") + server.copy_from_machine("${dumpFile}") ''; }; in diff --git a/nixos/tests/i18n.nix b/nixos/tests/i18n.nix index 77f0cc579d5d..f9e8d526c95a 100644 --- a/nixos/tests/i18n.nix +++ b/nixos/tests/i18n.nix @@ -59,7 +59,7 @@ lib.pipe nodes [ builtins.attrNames (map (node: '' - ${node}.copy_from_vm( + ${node}.copy_from_machine( ${node}.succeed("readlink -f /etc/locale.conf").strip(), "${node}" ) diff --git a/nixos/tests/marytts.nix b/nixos/tests/marytts.nix index 101f20662ea5..d6b880099d25 100644 --- a/nixos/tests/marytts.nix +++ b/nixos/tests/marytts.nix @@ -80,6 +80,6 @@ in 'LOCALE': 'en_US', }) machine.succeed(f"curl 'localhost:${toString port}/process?{query}' -o ./audio.wav") - machine.copy_from_vm("./audio.wav") + machine.copy_from_machine("./audio.wav") ''; } diff --git a/nixos/tests/matrix/appservice-irc.nix b/nixos/tests/matrix/appservice-irc.nix index a44712cb9872..a90deddb9c79 100644 --- a/nixos/tests/matrix/appservice-irc.nix +++ b/nixos/tests/matrix/appservice-irc.nix @@ -223,7 +223,7 @@ in appservice.wait_for_open_port(11111) with subtest("copy the registration file"): - appservice.copy_from_vm("/var/lib/matrix-appservice-irc/registration.yml") + appservice.copy_from_machine("/var/lib/matrix-appservice-irc/registration.yml") homeserver.copy_from_host( str(pathlib.Path(os.environ.get("out", os.getcwd())) / "registration.yml"), "/" ) diff --git a/nixos/tests/miracle-wm.nix b/nixos/tests/miracle-wm.nix index bc346a156815..1ee8f42e69e5 100644 --- a/nixos/tests/miracle-wm.nix +++ b/nixos/tests/miracle-wm.nix @@ -114,7 +114,7 @@ machine.wait_for_text("alice@machine") machine.send_chars("test-wayland\n") machine.wait_for_file("/tmp/test-wayland-exit-ok") - machine.copy_from_vm("/tmp/test-wayland.out") + machine.copy_from_machine("/tmp/test-wayland.out") machine.screenshot("foot_wayland_info") # please actually register that we want to close the window @@ -135,7 +135,7 @@ machine.wait_for_text("alice@machine") machine.send_chars("test-x11\n") machine.wait_for_file("/tmp/test-x11-exit-ok") - machine.copy_from_vm("/tmp/test-x11.out") + machine.copy_from_machine("/tmp/test-x11.out") machine.screenshot("alacritty_glinfo") # please actually register that we want to close the window diff --git a/nixos/tests/miriway.nix b/nixos/tests/miriway.nix index 0835fa5dc89b..bb450bf4ca0a 100644 --- a/nixos/tests/miriway.nix +++ b/nixos/tests/miriway.nix @@ -108,7 +108,7 @@ machine.wait_for_text(r"(alice|machine)") machine.send_chars("test-wayland\n") machine.wait_for_file("/tmp/test-wayland-exit-ok") - machine.copy_from_vm("/tmp/test-wayland.out") + machine.copy_from_machine("/tmp/test-wayland.out") machine.screenshot("foot_wayland_info") # please actually register that we want to close the window @@ -128,7 +128,7 @@ machine.wait_for_text(r"(alice|machine)") machine.send_chars("test-x11\n") machine.wait_for_file("/tmp/test-x11-exit-ok") - machine.copy_from_vm("/tmp/test-x11.out") + machine.copy_from_machine("/tmp/test-x11.out") machine.screenshot("alacritty_glinfo") # please actually register that we want to close the window diff --git a/nixos/tests/mpd.nix b/nixos/tests/mpd.nix index 36337bfbb4de..2c269ce790b5 100644 --- a/nixos/tests/mpd.nix +++ b/nixos/tests/mpd.nix @@ -140,7 +140,7 @@ in # to perform the following test: client.fail(f"{mpc} -h serverPulseAudio status") # For inspecting these files - serverALSA.copy_from_vm("/run/mpd/mpd.conf", "ALSA") - serverPulseAudio.copy_from_vm("/run/mpd/mpd.conf", "PulseAudio") + serverALSA.copy_from_machine("/run/mpd/mpd.conf", "ALSA") + serverPulseAudio.copy_from_machine("/run/mpd/mpd.conf", "PulseAudio") ''; } diff --git a/nixos/tests/musescore.nix b/nixos/tests/musescore.nix index a0497bd81f5d..5d6003ca3378 100644 --- a/nixos/tests/musescore.nix +++ b/nixos/tests/musescore.nix @@ -95,6 +95,6 @@ in ## Check that it contains the title of the score machine.succeed('pdfgrep "Untitled score" "/root/Untitled score.pdf"') - machine.copy_from_vm("/root/Untitled score.pdf") + machine.copy_from_machine("/root/Untitled score.pdf") ''; } diff --git a/nixos/tests/sane.nix b/nixos/tests/sane.nix index 6b112898de0c..2a294b400e75 100644 --- a/nixos/tests/sane.nix +++ b/nixos/tests/sane.nix @@ -78,11 +78,11 @@ in with subtest("debugging: /dev/video0 works"): machine.succeed("v4l2-ctl --all >&2") machine.succeed("fswebcam --no-banner /tmp/webcam.jpg") - machine.copy_from_vm("/tmp/webcam.jpg", "webcam") + machine.copy_from_machine("/tmp/webcam.jpg", "webcam") # scan with the webcam machine.succeed("scanimage -o /tmp/scan.png >&2") - machine.copy_from_vm("/tmp/scan.png", "scan") + machine.copy_from_machine("/tmp/scan.png", "scan") # the image should contain "${text}" output = machine.succeed("tesseract /tmp/scan.png -") diff --git a/nixos/tests/searx.nix b/nixos/tests/searx.nix index 71a9750ac275..b402e6de775a 100644 --- a/nixos/tests/searx.nix +++ b/nixos/tests/searx.nix @@ -79,7 +79,7 @@ with subtest("Environment variables have been substituted"): base.succeed("grep -q somesecret /run/searx/settings.yml") - base.copy_from_vm("/run/searx/settings.yml") + base.copy_from_machine("/run/searx/settings.yml") with subtest("Basic setup is working"): base.wait_for_open_port(8080) diff --git a/nixos/tests/sway.nix b/nixos/tests/sway.nix index 240c1392f4d2..6de050418592 100644 --- a/nixos/tests/sway.nix +++ b/nixos/tests/sway.nix @@ -148,7 +148,7 @@ machine.send_chars("test-x11\n") machine.wait_for_file("/tmp/test-x11-exit-ok") print(machine.succeed("cat /tmp/test-x11.out")) - machine.copy_from_vm("/tmp/test-x11.out") + machine.copy_from_machine("/tmp/test-x11.out") machine.screenshot("alacritty_glinfo") machine.succeed("pkill alacritty") @@ -160,7 +160,7 @@ machine.send_chars("test-wayland\n") machine.wait_for_file("/tmp/test-wayland-exit-ok") print(machine.succeed("cat /tmp/test-wayland.out")) - machine.copy_from_vm("/tmp/test-wayland.out") + machine.copy_from_machine("/tmp/test-wayland.out") machine.screenshot("foot_wayland_info") machine.send_key("alt-shift-q") machine.wait_until_fails("pgrep foot") diff --git a/nixos/tests/swayfx.nix b/nixos/tests/swayfx.nix index 7477e92b7a70..8375402b35de 100644 --- a/nixos/tests/swayfx.nix +++ b/nixos/tests/swayfx.nix @@ -149,7 +149,7 @@ machine.send_chars("test-x11\n") machine.wait_for_file("/tmp/test-x11-exit-ok") print(machine.succeed("cat /tmp/test-x11.out")) - machine.copy_from_vm("/tmp/test-x11.out") + machine.copy_from_machine("/tmp/test-x11.out") machine.screenshot("alacritty_glinfo") machine.succeed("pkill alacritty") @@ -161,7 +161,7 @@ machine.send_chars("test-wayland\n") machine.wait_for_file("/tmp/test-wayland-exit-ok") print(machine.succeed("cat /tmp/test-wayland.out")) - machine.copy_from_vm("/tmp/test-wayland.out") + machine.copy_from_machine("/tmp/test-wayland.out") machine.screenshot("foot_wayland_info") machine.send_key("alt-shift-q") machine.wait_until_fails("pgrep foot") diff --git a/nixos/tests/syncthing/many-devices.nix b/nixos/tests/syncthing/many-devices.nix index a07977e65a4f..9faaf58a090e 100644 --- a/nixos/tests/syncthing/many-devices.nix +++ b/nixos/tests/syncthing/many-devices.nix @@ -227,7 +227,7 @@ in }) + '' # Useful for debugging later - machine.copy_from_vm("${configPath}", "before") + machine.copy_from_machine("${configPath}", "before") machine.systemctl("restart syncthing-init.service") machine.wait_for_unit("syncthing-init.service") @@ -237,13 +237,13 @@ in }) + '' # Useful for debugging later - machine.copy_from_vm("${configPath}", "after") + machine.copy_from_machine("${configPath}", "after") # Copy the systemd unit's bash script, to inspect it for debugging. mergeScript = machine.succeed( "systemctl cat syncthing-init.service | " "${pkgs.initool}/bin/initool g - Service ExecStart --value-only" ).strip() # strip from new lines - machine.copy_from_vm(mergeScript, "") + machine.copy_from_machine(mergeScript, "") ''; } diff --git a/nixos/tests/systemd-analyze.nix b/nixos/tests/systemd-analyze.nix index 1751f132c8fc..dbe20e82627f 100644 --- a/nixos/tests/systemd-analyze.nix +++ b/nixos/tests/systemd-analyze.nix @@ -44,7 +44,7 @@ # We copy the main graph into the $out (toplevel), and we also copy # the entire output directory with additional data with subtest("Copying the resulting data into $out"): - machine.copy_from_vm("systemd-analyze/", "") - machine.copy_from_vm("systemd-analyze/systemd-analyze.svg", "") + machine.copy_from_machine("systemd-analyze/", "") + machine.copy_from_machine("systemd-analyze/systemd-analyze.svg", "") ''; } diff --git a/nixos/tests/systemd-capsules.nix b/nixos/tests/systemd-capsules.nix index d794a454a9af..a7a23e111311 100644 --- a/nixos/tests/systemd-capsules.nix +++ b/nixos/tests/systemd-capsules.nix @@ -37,7 +37,7 @@ with subtest("interactive shell with terminal in capsule"): hello_output = machine.succeed("systemd-run -t --capsule=alice /run/current-system/sw/bin/bash -i -c 'hello | tee ~/hello'") assert hello_output == "Hello, world!\r\n" - machine.copy_from_vm("/var/lib/capsules/alice/hello") + machine.copy_from_machine("/var/lib/capsules/alice/hello") with subtest("capsule cleanup"): machine.succeed("systemctl --capsule=alice stop sleeptest.service") diff --git a/nixos/tests/taskchampion-sync-server.nix b/nixos/tests/taskchampion-sync-server.nix index cec79c09975d..489b28a12a2b 100644 --- a/nixos/tests/taskchampion-sync-server.nix +++ b/nixos/tests/taskchampion-sync-server.nix @@ -41,7 +41,7 @@ client.succeed("task sync") # Useful for debugging - client.copy_from_vm("/root/.task", "client") - server.copy_from_vm("${cfg.dataDir}", "server") + client.copy_from_machine("/root/.task", "client") + server.copy_from_machine("${cfg.dataDir}", "server") ''; } diff --git a/nixos/tests/tinywl.nix b/nixos/tests/tinywl.nix index d4a5f3708cff..75ff4a853f5d 100644 --- a/nixos/tests/tinywl.nix +++ b/nixos/tests/tinywl.nix @@ -55,13 +55,13 @@ # Make a screenshot and save the result: machine.screenshot("tinywl_foot") print(machine.succeed("cat /tmp/test-wayland.out")) - machine.copy_from_vm("/tmp/test-wayland.out") + machine.copy_from_machine("/tmp/test-wayland.out") # Terminate cleanly: machine.send_key("alt-esc") machine.wait_until_fails("pgrep foot") machine.wait_until_fails("pgrep tinywl") machine.wait_for_file("/tmp/tinywl-exit-ok") - machine.copy_from_vm("/tmp/tinywl.log") + machine.copy_from_machine("/tmp/tinywl.log") ''; } diff --git a/nixos/tests/turbovnc-headless-server.nix b/nixos/tests/turbovnc-headless-server.nix index 2c670fc60ee7..585fe0a350e9 100644 --- a/nixos/tests/turbovnc-headless-server.nix +++ b/nixos/tests/turbovnc-headless-server.nix @@ -146,10 +146,10 @@ machine.succeed("scrot --display :0 /tmp/glxgears.png") # Copy files down. - machine.copy_from_vm("/tmp/glxgears.png") - machine.copy_from_vm("/tmp/glxgears.stdout") - machine.copy_from_vm("/tmp/Xvnc.stdout") - machine.copy_from_vm("/tmp/Xvnc.stderr") + machine.copy_from_machine("/tmp/glxgears.png") + machine.copy_from_machine("/tmp/glxgears.stdout") + machine.copy_from_machine("/tmp/Xvnc.stdout") + machine.copy_from_machine("/tmp/Xvnc.stderr") ''; } diff --git a/nixos/tests/web-apps/goupile/default.nix b/nixos/tests/web-apps/goupile/default.nix index 48215af9fa45..6826e46b7f7a 100644 --- a/nixos/tests/web-apps/goupile/default.nix +++ b/nixos/tests/web-apps/goupile/default.nix @@ -113,7 +113,7 @@ in machine.succeed("run-goupile-test") out_dir = os.environ.get("out", os.getcwd()) - machine.copy_from_vm("/tmp/videos", out_dir) + machine.copy_from_machine("/tmp/videos", out_dir) ''; # Debug interactively with: diff --git a/nixos/tests/wpa_supplicant.nix b/nixos/tests/wpa_supplicant.nix index a16547712769..88b727ad4a69 100644 --- a/nixos/tests/wpa_supplicant.nix +++ b/nixos/tests/wpa_supplicant.nix @@ -137,7 +137,7 @@ let testScript = '' # save hostapd config file for manual inspection machine.wait_for_unit("hostapd.service") - machine.copy_from_vm("/run/hostapd/wlan0.hostapd.conf") + machine.copy_from_machine("/run/hostapd/wlan0.hostapd.conf") ${extraTestScript} ''; @@ -257,7 +257,7 @@ in machine.succeed("wpa_cli -i wlan0 list_networks | grep -q test2") # save file for manual inspection - machine.copy_from_vm(config_file) + machine.copy_from_machine(config_file) # check hardening options machine.succeed("systemd-analyze security wpa_supplicant >&2")