Commit Graph

6677 Commits

Author SHA1 Message Date
Cole Robinson
195d775c5b installertree: abspath convert MEDIA_DIR
Various parts of the code implicitly expect an absolute path
2019-06-09 10:50:21 -04:00
Cole Robinson
e8e8853c22 guest: Don't log when setting default os name=generic 2019-06-09 10:48:13 -04:00
Cole Robinson
0113455065 tests: osdict: add basic list_os unittest 2019-06-09 10:40:26 -04:00
Cole Robinson
d9b41bf887 tests: Add clitest coverage for network-install resources 2019-06-09 10:14:48 -04:00
Cole Robinson
f6a4326a9a unattended: Drop glib/gio usage
Use native python lib bits to do timezone and locale lookup
2019-06-09 09:50:28 -04:00
Cole Robinson
4a04af38f1 tests: clitest: Add windows unattended unittest 2019-06-08 15:33:37 -04:00
Cole Robinson
d3b20b16d0 unattended: Don't use custom subdir for storing tempfiles
The reason this was done, is because we need to inject files with
certain names into the initrd/cdrom media so the guest OS can find
them, but our injection infrastructure didn't have the knowledge
necessary to rename files at injection time.

Having to deal with the subdir complicates cleanup and unattended
data generation, so let's do away with it. Teach the injection
bits about renaming, and adjust all the related bits to use
standard tempdirs
2019-06-08 15:25:12 -04:00
Cole Robinson
3495a8f1f9 unattended: Share more script generation bits
- Break out the installer* unattended prep to its own function
- Move logging into common unattended call
- Use libosinfo APIs to generate script str, then we write it
- Move commandline lookup to installertreemedia
- Rename path->scriptpath for clarity
2019-06-08 14:16:52 -04:00
Cole Robinson
08baf0ee5f unattended: Handle libosinfo returning kernel url arg
Latest libosinfo will handle this. Check for it so we don't end up
with double options on the command line
2019-06-08 13:03:08 -04:00
Cole Robinson
95d685420b connection: Fix --location with --connect test:///default
Some scratchdir changes made us now attempt vol upload, which doesn't
work for the test driver. Make sure we don't attempt kernelupload
for this case
2019-06-08 12:58:38 -04:00
Cole Robinson
635361f0bd tests: Add osinfo URL and URL unattended tests 2019-06-08 10:20:36 -04:00
Cole Robinson
1914f0f6cd initrdinject: Try harder to clean up tempdir on error 2019-06-08 09:55:09 -04:00
Cole Robinson
756dab784c kernelupload: Add test suite mocking 2019-06-08 09:41:52 -04:00
Cole Robinson
f01a534cfb tests: Use testsuirebr0 as the fake bridge name
It's more obvious in the output than 'eth0'
2019-06-08 09:24:33 -04:00
Cole Robinson
b97003ddfc interface: Get more unittest coverage of _default_* 2019-06-08 09:24:25 -04:00
Cole Robinson
f3b0830cf3 tests: Add run_without_testsuite_hacks decorator 2019-06-08 09:11:00 -04:00
Cole Robinson
e9dcb4056d installer: Rework some test suite urlfetcher hacking
Rather than alter where we save the files, behave like normal but
only change what we store in the XML
2019-06-07 21:40:47 -04:00
Cole Robinson
af12b32928 osdict: Don't use a variable named 'os' 2019-06-07 21:26:02 -04:00
Cole Robinson
37adfb0150 urlfetcher: Add http and ftp unit test mocking 2019-06-07 21:25:41 -04:00
Cole Robinson
9fc20d4a97 osdict: Fix url arg detection for fedora-rawhide distro 2019-06-07 21:13:51 -04:00
Cole Robinson
6caa085f6c tests: test_urls: Update 2019-06-07 21:13:51 -04:00
Cole Robinson
388850f04e virtinst: Rename util to xmlutil
The only functions left in there are largely for xml handling, so
make it explicit
2019-06-07 18:21:24 -04:00
Cole Robinson
6677f677da util: move generate_name to generatename.py 2019-06-07 18:16:53 -04:00
Cole Robinson
5ed8f2aa5f util: move validate_name to XMLBuilder.validate_generic_name 2019-06-07 18:04:12 -04:00
Cole Robinson
c2de4d7c36 util: Move get_cache_dir to VirtinstConnection
Renaming it get_app_cache_dir so it doesn't conflict with get_cache_dir
usage in virtManager
2019-06-07 17:53:15 -04:00
Cole Robinson
e6262435d6 unattended: Move gi require_version to virtinst import
Otherwise depending on import order this bit needs to be moved around
2019-06-07 17:45:21 -04:00
Cole Robinson
c603ea4084 util: Move *_meter to progress.py 2019-06-07 17:32:51 -04:00
Cole Robinson
6f5cd58ead util: Move pretty_* into virtManager code 2019-06-07 17:21:25 -04:00
Cole Robinson
b34800decd util: Move local_libvirt_version to VirtinstConnection
Make it private because we want people to use
conn.local_libvirt_version, and adjust the one other user
2019-06-07 17:15:10 -04:00
Cole Robinson
7d17d5d03b virtinst: Run register_libvirt_error_handler on import
We basically want this everywhere, and transparently, so run it on
import like we do for gettext setup
2019-06-07 16:56:57 -04:00
Cole Robinson
ca10e4094b util: move is_error_nosupport to SupportCache 2019-06-07 16:49:19 -04:00
Cole Robinson
ecc3e3d34e support: add is_libvirt_error_no_domain
Repurpose the generic util.exception_is_libvirt_error for the one
purpose that it's actually used, add it as a SupportCache staticmethod,
and test it
2019-06-07 16:44:14 -04:00
Cole Robinson
f85e6def55 support: Convert callers to the new format 2019-06-07 16:26:03 -04:00
Cole Robinson
566a4681a8 support: Rework support check invocations
SupportCache.check_support(SUPPORT_FOOBAR, args) becomes
SupportCache.foobar(args)

And SupportCache absorbs the caching infrastructure from
VirtinstConnection.

For now we add some hackery to hide the API change from callers, but
this will be undone in the next patch
2019-06-07 16:25:39 -04:00
Cole Robinson
3d2f678c0f support: Add a SupportCache class
For now it just contains all the SUPPORT ID numbers and public
functions.
2019-06-07 15:56:23 -04:00
Cole Robinson
281e796538 connection: Use weakref.proxy instead of weakref.ref
Works more like expected, let's us drop a hack in devicedisk
2019-06-07 15:53:36 -04:00
Cole Robinson
657c729f08 installertreemedia: Clarify scratchdir logic a bit 2019-06-07 14:13:25 -04:00
Cole Robinson
2a4a03e37a util: Move scratchdir helpers to InstallerTreeMedia
They are only really needed by the Installer handling
2019-06-07 14:00:00 -04:00
Fabiano Fidêncio
fd5bd5d90f installer: Prefer "cdrom" over "floppy"
Instead of using "floppy" as the way to perform unattended installations
for Windoes, let's prefer using "cdrom" instead.

The main reasons behind this change are:
- VMs using q35 may have floppy device disabled in some systems;
- We can drop mstools dependency;

Generating the ISO depends on genisofs, tho. However, it's not a big
deal as genisofs is already a virt-manager dependency.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-06-07 13:41:57 -04:00
Fabiano Fidêncio
473f5c14d6 installer*.py: Remove temporary dirs
Together with the temporary files removal, let's also remove the
directories created to store those files.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-06-07 13:41:57 -04:00
Fabiano Fidêncio
2dd006d6f2 installer: Log when cleaning up the unattended files
Similarly to what's already done in installertreeinfo.py, let's log when
removing the files used during the unattended installation.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-06-07 13:41:57 -04:00
Fabiano Fidêncio
98bd275969 unattended: Do not create a "unattended" dir
Let's just use mktemp() as done in several other places and avoid the
risk of having the content of the folder overwritten in case of parallel
installations.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-06-07 13:41:57 -04:00
Cole Robinson
e58d765ae5 tests: xmlconfig: Add tests for real uuid and mac generation 2019-06-06 18:35:36 -04:00
Cole Robinson
2bd08bee64 util: Move generate_uuid to a Guest staticmethod 2019-06-06 18:24:23 -04:00
Cole Robinson
f4f8cfb33b util: Remove validate_macaddr
Libvirt does this for us
2019-06-06 18:11:01 -04:00
Cole Robinson
f47f6f3c7c util: Replace xml_indent with textwrap.indent 2019-06-06 18:11:01 -04:00
Cole Robinson
50addfebca nodedev: Drop the non-standard .parse() handling 2019-06-05 16:35:34 -04:00
Cole Robinson
ab0c99057b nodedev: Fold DRMDevice into NodeDevice 2019-06-05 16:35:34 -04:00
Cole Robinson
87b2ea4672 nodedev: Fold SCSIBus into NodeDevice 2019-06-05 16:35:34 -04:00
Cole Robinson
8d13125564 nodedev: Fold StorageDevice into NodeDevice 2019-06-05 16:35:34 -04:00