Commit Graph

2082 Commits

Author SHA1 Message Date
Cole Robinson
258df88eab domain: tweak q35 <-> pc editing
* add_q35_pcie_controllers already skips adding controllers if
  any type=pci already exist, so delete the extra checking
* be more paranoid and only run the live edits when the machine
  type actually changed from an expected config

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-09-10 16:35:03 -04:00
Andrea Bolognani
e1468c04aa tests: Add testDomainCapabilitiesLoongArch64()
Inspired by the x86_64 counterpart.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-09-10 12:56:38 -04:00
Andrea Bolognani
5419524f7b tests: Add testDomainCapabilitiesRISCV64()
Inspired by the x86_64 counterpart.

We're using TCG in this case, so things like host-passthrough
are not available.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-09-10 12:56:38 -04:00
Andrea Bolognani
cf0b6cd78f tests: Add testDomainCapabilitiesPPC64le()
Inspired by the x86_64 counterpart.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-09-10 12:53:36 -04:00
Andrea Bolognani
01a451e7d9 tests: Update ppc64le capabilities
The old capabilities are extremely outdated. The new ones were
captured on an IBM POWER8 machine running Fedora 40.

A few new features are advertised, and the details of the
machine are significantly different, but not much of this is
reflected in the output XML files.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-09-10 12:53:36 -04:00
Andrea Bolognani
579eb3e91e tests: Extend testDomainCapabilitiesAArch64()
Bring it closer to the x86_64 counterpart.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-09-10 10:54:53 +02:00
Andrea Bolognani
38906948c6 tests: Update aarch64 capabilities
The old capabilities are extremely outdated. The new ones were
captured on an Ampere Mt. Jade machine running Fedora 40.

Notable differences that are reflected in the output XML files
include the availability of SPICE, as well as EFI firmware and
ACPI support being advertised.

The test script had to be updated too, since both virtiofs and
memfd are now available.

Closes: #714

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-09-10 10:54:53 +02:00
Lin Ma
4782dd1cce cli: Add --disk driver.discard_no_unref=on|off
E.g.
  virt-install \
  ... \
  --disk /tmp/disk0.qcow2,size=16,driver.type=qcow2,driver.discard=unmap,\
  driver.discard_no_unref=on

It results in the following domain xml:
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' discard='unmap' discard_no_unref='on'/>
      <source file='/tmp/disk0.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Lin Ma <lma@suse.de>
2024-09-08 11:25:32 -04:00
Lin Ma
6a65def684 cli: Add --video model.blob=on|off
Libvirt enables blob resources for the virtio video device since 9.2.0.
It accelerates the display path due to less or no copying of pixel data.

E.g.
  virt-install \
  ... \
  --video model.type=virtio,blob=on

It results in the following domain xml:

    <video>
      <model type="virtio" blob="on"/>
    </video>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Lin Ma <lma@suse.de>
2024-09-08 11:25:32 -04:00
Lin Ma
febddd4b01 cli: Add --memdev target.address_base for virtio-mem and virtio-pmem
Libvirt(since 9.4.0) allows to control this attribute for virtio-{mem,pmem}.
Now add it into virt-install.

Example:
virt-install \
--name test \
--os-variant opensusetumbleweed \
--cdrom /isos/openSUSE-Tumbleweed-DVD-x86_64-Current.iso \
--disk /vms/tw/disk0.qcow2 \
--vcpu 2 \
--cpu cell0.cpus=0,cell0.memory=4194304,\
cell1.cpus=1,cell1.memory=4194304 \
--memory maxMemory=65536,maxMemory.slots=8 \
--memdev model=virtio-mem,\
target.node=0,\
target.block=2048,\
target.size=8192,\
target.requested=2097152,\
target.address_base=0x280000000 \
--memdev model=virtio-pmem,\
source.path=/tmp/virtio_pmem,\
target.size=4096,\
target.address_base=0x480000000

It results in the following domain XML snippet:
    <memory model='virtio-mem'>
      <target>
        <size unit='KiB'>8388608</size>
        <node>0</node>
        <block unit='KiB'>2048</block>
        <requested unit='KiB'>2097152</requested>
        <current unit='KiB'>0</current>
        <address base='0x280000000'/>
      </target>
      <alias name='virtiomem0'/>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </memory>
    <memory model='virtio-pmem' access='shared'>
      <source>
        <path>/tmp/virtio_pmem</path>
      </source>
      <target>
        <size unit='KiB'>2097152</size>
        <address base='0x480000000'/>
      </target>
      <alias name='virtiopmem0'/>
      <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
    </memory>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Lin Ma <lma@suse.de>
2024-09-08 11:25:32 -04:00
Lin Ma
7a974a3a72 cli: Add --features kvm.pv-ipi.state=on|off
Set kvm pv-ipi feature by --features argument.

E.g. virt-install --features kvm.pv-ipi.state=off
It results in the following domain xml:

 <features>
   <kvm>
     <pv-ipi state='off'/>
   </kvm>
 </features>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Lin Ma <lma@suse.de>
2024-09-08 11:25:32 -04:00
Lin Ma
63f8f78e6b tests: Check missing_xorriso in osinfo-netinst-unattended test case
It avoids failure in case of missing xorriso.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Lin Ma <lma@suse.de>
2024-09-08 11:23:22 -04:00
Cole Robinson
9ec9c400f4 tests: add fake-win-multi.iso and test it
This has ambiguous volume labels that will match multiple
osinfo output:

$ osinfo-detect -a tests/data/fakemedia/fake-win-multi.iso
Media is bootable.

Generated by editing `fake-win7.iso` already in tree

$ xorriso -indev fake-win7.iso -outdev test.iso \
    -boot_image isolinux keep \
    -volid SSS_X64CHK_ -volset_id SSS_X64CHK_

Add a simple test case that confirms _some_ os was detected,
and virt-install doesn't totally choke on it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-09-07 14:34:43 -04:00
Cole Robinson
f4a9722dc6 uitests: cover serial console changes
+ Drop test_livetests bit which was working around the old behavior
+ Add test_details piece that covers the new behavior, and
  ideal behavior that we maintain the selection across VM restarts.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-09-07 13:38:42 -04:00
Cole Robinson
e1798ef8ad Add missing test file
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-09-06 15:32:04 -04:00
Cole Robinson
83daac0489 domain: os: treat xenpvh as xen PV
Notably, don't try to add a tablet device, this apparently
doesn't work.

https://github.com/virt-manager/virt-manager/issues/448

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-09-06 15:30:51 -04:00
Cole Robinson
9ad347fd76 tests: test XML generation for --disk path=file://...
Tweak the test case added in ba3a098c3b
to test XML generation instead, to make sure nothing regresses
weirdly there.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-09-06 14:54:09 -04:00
Pavel Hrdina
67206a858a tests: add more test cases to cover all code paths
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
74fd503b9e virtinst: enable most Hyper-V features by default
We will not enable hyperv_reset feature as modern Hyper-V versions don't
export it.

We also don't enable hyperv_reenlightenment as it is mostly relevant
when migrating VMs that are running Hyper-V inside and requires other
bits to work correctly.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
9e9dbf735c domain.features: use domcapabilities when setting default Hyper-V features
We will no longer enable hyperv features based on libvirt and QEMU
versions.

Some tests don't use the kvm-x86_64-domcaps-latest so the code will now
not enable Hyper-V features. There are still other test cases that cover
Hyper-V features so instead of mangling with URI for these tests update
test data.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
bec2d7cb44 tests: update kvm-x86_64-domcaps-latest
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
139b0e285b cli: add --features hyperv.avic.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
a06d53596b cli: add --features hyperv.evmcs.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
5afc6919c9 cli: add --features hyperv.ipi.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
e3ec248cff cli: add --features hyperv.tblflush.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
c421ec1b75 cli: add --features hyperv.reenlightenment.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
2786ea5df2 cli: add --features hyperv.frequencies.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
6289a1369b cli: add --features hyperv.stimer.direct.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
1f69795b0a cli: add --features hyperv.stimer.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
d7976a883a cli: add --features hyperv.runtime.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
d2a29245cd cli: add --features hyperv.vpindex.state=on/off
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
1c3fb02543 test_cli: extract hyperv features to separate lines
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Pavel Hrdina
ac26945c56 domain.features: reorder Hyper-V features
Follow the table from libvirt documentation [1].

[1] <https://libvirt.org/formatdomain.html#hypervisor-features>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-06 14:15:09 -04:00
Cole Robinson
2da4884962 tests: Cover some weird virt-xml corner case behaviors
Examples:

`virt-xml MYVM --add-device --sound FOO1 --sound FOO2` is not rejected
and will add 2 devices.

`virt-xml MYVM --remove-device --sound opt1=FOO1 --sound opt2=FOO2`
is not rejected, only the final `--sound` option is used.

`virt-xml MYVM --edit --sound FOO1 --sound address.type=BAR` is not
rejected. The commandlines will effectively be squashed

`--sound` can be any XML option, but trying to mix and match
options like `--sound` and `--disk` is always rejected.

These bits are unexpected and undocument, but have been around since
the beginning of virt-xml.

I can see us breaking compat on these in the future (particularly the
--remove-device bit), but that would need to be an explicit decision,
and announced appropriately. In the mean time, we should be testing
this so it doesn't accidentally regress.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-28 21:09:31 +02:00
Cole Robinson
7e79e064ea Revert virt-xml multiple --edit support
This reverts b34ae0d0c8 and
1fef5d8661.

Playing with this some more I found some deeper problems. For example

```console
[:~/src/virt-manager] (main) $ ./virt-xml test-for-virtxml --connect test://`pwd`/tests/data/testdriver/testsuite.xml --print-diff --edit 1 --video model=FOO --edit 2 --sound model=BAR
--- Original XML
+++ Altered XML
@@ -180,14 +180,14 @@
     <graphics type="vnc" port="-1" autoport="yes">
       <listen type="address"/>
     </graphics>
-    <sound model="sb16"/>
+    <sound model="BAR"/>
     <sound model="es1370"/>
     <sound model="ich6"/>
     <video>
       <model type="vmvga" vram="16384" heads="1" primary="yes"/>
     </video>
     <video>
-      <model type="cirrus" vram="16384" heads="3"/>
+      <model type="FOO" vram="16384" heads="3"/>
     </video>
     <hostdev mode="subsystem" type="usb" managed="yes">
       <source>
```

There's other weirdness too, though it's mostly strange plays on previous weird behavior

* `--edit --video model=vga --edit --sound model=ich9 --video model=qxl` works
* `--add-device --sound model=foo --video model=bar` was previously rejected but now works
* `--remove-device --video model=vmvga --sound model=sb16` was previously rejected by now works

Fixing all this is not trivial. So I think we need to revert and go back to the drawing board.
2024-08-28 21:09:31 +02:00
Cole Robinson
5fe6dcc6b4 Fix some pylint
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-28 11:53:35 -04:00
Daniel P. Berrangé
97469abd8e tests: add tests for AMD SEV-SNP
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-08-28 14:38:40 +02:00
Pavel Hrdina
1fef5d8661 tests: add virt-xml test to demonstrate changing graphics and video at the same time
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Pavel Hrdina
b34ae0d0c8 virt-xml: allow multiple --edit options
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Pavel Hrdina
093d58fbc8 virtinst: add/remove spice devices when updating graphics type
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Pavel Hrdina
aaf8551914 virtinst: remove spice devices when removing last spice graphics
When Spice graphics is used QEMU creates a Spice server and communicates
with Spice client using multiple channels. These channels are used by
the spice devices as well. Without the Spice graphics defined there is
no use for the other devices. In addition libvirt will report error for
such configuration.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Pavel Hrdina
7a03f3efa8 testsuite: add test-spice vm definition
This will test spice related changes. Follow up patches will change this
behavior to remove spice related devices.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 12:33:51 -04:00
Cole Robinson
29145b9e93 Fix some pylint
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-26 11:36:01 -04:00
Pavel Hrdina
90ceb87b7c virt-install: implement passt backend for user network interface
Add new `--network backend.type` attribute, libvirt currently supports
only `passt`. If not network type is specified virt-install will pick
`user` type as it is required for `passt` backend.

This also introduces support to specify portForward and specifying port
range as well.

For more details see [1].

[1] <https://libvirt.org/formatdomain.html#userspace-slirp-or-passt-connection>

Fixes: https://github.com/virt-manager/virt-manager/issues/488
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 11:27:03 -04:00
Cole Robinson
954c9b6bf7 uitests: createvm: fix case on f40
We should be checking 'selected' here, not 'focused'. This stopped
working on f40 apparently

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-14 11:36:13 -04:00
Cole Robinson
2ddbea5d0b uitests: Fix get_text() on fedora40
Seems like some dependent lib started exposing a similarly named
function, so ours stopped working

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-14 06:17:10 -04:00
Cole Robinson
0cad0c4dff uitests: force internal snapshots in test_snapshot.py
Incase the libvirt test driver ever starts advertising support

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-12 19:55:58 -04:00
Cole Robinson
a00c090022 uitests: handle newer libvirt test driver UpdateDevice support
Make it fail for the cases that expect it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-12 19:55:58 -04:00
Cole Robinson
2e1bacfd33 uitests: Add live external snapshot testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-12 19:55:58 -04:00
Cole Robinson
95ca39aae8 uitests: test xmleditor textview fallback
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-12 19:54:45 -04:00
Cole Robinson
1194f09968 tests: cli: Fix with latest libvirt
The libvirt test driver supports more APIs now, so we are getting
a different error message.

Extend the grep= string to work with both old and new libvirt

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-07 11:58:49 -04:00
Cole Robinson
0288e92581 tests: cli: Use regex for grep= and nogrep= args
This will let us match more complex output, and match error message
differences across libvirt versions

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-08-07 11:58:49 -04:00
Natanael Copa
648f52bde0 virt-install: fix cloud-init ssh keys
Fix the cloud-init config file for --clouduser-ssh key.

Also change ssh_authorized_keys to `ssh_authorized_keys`, and make sure
default user is not deleted when setting ssh key for root.

Fixes commit 22478f307d (virt-install: Add --cloud-init clouduser-ssh-key=)

Resolves: https://github.com/virt-manager/virt-manager/issues/452

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2024-07-25 16:50:34 +02:00
Patrice Lacouture
72a74fb1fb virtinstall: Fix --location and --cloud-init conflict
So far, --cloud-init is ignored when --location is specified.

Resolves: virt-manager#469
2024-07-22 16:08:09 +02:00
taoky
0c981eec58 tests: Add test for DeviceDisk.paths_in_use_by 2024-07-22 12:42:10 +02:00
Pavel Hrdina
8a0e22397d tests: add s390x default test case
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-07-02 15:40:51 +02:00
Pavel Hrdina
43f581c26c virtinst: add graphics to risc-v virt VMs by default
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-07-02 15:40:51 +02:00
Pavel Hrdina
faebce406b virtinst: add graphics to aarch64 virt VMs by default
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-07-02 15:40:51 +02:00
Xianglai Li
9ede5d22d5 Add test cases for loongarch
Add some basic test cases for loongarch.

Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
2024-06-18 12:09:14 +02:00
scarf
ba3a098c3b virtinst: disk: strip away file:// protocol 2024-06-10 17:43:35 +02:00
Pavel Hrdina
5fcf506e08 tests: skip mdev tests for libvirt older than 10.4.0
The test driver was broken for some time and our mdev tests were failing
on most libvirt versions. Recently this was fixed in libvirt 10.4.0 so
skip these tests unless we have new enough libvirt.

This requires extracting some mdev devices from many-devices test case.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-06-06 14:11:34 +02:00
Andrea Bolognani
a91e23c858 install: Use virtio-scsi for unattended installations
This won't make any difference on x86, where either SATA or IDE
is used depending on the machine type, but on other architectures
we want virtio-scsi for a reasonable chance that the guest OS
will recognize the disk.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-05-30 22:10:05 +02:00
Andrea Bolognani
7f8230a158 guest: Prefer UEFI for riscv64
Most existing disk images expect UEFI; those that don't, require
either using direct kernel boot or manually providing a firmware
image, both of which imply user intervention.

Using UEFI by default means that at least images belonging to
the first group, of which more are going to pop up as the
ecosystem matures further, can work out of the box.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-05-30 22:10:05 +02:00
Andrea Bolognani
6fca91f286 tests: Add more riscv64 tests
Cover additional scenarios: direct kernel boot, use of cloud-init,
installation from CDROM and unattended installation.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-05-30 22:10:05 +02:00
Andrea Bolognani
3b09701f6b tests: Use SPICE graphics on riscv64
Provides more coverage, specifically the sound part.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-05-30 22:10:05 +02:00
Andrea Bolognani
9ec5852591 tests: Switch to --osinfo for riscv64
It's the preferred name, and it's shorter to boot.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-05-30 22:10:05 +02:00
Andrea Bolognani
0612dca8ee tests: Drop precompare_check from riscv64
We're using data from a much newer version of libvirt now.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-05-30 22:10:05 +02:00
Andrea Bolognani
094a81201a tests: Update riscv64 capabilities
The new capabilities reflect the status of riscv64
virtualization as of Fedora 40, which comes with libvirt
10.1.0 and QEMU 8.2.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2024-05-30 22:10:05 +02:00
Cole Robinson
8b6db203f7 tests: Fix host-copy XML with libvirt 10.1.0
New `clusters` changes XML output

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-04-06 15:48:46 -04:00
Pavel Hrdina
d8565ac533 virtinst: snapshot: add memory file attribute
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-03-25 13:21:50 +01:00
Pavel Hrdina
3cde1acbb6 virtinst: add external snapshot capability
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2024-03-25 13:21:50 +01:00
Cole Robinson
a6b62a20b6 systray: Cleanups and improvements for --show-systray
- Add UI coverage
- Drop redundant systray_instance caching
- Tweaks help test and docs
- Show an error if the systray doesn't embed

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-03-03 14:18:04 -05:00
Cole Robinson
2043847ade uitests: More handling for slow startup on f39
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-03-03 14:18:04 -05:00
Cole Robinson
014d1ef99b console: Cleanup and improve console menu handling
- Rework the ConsolePages abstraction to carry the Gtk.Menu. makes
  it all less messy

- Make the console menu the single source of truth for console
  embeddability, and error message reporting

- Small misc cleanups here and there

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-03-03 12:52:37 -05:00
Cole Robinson
0c899a7ccd uitests: Handle slow app launch on fedora 39
Not quite sure what's going on here, I think it has something to
do with slowness when the accessibility bus is being polled.

Add some infrastructure to increase the timeout while we wait for
the app to pop up

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-03-03 10:43:30 -05:00
Cole Robinson
a05ab5cdb4 uitests: Fix walkUI flakyness
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-03-03 10:43:30 -05:00
Cole Robinson
cf172c8e57 testdriver: Add portgroups example to test-many-devices
This helps hit some uitests code coverage

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-03-02 13:22:40 -05:00
Cole Robinson
82f1c4495e domain: rename: handle firmware ending with .qcow2
Newer libvirt + edk2 will default to nvram in qcow2 format, but
our domain rename code had some .fd assumptions baked in.

Adjust uitests to handle it too

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-03-02 13:22:37 -05:00
Cole Robinson
135cf17072 tests: Add unittest coverage for qemu hvf VMs
I have no idea if the generated config is optimal, but this
at least provides a base for us to confirm when defaults change.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-02-05 14:42:49 -05:00
Cole Robinson
4e2bec5b14 tests: ui: make creatnet test start less flakey
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-01-23 13:28:07 -05:00
Cole Robinson
acf3cedbbf tests: ui: make newvm test start less flakey
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-01-23 09:07:29 -05:00
Cole Robinson
83fcc5b2e8 tests: cli: Adjust hotplug test for latest libvirt
The libvirt test driver now has implementations for hotplug routines,
which broke string matching for one case.

Loosen it up to work for old and new libvirt versions.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-01-22 17:10:41 -05:00
Jonathon Jongsma
40b73fec1b Fix filesystem socket.source
When specifying the socket.source option for filesystem devices, like
this:
  --filesystem type=mount,driver.type=virtiofs,source.socket=/xyz.sock,target.dir=tag1

virt-install is writing the xml as:

    <filesystem type="mount">
      <source>
        <socket>/xyz.sock</socket>
      </source>
      <target dir="tag1"/>
      <driver type="virtiofs"/>
    </filesystem>

This produces an error such as:

  ERROR missing source information for device mount_tag1

But the socket should be an attribute of source rather than a child
element. After this patch, the same command results in the following XML
and no error is produced:

    <filesystem type="mount">
      <source socket="/xyz.sock"/>
      <target dir="tag1"/>
      <driver type="virtiofs"/>
    </filesystem>

Resolves: RHEL-1126

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2023-10-24 10:30:37 +02:00
Cole Robinson
775edfd5dc connectauth: Drop sanity checking for libvirtd
Nowadays with libvirt split daemons, libvirtd isn't required to
be installed for a first run local connection to succeed, so we
are needlessly blocking the app from 'just working' in many cases.
Especially considering that many distros often have libvirt running
out of the box due to gnome-boxes pulling it in.

Drop the daemon checking entirely.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-09-24 16:31:58 -04:00
Cole Robinson
ec434948a8 installer: drop default TPM for --cloud-init install phase
When shim in the guest sees unpopulated EFI NVRAM, like when
we create a new UEFI VM, it invokes fallback.efi to populate
initial NVRAM boot entries. When the guest also has a TPM device,
shim will do a one time VM reset. This reset throws off the
reboot detection that is central to virt-install's install
process.

The main install case that this will usually be relevant is
the combo of UEFI and --cloud-init. The latter usually implies
use of a distro cloud image, which will be using shim, and the
--cloud-init process requires a multi stage install compared
to just a plain import install.

For that case, we disable the default TPM device for the first
boot.

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-09-12 12:04:49 -04:00
Cole Robinson
fca6de3950 tests: Add more cloud-init and TPM test cases
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-09-12 12:03:40 -04:00
Cole Robinson
0f706cf874 Fix some pylint
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-09-12 11:54:04 -04:00
Cole Robinson
19b0f3f446 tests: Add unit test coverage for #539
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-08-29 12:27:40 -04:00
Laszlo Ersek
6e5c1db6b4 tests/data: refresh Fedora tree URLs in virt-install-osinfo* expected XMLs
Libosinfo seems to generate Fedora tree URLs using the "https", not
"http", scheme now; which breaks CI. Update the expected outputs
accordingly.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
2023-08-29 13:24:52 +02:00
Cole Robinson
7cd6151a21 uitests: Drop hotplug work around, f38 libvirt is fixed now
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-24 12:49:02 -04:00
Cole Robinson
64bd6ba53e tests: uitests: make menu operations more robust
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-06 19:43:24 -04:00
Cole Robinson
509c95ddb9 uitests: More attempts at making manager reposition test reliable
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-06 19:43:24 -04:00
Cole Robinson
75422ec75e uitests: Make hotplug test pass on both f37 and f38
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-06 19:43:24 -04:00
Cole Robinson
a9cf4945b1 tests: Default --uitests to --verbosity=2
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-06 16:50:20 -04:00
Cole Robinson
6030049cd7 tests: uitests: Fix manager window repositioning test
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-05 15:48:24 -04:00
Cole Robinson
7f83d23f4f tests: livetests: work around qemu media change regression
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-05 15:47:25 -04:00
Cole Robinson
909c8aa880 tests: uitests: Fix window reposition on f38
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-05-05 14:54:31 -04:00
Oleg Vasilev
7769548411 tests: cli: test serial file clone
Previous commit added serial file clone, now we test it.

Signed-off-by: Oleg Vasilev <oleg.vasilev@virtuozzo.com>
2023-03-22 17:44:06 -04:00
Cole Robinson
5c49151df9 tests: test win11 XML generation
And drop the futureproofing workaround now that it's no longer
required

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2023-01-19 11:54:03 -05:00
Toshiki Sonoda
6ec00474a6 virtinstall: Hide total_size in the progress bar if it doesn't need
virt-install prints the total_size value to the progress bar even if it
is meaningless.
This value can be confusing to user, so for execute prosess that doesn't
copy files (total_size = 0B), we hide the total_size value.
For example, 'Creating domain...' doesn't need to print the total_size
value.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Signed-off-by: Haruka Ohata <ohata.haruka@fujitsu.com>
2022-12-14 13:18:36 -05:00