From 5f4288d49df7b0846e6f10a12997b6234df235b4 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Mon, 22 Jul 2019 13:21:33 +0300 Subject: [PATCH] boot tests: don't use globbing Turns out I broke all the boot tests except netboot. Instead of relying on build-time search for .iso we can use a proper attribute. --- nixos/tests/boot.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/nixos/tests/boot.nix b/nixos/tests/boot.nix index 7d1b393da1e4..57d8006d7ac3 100644 --- a/nixos/tests/boot.nix +++ b/nixos/tests/boot.nix @@ -17,7 +17,7 @@ let ]; }).config.system.build.isoImage; - perlAttrs = params: "{ ${concatStringsSep "," (mapAttrsToList (name: param: "${name} => '${toString param}'") params)} }"; + perlAttrs = params: "{ ${concatStringsSep ", " (mapAttrsToList (name: param: "${name} => ${builtins.toJSON param}") params)} }"; makeBootTest = name: extraConfig: let @@ -79,28 +79,28 @@ let in { biosCdrom = makeBootTest "bios-cdrom" { - cdrom = ''glob("${iso}/iso/*.iso")''; + cdrom = "${iso}/iso/${iso.isoName}"; }; biosUsb = makeBootTest "bios-usb" { - usb = ''glob("${iso}/iso/*.iso")''; + usb = "${iso}/iso/${iso.isoName}"; }; uefiCdrom = makeBootTest "uefi-cdrom" { - cdrom = ''glob("${iso}/iso/*.iso"''; - bios = ''"${pkgs.OVMF.fd}/FV/OVMF.fd"''; + cdrom = "${iso}/iso/${iso.isoName}"; + bios = "${pkgs.OVMF.fd}/FV/OVMF.fd"; }; uefiUsb = makeBootTest "uefi-usb" { - usb = ''glob("${iso}/iso/*.iso")''; - bios = ''"${pkgs.OVMF.fd}/FV/OVMF.fd"''; + usb = "${iso}/iso/${iso.isoName}"; + bios = "${pkgs.OVMF.fd}/FV/OVMF.fd"; }; biosNetboot = makeNetbootTest "bios" {}; uefiNetboot = makeNetbootTest "uefi" { - bios = ''"${pkgs.OVMF.fd}/FV/OVMF.fd"''; + bios = "${pkgs.OVMF.fd}/FV/OVMF.fd"; # Custom ROM is needed for EFI PXE boot. I failed to understand exactly why, because QEMU should still use iPXE for EFI. - netFrontendArgs = ''romfile="${pkgs.ipxe}/ipxe.efirom"''; + netFrontendArgs = "romfile=${pkgs.ipxe}/ipxe.efirom"; }; }