qemu_test: Remove hostCpuOnly flag (#541354)

This commit is contained in:
Maximilian Bosch
2026-07-21 23:12:16 +00:00
committed by GitHub
3 changed files with 56 additions and 1 deletions

View File

@@ -153,6 +153,7 @@ in
console-log = runTest ./nixos-test-driver/console-log.nix;
containers = runTest ./nixos-test-driver/containers.nix;
nspawn-daemon-reexec-dbus = runTest ./nspawn-daemon-reexec-dbus.nix;
multi-arch-test = runTest ./nixos-test-driver/multi-arch-test.nix;
skip-typecheck = runTest ./nixos-test-driver/skip-typecheck.nix;
console-timeout = runTest ./nixos-test-driver/console-timeout.nix;
options-doc-regression = import ./nixos-test-driver/options-doc-regression.nix { inherit pkgs; };

View File

@@ -0,0 +1,55 @@
{ pkgs, lib, ... }:
{
name = "multi-arch-test";
meta.maintainers = with pkgs.lib.maintainers; [ tfc ];
node.pkgsReadOnly = false;
nodes = {
# Setting build = host platform because such standard VM setups
# are well-cached by the multi-arch build infrastructure of the
# project.
vmIntel = {
nixpkgs.buildPlatform = "x86_64-linux";
nixpkgs.hostPlatform = "x86_64-linux";
};
vmArm = {
nixpkgs.buildPlatform = "aarch64-linux";
nixpkgs.hostPlatform = "aarch64-linux";
};
};
defaults = {
# not needed for this test and shrinks the closure
# because we dont' need qemu for all architectures
virtualisation.qemu.guestAgent.enable = false;
# the test is already very slow but we don't need DHCP anyway
networking.dhcpcd.enable = false;
# fix the network-online target, otherwise it doesn't work
# properly as a synchronization mechanism.
systemd.network.wait-online.enable = true;
systemd.network.wait-online.anyInterface = true;
};
# slow due to SW emulation but shouldn't be slower than that
globalTimeout = 5 * 60;
testScript = { nodes, ... }: /* python */ ''
start_all()
vmIntel.systemctl("start network-online.target")
vmArm.systemctl("start network-online.target")
vmIntel.wait_for_unit("network-online.target")
vmArm.wait_for_unit("network-online.target")
vmIntel.succeed("ping -c 1 vmArm")
vmArm.succeed("ping -c 1 vmIntel")
archIntel = vmIntel.succeed("uname -m")
t.assertIn("${nodes.vmIntel.nixpkgs.hostPlatform.qemuArch}", archIntel, "machine1 is an intel VM")
archArm = vmArm.succeed("uname -m")
t.assertIn("${nodes.vmArm.nixpkgs.hostPlatform.qemuArch}", archArm, "machine1 is an ARM VM")
'';
}

View File

@@ -7981,7 +7981,6 @@ with pkgs;
qemu_test = lowPrio (
qemu.override {
hostCpuOnly = true;
nixosTestRunner = true;
}
);