Skip ubuntu external tests on OSP17.0 and later

Due to a problem with ubuntu-images when config-drive is enabled,
these tests need to be skipped on OSP17.0 and later releases

Change-Id: Ia03defe90d01af406da77821a36007179315f644
This commit is contained in:
Eduardo Olivares 2022-06-23 17:54:51 +02:00 committed by Federico Ressi
parent bd7d0353cf
commit 3c54611e22
2 changed files with 23 additions and 9 deletions

View File

@ -18,6 +18,7 @@ import typing
import tobiko
from tobiko import config
from tobiko.openstack import glance
from tobiko.openstack import topology
from tobiko.openstack.stacks import _nova
from tobiko.openstack.stacks import _vlan
from tobiko.shell import sh
@ -217,6 +218,7 @@ class UbuntuServerStackFixture(UbuntuMinimalServerStackFixture,
return self.image_fixture.vlan_device
@topology.skip_unless_osp_version('17.0', lower=True)
class UbuntuExternalServerStackFixture(UbuntuServerStackFixture,
_nova.ExternalServerStackFixture):
"""Ubuntu server with port on special external network

View File

@ -682,18 +682,28 @@ def remove_duplications(items: typing.List) -> typing.List:
def _is_version_matched(current, required, higher=False, lower=False):
if not higher and not lower:
# return True means the condition has been fulfilled and next items do not
# need to be compared
# return False means the condition has not been fulfilled and next items do
# not need to be compared
# return None means the condition has been fulfilled so far, but next items
# need to be compared too
if not higher and not lower: # this means equal
if int(current) != int(required):
return False
elif higher and lower:
pass
else:
return None
elif higher:
if int(current) < int(required):
return False
elif lower:
if int(current) > int(required):
return False
return True
else:
raise RuntimeError
if int(current) != int(required):
return True
# else: return None
def verify_osp_version(version, higher=False, lower=False):
@ -708,11 +718,13 @@ def verify_osp_version(version, higher=False, lower=False):
os_version = current_version.split('.')
required_version = version.split('.')
for version_type in range(len(required_version)):
if not _is_version_matched(os_version[version_type],
required_version[version_type],
higher=higher,
lower=lower):
correct_version = False
is_version_match = _is_version_matched(
os_version[version_type],
required_version[version_type],
higher=higher,
lower=lower)
if is_version_match is not None:
correct_version = is_version_match
break
return correct_version