Commit Graph

7518 Commits

Author SHA1 Message Date
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 14232e1aa7 connection: Don't process errors in tick_from_engine
We haven't shown error dialogs for failed connections for a long
while, so all this processing isn't accomplishing anything anymore

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 525afd1aa6 DESIGN: More examples of rejected console features
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 20:02:21 -04:00
Cole Robinson bd4b53e7da netlist: Remove some leftover print debugging
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 18:04:29 -04:00
Cole Robinson ba33a6c99d details: Remove explicit video heads and ram reporting
RAM is rarely changed from the default
heads does not have any explicit virt-manager support
and both are viewable from the XML editor.
So remove the explicit fields for them

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 17:32:50 -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 4348d4b128 systray: Don't rebuild the menu on every change
This works fine for the StatusIcon backend, but for the appindicator
backend which communicates every menu changes over dbus this is
super slow. Instead update the menu in place when objects change
state or disappear

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

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 16:58:04 -04:00
Cole Robinson 408b3023bc viewers: Remove hidden grab-keyboard gsettings
This was added in 2014 per user request but we never exposed it in the
UI. This is fairly advanced needs from the console viewer IMO and is
better left to console specific tools like virt-viewer, per our
DESIGN.md

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -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 c40a9e3fed delete: Move show_instance to the proper class
It shouldn't be associated with the shared baseclass

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 8ff0da7664 connection: Pass object in -added/-removed signals
And not connkey. connkey == name, and name can change with object
rename, so it's a bad pattern to propagate that connkey can be used
as a static lookup key for objects. This begins unwinding it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson e4c0191f83 createvm: Only check network selection on final page
Otherwise early 'change' signals can give inconsistent
behavior WRT default 'advanced' expander state

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
Pino Toscano 7b8ea00361 tests: add Mageia 5 detection test
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-08-31 13:20:41 -04:00
Pino Toscano f6c2e75084 urldetect: add version detection for Mageia
Use the VERSION file not only to detect whether the tree is a Mageia
tree, but also to detect the version.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-08-31 13:20:41 -04:00
Pino Toscano f98daef031 tests: tweak mageia detection
- create a versioned directory for the current VERSION file, fixing the
  typo in the distro name
- move the test to an own function

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-08-31 13:20:41 -04:00
Cole Robinson 1a3a89d949 uitests: finish delete.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 15:59:39 -04:00
Cole Robinson 30e021bd3d uitests: finish createvm.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 14:23:24 -04:00
Cole Robinson 5442b6a890 createvm: Fix checking for empty KVM caps
This code path was never hit because it came after caps.guest_lookup
which errors in this case. We need to check things earlier

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 14:23:24 -04:00
Cole Robinson af0162caa2 createvm: Remove the xen PV-only warning
Nowadays this should be rare or possibly not even exist

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 14:23:24 -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 c36f232370 uitests: Finish console.py and viewers.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-30 10:34:44 -04:00
Cole Robinson e414fc3bdc viewers: Drop old style VNC socket handling
In all modern local cases we will be using openFD to get a direct
file descriptor from the VM, so this code should never be triggered
nowadays

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 16:49:52 -04:00
Cole Robinson 940bd3873e console: Replace auth-rejected with auth-error signal
Should be similar here. auth-rejected is hard to trigger anyways

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 16:17:45 -04:00
Cole Robinson d5f7089ef2 uitests: finish engine.py coverage
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 16:17:45 -04:00
Cole Robinson b0294a1bc6 testmock: Split apart the first-run option
Break it into disable-libguestfs, fake-systemd-success, and
firstrun-uri suboptions, and adjust using code to match

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 15:04:49 -04:00
Cole Robinson 7769d9a1e4 engine: Move the first run systemd handling to connectauth.py
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 13:23:34 -04:00
Cole Robinson 64e3ff1d08 uitests: console/keyring/viewer coverage work
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-29 13:23:34 -04:00
Cole Robinson 2c86eefa5b virt-manager: Drop the DISPLAY error handling
Gtk nowadays doesn't raise an exception, it just exits directly

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