git.iko.soy/typeable/nixpkgs
on master help sign in
nixos-test-driver: allow configuration of net frontend and backend

When IPXE tests were added, an option was added for configuring only the frontend, and the backend configuration was dropped entirely. This caused most installer tests to fail.

commitd2144755a41be5e6c866686aabbfb0d4dd79392c authorAndrew Childs <lorne@cons.org.nz> dateSun 21 Jul 2019, 14:07 (7 years ago) parentb93b7d2
2 files changed+13−7
nixos/lib/test-driver/Machine.pm+10−5 nixos/tests/boot.nix+3−2
nixos/lib/test-driver/Machine.pm+10−5
@@ -31,12 +31,17 @@ sub new {
3131
3232 if (!$startCommand) {
3333 # !!! merge with qemu-vm.nix.
34− my $netArgs = "";
35− $netArgs .= ",romfile=$args->{netRomFile}"
36− if defined $args->{netRomFile};
34+ my $netBackend = "-netdev user,id=net0";
35+ my $netFrontend = "-device virtio-net-pci,netdev=net0";
36+
37+ $netBackend .= "," . $args->{netBackendArgs}
38+ if defined $args->{netBackendArgs};
39+
40+ $netFrontend .= "," . $args->{netFrontendArgs}
41+ if defined $args->{netFrontendArgs};
42+
3743 $startCommand =
38− "qemu-kvm -m 384 " .
39− "-device virtio-net-pci,netdev=net0${netArgs} \$QEMU_OPTS ";
44+ "qemu-kvm -m 384 $netBackend $netFrontend \$QEMU_OPTS ";
4045
4146 if (defined $args->{hda}) {
4247 if ($args->{hdaInterface} eq "scsi") {
nixos/tests/boot.nix+3−2
@@ -61,7 +61,8 @@ let
6161 ];
6262 };
6363 machineConfig = perlAttrs ({
64− qemuFlags = "-boot order=n -netdev user,id=net0,tftp=${ipxeBootDir}/,bootfile=netboot.ipxe -m 2000";
64+ qemuFlags = "-boot order=n -m 2000";
65+ netBackendArgs = "tftp=${ipxeBootDir},bootfile=netboot.ipxe";
6566 } // extraConfig);
6667 in
6768 makeTest {
@@ -100,6 +101,6 @@ in {
100101 uefiNetboot = makeNetbootTest "uefi" {
101102 bios = ''"${pkgs.OVMF.fd}/FV/OVMF.fd"'';
102103 # Custom ROM is needed for EFI PXE boot. I failed to understand exactly why, because QEMU should still use iPXE for EFI.
103− netRomFile = ''"${pkgs.ipxe}/ipxe.efirom"'';
104+ netFrontendArgs = ''romfile="${pkgs.ipxe}/ipxe.efirom"'';
104105 };
105106}