summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2013-06-30 20:56:21 +0200
committeraszlig <aszlig@redmoonstudios.org>2013-07-01 19:05:38 +0200
commit2518521108cb41ea3acc84feb8e8bf188a62f3c4 (patch)
tree00c603ff1713292c45acbf35dd0d7fe784347d74 /tests
parentff8a01b145eb4ee91204a54dd442ace81bce0696 (diff)
downloadnixpkgs-2518521108cb41ea3acc84feb8e8bf188a62f3c4.tar
nixpkgs-2518521108cb41ea3acc84feb8e8bf188a62f3c4.tar.gz
nixpkgs-2518521108cb41ea3acc84feb8e8bf188a62f3c4.tar.bz2
nixpkgs-2518521108cb41ea3acc84feb8e8bf188a62f3c4.tar.lz
nixpkgs-2518521108cb41ea3acc84feb8e8bf188a62f3c4.tar.xz
nixpkgs-2518521108cb41ea3acc84feb8e8bf188a62f3c4.tar.zst
nixpkgs-2518521108cb41ea3acc84feb8e8bf188a62f3c4.zip
tests/partition: Reboot machine on every subtest.
This will ensure that we don't get errors because the kernel doesn't recognize
the new partitioning scheme on some conditions or architectures, such as i686.

See here for the Hydra build log on i686:

http://hydra.nixos.org/build/5432090/download/1/log.html

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/partition.nix21
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/partition.nix b/tests/partition.nix
index dabebfe2a02..4cee14e4e5c 100644
--- a/tests/partition.nix
+++ b/tests/partition.nix
@@ -64,9 +64,16 @@ in {
   };
 
   testScript = ''
-    startAll;
-    $machine->waitForUnit("default.target");
-    my $diskStart = $machine->succeed("dd if=/dev/vda bs=512 count=1");
+    my $diskStart;
+
+    sub parttest {
+      my ($desc, $code) = @_;
+      $machine->start;
+      $machine->waitForUnit("default.target");
+      $diskStart = $machine->succeed("dd if=/dev/vda bs=512 count=1");
+      subtest($desc, $code);
+      $machine->shutdown;
+    }
 
     sub ensureSanity {
       # Check whether the filesystem in /dev/vda is still intact
@@ -100,7 +107,7 @@ in {
       $machine->succeed("test ! -e /dev/$_[0]");
     }
 
-    subtest "ext2, ext3 and ext4 filesystems", sub {
+    parttest "ext2, ext3 and ext4 filesystems", sub {
       kickstart("${ksExt}");
       ensurePartition("boot", "ext2");
       ensurePartition("swap", "swap");
@@ -111,7 +118,7 @@ in {
       ensureNoPartition("vdc1");
     };
 
-    subtest "btrfs filesystem", sub {
+    parttest "btrfs filesystem", sub {
       kickstart("${ksBtrfs}");
       ensurePartition("swap1", "swap");
       ensurePartition("swap2", "swap");
@@ -121,7 +128,7 @@ in {
       ensureNoPartition("vdc3");
     };
 
-    subtest "RAID1 with XFS", sub {
+    parttest "RAID1 with XFS", sub {
       kickstart("${ksRaid}");
       ensurePartition("swap1", "swap");
       ensurePartition("swap2", "swap");
@@ -132,7 +139,7 @@ in {
       ensureNoPartition("md2");
     };
 
-    subtest "RAID1 with LUKS and LVM", sub {
+    parttest "RAID1 with LUKS and LVM", sub {
       kickstart("${ksRaidLvmCrypt}");
       ensurePartition("/dev/vdb1", "data");
       ensureNoPartition("vdb2");