[Libguestfs] Help: how to change default disk size when doing test

Richard W.M. Jones rjones at redhat.com
Tue May 26 10:43:20 UTC 2015


On Tue, May 26, 2015 at 05:13:55PM +0800, Pino wrote:
> Hi Rich,
> 
>     I am developing a patch for btrfs enhancement: btrfs-convert.
> When I do test, run: make check tests, in dir
> libguestfs/tests/c-api, I got these error:
> 
>           0/516 test_btrfs_convert_0
>     libguestfs: error: btrfs_convert: /dev/sda1: block size is too small
>     conversion aborted.
>     FAIL: test_btrfs_convert_0
> 
>     I also ran "btrfs-convert" command to deal with a 100MB img file
> outside the guestfish, I got the same err msg, so it is a
> litmitation of btrfs-convert
> 
>     So my question is:
>         How to changed the default disk size, when do: make check tests

The tests/c-api/ tests use certain fixed size disks, to make those
tests run quickly (if we had to create new disks for every test,
they'd run very slowly indeed).

The fixed disk sizes are described here:

  http://libguestfs.org/guestfs.3.html#adding-tests-for-an-api-action

If you want to write a more complicated test that requires a larger
disk, then you should put it into tests/btrfs/ instead.

In generator/actions.ml, leave the `tests' field out, and add a
`tests_excuse' line explaining that the tests are located in
tests/btrfs/.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the Libguestfs mailing list