It seems the default behaviour of rake is to run tests sequentially, and
not in parallel (there are separate gems to achieve that behaviour).
Hence just invoke "rake test" to run all the available tests at once.
This reverts commit 8f30c3c3f8.
Since we enabled parallel tests, you can no longer run tests
under valgrind merely by doing:
TESTS_ENVIRONMENT = $(top_builddir)/run --test $(VG)
check-valgrind:
$(MAKE) check VG="@VG@"
The reason is that the parallel tests framework doesn't run
``$(TESTS_ENVIRONMENT) <test>''. It inserts some other processes in
between the environment and the test, so you end up valgrinding some
unrelated process (currently the 'env' program).
In run.in, remove out of date documentation for using $(VG).
In guestfs-hacking(1), document how to do it properly.
Instead of running all the tests manually, the unittest module has a
'discovery' mode to run tests by importing them from a directory: this
requires the tests to have different filenames, since they need to be
imported as modules now (hence an empty __init__.py is added), and the
current naming does not match the convention.
Using unittest as loader/runner brings another change: tests skipped as
whole cannot be done anymore with exit(77), since they are not run but
imported: thus introduce an helper module with decorators applied to the
test classes to skip them according to the current checks. This also
gets us nicer recordings in the unittest log.
Due to the relative imports (needed for the helper code), it is no more
possible to execute tests anymore by invoking them manually; although
it is possible to run single tests, still using unittest's runner:
$ cd python
python$ ../run python -m unittest discover -v t test010Load.py
This does not change anything in what the tests do/check.
If you ran 'make installcheck' when libguestfs-devel was not
installed, then the installcheck would fail in many places with:
gcc: error: ../../src/.libs/libguestfs.so: No such file or directory
We should stop the installcheck script immediately if the .so file was
not found.
Also this commit ensures that src/.libs/libguestfs.so* not existing
before installcheck is not fatal.
Make this error message useful and actionable by suggesting commands
that the end user can run to find available pools, etc.
I also had to extend the fixed size buffer we use for messages since
the message got truncated.
Introduce a new kind of bindings tests, 090-retvalues, to check all the
possible return values in bindings; start implementing them for
scripting languages such as GObject introspection, Perl, PHP, Python,
and Ruby, reusing existing implementations where existing.
Thanks Joshua Pincus for finding the bug.
I checked back with the original W2K8R2 guest which I had used for
getting these registry entries, and there was a transcription error
with two of the CompatibleIDs.
- use assertIsInstance, assertNotEqual, and assertIsNotNone as more
specific checks (will produce better logging)
- use assertRaises when expecting exceptions being thrown
- when testing internal_test_rhashtable, instead of checking type and
elements of the return values just check the return value as a whole
(easier and already getting all the work needed by unittest)
When listing logical volumes, ignore the ones which don't get
activated automatically. No /dev/VG/LV device node is created for
these ones which confuses APIs that attempt to do 'guestfs_lvs'
followed by opening the device node. Note that 'guestfs_lvs_full' is
unaffected by this change.
Rename the existing tests according to the naming/numbering described in
guestfs-hacking(1), and improve the current ones:
- guestfs_php_001.phpt: rename to guestfs_020_create.phpt
- guestfs_php_003.phpt: rename to guestfs_070_optargs.phpt
- guestfs_php_bindtests.phpt: rename to guestfs_090_bindtests.phpt
- guestfs_090_version.phpt: new, checks taken from the former
guestfs_php_002.phpt
- guestfs_100_launch.phpt: new, modelled after the equivalent in e.g.
OCaml/Perl/Python
- guestfs_php_002.phpt: remove, as what it did is now covered by
090_version and 100_launch
And that READ_ONLY access is insufficient. I believe this is a bug in
libvirt, but it requires further investigation. If it is resolved in
libvirt then we can update this documentation again.
Thanks: Ulhas Surse
Now that all the stuff related to Windows virtio drivers has been moved
into a dedicated module, it makes sense to move the definition of
virtio_win there, too, and stop passing it around as a parameter.
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Move to lazy_make_tmpdir the logic for making world-readable (but only
for root) newly-created temporary directories, removing the non-fatal
code doing that in guestfs_impl_launch.
Followup of commit 772f649e59.
When running as root libvirt will launch qemu as qemu.qemu, which will
not be able to read inside the socket directory in case it is set as
XDG_RUNTIME_DIR under /run/user/0.
Since normal users don't need particular extra access permissions for
their sockdirs, restrict /tmp as only possible sockdir for root,
changing the permissions only for this user (and making this operation
fatal).
Fixes commit 55202a4d49 and
commit 7453952d24.
1 GB should be enough to create a btrfs filesystem, even with 64K page
size; hence, make the /dev/sda and /dev/sdb test devices smaller so
there is less space taken during the test run.
Followup of commit 8ffad75e5b and
commit 9e9b648770.
This patch updates the guestfs_inspect_get_drive_mappings API call to
also return drive letters for GPT paritions. Previously this worked
only for MBR partitions. This is achieved by matching the GPT partition
GUID with the info stored in the blob from
HKLM\SYSTEM\MountedDevices\DosDevices keys. For GPT partions this blob
contains a "DMIO:ID:" prefix followed by a 16 byte binary GUID.