Commit Graph

140 Commits

Author SHA1 Message Date
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
Pino Toscano 0145d9838b i18n: fix few spellings
"iSCSI", "KVM", "QEMU", "UNIX", "UUID", "VirtIO", "XML", "vCPU".

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-13 15:37:00 -04:00
Cole Robinson 3062b5ce08 virtManager: Move a lot of misc files to lib/ 2019-06-17 00:12:32 -04:00
Cole Robinson fa3f25dc1c virtManager: rename connect.py -> createconn.py
connect.py is too ambiguous, and this naming is more consistent
2019-06-17 00:12:32 -04:00
Cole Robinson 121cf5528d virtManager: rename create.py -> createvm.py
To be more consistent with other create wizard naming
2019-06-17 00:12:32 -04:00
Cole Robinson f107e39989 Switch to more traditional logging structure
Init a shared log instance in virtinst/logger.py, and use that
throughout the code base, so we aren't calling directly into
'logging'. This helps protect our logging output from being
cluttered with other library output, as happens with some
'requests' usage
2019-06-17 00:12:31 -04:00
Cole Robinson d2462367ee virt-manager: Add --test-options
Will take a string of comma separated options which we can use to
tweak app behavior, for testing. Convert the existing --test-* options
to use the same abstraction internally. This will make it easier to
add new test options in the future
2019-06-05 16:28:05 -04:00
Cole Robinson f947afc3df details: split out a top level vmwindow
vmmVMWindow handles all the menuing, and coordinating between the
console, snapshots, and details panel. Simplifies the details
code a bit which will help when we add xmlediting
2019-05-13 12:08:55 -04:00
Cole Robinson ef279273af virt-manager: add --show-domain-delete
Launches delete wizard on top of a VM window, so when domain is
deleted, VM window disappears and the whole app exits
2019-03-04 14:04:34 -05:00
Cole Robinson ae8a4f3db3 engine: Fix first run startup error (bz 1674040)
unitpath can be used uninitialized

https://bugzilla.redhat.com/show_bug.cgi?id=1674040
2019-02-08 15:50:15 -05:00
Cole Robinson a391613b9f engine: More logging for --test-first-run 2019-02-03 15:46:32 -05:00
Cole Robinson a00152d72a manager: fix some --test-leak-debug issues 2018-10-13 14:27:10 -04:00
Cole Robinson a1d1b4d5a0 engine: Drop PackageKit integration
On first run of the app we will check to see if libvirt and qemu
are installed, and if not, offer to install them. In theory anyways.
In practice this stuff breaks repeatedly and is a pain to test because
every desktop has their own API provider with subtly different behavior.

My last round of testing about 12 months ago: apper on KDE was completely
busted and apparently unmaintained (although that may have changed lately),
gnome-software is the latest packagekit provider on gnome and completely
changes the semantics of the API compared to old style gnome-packagekit
that break a lot of virt-manager assumptions.

So I'm tired of it and want it all gone. Still use systemd to try and
check if libvirtd is running, and provide error messages at startup
to guide people.
2018-10-07 14:24:05 -04:00
Cole Robinson 75c64151b1 engine: Exit app if if --show-X bits fail
We were missing some cases. Simplify the code while we are at it
and add some extra ui test cases
2018-09-30 20:55:18 -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
Daniel P. Berrangé 24a8b66b35 avoid referencing ConnectError if it is None
Currently it throws an exception at startup which is hidden unless you
run with --no-fork

  $ python3 ./virt-manager --no-fork
  Traceback (most recent call last):
    File "/home/berrange/src/virt/virt-manager/virtManager/baseclass.py", line 225, in wrap_func
      return func(*wrapargs)
    File "/home/berrange/src/virt/virt-manager/virtManager/engine.py", line 206, in conn_open_completed
      ConnectError.details)
  AttributeError: 'NoneType' object has no attribute 'details'

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 a55abc8e89 details: Again fix default page showing 2018-03-18 11:36:02 -04:00
Cole Robinson defdfd4b51 engine: Fix backtrace from manager->exit 2018-03-17 18:47:13 -04:00
Cole Robinson b5377f8f0f engine: Make a decorator function for showing startup errors 2018-03-17 18:46:40 -04:00
Cole Robinson 3c1e0a8a12 virtManager/*: Give pylint hints about singleton classes
It can't seem to figure out that what 'cls' is in this context,
so make it explicit.
2018-03-17 18:46:39 -04:00
Cole Robinson 483a8de6c1 systray: Change window tracking a bit
We should only prevent app closing if the systray is actually embedded
2018-03-17 12:18:38 -04:00
Cole Robinson dac860e8ce engine: Show modal startup errors if window open fails 2018-03-16 19:09:55 -04:00
Cole Robinson ee817c32ce s/connect_opt_out/connect_once/ for open-completed callback
Forgot about that helper function...
2018-03-16 18:05:52 -04:00
Cole Robinson ad632383c8 virt-manager: if new --connect fails, don't save the URI 2018-03-16 18:05:52 -04:00
Cole Robinson dabbc8d5bd engine: Remove centralized conn.open handling
Move connection opening logic to each caller, since needs are
slightly different.
2018-03-15 21:24:48 -04:00
Cole Robinson cad809fe80 Make all dialogs clean up when vm/conn disappears
Moves all the window cleanup handling to each class and audit for
all --test-leak-debug errors and fix
2018-03-15 21:24:48 -04:00
Cole Robinson 1d17b98852 engine: Move most remaining window tracking to UI classes
Kind of a big mess but it was difficult to untangle piecemeal.
Basically this drops nearly all the centralized window tracking
in engine.py and moves it to each UI class. If manager.py wants
to open a details window it does it directly, and vmmDetails tracks
the window object list itself. This simplifies things and makes
the code easier to follow.

There's still some weirdness with vmmConnect and connection callbacks,
but future patches will break those apart.
2018-03-15 21:24:48 -04:00
Cole Robinson 92aea7c565 engine: Have windows increment/decrement windows directly 2018-03-15 21:24:48 -04:00
Cole Robinson 9fa9777f1c engine: Have windows call exit_app directly 2018-03-15 21:24:48 -04:00
Cole Robinson 6180a3c81f engine: Cleanup function names, comments, etc. 2018-03-15 21:24:48 -04:00
Cole Robinson 58f872a205 clone: Convert to per-connection singleton-ish pattern
And convert the dialog VM handling to match other dialogs
2018-03-15 21:24:48 -04:00
Cole Robinson b94a9fdffb migrate: convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson 65b512ae6f delete: Convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson 1780d0e9f0 details: Call inspection VM refresh directly 2018-03-15 21:24:48 -04:00
Cole Robinson f088537798 engine: break out vmmConnectionManager
Have a separate class for tracking the connection list, and emitting
conn-added and conn-removed signals. It exists as a singleton instance
that UI classes can talk directly to
2018-03-15 21:24:48 -04:00
Cole Robinson befafe9dc7 engine: connect conn-added in UI classes
This creates a weird situation where we pass the engine to those
classes UI functions, but this is a step towards untangling that.

While here, get rid of the conn-added connect magic and add a
simpler way to access the connection list from the engine
2018-03-15 21:24:48 -04:00
Cole Robinson 6b1278ccda prefs: Add a setting to enable/disable libguestfs inspection
Rather than key it on the library being available. Makes it much
easier to test both modes of behavior.

Fix up a few inspection bugs while I'm in the area, and convert
it to be more singleton like.
2018-03-15 21:24:48 -04:00
Cole Robinson 33def3c4af preferences: Convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson b6a61818af about: Convert to singleton 2018-03-15 21:24:48 -04:00
Cole Robinson 717ff72684 engine: Move VM action callbacks to vmmenu.py
Call the callbacks directly rather than using signals. engine.py
has become a bit of a catchall for shared functionality and this
is a step towards disentangling it
2018-03-15 21:24:48 -04:00
Cole Robinson 6ad6f44920 connection: Call virConnectClose and log the return value
This can help us find object leaks within the code. virConnectClose
is just a deference and will return 1 if other references are still
floating around.
2018-03-15 21:24:48 -04:00
Cole Robinson 7e1cddef18 virt-manager: Add hidden --test-leak-debug option
That enables the pre-existing debug_ref_leaks behavior
2018-03-15 21:24:48 -04:00
Cole Robinson 56cf42e6ea engine: Only init systray if launching new app
We were doing it too early, and the systray could pop up for a moment
when connecting to a remote app
2018-03-15 21:24:48 -04:00
Radostin Stoyanov 5854b7bb17 Replace "Queue" with "queue"
The Queue module has been renamed to queue in Python 3. [1]

[1] https://docs.python.org/2/library/queue.html
2018-02-06 18:49:17 -05:00
Radostin Stoyanov 978fb25ac7 Wrap keys(), values() in a list
In Python 3 dict.values() [1] , dict.keys() [2] and dict.items() [3]
return a view [4] of the dictionary’s values, keys and items.

In Python 2 these functions return a list. [5] [6] [7]

To resolve this we can convert the result of these function to a list.

[1] https://docs.python.org/3/library/stdtypes.html#dict.values
[2] https://docs.python.org/3/library/stdtypes.html#dict.keys
[3] https://docs.python.org/3/library/stdtypes.html#dict.items
[4] https://docs.python.org/3/library/stdtypes.html#dict-views
[5] https://docs.python.org/2/library/stdtypes.html#dict.items
[6] https://docs.python.org/2/library/stdtypes.html#dict.keys
[7] https://docs.python.org/2/library/stdtypes.html#dict.values
2018-02-06 18:49:17 -05:00
Cole Robinson b4a2c46f6a virt-manager: If --connect passed, wait for it to init
...before showing the UI. This helps the UI test suite be less
racy at least.
2018-01-09 13:51:53 -05:00