Commit Graph

31 Commits

Author SHA1 Message Date
Cole Robinson c61074191d tests: Drop usage of sgio=unfiltered
libvirt 8.1.0+ rejects it, so it breaks the testsuite

Fixes: #382

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-04-13 07:00:37 -04:00
Cole Robinson 365d1f5d56 diskbackend: Set relative path for media change
Via the virt-manager UI we aren't converting relative path to
absolute path, even though we do it internally when needed.

We were benefiting from this in the test suite in some ways, so we
need to adjust tests to strip out the dev dir on XML comparison

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-27 13:44:26 -05:00
Cole Robinson 435c7181f1 tests: testdriver: Rename default-pool -> pool-dir
And move the path to not be rooted in /dev, which doesn't make
sense for a directory pool, and triggers some special /dev handling
in virtinst that we don't want in the common testing path.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-27 13:03:04 -05:00
Cole Robinson 6a21b38ae8 tests: testdriver: Rename disk-pool -> pool-logical
It _is_ type=logical, so make it clear in the naming. Plus we
already have a type=disk pool named pool-disk

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-27 12:55:48 -05:00
Cole Robinson b275e3c266 cli: Add --boot refresh-machine-type=yes
This is a virt-xml option to refresh a VM to use the latest machine
type version for the machine type it's currently using. Ex:

pseries-2.11 -> pseries
pc-q35-5.0 -> q35

This is useful for when qemu deprecates and removes the machine type
out from under you, or to pick up bug fixes.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-26 14:11:56 -05:00
Cole Robinson 8eeebce4bc tests: more capabilities data cleanup
* Merge kvm-x86_64-domcaps{-q35} variants
* Add -oldfirmware for explicitly testing secboot fallback setup
* Use consistent kvm-x86_64-domcaps-* prefix

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 12:31:52 -05:00
Cole Robinson 49f54a294b virtinst: cpu: drop host-copy support
host-copy was the old default, but it's fundamentally flawed. Since
we switched to host-model default a few years back, it's not advertised
in the docs or selectable via virt-manager any more.

Have it print a warning and invoke host-model-only

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-16 12:31:52 -05:00
Cole Robinson b39aa1ea79 tests: Clean up URI building and naming
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-01-25 10:32:03 -05:00
Jonathon Jongsma 9766beea04 cli: add 'ioapic.driver' to --features
Add the ability to set the ioapic driver using the --features argument:

    $ virt-install --features ioapic.driver=qemu ...

This results in the following xml:

  <features>
    ...
    <ioapic driver="qemu"/>
  </features>

This is required in order to install a guest with >255 cpus. Such a
configuration requires an iommu with extended interrupt mode enabled,
which in turn requires IOMMU interrupt remapping to be enabled, which in
turn requires a split I/O APIC.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2022-01-11 18:26:06 -05:00
Cole Robinson 68ca651d85 xmlbuilder: Make embedded device XML print correctly
If you call get_xml() on a device that's part of a Guest class,
the last element has correct indent but not the first element.

Steal the indent from the last element and prepend it to the returned
XML

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-10-12 15:10:39 -04:00
Hugues Fafard a24cdd1964 cli: --boot: Completed options for guest-based bootloader
Adds support for `bootmenu.timeout` suboption.
2021-07-29 11:44:57 -04:00
Cole Robinson 3d07b28a36 device: disk: Rename path property to get/set_source_path
This makes it more clear that 'path' is really a special designation
with a bunch of complicated logic behind it. It's also easier to
grep for

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 19:06:32 -05:00
Cole Robinson b3ff59c75c device: disk: Move <source> XML handling to its own class
Makes DeviceDisk less complicated, helps with readability

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 18:07:50 -05:00
Cole Robinson fa322588b4 tests: Drop most unittest usage from virtinst tests
Kill usage of the TestCase class, move more to pytest standard
style

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-19 13:46:46 -04:00
Cole Robinson b79ee9565f tests: Rename test_xmlconfig.py to test_misc.py
That's what it is now, just a collection of misc virtinst tests

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-19 13:46:33 -04:00
Cole Robinson 4c4753d910 tests: break out test_disk.py
Move a bunch of misc disk/diskbackend tests to this file

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-19 13:46:22 -04:00
Cole Robinson 0ac9ff3488 tests: Drop a bunch of redundant xmlparse/xmlconfig tests
For the few bits we are hitting specific code paths, break them
out or fold them into other test cases

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-19 13:46:08 -04:00
Cole Robinson 71ac3ee044 tests: Convert to use pytest style 'assert'
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-19 13:44:50 -04:00
Cole Robinson ac51ff8684 cli: Fill in all --filesystem suboptions
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 09:00:33 -04:00
Cole Robinson 9c1453a253 disk: lookup volumes in disk.set_backend_for_existing_path
Seems like it should be doing this.
Make use of that helper in cloner afterwards

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson 38405a477c tests: Add *DIR helper variables
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 14:23:24 -04:00
Cole Robinson 34c6d1c7ea virtinst: cpu: Move topology elements to their own class
This is a no-op but will help with a future bug fix

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-27 19:41:28 -04:00
Cole Robinson aa89a48371 xmlutil: Centralize all 'programming error' exceptions
Raise them directly instead of adding the hard to read conditional
into the function

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-17 19:08:27 -04:00
Cole Robinson e7bb021c4c diskbackend: Add lots of test coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 08:38:18 -05:00
Cole Robinson 04c0d48ef7 devices: disk: Always set a stub storage backend
This reworks the existing code to never have storage_backend = None,
instead carrying around a stub class, and resolving the actual
storage info when necessary. This makes the logic easier to follow.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 06:52:29 -05:00
Cole Robinson 4cb775773f devices: disk: Add change_bus()
Taken from virt-manager code. Move it here because it is strictly
an XML operation, and it will be easier to unit test

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-29 06:44:33 -05:00
Cole Robinson 11d6536542 guest: Finish off test coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson dcab14e0b4 domain: cpu: Finish test coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson 6f95ebc7fd devices: controller: Add get_attached_devices
Move the opencoded impl out of virt-manager details.py and into
virtinst, since this is entirely about XML comparison. Add tests for
it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson ec580f82a2 tests: Cover Guest.find_device and Device.compare_device
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 07:38:53 -05:00
Cole Robinson e784376699 tests: Rename all test files to have test_ prefix
This will help for a possible future conversion to pytest

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 06:57:37 -05:00