summary refs log tree commit diff
path: root/nixos/tests/installer.nix
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2014-05-01 06:21:30 -0500
committerWilliam A. Kennington III <william@wkennington.com>2014-08-28 13:35:35 -0700
commit809caa87ab88fae9164347c3f1a63f6117c09821 (patch)
tree431a66e0879cccb3167ffd92686324de76e67dc1 /nixos/tests/installer.nix
parent8329d12b799b98a2b220e34ed347417c2d5b8fbe (diff)
downloadnixpkgs-809caa87ab88fae9164347c3f1a63f6117c09821.tar
nixpkgs-809caa87ab88fae9164347c3f1a63f6117c09821.tar.gz
nixpkgs-809caa87ab88fae9164347c3f1a63f6117c09821.tar.bz2
nixpkgs-809caa87ab88fae9164347c3f1a63f6117c09821.tar.lz
nixpkgs-809caa87ab88fae9164347c3f1a63f6117c09821.tar.xz
nixpkgs-809caa87ab88fae9164347c3f1a63f6117c09821.tar.zst
nixpkgs-809caa87ab88fae9164347c3f1a63f6117c09821.zip
tests/installer: Add btrfs tests for grub and nixos-generate-config
Diffstat (limited to 'nixos/tests/installer.nix')
-rw-r--r--nixos/tests/installer.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix
index 621afffbfc1..89abafcab83 100644
--- a/nixos/tests/installer.nix
+++ b/nixos/tests/installer.nix
@@ -394,4 +394,49 @@ in {
           $machine->shutdown;
         '';
     };
+
+  # Simple btrfs grub testing
+  btrfsSimple = makeInstallerTest {
+    createPartitions = ''
+      $machine->succeed(
+        "sgdisk -Z /dev/vda",
+        "sgdisk -n 1:0:+1M -N 2 -t 1:ef02 -t 2:8300 -c 2:root /dev/vda",
+        "mkfs.btrfs -L root /dev/vda2",
+        "mount LABEL=root /mnt",
+      );
+    '';
+  };
+
+  # Test to see if we can detect /boot and /nix on subvolumes
+  btrfsSubvols = makeInstallerTest {
+    createPartitions = ''
+      $machine->succeed(
+        "sgdisk -Z /dev/vda",
+        "sgdisk -n 1:0:+1M -N 2 -t 1:ef02 -t 2:8300 -c 2:root /dev/vda",
+        "mkfs.btrfs -L root /dev/vda2",
+        "btrfs device scan",
+        "mount LABEL=root /mnt",
+        "btrfs subvol create /mnt/boot",
+        "btrfs subvol create /mnt/nixos",
+        "umount /mnt",
+        "mount -o defaults,subvol=mnt LABEL=root /mnt",
+        "mkdir /mnt/boot",
+        "mount -o defaults,subvol=boot LABEL=root /mnt/boot",
+      );
+    '';
+  };
+
+  # Test to see if we can detect subvols by their id's
+  btrfsSubvolId = makeInstallerTest {
+    createPartitions = ''
+      $machine->succeed("false");
+    '';
+  };
+
+  # Test to see if we can detect a default subvolume on /
+  btrfsDefaultSubvol = makeInstallerTest {
+    createPartitions = ''
+      $machine->succeed("false");
+    '';
+  };
 }