mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 21:18:04 +03:00
tests: Move OLD_OSINFO check to central place
Other tests may need it in the future
This commit is contained in:
parent
9edca3486a
commit
877cbade4a
@ -14,7 +14,6 @@ import sys
|
||||
import traceback
|
||||
import unittest
|
||||
|
||||
import virtinst
|
||||
from tests import virtinstall, virtclone, virtconvert, virtxml
|
||||
from tests import utils
|
||||
|
||||
@ -22,10 +21,7 @@ os.environ["LANG"] = "en_US.UTF-8"
|
||||
os.environ["HOME"] = "/tmp"
|
||||
os.environ["DISPLAY"] = ":3.4"
|
||||
|
||||
OLD_OSINFO = False
|
||||
if virtinst.OSDB.lookup_os("rhel7.0"):
|
||||
OLD_OSINFO = not virtinst.OSDB.lookup_os("rhel7.0").supports_usb3()
|
||||
|
||||
OLD_OSINFO = utils.has_old_osinfo()
|
||||
TMP_IMAGE_DIR = "/tmp/__virtinst_cli_"
|
||||
XMLDIR = "tests/cli-test-xml"
|
||||
|
||||
|
@ -29,6 +29,15 @@ class _CLIState(object):
|
||||
clistate = _CLIState()
|
||||
|
||||
|
||||
def has_old_osinfo():
|
||||
# Some tests rely on newer osinfo data. Check for a new condition
|
||||
# here, and older tests will be skipped
|
||||
osname = "rhel7.0"
|
||||
if not virtinst.OSDB.lookup_os(osname):
|
||||
return True
|
||||
return not virtinst.OSDB.lookup_os(osname).supports_usb3()
|
||||
|
||||
|
||||
class _URIs(object):
|
||||
def __init__(self):
|
||||
self._conn_cache = {}
|
||||
|
Loading…
Reference in New Issue
Block a user