about summary refs log tree commit diff
path: root/nixos/tests/boot.nix
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2016-05-03 23:12:48 +0300
committerTuomas Tynkkynen <tuomas@tuxera.com>2016-05-03 23:12:48 +0300
commitaadaa913792b0fdeb68b02425e4f03d2f8286a1f (patch)
treeea582b078a00e6ba27e2c887a9df5a792c37fb0e /nixos/tests/boot.nix
parent2362891dc815160e343e52458f25db22508ac487 (diff)
parente7d3166656af0d98da9f59c78e2213cec842d743 (diff)
downloadnixlib-aadaa913792b0fdeb68b02425e4f03d2f8286a1f.tar
nixlib-aadaa913792b0fdeb68b02425e4f03d2f8286a1f.tar.gz
nixlib-aadaa913792b0fdeb68b02425e4f03d2f8286a1f.tar.bz2
nixlib-aadaa913792b0fdeb68b02425e4f03d2f8286a1f.tar.lz
nixlib-aadaa913792b0fdeb68b02425e4f03d2f8286a1f.tar.xz
nixlib-aadaa913792b0fdeb68b02425e4f03d2f8286a1f.tar.zst
nixlib-aadaa913792b0fdeb68b02425e4f03d2f8286a1f.zip
Merge remote-tracking branch 'upstream/master' into staging
Conflicts:
	pkgs/applications/networking/browsers/vivaldi/default.nix
	pkgs/misc/emulators/wine/base.nix
Diffstat (limited to 'nixos/tests/boot.nix')
-rw-r--r--nixos/tests/boot.nix43
1 files changed, 41 insertions, 2 deletions
diff --git a/nixos/tests/boot.nix b/nixos/tests/boot.nix
index 905d16458825..af7db5aa8164 100644
--- a/nixos/tests/boot.nix
+++ b/nixos/tests/boot.nix
@@ -44,5 +44,44 @@ in {
         usb => glob("${iso}/iso/*.iso"),
         bios => '${pkgs.OVMF}/FV/OVMF.fd'
       '';
-  }
-
+    netboot = let
+      config = (import ../lib/eval-config.nix {
+          inherit system;
+          modules =
+            [ ../modules/installer/netboot/netboot.nix
+              ../modules/testing/test-instrumentation.nix
+              { key = "serial"; }
+            ];
+        }).config;
+      ipxeScriptDir = pkgs.writeTextFile {
+        name = "ipxeScriptDir";
+        text = ''
+          #!ipxe
+          dhcp
+          kernel bzImage init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams} console=ttyS0
+          initrd initrd
+          boot
+        '';
+        destination = "/boot.ipxe";
+      };
+      ipxeBootDir = pkgs.symlinkJoin {
+        name = "ipxeBootDir";
+        paths = [
+          config.system.build.netbootRamdisk
+          config.system.build.kernel
+          ipxeScriptDir
+        ];
+      };
+    in
+      makeTest {
+        name = "boot-netboot";
+        nodes = { };
+        testScript =
+          ''
+            my $machine = createMachine({ qemuFlags => '-boot order=n -net nic,model=e1000 -net user,tftp=${ipxeBootDir}/,bootfile=boot.ipxe -m 2000M' });
+            $machine->start;
+            $machine->waitForUnit("multi-user.target");
+            $machine->shutdown;
+          '';
+      };
+}