diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2010-05-16 20:44:45 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2010-05-16 20:44:45 +0000 |
commit | ec33622b48d33497caf9bc81e5df7f16bc94c29a (patch) | |
tree | fcbcf382f3331b9c34a9831fe09263b6637ddb61 /tests/installer.nix | |
parent | 74847741724385febb3481cdf43fc9e25cf75d8e (diff) | |
download | nixpkgs-ec33622b48d33497caf9bc81e5df7f16bc94c29a.tar nixpkgs-ec33622b48d33497caf9bc81e5df7f16bc94c29a.tar.gz nixpkgs-ec33622b48d33497caf9bc81e5df7f16bc94c29a.tar.bz2 nixpkgs-ec33622b48d33497caf9bc81e5df7f16bc94c29a.tar.lz nixpkgs-ec33622b48d33497caf9bc81e5df7f16bc94c29a.tar.xz nixpkgs-ec33622b48d33497caf9bc81e5df7f16bc94c29a.tar.zst nixpkgs-ec33622b48d33497caf9bc81e5df7f16bc94c29a.zip |
* A test for installing NixOS on software RAID. Doesn't quite work
yet though - GRUB fails mysteriously on the second reboot. svn path=/nixos/trunk/; revision=21808
Diffstat (limited to 'tests/installer.nix')
-rw-r--r-- | tests/installer.nix | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/installer.nix b/tests/installer.nix index 10ac14332b0..26423cd9d06 100644 --- a/tests/installer.nix +++ b/tests/installer.nix @@ -173,7 +173,7 @@ let # Did /boot get mounted, if appropriate? # !!! There is currently no good way to wait for the - # `filesystems' tash to finish. + # `filesystems' task to finish. $machine->waitForFile("/boot/grub/grub.cfg"); # Did the swap device get activated? @@ -209,6 +209,9 @@ let in { + # !!! `parted mkpart' seems to silently create overlapping partitions. + + # The (almost) simplest partitioning scheme: a swap partition and # one big filesystem partition. simple = makeTest @@ -282,5 +285,27 @@ in { ''; fileSystems = rootFS; }; - + + swraid = makeTest + { createPartitions = + '' + $machine->mustSucceed( + "parted /dev/vda mklabel msdos", + "parted /dev/vda -- mkpart primary 1M 1000M", # md0 (root), first device + "parted /dev/vda -- mkpart primary 1024M 2024M", # md0 (root), second device + "parted /dev/vda -- mkpart primary 2048M 2548M", # md1 (swap), first device + "parted /dev/vda -- mkpart primary 2560M 3060M", # md1 (swap), second device + "udevadm settle", + # Note that GRUB2 doesn't work with version 1.2 metadata. + "mdadm --create --force /dev/md0 --metadata 0.90 --level=raid1 --raid-devices=2 /dev/vda1 /dev/vda2", + "mdadm --create --force /dev/md1 --metadata 1.2 --level=raid1 --raid-devices=2 /dev/vda3 /dev/vda4", + "mkswap -f /dev/md1 -L swap", + "swapon -L swap", + "mkfs.ext3 -L nixos /dev/md0", + "mount LABEL=nixos /mnt", + ); + ''; + fileSystems = rootFS; + }; + } |