From 2518521108cb41ea3acc84feb8e8bf188a62f3c4 Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 30 Jun 2013 20:56:21 +0200 Subject: [PATCH] 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 --- tests/partition.nix | 21 ++++++++++++++------- 1 file 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");