Commit Graph

87 Commits

Author SHA1 Message Date
Cole Robinson 877cbade4a tests: Move OLD_OSINFO check to central place
Other tests may need it in the future
2018-10-04 19:29:41 -04:00
Cole Robinson 2b41e130d8 connection: rename fetch_all_guests->fetch_all_domains
The virtinst class is erroneously called Guest, but these
functions are dealing with libvirt <domain> XML, so rename them
2018-08-31 16:50:46 -04:00
Cole Robinson 83a9e613e9 tests: uitests: Fix breakage
Needs adapting to latest TPM addhw work, and armv7 UEFI support
2018-08-31 16:47:10 -04:00
Cole Robinson 8e150901f4 clitest: Streamline the string format dict
Remove a bunch of dead entries, open code a bunch of limited usage,
and only use the dict for commonly referenced data
2018-06-12 14:07:50 -04:00
Cole Robinson d68305eaab tests: utils: Move all URI strings to URIs object
Non-functional change, just makes code org nicer
2018-06-12 14:07:50 -04:00
Cole Robinson e0e6ac6956 tests: Remove useless read_file helper 2018-06-12 14:07:50 -04:00
Daniel P. Berrangé 48e32b429d Fix copyright header to specify GPLv2 or later, not GPLv2 only.
The copyright headers in every file were chjanged in this previous commit

  commit b6dcee8eb7
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Tue Mar 20 15:00:02 2018 -0400

    Use consistent and minimal license header for every file

Where before this they said "

  "either version 2 of the License, or (at your option) any later version."

Now they just say

  "GNU GPLv2"

This fixes it to say "GNU GPLv2 or later" again.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-04 16:51:37 -04:00
Cole Robinson b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Cole Robinson 6954c6774a tests: Fix running testsuite on older libvirt
If we try to run the testsuite on anything older than libvirt 3.1,
it immediately throws an exception before processing any tests,
due to choking on parsing drm bits from testdriver.xml. This global
failure is only due to sloppy coding though.

Turn all test cases that use testdriver.xml into skips in this case,
so we can at least get some test coverage otherwise.
2018-02-22 16:01:24 -05:00
Cole Robinson 62fecb09d3 tests: Create a smaller testsuite.xml
Right now, most test cases will create a libvirt test driver using
tests/testdriver.xml. This is problematic for 2 reasons:

1) testdriver.xml is 3500 lines of XML, and it's parsed hundreds of
   times. Opening it is responsible for about 25% of test suite time
2) Older libvirt chokes on testdriver.xml, meaning the test suite will
   be useless there. This is a recurring problem as new features are
   added to testdriver.xml

Most test cases don't actually need all the test state in testdriver.xml
though. So this creates a smaller testsuite.xml which has a lower
libvirt requirement and is much quicker to parse. New XML bits should
continue to go into testdriver.xml so we can keep testsuite.xml as
the more stripped down option.
2018-02-22 15:44:06 -05:00
Cole Robinson c05cd52772 setup: Use CLIState for setting --debug value 2018-02-22 15:18:47 -05:00
Cole Robinson 98d880a179 tests: Differentiate conn cache based on actual open URI
Since what is actually passed to libvirt here is what actually matters,
not all our fakeuri trickery
2018-02-20 12:21:45 -05:00
Cole Robinson 4b4f532417 uitests: Wire up --coverage
Need to launch the external coverage process to actually measure
things
2018-01-09 13:51:53 -05:00
Cole Robinson 044d93d471 tests: Rework how we pass command line objects down to test data 2018-01-08 17:05:55 -05:00
Radostin Stoyanov a2bcd6c43a Do not compare between None and int
In Python 2 comparison between int and None is allowed but in
Pyhton 3 it is not.

Example:

Pyhton 2

    >>> None > 0
    False

Python 3

    >>> None > 0
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: '>' not supported between instances of 'NoneType' and 'int'
2017-10-20 13:18:31 -04:00
Cole Robinson f0e36d52e7 tests: bypass cache hacking for test:///default
To allow us to test the standard code in some cases. Would have caught
the previous issue
2017-08-30 10:36:37 -04:00
Radostin Stoyanov b93cc3bbc9 pycodestyle: Do not use bare 'except:'
A bare 'except:' catches all exceptions [1], including SystemExit,
KeyboardInterrupt, and GeneratorExit (which is not an error and should
not normally be caught by user code). In situations where you need to
catch all “normal” errors, you can catch the base class for all normal
exceptions, Exception [2].

[1] https://docs.python.org/2/howto/doanddont.html#except
[2] https://docs.python.org/2/library/exceptions.html#Exception
2017-08-02 13:57:43 -04:00
Cole Robinson 1a09a05dc7 tests: Add a clone test for importing nvram directory
Need to use some callback magic to fake it like there's a file in
an existing directory
2017-07-20 17:51:06 -04:00
Cole Robinson 6b586e2bed tests: Rework connection caching
Drop the callbacks and instead prime the connection's internal cache.
This will simplify upcoming changes
2017-07-20 17:28:38 -04:00
Cole Robinson 55aa23b400 connection: Return copys of cached object lists
Incase any users manipulate the lists, we don't want that to affect
our caching. Could prevent future mistakes
2017-07-20 17:28:38 -04:00
Cole Robinson 4e4a6c817f connection: Rework cache function layout slightly
Have the internal polling functions not touch the connection cache.
This let's us not worry about the connection cache in the test suite,
where clear_cache wasn't 100% correct.
2017-07-20 17:28:38 -04:00
Pavel Hrdina 4f8e795c6a virtinst: if required by UEFI enable SMM feature and set q35 machine type
If we detect that the UEFI image is build to require SMM feature we
should configure the guest to enable SMM feature and set q35 machine
type.  Without this user wouldn't be able to boot the guest.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1387479

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-01 09:58:46 +02:00
Cole Robinson f551d7e55d Replace file() usage with open()
Same semantics, but the latter is needed for python3
2017-05-05 14:53:12 -04:00
Cole Robinson 62feeb02a8 Switch to python3 style 'except X as Y' notation
Which also works with python2.7
2017-05-05 14:52:11 -04:00
Cole Robinson e7e9369989 util: Catch libxml2 stderr messages
Similar to what we do with libvirt. Was never really relevant before,
but some of the namespace XML stuff can be a bit noisy even though it
doesn't have any functional impact that I can tell
2017-03-06 22:15:46 -05:00
Mikhail Feoktistov 3870001fd2 virtinst: Add tests for Virtuozzo hypervisor 2017-03-01 15:45:24 -05:00
Pavel Hrdina 3d73f9cd3b tests: add aarch64 domcapabilities
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-10 18:09:54 +02:00
Kevin Zhao 79d02e356b Add a capatilities-xml for s390x, and add a clitest for it.
Add a capatilities xml file for s390x ,the capatility for IBM
Distro called KVMIBM,mainly focus on a KVM hypervious on S390x.
Also add a clitest by using virt-install.
2015-11-04 14:42:26 -05:00
Cole Robinson 7f1af40262 tests: Share sanitize_xml helpers 2015-09-22 12:41:57 -04:00
Cole Robinson 82ea5bfc62 tests: Add qemu:///session unit tests 2015-08-10 12:46:47 -04:00
Kevin Zhao 8dbe96fc01 virt-manager : add support for architecture type "s390x".
For architecture "s390x",the disk and the network device are base
on "virtio" bus.The cdrom is based on "scsi".So set the default
cdrom bus as "scsi",the default bus as "virtio".Also the default
machine type is set to "s390-ccw-virtio" as it is the only supported
in "s390x".Also add a test cast of virt-install by cdrom in s390x.

(crobinso: Tweak test suite and minor formatting stuff)
2015-07-14 12:45:32 -04:00
Cole Robinson bbb048cbd0 clitest: Add KVM tests for aarch64, armv7, ppc64le 2015-04-22 20:28:47 -04:00
Cole Robinson 6fd3983f6d tests: Clean up capabilities test data
Make it clear which ones are used for the caps unit tests, and which
are for cli/UI testing and can be updated at will. And drop a bunch
of outdated stuff.
2015-04-22 19:05:06 -04:00
Cole Robinson 08a72a4aec connection: Clean up stable_defaults, improve test coverage 2015-03-23 16:49:32 -04:00
Cole Robinson c7c772b200 virt-install: Default to --boot uefi
Try to use --boot uefi if the user hasn't already specified loader params,
or a kernel to boot. If we can't determine a UEFI setup, just print a
warning.
2015-02-22 10:25:51 -05:00
Cole Robinson 4efc814d7f connection: Add domain caps handling for fake URIs
Allows us to pass in custom domcaps content for testing purposes
2015-02-22 10:25:47 -05:00
Cole Robinson 838d7f015c tests: Drop a bunch of redundant xmlconfig tests
These are mostly covered by clitests. Keep the important ones around
for code coverage.
2014-12-09 13:19:56 -05:00
Cole Robinson 40a5ec75b7 tests: Switch away from set_create_storage 2014-12-05 21:49:10 -05:00
Cole Robinson dd67c48233 connection: Handle nodedev polling too
And cleanup up a bunch of nodedev functions as a result
2014-09-20 12:04:49 -04:00
Cole Robinson 8cd4958a19 cli: Break out function to disable libvirt error printing
We need it early in the test suite
2014-09-20 12:04:37 -04:00
Cole Robinson a8843e5807 virtinst: Remove redundant LiveCDInstaller
DistroInstaller can basically do the same thing. This also gives us distro
detection when using virt-install --livecd
2014-09-07 13:42:56 -04:00
Cole Robinson a398d245cb Clean up pylint integration
- Drop no longer needed disable= bits
- Use string names for all skipped pylint messages
2014-04-02 19:00:24 -04:00
Cole Robinson d76aab264e tests: Only use one env variable to notify we are running tests 2014-02-10 14:47:20 -05:00
Cole Robinson 98ea4cdad2 Reduce test suites clear_cache calls 2014-02-08 19:28:56 -05:00
Cole Robinson c5f6c6852a VirtualDisk: Always use storage APIs for provisioning
This means if we are passed an unmanaged path, we try to create a
storage pool for the parent directory.

We skip directories like /dev where doing this might be problematic.

This makes things much friendlier to use for remote connections, and
means we can always rely on having libvirt's storage APIs to use
for format probing.
2014-02-08 19:24:14 -05:00
Giuseppe Scrivano 499cb63f65 doc: remove reference to SDL from virt-install man page
Adjust some tests to not use --graphics sdl.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-02-06 16:20:12 +01:00
Cole Robinson dff14ea12b tests: Use consistent predictable URIs 2014-02-05 19:02:42 -05:00
Cole Robinson 02402fcc0a Fix some pylint 2014-02-03 16:00:03 -05:00
Cole Robinson 35d06e668a setup: Add tests --regenerate-output
Static variable is too dangerous (notice I forgot to unset it with a
recent commit)
2014-02-03 15:55:20 -05:00
Cole Robinson 0654784643 virt-install: Add --pm option 2014-02-03 11:11:38 -05:00