Commit Graph

86 Commits

Author SHA1 Message Date
Cole Robinson
be15a01bb2 tests: test_urls: require explicit distro= value
Most tests have a distro= value specified already. Make distro=none
required for those tests since they are limited
2019-03-02 16:52:24 -05:00
Cole Robinson
41b276ffcd installertreemedia: Don't carry around _Distro internally
Detect the distro, and pull out all the data we need into an internal
cache. This will simplify future improvements
2019-02-03 12:05:18 -05:00
Cole Robinson
bcb13bfbfa tests: test_urls: Add some additional failure cases 2019-02-03 12:05:18 -05:00
Cole Robinson
f7619cdcda tests: test_urls: Use installer, not _Distro directly 2019-02-03 12:05:18 -05:00
Cole Robinson
5df6bc2ba5 test_urls: Drop comparison against _Distro class
Future changes to use libosinfo more are going to break
this. Comparing against detected os_variant should be
mostly sufficient
2019-02-03 12:05:18 -05:00
Cole Robinson
9e4287321f urlfetcher: Drop explicit prepare/cleanup calls
We can do this automatically easily enough. The downsides of
not cleaning up are pretty minor these days anyways without
the 'mount' handling
2019-02-03 12:05:18 -05:00
Cole Robinson
9995ebc86b urldetect: Kill acquireKernel
Decompose it into a helper to probe for available kernel paths, but leave
the actual file fetching up to the installer class
2019-02-03 12:05:18 -05:00
Cole Robinson
c38be50dcb urldetect: Use fedora-unknown more
Instead of the magic to look up latest OS... fedora-unknown is meant
for that usecase.
2019-01-08 16:02:34 -05:00
Marc Hartmayer
6476a6a489 test_urls: simplify the sorting
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 14:46:00 -05:00
Fabiano Fidêncio
7612c5bdcd osdict: expand the "unknown" check for any distro
Currently osinfo-db has "unknown" entries for fedora, opensuse and
asianux. Considering this list may grow even more at some point, let's
just make the check more generic and use it for all of them instead of
keeping it for fedora only.

Changes have also been done in urldetect and tests_url, as those also
used latest_fedora_version().

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2018-12-05 15:04:59 +01:00
Cole Robinson
49f469a034 test_urls: Always check for distro value 2018-10-18 13:43:12 -04:00
Cole Robinson
cd122b9387 test_urls: Drop dead code
This is solved by the "testsuite-fedora-rawhide" hack
2018-10-18 13:36:16 -04:00
Cole Robinson
fe9aa7085b test_urls: Add kernelregex= option
For verifying detected kernel paths. Add a few basic examples. I
will use this in my local iso test suite for checking debian
iso vs http-iso case
2018-10-18 13:21:44 -04:00
Cole Robinson
8ff2043f2a urldetect: Drop boot.iso fetching
Since this was only used for the --cdrom $treeurl case, this is
no longer used
2018-10-12 15:54:39 -04:00
Cole Robinson
6063538750 guest: Replace os_variant with set_os_name
And have callers directly access osinfo.name if they need it
2018-09-12 17:24:28 -04:00
Cole Robinson
568841835d urldetect: Standardize _detect_version naming
This is the hook that subclasses use to save a detect os_variant value
2018-04-24 11:34:53 -04:00
Cole Robinson
a9ad2426b0 test_urls: Improve error output 2018-04-24 11:33:12 -04:00
Cole Robinson
105a6d20be tests: urls: Fix custom ini file usage 2018-04-16 11:36:39 -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
Cole Robinson
83a1c43490 tests: test_urls: Look for manual.ini in ~/.config/virt-manager
Rather than deal with ignoring it in the source tree
2018-04-03 15:29:03 -04:00
Cole Robinson
eafdaf8b48 tests: test_urls: Add urldetect kernel arg validation 2018-04-02 17:15:05 -04:00
Cole Robinson
ad13c57dc5 urlfetch: Formalize the failed hostname check
This heuristic is only valid for http connections, everything
else will fail way earlier in the process
2018-03-29 19:45:33 -04:00
Cole Robinson
5055d7bd19 urlfetcher: Clean up RHEL version parsing/handling
Drop SLDistro entirely because it adds nothing, just make it an
alias of Centos. Drop some old RHEL version logic. Tweak test cases
2018-03-29 19:45:33 -04:00
Cole Robinson
b9e72b8609 urldetect: Move treeinfo media checking into Treeinfo class
Rather than in the base Distro class. Simplifies things a bit
2018-03-29 16:23:57 -04:00
Cole Robinson
5aedc0aff7 urldetect: Drop GenericDistro, non-treeinfo redhat bits
non-treeinfo redhat only applies to pre RHEL5.4 and very old
Fedora. It's not worth it anymore to slow down all URL lookups
and maintain code complexity to handle such long out of date
distros.

GenericDistro doesn't actually apply to any public trees that I
can find, except for some with TreeInfo. So turn it into
GenericTreeinfoDistro. If random URL trees want to work with
virt-install, add a treeinfo file
2018-03-29 16:23:57 -04:00
Cole Robinson
a8522032eb virtinst: Split out urldetect.py from urlfetcher.py
urldetect.py has all the distro metadata and parsing logic,
urlfetcher.py has the http/ftp/iso/etc. fetching logic
2018-03-28 18:46:07 -04:00
Cole Robinson
35df66c1ed tests: test_urls: Make fedora distro checking a bit smarter
Rather than constantly require updating distro values for latest
Fedora when osinfo-db catches up, build some smarts into the
test suite
2018-03-28 14:56:52 -04:00
Cole Robinson
74f2fb73fd tests: test_urls: Rename distroobj->testdata
Makes it much more clear what it is
2018-03-28 14:40:41 -04:00
Cole Robinson
b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Cole Robinson
6954c6774a tests: Fix running testsuite on older libvirt
If we try to run the testsuite on anything older than libvirt 3.1,
it immediately throws an exception before processing any tests,
due to choking on parsing drm bits from testdriver.xml. This global
failure is only due to sloppy coding though.

Turn all test cases that use testdriver.xml into skips in this case,
so we can at least get some test coverage otherwise.
2018-02-22 16:01:24 -05:00
Cole Robinson
c05cd52772 setup: Use CLIState for setting --debug value 2018-02-22 15:18:47 -05:00
Cole Robinson
8917305a6e Don't use count() for substring checking
Use the idiomatic 'X in Y'
2018-02-14 11:08:09 -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
Radostin Stoyanov
810ee09292 Replace ConfigParser with configparser
The ConfigParser module has been renamed to configparser in
Python 3. [1] Backport of this changes is also available for
Python 2. [2]

[1] https://docs.python.org/2/library/configparser.html
[2] https://pypi.python.org/pypi/configparser/3.2.0r3
2018-02-06 18:49:17 -05:00
Cole Robinson
5e70cee128 tests: urls: Fix pylint 2018-01-27 16:12:11 -05:00
Cole Robinson
1f23d60725 tests: urls: Tweak output and logging a bit 2018-01-27 15:28:12 -05:00
Cole Robinson
c9ca8ab7ce tests: test_urls: Simplify adding in local tests
I'll use this to scoop up local ISOs for comprehensive testing
locally.
2018-01-06 14:04:34 -05:00
Cole Robinson
c7ed34de63 tests: test_urls: Big rework
Move all the test cases to an .ini file. Various cleanups and
minor improvements throughout
2018-01-06 14:04:34 -05:00
Cole Robinson
9b58ea4e51 tests: test_urls: Update URL list 2017-11-22 17:32:20 -05:00
Cole Robinson
2d27142c9c tests: urls: check for latest ubuntu LTS 2017-09-19 19:55:57 -04:00
Pavel Hrdina
4b108a8c75 tests: fix pylint
Commit g785352ea removed unused variable and felt unused import.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-09-09 10:55:47 +02:00
Cole Robinson
170a169fcc test_urls: Remove dead link 2017-09-08 16:58:45 -04:00
Cole Robinson
785352ea60 tests: Fix pylint 2017-09-08 16:55:49 -04:00
Cole Robinson
427592bc7b tests: test_urls: Add debian s390x example 2017-08-29 11:57:45 -04:00
Cole Robinson
9cffcef66e tests: test_urls: Update
And only have one ftp test, since ftp is sloooow
2017-08-29 11:57:14 -04:00
Cole Robinson
d71ef83942 tests: test_urls: Rework to better handle multiple archs 2017-08-29 11:57:14 -04:00
Radostin Stoyanov
b93cc3bbc9 pycodestyle: Do not use bare 'except:'
A bare 'except:' catches all exceptions [1], including SystemExit,
KeyboardInterrupt, and GeneratorExit (which is not an error and should
not normally be caught by user code). In situations where you need to
catch all “normal” errors, you can catch the base class for all normal
exceptions, Exception [2].

[1] https://docs.python.org/2/howto/doanddont.html#except
[2] https://docs.python.org/2/library/exceptions.html#Exception
2017-08-02 13:57:43 -04:00
Cole Robinson
69f19ca614 tests: test_urls: Update 2017-05-16 17:16:59 -04:00
Cole Robinson
62feeb02a8 Switch to python3 style 'except X as Y' notation
Which also works with python2.7
2017-05-05 14:52:11 -04:00
Cole Robinson
e369580450 tests: test_urls: update data 2016-12-13 14:36:24 -05:00