diff --git a/doc/source/_static/tobiko.conf.sample b/doc/source/_static/tobiko.conf.sample index f70fad3f4..5f03e917b 100644 --- a/doc/source/_static/tobiko.conf.sample +++ b/doc/source/_static/tobiko.conf.sample @@ -14,76 +14,6 @@ #verbosity = -[centos] - -# -# From tobiko -# - -# Default centos image name (string value) -#image_name = - -# Default centos image URL (string value) -#image_url = - -# Default centos image filename (string value) -#image_file = - -# Default centos container format (string value) -#container_format = - -# Default centos disk format (string value) -#disk_format = - -# Default centos username (string value) -#username = - -# Default centos password (string value) -#password = - -# Default centos SSH connection timeout (seconds) (floating point value) -#connection_timeout = - -# Allow to disable SSH auth algorithmsin order to SSH to old servers likeCirrOS ones -# (dict value) -#disabled_algorithms = - - -[centos7] - -# -# From tobiko -# - -# Default centos7 image name (string value) -#image_name = - -# Default centos7 image URL (string value) -#image_url = - -# Default centos7 image filename (string value) -#image_file = - -# Default centos7 container format (string value) -#container_format = - -# Default centos7 disk format (string value) -#disk_format = - -# Default centos7 username (string value) -#username = - -# Default centos7 password (string value) -#password = - -# Default centos7 SSH connection timeout (seconds) (floating point value) -#connection_timeout = - -# Allow to disable SSH auth algorithmsin order to SSH to old servers likeCirrOS ones -# (dict value) -#disabled_algorithms = - - [cirros] # @@ -129,41 +59,6 @@ #shelves_dir = ~/.tobiko/cache/shelves -[fedora] - -# -# From tobiko -# - -# Default fedora image name (string value) -#image_name = - -# Default fedora image URL (string value) -#image_url = - -# Default fedora image filename (string value) -#image_file = - -# Default fedora container format (string value) -#container_format = - -# Default fedora disk format (string value) -#disk_format = - -# Default fedora username (string value) -#username = - -# Default fedora password (string value) -#password = - -# Default fedora SSH connection timeout (seconds) (floating point value) -#connection_timeout = - -# Allow to disable SSH auth algorithmsin order to SSH to old servers likeCirrOS ones -# (dict value) -#disabled_algorithms = - - [glance] # @@ -380,41 +275,6 @@ #timeout = 300.0 -[rhel] - -# -# From tobiko -# - -# Default rhel image name (string value) -#image_name = - -# Default rhel image URL (string value) -#image_url = - -# Default rhel image filename (string value) -#image_file = - -# Default rhel container format (string value) -#container_format = - -# Default rhel disk format (string value) -#disk_format = - -# Default rhel username (string value) -#username = - -# Default rhel password (string value) -#password = - -# Default rhel SSH connection timeout (seconds) (floating point value) -#connection_timeout = - -# Allow to disable SSH auth algorithmsin order to SSH to old servers likeCirrOS ones -# (dict value) -#disabled_algorithms = - - [shell] # diff --git a/tobiko/openstack/glance/config.py b/tobiko/openstack/glance/config.py index d30a2aa50..51a58208e 100644 --- a/tobiko/openstack/glance/config.py +++ b/tobiko/openstack/glance/config.py @@ -27,11 +27,7 @@ OPTIONS = [ ] -GLANCE_IMAGE_NAMES = ['centos', - 'centos7', - 'cirros', - 'fedora', - 'rhel', +GLANCE_IMAGE_NAMES = ['cirros', 'ubuntu'] diff --git a/tobiko/openstack/stacks/__init__.py b/tobiko/openstack/stacks/__init__.py index f968b44cf..dc104cc68 100644 --- a/tobiko/openstack/stacks/__init__.py +++ b/tobiko/openstack/stacks/__init__.py @@ -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 diff --git a/tobiko/openstack/stacks/_centos.py b/tobiko/openstack/stacks/_centos.py deleted file mode 100644 index d0bc2af89..000000000 --- a/tobiko/openstack/stacks/_centos.py +++ /dev/null @@ -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) diff --git a/tobiko/openstack/stacks/_fedora.py b/tobiko/openstack/stacks/_fedora.py deleted file mode 100644 index 924036d52..000000000 --- a/tobiko/openstack/stacks/_fedora.py +++ /dev/null @@ -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) diff --git a/tobiko/openstack/stacks/_redhat.py b/tobiko/openstack/stacks/_redhat.py deleted file mode 100644 index 14142097c..000000000 --- a/tobiko/openstack/stacks/_redhat.py +++ /dev/null @@ -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) diff --git a/tobiko/tests/functional/openstack/stacks/test_centos.py b/tobiko/tests/functional/openstack/stacks/test_centos.py deleted file mode 100644 index 5d20c8e73..000000000 --- a/tobiko/tests/functional/openstack/stacks/test_centos.py +++ /dev/null @@ -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) diff --git a/tobiko/tests/functional/openstack/stacks/test_fedora.py b/tobiko/tests/functional/openstack/stacks/test_fedora.py deleted file mode 100644 index abd058583..000000000 --- a/tobiko/tests/functional/openstack/stacks/test_fedora.py +++ /dev/null @@ -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) diff --git a/tobiko/tests/functional/openstack/stacks/test_red_hat.py b/tobiko/tests/functional/openstack/stacks/test_red_hat.py deleted file mode 100644 index e2ea2ee31..000000000 --- a/tobiko/tests/functional/openstack/stacks/test_red_hat.py +++ /dev/null @@ -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) diff --git a/tobiko/tests/functional/shell/test_ip.py b/tobiko/tests/functional/shell/test_ip.py index fd46b6f50..9e2ff07ee 100644 --- a/tobiko/tests/functional/shell/test_ip.py +++ b/tobiko/tests/functional/shell/test_ip.py @@ -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) diff --git a/tobiko/tests/functional/shell/test_ping.py b/tobiko/tests/functional/shell/test_ping.py index 49cec5ea2..1d2f9f6fe 100644 --- a/tobiko/tests/functional/shell/test_ping.py +++ b/tobiko/tests/functional/shell/test_ping.py @@ -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) diff --git a/tobiko/tests/scenario/nova/test_server.py b/tobiko/tests/scenario/nova/test_server.py index 8975075f9..86166f50b 100644 --- a/tobiko/tests/scenario/nova/test_server.py +++ b/tobiko/tests/scenario/nova/test_server.py @@ -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)