+(* You can supply zero or as many tests as you want per API call.
+ *
+ * Note that the test environment has 3 block devices, of size 10M, 20M
+ * and 30M (respectively /dev/sda, /dev/sdb, /dev/sdc). To run the
+ * tests in a reasonable amount of time, the virtual machine and
+ * block devices are reused between tests. So don't try testing
+ * kill_subprocess :-x
+ *
+ * Don't assume anything about the previous contents of the block
+ * devices. Use 'Init*' to create some initial scenarios.
+ *)
+type tests = test list
+and test =
+ (* Run the command sequence and just expect nothing to fail. *)
+ | TestRun of test_init * seq
+ (* Run the command sequence and expect the output of the final
+ * command to be the string.
+ *)
+ | TestOutput of test_init * seq * string
+ (* Run the command sequence and expect the output of the final
+ * command to be the list of strings.
+ *)
+ | TestOutputList of test_init * seq * string list
+ (* Run the command sequence and expect the output of the final
+ * command to be the integer.
+ *)
+ | TestOutputInt of test_init * seq * int
+ (* Run the command sequence and expect the output of the final
+ * command to be a true value (!= 0 or != NULL).
+ *)
+ | TestOutputTrue of test_init * seq
+ (* Run the command sequence and expect the output of the final
+ * command to be a false value (== 0 or == NULL, but not an error).
+ *)
+ | TestOutputFalse of test_init * seq
+ (* Run the command sequence and expect the output of the final
+ * command to be a list of the given length (but don't care about
+ * content).
+ *)
+ | TestOutputLength of test_init * seq * int
+ (* Run the command sequence and expect the final command (only)
+ * to fail.
+ *)
+ | TestLastFail of test_init * seq
+
+(* Some initial scenarios for testing. *)
+and test_init =
+ (* Do nothing, block devices could contain random stuff. *)
+ | InitNone
+ (* /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.
+ * No LVM.
+ *)
+ | InitEmpty
+ (* /dev/sda:
+ * /dev/sda1 (is a PV):
+ * /dev/VG/LV:
+ * formatted as ext2, empty [except for lost+found], mounted on /
+ * /dev/sdb and /dev/sdc may have random content.
+ *)
+ | InitEmptyLVM
+
+(* Sequence of commands for testing. *)
+and seq = cmd list
+and cmd = string list
+