tests/partition: Explicitly check mountpoints.

Don't rely solely on canaries, because mountpoints might not have been created
in the first place.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2013-07-01 17:58:05 +02:00
parent b414e43d5a
commit 8025bae9b1
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961

View File

@ -133,6 +133,10 @@ in {
$machine->succeed("test ! -e /dev/$_[0]"); $machine->succeed("test ! -e /dev/$_[0]");
} }
sub ensureMountPoint {
$machine->succeed("mountpoint $_[0]");
}
sub remount_and_check { sub remount_and_check {
$machine->nest("Remounting partitions:", sub { $machine->nest("Remounting partitions:", sub {
# XXX: "findmnt -ARunl -oTARGET /mnt" seems to NOT print all mounts! # XXX: "findmnt -ARunl -oTARGET /mnt" seems to NOT print all mounts!
@ -152,6 +156,7 @@ in {
} }
# Try to remount with nixpart # Try to remount with nixpart
$machine->succeed("nixpart -vm /kickstart"); $machine->succeed("nixpart -vm /kickstart");
ensureMountPoint("/mnt");
# Check if our beloved canaries are dead # Check if our beloved canaries are dead
chomp $canaries; chomp $canaries;
$machine->nest("Checking canaries:", sub { $machine->nest("Checking canaries:", sub {
@ -172,6 +177,8 @@ in {
ensureNoPartition("vdb6"); ensureNoPartition("vdb6");
ensureNoPartition("vdc1"); ensureNoPartition("vdc1");
remount_and_check; remount_and_check;
ensureMountPoint("/mnt/boot");
ensureMountPoint("/mnt/nix");
}; };
parttest "btrfs filesystem", sub { parttest "btrfs filesystem", sub {
@ -195,6 +202,7 @@ in {
ensureNoPartition("vdc4"); ensureNoPartition("vdc4");
ensureNoPartition("md2"); ensureNoPartition("md2");
remount_and_check; remount_and_check;
ensureMountPoint("/mnt/boot");
}; };
parttest "RAID1 with LUKS and LVM", sub { parttest "RAID1 with LUKS and LVM", sub {
@ -211,6 +219,7 @@ in {
ensurePartition("/dev/nixos/swap", "swap"); ensurePartition("/dev/nixos/swap", "swap");
ensurePartition("/dev/nixos/root", "ext4"); ensurePartition("/dev/nixos/root", "ext4");
remount_and_check; remount_and_check;
ensureMountPoint("/mnt/boot");
}; };
''; '';
} }