about summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorFrederik Rietdijk2018-12-19 09:00:36 +0100
committerFrederik Rietdijk2018-12-19 09:00:36 +0100
commit9ab61ab8e2c5b7a40f2f0f8a044e6c8d15d10158 (patch)
treeec26979beba499c597f55768464697f20729a96e /nixos/lib
parentdb0211c6bc16827a7bcc23f807c6b3703b1452a5 (diff)
parent911d1853ca990a7af6725105e7cda8c24cac025f (diff)
Merge staging-next into staging
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/make-iso9660-image.sh5
-rw-r--r--nixos/lib/testing.nix20
2 files changed, 20 insertions, 5 deletions
diff --git a/nixos/lib/make-iso9660-image.sh b/nixos/lib/make-iso9660-image.sh
index 45cdef1ef4df..b7b1ab52a637 100644
--- a/nixos/lib/make-iso9660-image.sh
+++ b/nixos/lib/make-iso9660-image.sh
@@ -47,7 +47,8 @@ if test -n "$bootable"; then
 
     isoBootFlags="-eltorito-boot ${bootImage}
                   -eltorito-catalog .boot.cat
-                  -no-emul-boot -boot-load-size 4 -boot-info-table"
+                  -no-emul-boot -boot-load-size 4 -boot-info-table
+                  --sort-weight 1 /isolinux" # Make sure isolinux is near the beginning of the ISO
 fi
 
 if test -n "$usbBootable"; then
@@ -112,7 +113,7 @@ xorriso="xorriso
  -r
  -path-list pathlist
  --sort-weight 0 /
- --sort-weight 1 /isolinux" # Make sure isolinux is near the beginning of the ISO
+"
 
 $xorriso -output $out/iso/$isoName
 
diff --git a/nixos/lib/testing.nix b/nixos/lib/testing.nix
index 05b06ca467e4..ff07cc17f87b 100644
--- a/nixos/lib/testing.nix
+++ b/nixos/lib/testing.nix
@@ -156,9 +156,23 @@ in rec {
       test = passMeta (runTests driver);
       report = passMeta (releaseTools.gcovReport { coverageRuns = [ test ]; });
 
-    in (if makeCoverageReport then report else test) // {
-      inherit nodes driver test;
-    };
+      nodeNames = builtins.attrNames nodes;
+      invalidNodeNames = lib.filter
+        (node: builtins.match "^[A-z_][A-z0-9_]+$" node == null) nodeNames;
+
+    in
+      if lib.length invalidNodeNames > 0 then
+        throw ''
+          Cannot create machines out of (${lib.concatStringsSep ", " invalidNodeNames})!
+          All machines are referenced as perl variables in the testing framework which will break the
+          script when special characters are used.
+
+          Please stick to alphanumeric chars and underscores as separation.
+        ''
+      else
+        (if makeCoverageReport then report else test) // {
+          inherit nodes driver test;
+        };
 
   runInMachine =
     { drv