summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-08-07 08:32:56 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-08-07 08:32:56 +0100
commit39e4f1dad208124640f0f795518390ba680a9704 (patch)
treecb22996b2b4a4950782436ef46493e1a14552e02 /src
parent530a90d3d4d7d107f52ac8db90fdb86c4f3e1737 (diff)
downloadlibguestfs-39e4f1dad208124640f0f795518390ba680a9704.tar.gz
libguestfs-39e4f1dad208124640f0f795518390ba680a9704.tar.xz
libguestfs-39e4f1dad208124640f0f795518390ba680a9704.zip
Tests: swapon_device test mkswap /dev/sda1 instead of /dev/sdb.
On RHEL 5, mkswap /dev/sdb fails, even with the '-f' option (contradictory to what the manual page says). This commit adds a new 'InitPartition' initialization which just creates /dev/sda1, and then does the swap test on that.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/generator.ml21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/generator.ml b/src/generator.ml
index 8b0fc664..fdf8f095 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -301,6 +301,12 @@ and test_init =
(* Block devices are empty and no filesystems are mounted. *)
| InitEmpty
+ (* /dev/sda contains a single partition /dev/sda1, with random
+ * content. /dev/sdb and /dev/sdc may have random content.
+ * No LVM.
+ *)
+ | InitPartition
+
(* /dev/sda contains a single partition /dev/sda1, which is formatted
* as ext2, empty [except for lost+found] and mounted on /.
* /dev/sdb and /dev/sdc may have random content.
@@ -3207,10 +3213,10 @@ C<alloc> command which allocates a file in the host and
attaches it as a device.");
("swapon_device", (RErr, [String "device"]), 170, [],
- [InitNone, Always, TestRun (
- [["mkswap"; "/dev/sdb"];
- ["swapon_device"; "/dev/sdb"];
- ["swapoff_device"; "/dev/sdb"]])],
+ [InitPartition, Always, TestRun (
+ [["mkswap"; "/dev/sda1"];
+ ["swapon_device"; "/dev/sda1"];
+ ["swapoff_device"; "/dev/sda1"]])],
"enable swap on device",
"\
This command enables the libguestfs appliance to use the
@@ -5318,6 +5324,13 @@ and generate_one_test_body name i test_name init test =
[["blockdev_setrw"; "/dev/sda"];
["umount_all"];
["lvm_remove_all"]]
+ | InitPartition ->
+ pr " /* InitPartition for %s: create /dev/sda1 */\n" test_name;
+ List.iter (generate_test_command_call test_name)
+ [["blockdev_setrw"; "/dev/sda"];
+ ["umount_all"];
+ ["lvm_remove_all"];
+ ["sfdiskM"; "/dev/sda"; ","]]
| InitBasicFS ->
pr " /* InitBasicFS for %s: create ext2 on /dev/sda1 */\n" test_name;
List.iter (generate_test_command_call test_name)