Commit Graph

8809 Commits

Author SHA1 Message Date
Richard W.M. Jones
085815ce10 build: Describe how to set up check-valgrind rules correctly.
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.
2016-02-22 17:55:13 +00:00
Pino Toscano
789d256645 python: tests: fix long/int mismatch in test090RetValues.py
Cast the value to the "int_type" representing the "long" value for
test_rint64, so the test works again with Python 3.
2016-02-22 17:13:38 +01:00
Pino Toscano
519c9bc8df python: tests: move the 'int' type in tests_helper
This way it can be used in other tests as well.

Simple code motion.
2016-02-22 16:57:57 +01:00
Pino Toscano
9776615301 python: tests: refactor to use unittest's discovery
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.
2016-02-22 16:57:15 +01:00
Richard W.M. Jones
961721b64b FAQ: Link to posting about compiling libguestfs from source. 2016-02-22 10:19:42 +00:00
Richard W.M. Jones
34e7b69612 FAQ: cache=none, not cache=unsafe, prevents qemu from caching.
Thanks: kaze on IRC.
2016-02-22 09:54:10 +00:00
Richard W.M. Jones
3fa03a30b3 build: installcheck: Ensure libguestfs.so is copied.
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.
2016-02-19 12:49:18 +00:00
Richard W.M. Jones
2e87face9e v2v: windows: Change wording of warning about basic VGA display driver (RHBZ#1309619). 2016-02-19 09:00:10 +00:00
Pino Toscano
9854ea913a gobject: ship also run-tests-retvalues
Fixes commit f7765ea6e4 and
commit 3787ebace4.
2016-02-19 09:47:37 +01:00
Richard W.M. Jones
cbf0714e07 v2v: RHEV: Treat Windows 8.1 x86 client as Windows 8 (RHBZ#1213324). 2016-02-18 14:43:33 +00:00
Richard W.M. Jones
7bf820b0d9 v2v: RHEV: Treat Windows 8.1 client as Windows 8 (RHBZ#1309580). 2016-02-18 14:41:43 +00:00
Richard W.M. Jones
5431eda3a6 v2v: Make the error message actionable when cannot find libvirt pool.
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.
2016-02-18 14:14:19 +00:00
Richard W.M. Jones
ba839f553b v2v: OVF: In warning, display inspect.i_arch field.
See: https://bugzilla.redhat.com/show_bug.cgi?id=1213324#c11
2016-02-18 10:06:27 +00:00
Richard W.M. Jones
d87c6fd6f2 v2v: Add Windows 10 to OVF.
See https://github.com/oVirt/ovirt-engine/blob/master/packaging/conf/osinfo-defaults.properties
2016-02-18 10:00:45 +00:00
Richard W.M. Jones
6200ae7204 v2v: glance: Allow Glance backend to import multiple disks (RHBZ#1308769). 2016-02-17 18:04:32 +00:00
Richard W.M. Jones
bae3d92e88 v2v: glance: Add "OUTPUT TO GLANCE" section to the documentation. 2016-02-17 18:02:54 +00:00
Pino Toscano
3787ebace4 gobject: ship correct .js file
Fixes commit f7765ea6e4.
2016-02-17 10:26:35 +01:00
Pino Toscano
967e887e43 v2v: update URL with glance metadata 2016-02-16 14:42:44 +01:00
Pino Toscano
f7765ea6e4 Start adding return values tests for bindings
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.
2016-02-15 18:32:07 +01:00
Richard W.M. Jones
938f48f08a v2v: Fix CompatibleIDs for Windows > 7 conversions.
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.
2016-02-15 10:40:11 +00:00
Pino Toscano
2a2a540436 python: tests: use more targeted assert*() functions/checks
- 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)
2016-02-12 17:57:58 +01:00
Richard W.M. Jones
6629cb0d91 Version 1.33.12. 1.33.12 2016-02-12 15:57:51 +00:00
Richard W.M. Jones
85b1815e7b tests: Make '080' be an official test of the guestfs_version API.
Useful because it tests returning a single structure.
2016-02-12 15:41:42 +00:00
Richard W.M. Jones
b647dd8b52 python: tests: Use the 'unittest' module to run the test suite. 2016-02-12 15:32:39 +00:00
Richard W.M. Jones
2e16e3e993 daemon: lvm: Ignore LVs with the activationskip flag set (RHBZ#1306666).
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.
2016-02-12 14:21:08 +00:00
Pino Toscano
7a598a0c02 php: restructure and expand tests
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
2016-02-12 15:10:07 +01:00
Pino Toscano
9753986819 fish, sysprep: run FUSE-related tests only when FUSE is available
They will fail anyway in that case, so run them only when the FUSE
support is built in.
2016-02-11 18:40:04 +01:00
Richard W.M. Jones
18fa191250 v2v: Small documentation fix in permissions section.
In vCenter 5.5 at least, it's 'Sessions', not 'Session'.
2016-02-10 14:44:35 +00:00
Richard W.M. Jones
eae73a5aa9 Revert "v2v: Document that vCenter etc permissions must be set to "OK"."
On further examining the incredibly confusing VMware dialogs, I don't
believe this is true after all.

This reverts commit e76128a20b.
2016-02-10 14:43:09 +00:00
Richard W.M. Jones
e76128a20b v2v: Document that vCenter etc permissions must be set to "OK".
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
2016-02-10 13:21:47 +00:00
Pino Toscano
2f461b7cb8 Update zanata.xml
Update the Zanata configuration based on what Zanata itself proposes as
project configuration.
2016-02-10 14:15:05 +01:00
Richard W.M. Jones
f9686217b5 docs: Add recipe for FUSE-mounting a Windows guest with drive letters.
Thanks: Pino Toscano, Hilko Bengen.
2016-02-10 11:06:07 +00:00
Richard W.M. Jones
3a9643834c docs: Alphabetize headings in guestfs-recipes(1).
No change, just reorder a section so they are in alphabetical order.
2016-02-10 10:43:09 +00:00
Roman Kagan
92ea4ed5f7 v2v: move virtio_win to windows_virtio
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>
2016-02-09 16:36:10 +00:00
Richard W.M. Jones
511280c076 Version 1.33.11. 1.33.11 2016-02-09 13:27:55 +00:00
Pino Toscano
41afeb266d tmpdirs: fix typo in variable name
On mkdtemp error, free tmppath and not tmpdir (which is CLEANUP_FREE).

Fixes commit 673a7a959c.
2016-02-09 14:18:15 +01:00
Pino Toscano
15d28b09c0 tmpdirs: centralize permissions handling
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.
2016-02-09 14:15:06 +01:00
Pino Toscano
772f649e59 lib: fix sockdir for root
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.
2016-02-09 11:36:23 +01:00
Richard W.M. Jones
d5c0f85c6e Version 1.33.10. 1.33.10 2016-02-08 17:52:29 +00:00
Pino Toscano
fcf1884932 tests: reduce sizes of scratch disks to 2 GB
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.
2016-02-08 17:22:48 +00:00
Richard W.M. Jones
7453952d24 launch: Set sockdir mode to 0755.
https://bugzilla.redhat.com/show_bug.cgi?id=610880

Fixes commit 55202a4d49.
2016-02-08 17:20:30 +00:00
Richard W.M. Jones
7fd17fa99d launch: libvirt: Debug sockdir not tmpdir.
Fixes commit 55202a4d49.
2016-02-08 17:09:48 +00:00
Dawid Zamirski
7cb28488a6 inspect: get windows drive letters for GPT disks.
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.
2016-02-06 17:09:18 +00:00
Richard W.M. Jones
985a693251 Version 1.33.9. 1.33.9 2016-02-05 19:11:47 +00:00
Richard W.M. Jones
8cba70c038 lib: Stop exporting the safe_malloc, etc. functions.
As was forewarned in the comment, stop exporting these functions
outside the library.
2016-02-05 14:17:48 +00:00
Richard W.M. Jones
32cd056ff8 ruby: Stop using the safe_malloc, etc. functions. 2016-02-05 14:17:48 +00:00
Richard W.M. Jones
4b96331ad5 perl: Stop using the safe_malloc, etc. functions. 2016-02-05 14:17:48 +00:00
Richard W.M. Jones
2a48a6591f java: Stop using the safe_malloc, etc. functions. 2016-02-05 13:16:22 +00:00
Richard W.M. Jones
ae750fcfe0 python: Stop using the safe_malloc, etc. functions. 2016-02-05 13:15:59 +00:00
Richard W.M. Jones
0445284dfb ocaml: Stop using the safe_malloc, etc. functions. 2016-02-05 13:15:48 +00:00