Fix swapon_label test
authorMatthew Booth <mbooth@redhat.com>
Mon, 3 Aug 2009 19:29:24 +0000 (20:29 +0100)
committerMatthew Booth <mbooth@redhat.com>
Wed, 5 Aug 2009 16:08:03 +0000 (17:08 +0100)
The swapon label test has a side-effect, in that it creates a new partition.
This causes the later failure of the list_partitions test.

This change causes the swapon_label test to zero /dev/sdb after the test, and
then re-read the partition table.

src/generator.ml

index c9b3315..94dc268 100755 (executable)
@@ -3254,7 +3254,9 @@ This command disables the libguestfs appliance swap on file.");
       [["sfdiskM"; "/dev/sdb"; ","];
        ["mkswap_L"; "swapit"; "/dev/sdb1"];
        ["swapon_label"; "swapit"];
       [["sfdiskM"; "/dev/sdb"; ","];
        ["mkswap_L"; "swapit"; "/dev/sdb1"];
        ["swapon_label"; "swapit"];
-       ["swapoff_label"; "swapit"]])],
+       ["swapoff_label"; "swapit"];
+       ["zero"; "/dev/sdb"];
+       ["blockdev_rereadpt"; "/dev/sdb"]])],
    "enable swap on labelled swap partition",
    "\
 This command enables swap to a labelled swap partition.
    "enable swap on labelled swap partition",
    "\
 This command enables swap to a labelled swap partition.