Commit Graph

1681 Commits

Author SHA1 Message Date
Cole Robinson 8560138cf2 cli: Add --xml xpath option for virt-install and virt-xml
The --xml option allows users to request raw XML edits to virt-install
or virt-xml generated XML. This gives users a bit of a workaround
incase we don't have proper support for some XML property. The --xml
option can gain more features in the future if it makes sense, like
setting XML namespaces for example.

Basic usage is like: virt-install --xml ./@foo=bar ...

Which will change the generated <domain> XML to have

<domain foo='bar' ...

virt-xml works similarly. It can only be combined with --edit currently.
This only works with xpaths rooted against the entire document.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 15:04:37 -04:00
Cole Robinson aa8572048b uitests: Add a fixture for passing in VMMDogtailApp
Reproducing what the custom unittest TestCase does. Convert
test_about as a demo

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 14:25:53 -04:00
Cole Robinson ebf76563b8 uitests: Big code reorganization
Break utils.py apart into a whole uitests/lib/ directory with

* lib/_dogtailinit.py: all the dogtail library init we need
* lib/_node.py: extending our dogtail node class with more functions
* lib/app.py: VMMDogtailApp
* lib/util.py: util functions plus all the special helpers previously
    in our custom TestCase
* lib/testcase.py: The TestCase that sets and tears down self.app

Adjust callers to match and make it easier to eventually convert to
native pytest usage

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 13:55:54 -04:00
Cole Robinson aa9fcdfdb2 uitests: details: use treeview search to speed up hardware selection
This uncovered some areas in details.py we weren't handling that
the search view unselects the current selection

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 12:22:25 -04:00
Cole Robinson 1b48772bc1 virt-install: Don't reboot VM is user manually stopped it
Similar to behavior we have in virt-manager, if the user destroys the
VM during the VM install process, don't invoke the post install
reboot.

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 09:00:33 -04:00
Cole Robinson 9c5c1f3e44 virt-install: Move more install process handling into separate functions
Try to save us having to pass around a ton of options, and make
things cleaner for upcoming changes

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 09:00:33 -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 d24b3ba1d1 cli: Add virtio driver packed= option
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 09:00:33 -04:00
Cole Robinson 65f93e5d60 cli: support --sysinfo type=fwcfg,entry...
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-11 09:00:33 -04:00
Cole Robinson ac8591192f console: Add option to disable autoconnect
As part of making virt-manager cooperate better with external viewers,
add an option to disable console autoconnect. When opening a VM window
for a running VM, you'll see a 'Connect to console' button in place
of the spice/vnc viewer. Click that and things proceed like normal.

This is useful to prevent virt-manager from disconnecting a virt-viewer
instance that's already attached to a VM

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 19:59:31 -04:00
Cole Robinson bbbfd4b7c8 vmwindow: Default the console widget to 1024x768
When a VM window is launched for the first for a VM, currently we
set the top window size to 800x600 which is small and arbitrary and
is universally shrinks the viewer too much to fit any OS installer
I can find.

Instead do some hacks to resize the window to accomodate a viewer
widget of 1024x768 which seems to be what QXL graphics give us for
win10 and Fedora 32 installers. So for new VMs hitting the OS installer
we don't see scrollbars.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 19:37:11 -04:00
Cole Robinson 48bf5c6ab8 uitests: Fix some clonevm flakiness
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 19:22:19 -04:00
Cole Robinson aafb874c85 viewers: Enable window modifiers when viewer doesn't have keyboard
Right now this is tied to widget focus, which is too strong. This
changes it so that say clicking on the window title or toolbar then
allows the user to use Alt+F to trigger the File menu for example.
This roughly matches how virt-viewer works

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 11:25:50 -04:00
Cole Robinson 33a61f7f30 prefs: Remove 'Force console accels' option
This is very obscure and definitely not in line with our DESIGN.md
nowadays

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 09:15:53 -04:00
Cole Robinson 971a3e58f8 uitests: Fix createvm test after tests/data move
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 09:11:23 -04:00
Cole Robinson b88e755a52 console: Text console submenu improvements
* Move all the menu building to its own class, for clarity
* Rename the menu 'Consoles' since it contains graphical choice as well
* Strip out the VM console duplicate if it exists
* Simplify the code a bit

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-09 08:49:12 -04:00
Cole Robinson 5473695fe1 installer: Upload unattended and cloudinit data to remote connections
* rename kernelupload.py to volumeupload.py and make the entrypoint
  more generic
* move all upload invocation to the Installer class
* use it with cloudinit and unattended ISO generation if required

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 19:24:21 -04:00
Cole Robinson 44033b43bb virt-xml: Handle removing <console> <serial> dup device
This is a quirk of libvirt that the first <device> is usually a
logical duplicate of the first <serial> device. Adjust virt-xml to
understand this quirk and remove both devices at the same time,
like we already do in virt-manager

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 17:55:09 -04:00
Cole Robinson e2419869e7 tests: data: Move all cli/ bits to their own directories
Move the content to:

* cli/virtclone/
* cli/unattended/
* fakemedia/

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 17:48:40 -04:00
Cole Robinson 900ff8c3e1 tests: Move cli virt-xml input XML to a virtxml/ dir
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 17:39:38 -04:00
Cole Robinson d073ee9a48 addstorage: Revive disk serial UI
coreos is going to start using disk serial for ignition disk, so
setting this in the UI for distro testing will become more common

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 17:32:00 -04:00
Cole Robinson c54da68535 addstorage: Absorb advanced field UI
Share the UI for changing all these disk properties:

- shareable
- readonly
- removable
- cache
- discard
- detect zeroes

Move them all under the 'Advanced options' expander in details, and
add the checkbox options to the addhardware wizard.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-08 17:32:00 -04:00
Cole Robinson 5e495ebd46 migrate: Add XML editor support
Allows the user to tweak the XML at the destination, which is already
something that libvirt supports

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 17:50:48 -04:00
Cole Robinson 16ebab2230 clone: Rework the UI
* Drop the network editing, users can use the details window
* Drop the combo box approach in favor of a regular treeview
* Drop a lot validation checks which are redundant with modern
  virtinst. We probably lose some checks but I don't think it's
  too important
* Use the cloner API
* Add uitest coverage

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson b9de8ad919 cloner: Fix some corner cases with name generation
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson 4a47d32b09 xmlutil: add a diff() helper
And centralize all the scattered difflib calls we have

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson 7f1f5e343e codespell: Whitelist 'cloneable'
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson 8856b781d0 cloner: Write preserve vs share vs clone into DiskInfo
This let's us move more of the preserve logic to virtclone.py
and prep more things to share with virt-manager

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson e6df73261b cloner: Rename clone_disk -> new_disk
The latter is more clear in most contexts, and will make more
sense for future changes

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -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 8f60e4af47 tests: Add our own test:///default driver XML
test:///default saves changes for the lifetime of the connecting
process, which can cause weird interdependent issues in the test
suite. Duplicating it with driver XML will avoid those issues
popping up.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson f06325904b cloner: Share more clone disk building logic
We use this in virt-manager for nvram move on VM rename, so
let's simplify things for all callers

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson f23a27639f cloner: Big API rework
* Centralize lots of disk building
* Open code virt-clone specific behavior at the source
* Drop a lot or properties
* Move most testing to test_cli.py
* Generally a ton of cleanup

virt-manager clone wizard has not been converted yet so is totally
broken after this commit

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson c0d1e76941 tests: Cover more of cloner.py from test_cli.py
Cover more cases via the virt-clone CLI testing, than just the
test_cloner.py unit style testing.

Change most of the virt-clone --print-xml testing to also attempt the
clone operation as well via a hidden cli option, to ensure we aren't
testing XML of any bogus operations

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson f157aa1839 diskbackend: Simplify path a case of path joining
We are reimplementing os.path.join. Make sure the standard cli
test suite hits this case too

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson f46e1a395c tests: cli: Drop most usage of virt-clone --clone-running
This is just a test suite hack from before we had other methods
of specifying cloneable guests. It will be removed soon

We need to tweak some test XML to fix code coverage after

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson 39e8d60bea tests: cli: drop some clone --original-xml arg redundancy
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson 92b46245bd uitests: finish connection, connectauth
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson cb49648106 uitests: Finish inspection.py coverage
As much as we can. There's not any current way to actually test
the full guestfs implementation, so we exclude it all

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:04:36 -04:00
Cole Robinson 55fd4ccd23 uitests: Add connection login console lookup testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:04:36 -04:00
Cole Robinson 485dddf2ed uitests: Add connection user/pass auth testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:04:36 -04:00
Cole Robinson f6e880b195 uitests: Add connection nodedev and agent event testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:03:51 -04:00
Cole Robinson 306c6be12f uitests: Add connection tick failure testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:03:51 -04:00
Cole Robinson 29f866e6f3 uitests: add connection object blacklist testing
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-02 12:59:25 -04:00
Cole Robinson a10d746c41 gfxdetails: Update UI a bit
Refactor the internals to cleanly separate the pieces that fill in
the UI, and the pieces that react to UI state to dynamically show/hide
fields.

Improve spice GL warnings while he are here, and several other minor
fixes

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 20:10:34 -04:00
Cole Robinson 9b5d9eb9eb systray: add a standalone window impl for uitests
This gives us as much coverage as possible without relying on too much
host desktop config

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 16:59:20 -04:00
Cole Robinson 315f492156 uitests: Remove some debugging
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson e45a2228dc objects: Erase the notion of connkey
Make it explicit that all uses of this is actually the object
name. We already leaked this abstraction in several places so better
to make it explicit. This also communicates to users that this is a
field that is not immutable so it shouldn't be used as a unique key

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson b3fb88e345 cli: Add --cpu numa.cell.memAccess and discard
https://bugzilla.redhat.com/show_bug.cgi?id=1824373

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-31 13:53:26 -04:00
Cole Robinson 7e3fb3f281 graphics: Default to 'vga' instead of 'qxl' for non-spice
qxl doesn't add anything for the VNC case, and qxl is more likely
to be compiled out of qemu since it is dependent on spice, so vga
is the safer default for getting a working config

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-31 13:43:56 -04:00