Remove Fedora, Centos and RHEL from tobiko tests

The scenario tests were not really executed because they were marked as
flaky.
The benefit from using this images in some functional tests is irrelevant
compared with the impact in job duration and stability.
Due to these reasons, it has been decided to use only cirros and ubuntu
(for the test that required advanced images).

Change-Id: I168b1f071b3a77eb0b24586fd403d12165db1db2
This commit is contained in:
Eduardo Olivares 2023-05-18 09:26:52 +02:00
parent 0962d8e266
commit 38e7f70acc
12 changed files with 1 additions and 587 deletions

View File

@ -14,76 +14,6 @@
#verbosity = <None>
[centos]
#
# From tobiko
#
# Default centos image name (string value)
#image_name = <None>
# Default centos image URL (string value)
#image_url = <None>
# Default centos image filename (string value)
#image_file = <None>
# Default centos container format (string value)
#container_format = <None>
# Default centos disk format (string value)
#disk_format = <None>
# Default centos username (string value)
#username = <None>
# Default centos password (string value)
#password = <None>
# Default centos SSH connection timeout (seconds) (floating point value)
#connection_timeout = <None>
# Allow to disable SSH auth algorithmsin order to SSH to old servers likeCirrOS ones
# (dict value)
#disabled_algorithms = <None>
[centos7]
#
# From tobiko
#
# Default centos7 image name (string value)
#image_name = <None>
# Default centos7 image URL (string value)
#image_url = <None>
# Default centos7 image filename (string value)
#image_file = <None>
# Default centos7 container format (string value)
#container_format = <None>
# Default centos7 disk format (string value)
#disk_format = <None>
# Default centos7 username (string value)
#username = <None>
# Default centos7 password (string value)
#password = <None>
# Default centos7 SSH connection timeout (seconds) (floating point value)
#connection_timeout = <None>
# Allow to disable SSH auth algorithmsin order to SSH to old servers likeCirrOS ones
# (dict value)
#disabled_algorithms = <None>
[cirros]
#
@ -129,41 +59,6 @@
#shelves_dir = ~/.tobiko/cache/shelves
[fedora]
#
# From tobiko
#
# Default fedora image name (string value)
#image_name = <None>
# Default fedora image URL (string value)
#image_url = <None>
# Default fedora image filename (string value)
#image_file = <None>
# Default fedora container format (string value)
#container_format = <None>
# Default fedora disk format (string value)
#disk_format = <None>
# Default fedora username (string value)
#username = <None>
# Default fedora password (string value)
#password = <None>
# Default fedora SSH connection timeout (seconds) (floating point value)
#connection_timeout = <None>
# Allow to disable SSH auth algorithmsin order to SSH to old servers likeCirrOS ones
# (dict value)
#disabled_algorithms = <None>
[glance]
#
@ -380,41 +275,6 @@
#timeout = 300.0
[rhel]
#
# From tobiko
#
# Default rhel image name (string value)
#image_name = <None>
# Default rhel image URL (string value)
#image_url = <None>
# Default rhel image filename (string value)
#image_file = <None>
# Default rhel container format (string value)
#container_format = <None>
# Default rhel disk format (string value)
#disk_format = <None>
# Default rhel username (string value)
#username = <None>
# Default rhel password (string value)
#password = <None>
# Default rhel SSH connection timeout (seconds) (floating point value)
#connection_timeout = <None>
# Allow to disable SSH auth algorithmsin order to SSH to old servers likeCirrOS ones
# (dict value)
#disabled_algorithms = <None>
[shell]
#

View File

@ -27,11 +27,7 @@ OPTIONS = [
]
GLANCE_IMAGE_NAMES = ['centos',
'centos7',
'cirros',
'fedora',
'rhel',
GLANCE_IMAGE_NAMES = ['cirros',
'ubuntu']

View File

@ -15,11 +15,8 @@
# under the License.
from __future__ import absolute_import
from tobiko.openstack.stacks import _centos
from tobiko.openstack.stacks import _cirros
from tobiko.openstack.stacks import _designate
from tobiko.openstack.stacks import _fedora
from tobiko.openstack.stacks import _redhat
from tobiko.openstack.stacks import _l3ha
from tobiko.openstack.stacks import _neutron
from tobiko.openstack.stacks import _nova
@ -29,11 +26,6 @@ from tobiko.openstack.stacks import _ubuntu
from tobiko.openstack.stacks import _vlan
CentosFlavorStackFixture = _centos.CentosFlavorStackFixture
CentosImageFixture = _centos.CentosImageFixture
CentosServerStackFixture = _centos.CentosServerStackFixture
Centos7ServerStackFixture = _centos.Centos7ServerStackFixture
CirrosFlavorStackFixture = _cirros.CirrosFlavorStackFixture
CirrosImageFixture = _cirros.CirrosImageFixture
CirrosServerStackFixture = _cirros.CirrosServerStackFixture
@ -54,14 +46,6 @@ MultiIPCirrosServerStackFixture = (
DesignateZoneStackFixture = _designate.DesignateZoneStackFixture
FedoraFlavorStackFixture = _fedora.FedoraFlavorStackFixture
FedoraImageFixture = _fedora.FedoraImageFixture
FedoraServerStackFixture = _fedora.FedoraServerStackFixture
RedHatFlavorStackFixture = _redhat.RedHatFlavorStackFixture
RhelImageFixture = _redhat.RhelImageFixture
RedHatServerStackFixture = _redhat.RedHatServerStackFixture
L3haNetworkStackFixture = _l3ha.L3haNetworkStackFixture
L3haServerStackFixture = _l3ha.L3haServerStackFixture
L3haPeerServerStackFixture = _l3ha.L3haPeerServerStackFixture

View File

@ -1,77 +0,0 @@
# Copyright 2019 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
import tobiko
from tobiko import config
from tobiko.openstack import glance
from tobiko.openstack.stacks import _nova
CONF = config.CONF
CENTOS_IMAGE_URL = (
'https://cloud.centos.org/centos/8/x86_64/images/'
'CentOS-8-GenericCloud-8.4.2105-20210603.0.x86_64.qcow2')
class CentosImageFixture(glance.URLGlanceImageFixture):
image_url = CONF.tobiko.centos.image_url or CENTOS_IMAGE_URL
image_name = CONF.tobiko.centos.image_name
image_file = CONF.tobiko.centos.image_file
disk_format = CONF.tobiko.centos.disk_format or "qcow2"
container_format = CONF.tobiko.centos.container_format or "bare"
username = CONF.tobiko.centos.username or 'centos'
password = CONF.tobiko.centos.password
connection_timeout = CONF.tobiko.centos.connection_timeout or 800.
disabled_algorithms = CONF.tobiko.centos.disabled_algorithms
CENTOS7_IMAGE_URL = (
'https://cloud.centos.org/centos/7/images/'
'CentOS-7-x86_64-GenericCloud.qcow2.xz')
class Centos7ImageFixture(glance.URLGlanceImageFixture):
image_url = CONF.tobiko.centos7.image_url or CENTOS7_IMAGE_URL
image_name = CONF.tobiko.centos7.image_name
image_file = CONF.tobiko.centos7.image_file
disk_format = CONF.tobiko.centos7.disk_format or "qcow2"
container_format = CONF.tobiko.centos7.container_format or "bare"
username = CONF.tobiko.centos7.username or 'centos'
password = CONF.tobiko.centos7.password
connection_timeout = CONF.tobiko.centos7.connection_timeout or 800.
class CentosFlavorStackFixture(_nova.FlavorStackFixture):
ram = 512
swap = 1024
class CentosServerStackFixture(_nova.CloudInitServerStackFixture):
#: Glance image used to create a Nova server instance
image_fixture = tobiko.required_fixture(CentosImageFixture)
#: Flavor used to create a Nova server instance
flavor_stack = tobiko.required_fixture(CentosFlavorStackFixture)
# I expect CentOS based servers to be very slow to boot
is_reachable_timeout = 900.
class Centos7ServerStackFixture(CentosServerStackFixture):
#: Glance image used to create a Nova server instance
image_fixture = tobiko.required_fixture(Centos7ImageFixture)

View File

@ -1,64 +0,0 @@
# Copyright 2019 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
import typing
import tobiko
from tobiko import config
from tobiko.openstack import glance
from tobiko.openstack.stacks import _nova
CONF = config.CONF
FEDORA_IMAGE_URL = (
'https://download.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/'
'x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2')
class FedoraBaseImageFixture(glance.URLGlanceImageFixture):
image_url = CONF.tobiko.fedora.image_url or FEDORA_IMAGE_URL
image_name = CONF.tobiko.fedora.image_name
image_file = CONF.tobiko.fedora.image_file
disk_format = CONF.tobiko.fedora.disk_format or "qcow2"
container_format = CONF.tobiko.fedora.container_format or "bare"
username = CONF.tobiko.fedora.username or 'fedora'
password = CONF.tobiko.fedora.password
connection_timeout = CONF.tobiko.fedora.connection_timeout or 800.
disabled_algorithms = CONF.tobiko.fedora.disabled_algorithms
class FedoraImageFixture(FedoraBaseImageFixture,
glance.CustomizedGlanceImageFixture):
@property
def run_commands(self) -> typing.List[str]:
return super().run_commands + [
'update-crypto-policies --set LEGACY']
class FedoraFlavorStackFixture(_nova.FlavorStackFixture):
ram = 256
swap = 1024
class FedoraServerStackFixture(_nova.CloudInitServerStackFixture):
#: Glance image used to create a Nova server instance
image_fixture = tobiko.required_fixture(FedoraImageFixture)
#: Flavor used to create a Nova server instance
flavor_stack = tobiko.required_fixture(FedoraFlavorStackFixture)

View File

@ -1,87 +0,0 @@
# Copyright 2020 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
import functools
from oslo_log import log
import requests
import tobiko
from tobiko import config
from tobiko.openstack import glance
from tobiko.openstack.stacks import _centos
LOG = log.getLogger(__name__)
CONF = config.CONF
RHEL_IMAGE_MAJOR_VERSION = '8.4'
RHEL_IMAGE_MINOR_VERSION = '1313'
RHEL_IMAGE_URL = ('https://url.corp.redhat.com/rhel-guest-image-'
f'{RHEL_IMAGE_MAJOR_VERSION.replace(".", "-")}-'
f'{RHEL_IMAGE_MINOR_VERSION}-x86-64-qcow2')
def skip_unless_has_rhel_image():
return tobiko.skip_unless('RHEL image not found',
has_rhel_image)
@functools.lru_cache()
def has_rhel_image() -> bool:
image_url = tobiko.get_fixture(RhelImageFixture).image_url
try:
response = requests.get(image_url, stream=True)
except requests.exceptions.ConnectionError as ex:
LOG.debug(f'RHEL image file not found at {image_url}: {ex}',
exc_info=1)
return False
if response.status_code == 404:
LOG.debug(f'RHEL image file not found at {image_url}')
return False
response.raise_for_status()
LOG.debug(f'RHEL image file found at {image_url}')
return True
@skip_unless_has_rhel_image()
class RhelImageFixture(glance.URLGlanceImageFixture):
image_url = CONF.tobiko.rhel.image_url or RHEL_IMAGE_URL
image_name = CONF.tobiko.rhel.image_name
image_file = CONF.tobiko.rhel.image_file
disk_format = CONF.tobiko.rhel.disk_format or "qcow2"
container_format = CONF.tobiko.rhel.container_format or "bare"
username = CONF.tobiko.rhel.username or 'cloud-user'
password = CONF.tobiko.rhel.password
connection_timeout = CONF.tobiko.rhel.connection_timeout
disabled_algorithms = CONF.tobiko.rhel.disabled_algorithms
class RedHatFlavorStackFixture(_centos.CentosFlavorStackFixture):
pass
class RedHatServerStackFixture(_centos.CentosServerStackFixture):
#: Glance image used to create a Nova server instance
# (alternative is given for cases the RHEL image is failed to be
# set up)
image_fixture = tobiko.required_fixture(RhelImageFixture)
#: Flavor used to create a Nova server instance
flavor_stack = tobiko.required_fixture(RedHatFlavorStackFixture)

View File

@ -1,59 +0,0 @@
# Copyright (c) 2019 Red Hat, Inc.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
import tobiko
from tobiko.shell import sh
from tobiko.openstack import keystone
from tobiko.openstack import nova
from tobiko.openstack import stacks
from tobiko.tests.functional.openstack.stacks import test_cirros
@keystone.skip_unless_has_keystone_credentials()
class CentosServerStackTest(test_cirros.CirrosServerStackTest):
"""Test CentOS server instance"""
#: Stack of resources with a server attached to a floating IP
stack = tobiko.required_fixture(stacks.CentosServerStackFixture)
def test_user_data(self):
user_data = self.stack.user_data
self.assertEqual('', user_data)
def test_python(self):
python_version = sh.execute(['/usr/libexec/platform-python',
'--version'],
ssh_client=self.stack.ssh_client).stdout
self.assertTrue(python_version.startswith('Python 3.'),
python_version)
def test_cloud_init_done(self):
nova.wait_for_cloud_init_done(ssh_client=self.stack.ssh_client)
@tobiko.skip("Can't SSH to CentOS 7 server")
@keystone.skip_unless_has_keystone_credentials()
class Centos7ServerStackTest(CentosServerStackTest):
#: Stack of resources with a server attached to a floating IP
stack = tobiko.required_fixture(stacks.Centos7ServerStackFixture)
def test_python(self):
python_version = sh.execute(['python', '--version'],
ssh_client=self.stack.ssh_client).stderr
self.assertTrue(python_version.startswith('Python 2.'),
python_version)

View File

@ -1,47 +0,0 @@
# Copyright (c) 2019 Red Hat, Inc.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
import tobiko
from tobiko.shell import sh
from tobiko.openstack import keystone
from tobiko.openstack import nova
from tobiko.openstack import stacks
from tobiko.tests.functional.openstack.stacks import test_cirros
@keystone.skip_unless_has_keystone_credentials()
class FedoraServerStackTest(test_cirros.CirrosServerStackTest):
"""Test Fedora server instance"""
#: Stack of resources with a server attached to a floating IP
stack = tobiko.required_fixture(stacks.FedoraServerStackFixture)
nameservers_filenames = ('/run/systemd/resolve/resolv.conf',)
def test_user_data(self):
user_data = self.stack.user_data
self.assertEqual('', user_data)
def test_python3(self):
python_version = sh.execute(['/usr/bin/python3',
'--version'],
ssh_client=self.stack.ssh_client).stdout
self.assertTrue(python_version.startswith('Python 3.'),
python_version)
def test_cloud_init_done(self):
nova.wait_for_cloud_init_done(ssh_client=self.stack.ssh_client)

View File

@ -1,29 +0,0 @@
# Copyright (c) 2020 Red Hat, Inc.
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
import tobiko
from tobiko.openstack import keystone
from tobiko.openstack import stacks
from tobiko.tests.functional.openstack.stacks import test_centos
@keystone.skip_unless_has_keystone_credentials()
class RedHatServerStackTest(test_centos.CentosServerStackTest):
"""Test Red Hat server instance"""
#: Stack of resources with a server attached to a floating IP
stack = tobiko.required_fixture(stacks.RedHatServerStackFixture)

View File

@ -29,15 +29,9 @@ from tobiko.tests.functional.shell import _fixtures
class IpTest(testtools.TestCase):
centos_stack = tobiko.required_fixture(
stacks.CentosServerStackFixture)
cirros_stack = tobiko.required_fixture(
stacks.CirrosServerStackFixture)
fedora_stack = tobiko.required_fixture(
stacks.FedoraServerStackFixture)
ubuntu_stack = tobiko.required_fixture(
stacks.UbuntuServerStackFixture)
@ -86,15 +80,9 @@ class IpTest(testtools.TestCase):
def test_list_ip_addresses_with_ipv6(self):
self.test_list_ip_addresses(ip_version=6)
def test_list_ip_addresses_with_centos_server(self):
self.test_list_ip_addresses(ssh_client=self.centos_stack.ssh_client)
def test_list_ip_addresses_with_cirros_server(self):
self.test_list_ip_addresses(ssh_client=self.cirros_stack.ssh_client)
def test_list_ip_addresses_with_fedora_server(self):
self.test_list_ip_addresses(ssh_client=self.fedora_stack.ssh_client)
def test_list_ip_addresses_with_ubuntu_server(self):
self.test_list_ip_addresses(ssh_client=self.ubuntu_stack.ssh_client)
@ -155,14 +143,6 @@ class IpTest(testtools.TestCase):
self.assertIsInstance(namespace, str)
self.test_list_ip_addresses(network_namespace=namespace)
@pytest.mark.flaky(reruns=3, reruns_delay=5)
def test_list_namespaces_with_centos_server(self):
self.test_list_namespaces(ssh_client=self.centos_stack.ssh_client)
@pytest.mark.flaky(reruns=3, reruns_delay=5)
def test_list_namespaces_with_fedora_server(self):
self.test_list_namespaces(ssh_client=self.fedora_stack.ssh_client)
@pytest.mark.flaky(reruns=3, reruns_delay=5)
def test_list_namespaces_with_ubuntu_server(self):
self.test_list_namespaces(ssh_client=self.ubuntu_stack.ssh_client)

View File

@ -220,16 +220,6 @@ class CirrosPingTest(PingTest):
return self.stack.ssh_client
class CentosPingTest(CirrosPingTest):
stack = tobiko.required_fixture(stacks.CentosServerStackFixture)
class FedoraPingTest(CirrosPingTest):
stack = tobiko.required_fixture(stacks.FedoraServerStackFixture)
class UbuntuPingTest(CirrosPingTest):
stack = tobiko.required_fixture(stacks.UbuntuServerStackFixture)

View File

@ -217,36 +217,3 @@ class UbuntuServerStackFixture(CloudInitServerStackFixture,
class UbuntuServerTest(BaseServerTest):
__test__ = True
stack = tobiko.required_fixture(UbuntuServerStackFixture)
class FedoraServerStackFixture(CloudInitServerStackFixture,
stacks.FedoraServerStackFixture):
pass
@pytest.mark.flaky(reruns=2, reruns_delay=60)
class FedoraServerTest(BaseServerTest):
__test__ = True
stack = tobiko.required_fixture(FedoraServerStackFixture)
class CentosServerStackFixture(CloudInitServerStackFixture,
stacks.CentosServerStackFixture):
pass
@pytest.mark.flaky(reruns=2, reruns_delay=60)
class CentosServerTest(BaseServerTest):
__test__ = True
stack = tobiko.required_fixture(CentosServerStackFixture)
class RedhatServerStackFixture(CloudInitServerStackFixture,
stacks.RedHatServerStackFixture):
pass
@pytest.mark.flaky(reruns=2, reruns_delay=60)
class RedhatServerTest(BaseServerTest):
__test__ = True
stack = tobiko.required_fixture(RedhatServerStackFixture)