diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2010-11-30 11:48:35 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2010-11-30 11:48:35 +0000 |
commit | f93cdf1ed3323b8d9451a7f4f6365ac30ab8ba81 (patch) | |
tree | 445271ceb0c1bf1fbc33833830d1a75ea2bb7bf6 /HACKING | |
parent | 17233ce2113aa730752ae3420cc209b2a72ab616 (diff) | |
download | libguestfs-f93cdf1ed3323b8d9451a7f4f6365ac30ab8ba81.tar.gz libguestfs-f93cdf1ed3323b8d9451a7f4f6365ac30ab8ba81.tar.xz libguestfs-f93cdf1ed3323b8d9451a7f4f6365ac30ab8ba81.zip |
capitests: Add 'InitScratchFS' test environment.
This should allow us to perform filesystem-based write
tests much more quickly, because we don't need to recreate
the filesystem from scratch each time.
Diffstat (limited to 'HACKING')
-rw-r--r-- | HACKING | 55 |
1 files changed, 31 insertions, 24 deletions
@@ -168,35 +168,42 @@ Tests 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 500MB, -50MB and 10MB (respectively /dev/sda, /dev/sdb, /dev/sdc), and -a fourth ISO block device with some known files on it (/dev/sdd). +The test environment has 4 block devices: + /dev/sda 500MB General block device for testing. + /dev/sdb 50MB /dev/sdb1 is an ext2 filesystem used for testing + filesystem write operations. + /dev/sdc 10MB Used in a few tests where 2 block devices are needed. + /dev/sdd - ISO with fixed content (see images/test.iso). + +To be able 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 Between each test we blockdev-setrw, +umount-all, lvm-remove-all. + +Each test starts with an initial scenario, selected using one of the +'Init*' expressions, described in generator/generator_types.ml. These +initialize the disks in a particular way as described. You should not +assume anything about the previous contents of other disks that are +not initialized. + +You can add a prerequisite clause to any individual test. This is a +run-time check, which, if it fails, causes the test to be skipped. +Useful if testing a command which might not work on all variations of +libguestfs builds. A test that has prerequisite of 'Always' is run +unconditionally. -Note for partitioning purposes, the 500MB device has 1015 cylinders. -Number of cylinders was 63 for IDE emulated disks with precisely -the same size. How exactly this is calculated is a mystery. - -The ISO block device (/dev/sdd) comes from images/test.iso. - -To be able 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 +In addition, packagers can skip individual tests by setting the +environment variables: eg: -Between each test we blockdev-setrw, umount-all, lvm-remove-all. + SKIP_TEST_<CMD>_<NUM>=1 SKIP_TEST_COMMAND_3=1 (skips test #3 of command) + SKIP_TEST_<CMD>=1 SKIP_TEST_ZEROFREE=1 (skips all zerofree tests) -Don't assume anything about the previous contents of the block -devices. Use 'Init*' to create some initial scenarios. +and packagers can run only certain tests by setting eg: -You can add a prerequisite clause to any individual test. This -is a run-time check, which, if it fails, causes the test to be -skipped. Useful if testing a command which might not work on -all variations of libguestfs builds. A test that has prerequisite -of 'Always' is run unconditionally. + TEST_ONLY="vfs_type zerofree" -In addition, packagers can skip individual tests by setting the -environment variables: eg: - SKIP_TEST_<CMD>_<NUM>=1 SKIP_TEST_COMMAND_3=1 (skips test #3 of command) - SKIP_TEST_<CMD>=1 SKIP_TEST_ZEROFREE=1 (skips all zerofree tests) +See capitests/tests.c for more details of how these environment +variables work. Debugging ---------------------------------------------------------------------- |