summaryrefslogtreecommitdiff
path: root/tests/test_urls.py
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2019-01-30 11:48:42 -0500
committerCole Robinson <crobinso@redhat.com>2019-02-03 12:05:18 -0500
commit5df6bc2ba52a2aa60a8269518d5f881cdaba8557 (patch)
tree67ca9675873ff2186f2b5a545a5c264833ef7aee /tests/test_urls.py
parent9e4287321f0159673571cff68cc3f09a3fcf8acf (diff)
downloadvirt-manager-5df6bc2ba52a2aa60a8269518d5f881cdaba8557.tar.gz
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
Diffstat (limited to 'tests/test_urls.py')
-rw-r--r--tests/test_urls.py51
1 files changed, 2 insertions, 49 deletions
diff --git a/tests/test_urls.py b/tests/test_urls.py
index 4bfd0b4e..47390834 100644
--- a/tests/test_urls.py
+++ b/tests/test_urls.py
@@ -17,15 +17,6 @@ from virtinst import Guest
from virtinst import urldetect
from virtinst import urlfetcher
from virtinst import util
-from virtinst.urldetect import ALTLinuxDistro
-from virtinst.urldetect import CentOSDistro
-from virtinst.urldetect import DebianDistro
-from virtinst.urldetect import FedoraDistro
-from virtinst.urldetect import GenericTreeinfoDistro
-from virtinst.urldetect import MandrivaDistro
-from virtinst.urldetect import RHELDistro
-from virtinst.urldetect import SuseDistro
-from virtinst.urldetect import UbuntuDistro
class _URLTestData(object):
@@ -39,7 +30,6 @@ class _URLTestData(object):
self.url = url
self.detectdistro = detectdistro
self.arch = self._find_arch()
- self.distroclass = self._distroclass_for_name(self.name)
self.kernelarg = kernelarg
self.kernelregex = kernelregex
@@ -50,30 +40,6 @@ class _URLTestData(object):
# and exercises the shortcircuit infrastructure
self.testshortcircuit = testshortcircuit
- def _distroclass_for_name(self, name):
- # Map the test case name to the expected urldetect distro
- # class we should be detecting
- if "fedora" in name:
- return FedoraDistro
- if "centos" in name:
- return CentOSDistro
- if "rhel" in name:
- return RHELDistro
- if "suse" in name:
- return SuseDistro
- if "debian" in name:
- return DebianDistro
- if "ubuntu" in name:
- return UbuntuDistro
- if "mageia" in name:
- return MandrivaDistro
- if "altlinux" in name:
- return ALTLinuxDistro
- if "generic" in name:
- return GenericTreeinfoDistro
- raise RuntimeError("name=%s didn't map to any distro class. Extend "
- "_distroclass_for_name" % name)
-
def _find_arch(self):
if ("i686" in self.url or
"i386" in self.url or
@@ -153,15 +119,6 @@ def _testURL(fetcher, testdata):
if not s:
continue
- if not isinstance(s, testdata.distroclass):
- raise AssertionError("Unexpected URLDistro class:\n"
- "found = %s\n"
- "expect = %s\n\n"
- "testname = %s\n"
- "url = %s" %
- (s.__class__, testdata.distroclass, distname,
- fetcher.location))
-
# Make sure the stores are reporting correct distro name/variant
if detectdistro != s.get_osdict_info():
raise AssertionError(
@@ -169,10 +126,9 @@ def _testURL(fetcher, testdata):
"found = %s\n"
"expect = %s\n\n"
"testname = %s\n"
- "url = %s\n"
- "store = %s" %
+ "url = %s\n" %
(s.get_osdict_info(), detectdistro,
- distname, fetcher.location, testdata.distroclass))
+ distname, fetcher.location))
# Fetch regular kernel
kernel, initrd = hvmstore.check_kernel_paths()
@@ -204,9 +160,6 @@ def _fetchWrapper(url, cb):
def _testURLWrapper(testdata):
os.environ.pop("VIRTINST_TEST_SUITE", None)
- logging.debug("Testing for media arch=%s distroclass=%s",
- testdata.arch, testdata.distroclass)
-
sys.stdout.write("\nTesting %-25s " % testdata.name)
sys.stdout.flush()