Cole Robinson
1684049fa3
virtManager: Misc coverage annotations
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:06 -04:00
Cole Robinson
dc41f61e5e
uitests: Add combo selection helpers and use them
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:06 -04:00
Cole Robinson
c405dd2741
setup: Add --tb=native to pytest options
...
I find it much easier to read
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:06 -04:00
Cole Robinson
3f59d9de84
uitests: More usage of storagebrowser helper
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:06 -04:00
Cole Robinson
73b61ffbc9
uitests: Use our loop check() helper for all asserts
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:06 -04:00
Cole Robinson
627fa2f611
addhardware: Simplify input_pretty_name
...
Drop the 'Generic' prefix for all strings which isn't particularly
meaningful.
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
147f918ffd
addhardware: Use dictionary pattern for pretty labels
...
It's shorter and saves us the pain of adding coverage
for every option
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
ab92693a56
uitests: finish preferences.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
b1ddc6344a
uitests: make test_createvm.py asserts more robust
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
fd5216c184
uitests: Finish createconn.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
35d4687237
uitests: Rename test_newvm.py to test_createvm.py
...
To mirror the code name
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
bb1180fb40
Move virtmanager test cli handling to testmock.py
...
We will be adding more stuff here, so let's move it out
of the main virt-manager script
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
5ccbcb898f
uitests: Finish netlist.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
ea49c1d932
netlist: Rework the 'no network' case
...
Always force a network selection. If we have to fall back to
manual bridge UI because nothing else exists, show a warning.
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
0283f26ace
uitests: test createvm.py with an inactive default network
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
153dcba126
uitests: test createvm.py with an empty connection
...
Fix the 'No networking' createvm case that it shows was broken
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
7fef49e99f
uitests: Test createvm.py with a fake session URI
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
463c42773c
createvm: Drop explicit warning about no net + URL install
...
This case should be exceedingly rare, and we already show
a visual warning about 'no network'. So let's drop this
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
aab71cc4d0
tests: Move all testdriver XML to the same dir
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
bc32852e17
connection: Remove unused 'vm-renamed' signal
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
f15cdd732d
graphics: Remove spice GL/rendernode version support warnings
...
The versions we are warning about are all over 4 years old, and
these warnings were initially just informative to help users know
when the config wasn't going to work. Drop most of it. Still warn
in the UI when a VM misconfig will prevent spice GL from working
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
c2dbdbfab1
uitests: Finish snapshot.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
5ecacfdfed
uitests: Finish error.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
4b4f2ddba3
uitests: Finish addstorage.py coverage
...
We need to wire up some craziness to make path permission
searching fail, but this is a critical area to get correct
so it is worth it
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
95bf8bf6b9
uitests: Cover more createvm validation checks
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
e3be4b677e
error: Remove some dead code
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
2f4aa652d3
error: Try not to split val_err over multiple lines
...
Helps grepping for val_err usage, and grepping for error strings
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
be2b308ae4
createvm: Break out _validate_oscontainer_bootstrap
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
d111df4e62
uitests: Finish uiutil.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
fea7f3e262
uitests: Finish storagebrowser.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
57f916461f
uitests: Finish fsdetails.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
7bfe8139c0
uitests: Add module_trace.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
28f57cbf2f
uitests: Finish oslist.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
fe323be0ad
uitests: Finish mediacombo.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
5c10f4e394
storagebrowse: Fix set_browse_reason
...
We can't call this at init time, we need to do UI changes on demand
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
c323ecfd55
fsdetails: Rework xml builder APIs
...
Don't have the caller call a validate function, they all catch
errors anyways. Let the build step raise error if there's a problem
Drop some validation checks that libvirt should be performing for us
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
4c439cda21
uitests: Add vsockdetails full coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
bc9d6cf6d5
Drop some explicit openvz handling
...
I don't think many, if any, people are using virt-manager with
openvz. Drop the specific handling the filesystem UI, users can use
the raw XML editor if they need special behavior
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
7a63fb95ec
object: Finish off non-domain code coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
9d34d1da0b
libvirtobject: Centralize most tick() implementations
...
Basically all non-domain objects just need to check to see
if status changed, which will also refresh the XML if
a change occurs. This all works to ensure we are initializing
XML at tick time
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
f22e060190
Always assume objects support .isActive()
...
All drivers that support the listAll APIs, which we depend on,
also are new enough to support isActive, so stop checking support
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
9a9eb165ed
uitests: Add host*.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
6f8c305d62
tests: uitests: Add createvol.py coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
0babd6b27f
createnet: Add full uitest coverage
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
886339e8dd
virtManager: add coverage annotations and remove dead code
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
27d1b4d4bd
uitests: Make test_mediachange more resilient
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
7342d9a11b
uitests: Add _click_alert_button helper
...
Centralizes a pattern we were using all over the place
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
8f4341bee8
host: Move xmleditor init earlier
...
It can be triggered via callbacks which may fire early,
so initialize it first
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
543ddba9f2
hoststorage: Fix some UI issues with initial offline conn
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
d9b3108436
hostnets: Fix some UI issues with initial offline conn
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
760d98ba64
network: Rework dhcp_leases usage to avoid dead code
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
045c8c108d
network: Drop dead code in pretty_format_mode
...
There isn't any XML that hits this case that I can find.
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
766d7c47c3
hostnets: Remove route UI label
...
This is an uncommon configuration. Users can see
the details in the XML editor
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
d0e725f439
gfxdetails: Remove explicit SDL UI fields
...
Users can look at the device XML easy enough, and very few people
are using SDL with libvirt
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
deeda106c1
createpool: Remove pool-created callback
...
The intent is this would select the newly created pool in the
UI after the user creates it. With async events though this
is racy and doesn't tend to work as expected.
It's fixable but it would likely require hanging around for
a period of time waiting for the signal to fire, which
takes more work. Just drop it
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
f61bf516df
createpool: Remove 'build' checkbox
...
We only showed it for disk pools, and it determined whether we
partition the device or not. I don't think this gets much
usage and there are much better tools for that job. If users
aren't sure what they are doing they can lose data.
Drop the UI, which always defaults to build=False for disk
pools, and expect the user to partition the device themselves.
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
c6830740f3
tests: uitests: Use keyfile to test initial conn loading
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
8dd3b8ba20
virt-manager: Add --test-options gsettings-keyfile
...
This will let us test some difficult code paths in the uitests.
Rework the `--test-options first-run` behavior to use a temporary
keyfile rather than the memory backend, to unify the code paths
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-26 15:20:05 -04:00
Cole Robinson
a121c943ef
tests: Fix failure with newer pytest
...
This is with latest packages on Fedora 33, I didn't investigate deeper
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-18 14:33:00 -04:00
Cole Robinson
bea401a2cf
domcapabilities: Fix backtrace on python3.9
...
Apparently we can't set etree 'root.attrib = None' anymore
https://bugzilla.redhat.com/show_bug.cgi?id=1869046
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-18 13:49:16 -04:00
Cole Robinson
3e0155b055
osdict: Fix resource checking inheritance
...
-1 returned from osdict resource lookup means the value is unspecified.
When we encounter that value we should also check the 'all' arch
category, instead of stop processing.
This fixes some vcpus calculation for --os-variant rhel7.0 with
latest osdict
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-08-11 16:50:50 -04:00
Cole Robinson
cd603672a8
CI: Add ci.yml
...
Run RPM build and test suite against latest fedora + virt-preview,
output and upload coverage info to codecov
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-18 19:28:04 -04:00
Cole Robinson
a2829e65e9
tests: Don't show debug output by default on failure
...
Require --log-level=debug to see output
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-18 19:28:04 -04:00
Cole Robinson
fe1747e2fc
tests: Add urldetect.py unit test coverage
...
Add data/urldetect with a bunch of distro tree content to trigger
full code coverage of virtinst/install/urldetect.py
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-18 19:28:04 -04:00
Cole Robinson
93c8e4aab3
urldetect: Drop attempt at sles9 distro detection
...
I can't find any publicly available media to test this case, I'm
not sure it does anything useful anyways, so just drop it
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-18 19:28:04 -04:00
Cole Robinson
bf1fcdcd12
urldetect: Remove 'content' parsing for opensuse tumbleweed
...
tumbleweed uses treeinfo now, so this path shouldn't be hit in
the wild anymore
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-18 19:28:04 -04:00
Cole Robinson
25b3113ba9
osdict: Drop post_install driver bits
...
osinfo library doesn't return data for these with the fedora 32
version, so it's hard to get coverage testing. Since we aren't
even using this code yet anyways, let's remove it until it is needed
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-18 19:28:04 -04:00
Cole Robinson
2170efc9a5
virtinst: Unify test code paths when run as root
...
CI runs the code as root by default, fix up some of the differences
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-18 19:28:04 -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
380a44318a
virtinst: Centralize in_testsuite checking
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 19:08:27 -04:00
Cole Robinson
44aa0b093e
tests: cli: Clean up global module data a bit
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 16:47:58 -04:00
Cole Robinson
ef0c36f0b0
tests: Speed up pytest collection a bit
...
Point it at tests/ and have it exclude search data/ dirs
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 16:47:58 -04:00
Cole Robinson
f6c6f033d9
tests: Move checkprops.py magic skipping to pytest
...
We want to skip these tests if previous tests failed or were skipped,
but current impl depends on unittest specifics. Move it to pytest
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 16:47:58 -04:00
Cole Robinson
61a947d667
tests: Rename clistate -> TESTCONFIG
...
Makes it more clear it's a constant class, and its purpose
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 16:38:40 -04:00
Cole Robinson
c01fbcc885
Rename pylintrc -> .pylintrc
...
Plain pylint calls pick that up as well
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 16:00:32 -04:00
Cole Robinson
62e7f1c521
spec: Move virt-manager.spec.in -> virt-manager.spec
...
Drop the VERSION templating. Tools today like packit and tito
work best when a working .spec file exists. The extra burden is
we need to update the version at release time, but that's no
big deal
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 16:00:32 -04:00
Cole Robinson
b9dfd92bf0
setup: Force 'rpm' to output to the git dir
...
And modernize it to use subprocess and report error output
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 16:00:32 -04:00
Cole Robinson
4226a4c1d5
setup: Kill old test_* command infrastructure
...
pytest invocations are now preferred. Leave plain `./setup.py test`
as a stub that errors and points to pytest.
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 16:00:32 -04:00
Cole Robinson
ded69ee2ce
CONTRIBUTING: Point to new pytest test steps
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 16:00:32 -04:00
Cole Robinson
92844eb2f8
tests: Wire pytest --log-level=debug to cli tests debug infrastructure
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 16:00:06 -04:00
Cole Robinson
f086c75560
tests: Add pytest --regenerate-output
...
Duplicate of ./setup.py test --regenerate-output
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 14:57:03 -04:00
Cole Robinson
0aa030245c
tests: Move setup.py test_urls suboptions to pytest
...
Adds --urls-skip-libosinfo, --urls-force-libosinfo, --urls-iso-only,
and --urls-url-only
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 14:57:03 -04:00
Cole Robinson
b90820c17d
setup.cfg: Disable warnings with pytest
...
dogtail, gtk are quite noisy
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 14:57:03 -04:00
Cole Robinson
e9b3ed509f
tests: Add pytest conftest.py
...
Makes 'pytest' and 'pytest --cov' work for the standard tests.
uitests run with `pytest --uitests --cov=virtManager`.
test_urls.py, test_dist.py, test_inject.py need to be invoked like
pytest $PATH
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 14:57:03 -04:00
Cole Robinson
4f15e2d6eb
cli: Fake fdopen to work around argcomplete bug with pytest
...
argcomplete will uncontionally try to take over fd=9 which causes
problems with pytest capturing
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 14:57:03 -04:00
Cole Robinson
247170c066
tests: cli: Make test names easier to match with pytest
...
pytest doesn't like './' in the name
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-17 13:03:54 -04:00
Cole Robinson
49cf5256d7
pylint: Ignore ngettext builtin
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-14 12:06:20 -04:00
Cole Robinson
3a6ec2fe09
CI: Add note that translations.yml runs on default branch
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-14 11:58:41 -04:00
Cole Robinson
b1f6f64e54
CI: Rename ci.yml -> translations.yml
...
If we add CI it will be in a different workflow
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-14 11:58:41 -04:00
Cole Robinson
00fa636682
tests: uitests: Fix after string changes
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-13 15:37:00 -04:00
Cole Robinson
a5cb0bb165
CONTRIBUTING: mention translations branch
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-12 17:15:33 -04:00
Cole Robinson
e2b1e2d59b
tests: dist: Add xgettext warning check
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-12 17:08:10 -04:00
Cole Robinson
f2f2822090
ci: Commit extracted messages after rebase
...
Otherwise rebase fails because state is dirty
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-12 14:04:10 -04:00
Cole Robinson
4ac7a1fac2
ci: Regenerate .pot only after rebasing to 'translations' branch
...
Otherwise we will get conflicts
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-12 13:47:15 -04:00
Cole Robinson
76eca73cc7
Update virt-manager.pot
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-12 08:58:10 -04:00
Cole Robinson
6944550218
Add github action to regenerate virt-manager.pot
...
We store this in a 'translations' branch so the master branch isn't
constantly spammed. I will merge that branch to master before release
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-12 08:57:29 -04:00
Cole Robinson
e7e7eee287
gfxdetails: Don't mark OpenGL as translatable
...
Fixes : #70
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-12 07:34:59 -04:00
Cole Robinson
35bfdc26a6
setup: Use xgettext --add-comments=translators
...
So in the code we can prefix comments with 'translators:' before
translated strings to have them show up in .pot file output
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-11 19:18:38 -04:00
Cole Robinson
14f8d2ff7a
setup: Tweak extract_messages
...
* Use long xgettext options
* Truncate .pot file upfront so every call uses --join-existing
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-11 19:18:38 -04:00
Cole Robinson
fec9f0b136
po: Fix message format warnings printed from xgettext
...
Signed-off-by: Cole Robinson <crobinso@redhat.com >
2020-07-11 19:18:38 -04:00