diff --git a/doc/source/_static/tobiko.conf.sample b/doc/source/_static/tobiko.conf.sample index b623f8cdc..b476bb136 100644 --- a/doc/source/_static/tobiko.conf.sample +++ b/doc/source/_static/tobiko.conf.sample @@ -253,11 +253,11 @@ # Default SSH key type to login to server instances (string value) #key_type = ecdsa -# Timeout (in seconds) for establishing connection to ubuntu (floating point value) -#ubuntu_connection_timeout = 1500.0 +# Timeout (in seconds) for establishing connection to advanced vms (floating point value) +#advanced_vm_connection_timeout = 1500.0 -# Timeout (in seconds) till ubuntu server is reachable (floating point value) -#ubuntu_is_reachable_timeout = 900.0 +# Timeout (in seconds) till advanced vm is reachable (floating point value) +#advanced_vm_is_reachable_timeout = 900.0 # Timeout (in seconds) till cloud-init based server is reachable (floating point value) #cloudinit_is_reachable_timeout = 600.0 @@ -510,31 +510,31 @@ #overcloud_groups_dict = cmp:compute,ctrl:controller -[ubuntu] +[advanced_vm] # # From tobiko # -# Default ubuntu image name (string value) +# Default advanced_vm image name (string value) #image_name = -# Default ubuntu image URL (string value) +# Default advanced_vm image URL (string value) #image_url = -# Default ubuntu container format (string value) +# Default advanced_vm container format (string value) #container_format = -# Default ubuntu disk format (string value) +# Default advanced_vm disk format (string value) #disk_format = -# Default ubuntu username (string value) +# Default advanced_vm username (string value) #username = -# Default ubuntu password (string value) +# Default advanced_vm password (string value) #password = -# Default ubuntu SSH connection timeout (seconds) (floating point value) +# Default advanced_vm SSH connection timeout (seconds) (floating point value) #connection_timeout = # Allow to disable SSH auth algorithmsin order to SSH to old servers likeCirrOS ones diff --git a/infrared_plugin/plugin.spec b/infrared_plugin/plugin.spec index 73917a532..0b7579261 100644 --- a/infrared_plugin/plugin.spec +++ b/infrared_plugin/plugin.spec @@ -256,29 +256,25 @@ subparsers: help: Skip Swift containers healthchecks when CephAdm is deployed ansible_variable: ceph_rgw default: False - ubuntu-connection-timeout: + advanced-vm-connection-timeout: type: Value help: | - Timeout error is raised if a connection to an ubuntu instance + Timeout error is raised if a connection to an advanced_vm instance is not successful before it expires - ansible_variable: ubuntu_connection_timeout - ubuntu-is-reachable-timeout: + ansible_variable: advanced_vm_connection_timeout + advanced-vm-is-reachable-timeout: type: Value help: | - Timeout error is raised if an ubuntu instance is not reachable + Timeout error is raised if an advanced_vm instance is not reachable before it expires - ansible_variable: ubuntu_is_reachable_timeout - ubuntu-vm-nic-name: + ansible_variable: advanced_vm_is_reachable_timeout + customized-fedora-image-url: type: Value help: | - NIC name expected on Ubuntu VM instances. - When Openstack spawns these VMs, their NIC (usually they - only have one NIC and one VLAN on that NIC) name is usually - "ens3", but with some Openstack versions, it is "enp3s0". - Defaults to "enp3s0" because it is the value obtained with - Openstack versions that use infrared. - default: "enp3s0" - ansible_variable: ubuntu_nic_name + URL to customized fedora image that tobiko ansible roles will + download and will be used to create Advanced VM instances and + run tests on them. + ansible_variable: customized_fedora_image_url cleanup-containerlist-file: type: Bool help: | diff --git a/infrared_plugin/roles/tobiko-ir-run/tasks/main.yaml b/infrared_plugin/roles/tobiko-ir-run/tasks/main.yaml index bf798db55..eb3191f45 100644 --- a/infrared_plugin/roles/tobiko-ir-run/tasks/main.yaml +++ b/infrared_plugin/roles/tobiko-ir-run/tasks/main.yaml @@ -54,6 +54,16 @@ - name: "download images" include_role: name=tobiko-download-images + vars: + fedora_image_override_pattern: + advanced_vm: + customized: true + url: "{{ customized_fedora_image_url | default('') }}" + download_images_override: >- + {{ + customized_fedora_image_url is defined | + ternary(fedora_image_override_pattern, {}) + }} - name: "initialize test execution" include_role: name=tobiko-configure diff --git a/roles/tobiko-common/defaults/main.yaml b/roles/tobiko-common/defaults/main.yaml index b7e27a1a5..e36b8c8ab 100644 --- a/roles/tobiko-common/defaults/main.yaml +++ b/roles/tobiko-common/defaults/main.yaml @@ -59,24 +59,30 @@ test_collect_dir: '{{ test_src_dir | realpath }}/{{ test_report_name }}' # --- download-images options ------------------------------------------------- download_images_dir: "{{ ansible_user_dir }}/.downloaded-images" -download_images: - ubuntu-customized: - type: ubuntu - url: "https://cloud-images.ubuntu.com/minimal/releases/jammy/release/ubuntu-22.04-minimal-cloudimg-amd64.img" +download_images_default: + advanced_vm: + username: fedora + type: advanced_vm + url: "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2" customized: false + copy_in_files: + - nginx_id.conf + - iperf3-server.service customize_command_pattern: > LIBGUESTFS_BACKEND=direct virt-customize -a $TMPPATH - --firstboot-command 'sh -c "hostname > /var/www/html/id"' - --install iperf3,iputils-ping,ncat,nginx,vlan - --run-command 'echo "[Unit]\nDescription=iperf3 server on port %i\nAfter=syslog.target network.target\n\n[Service]\nExecStart=/usr/bin/iperf3 -s -p %i\nRestart=always\nUser=root\n\n[Install]\nWantedBy=multi-user.target\nDefaultInstance=5201\n" - > /etc/systemd/system/iperf3-server@.service' - --run-command 'systemctl enable iperf3-server@5201' - --run-command 'echo "8021q" >> /etc/modules' - --run-command - 'echo "network:\n version: 2\n vlans:\n vlan101:\n dhcp4: true\n dhcp4-overrides:\n use-routes: false\n dhcp6: true\n dhcp6-overrides:\n use-routes: false\n id: 101\n link: {{ ubuntu_nic_name }}\n" - > /etc/netplan/75-tobiko-vlan.yaml' + --firstboot-command 'sh -c "nmcli connection add type vlan con-name vlan101 ifname vlan101 vlan.parent eth0 vlan.id 101 ipv6.addr-gen-mode default-or-eui64; + chown -R nginx:nginx /var/lib/nginx/ /var/log/nginx/; setenforce 0; systemctl restart nginx.service"' + --install iperf3,iputils,nmap-ncat,nginx + --copy-in /tmp/nginx_id.conf:/etc/nginx/conf.d + --run-command 'systemctl enable nginx' + --copy-in /tmp/iperf3-server.service:/etc/systemd/system + --run-command 'systemctl enable iperf3-server' + --root-password password:tobiko + --selinux-relabel -# NIC name expected on Ubuntu VM instances. -# Depending on the openstack version, it has been observed the Ubuntu VM -# instances are created with an interface named 'ens3' or 'enp3s0' -ubuntu_nic_name: 'ens3' +download_images: >- + {{ + download_images_default | + combine(download_images_override | default({}), recursive=True) + }} +# download_images_override can be provided with more images or with values to override the default ones from download_images_default diff --git a/roles/tobiko-configure/defaults/main.yaml b/roles/tobiko-configure/defaults/main.yaml index a6b7af78f..00a04d65d 100644 --- a/roles/tobiko-configure/defaults/main.yaml +++ b/roles/tobiko-configure/defaults/main.yaml @@ -18,8 +18,8 @@ test_default_conf: ceph_rgw: "{{ ceph_rgw }}" nova: - ubuntu_connection_timeout: "{{ ubuntu_connection_timeout }}" - ubuntu_is_reachable_timeout: "{{ ubuntu_is_reachable_timeout }}" + advanced_vm_connection_timeout: "{{ advanced_vm_connection_timeout }}" + advanced_vm_is_reachable_timeout: "{{ advanced_vm_is_reachable_timeout }}" manila: share_protocol: "{{ manila_share_protocol }}" @@ -38,7 +38,7 @@ overcloud_ssh_username: '' ceph_rgw: '' -ubuntu_connection_timeout: '' -ubuntu_is_reachable_timeout: '' +advanced_vm_connection_timeout: '' +advanced_vm_is_reachable_timeout: '' manila_share_protocol: '' diff --git a/roles/tobiko-configure/tasks/main.yaml b/roles/tobiko-configure/tasks/main.yaml index fabfac689..b9e125a83 100644 --- a/roles/tobiko-configure/tasks/main.yaml +++ b/roles/tobiko-configure/tasks/main.yaml @@ -25,6 +25,11 @@ - section: "{{ dict_value.type }}" option: image_url value: "file://{{ download_images_dir }}/{{ file_name }}" + {% if dict_value.username is defined %} + - section: "{{ dict_value.type }}" + option: username + value: "{{ dict_value.username }}" + {% endif %} {% endfor %} vars: diff --git a/roles/tobiko-download-images/files/iperf3-server.service b/roles/tobiko-download-images/files/iperf3-server.service new file mode 100644 index 000000000..3959453af --- /dev/null +++ b/roles/tobiko-download-images/files/iperf3-server.service @@ -0,0 +1,11 @@ +[Unit] +Description=iperf3 server on port 5201 +After=syslog.target network.target + +[Service] +ExecStart=/usr/bin/iperf3 -s -p 5201 +Restart=always +User=root + +[Install] +WantedBy=multi-user.target diff --git a/roles/tobiko-download-images/files/nginx_id.conf b/roles/tobiko-download-images/files/nginx_id.conf new file mode 100644 index 000000000..16f671a3c --- /dev/null +++ b/roles/tobiko-download-images/files/nginx_id.conf @@ -0,0 +1,5 @@ +server{ + listen 80; + listen [::]:80; + location /id { add_header Content-Type text/plain; return 200 '$hostname';} +} diff --git a/roles/tobiko-download-images/tasks/download-and-customize.yaml b/roles/tobiko-download-images/tasks/download-and-customize.yaml new file mode 100644 index 000000000..d2acc6ee1 --- /dev/null +++ b/roles/tobiko-download-images/tasks/download-and-customize.yaml @@ -0,0 +1,36 @@ +--- + +- name: download images + get_url: + dest: "{{ download_images_dir }}/{{ dl_image.key }}" + url: "{{ dl_image.value.url }}" + register: download + retries: 5 + until: download is success + +- name: copy files needed for image customization + copy: + src: "{{ item }}" + dest: "/tmp/{{ item }}" + force: true + mode: "0644" + loop: "{{ dl_image.value.copy_in_files }}" + when: + - dl_image.value.copy_in_files is defined + +- name: customize images + # root needed to avoid the supermin issue: + # https://github.com/virt-manager/virt-bootstrap/issues/9 + become: yes + vars: + image_file_path: "{{ download_images_dir }}/{{ dl_image.key }}" + shell: | + set -xe + TMPPATH=$(mktemp) + cp {{ image_file_path }} $TMPPATH + {{ dl_image.value.customize_command_pattern }} + mv $TMPPATH {{ image_file_path }} + chmod a+r {{ image_file_path }} + when: + - not (dl_image.value.customized | default(False) | bool) + - dl_image.value.customize_command_pattern is defined diff --git a/roles/tobiko-download-images/tasks/main.yaml b/roles/tobiko-download-images/tasks/main.yaml index acb2bb94a..dc8d4dc21 100644 --- a/roles/tobiko-download-images/tasks/main.yaml +++ b/roles/tobiko-download-images/tasks/main.yaml @@ -5,34 +5,13 @@ state: directory dest: "{{ download_images_dir }}" -- name: download images - get_url: - dest: "{{ download_images_dir }}/{{ item.key }}" - url: "{{ item.value.url }}" - register: download - retries: 5 - until: download is success - with_dict: "{{ download_images }}" - - name: install libguestfs-tools become: true package: name: libguestfs-tools -- name: customize images -# root needed to avoid the supermin issue: -# https://github.com/virt-manager/virt-bootstrap/issues/9 - become: yes - vars: - image_file_path: "{{ download_images_dir }}/{{ item.key }}" - shell: | - set -xe - TMPPATH=$(mktemp) - cp {{ image_file_path }} $TMPPATH - {{ item.value.customize_command_pattern }} - mv $TMPPATH {{ image_file_path }} - chmod a+r {{ image_file_path }} - when: - - not (item.value.customized | default(False) | bool) - - item.value.customize_command_pattern is defined - with_dict: "{{ download_images }}" +- name: "download and customize images" + include_tasks: download-and-customize.yaml + loop: '{{ download_images | dict2items }}' + loop_control: + loop_var: dl_image diff --git a/tobiko/openstack/glance/config.py b/tobiko/openstack/glance/config.py index 9c98b1d01..170bccfc4 100644 --- a/tobiko/openstack/glance/config.py +++ b/tobiko/openstack/glance/config.py @@ -28,7 +28,7 @@ OPTIONS = [ GLANCE_IMAGE_NAMES = ['cirros', - 'ubuntu'] + 'advanced_vm'] def register_tobiko_options(conf): diff --git a/tobiko/openstack/neutron/config.py b/tobiko/openstack/neutron/config.py index e8b5fbe1b..bb1b03fd1 100644 --- a/tobiko/openstack/neutron/config.py +++ b/tobiko/openstack/neutron/config.py @@ -29,11 +29,7 @@ OPTIONS = [ default=24, help="The mask bits for IPv4 subnets"), cfg.ListOpt('ipv4_dns_nameservers', - # This value is a workaround to avoid UbuntuExternalPortTest - # failures - with certain ubuntu images, routes to the - # nameservers were added to a VLAN interface, breaking - # connectivity from the VMs to the external network. - default=["8.8.8.8"], + default=None, help="List of nameservers IPv4 addresses"), cfg.StrOpt('ipv6_cidr', default='fc00::/48', diff --git a/tobiko/openstack/nova/config.py b/tobiko/openstack/nova/config.py index d8126131a..704dde794 100644 --- a/tobiko/openstack/nova/config.py +++ b/tobiko/openstack/nova/config.py @@ -28,13 +28,13 @@ OPTIONS = [ cfg.StrOpt('key_type', default=DEFAULT_KEY_TYPE, help="Default SSH key type to login to server instances"), - cfg.FloatOpt('ubuntu_connection_timeout', + cfg.FloatOpt('advanced_vm_connection_timeout', default=1500., help="Timeout (in seconds) for establishing connection " - "to ubuntu"), - cfg.FloatOpt('ubuntu_is_reachable_timeout', + "to advanced_vm"), + cfg.FloatOpt('advanced_vm_is_reachable_timeout', default=900., - help="Timeout (in seconds) till ubuntu server is reachable"), + help="Timeout (in seconds) till advanced_vm is reachable"), cfg.FloatOpt('cloudinit_is_reachable_timeout', default=600., help="Timeout (in seconds) till cloud-init based server is " diff --git a/tobiko/openstack/stacks/__init__.py b/tobiko/openstack/stacks/__init__.py index fdeb12d55..063cb237e 100644 --- a/tobiko/openstack/stacks/__init__.py +++ b/tobiko/openstack/stacks/__init__.py @@ -22,7 +22,7 @@ from tobiko.openstack.stacks import _neutron from tobiko.openstack.stacks import _nova from tobiko.openstack.stacks import _octavia from tobiko.openstack.stacks import _qos -from tobiko.openstack.stacks import _ubuntu +from tobiko.openstack.stacks import _advanced_vm from tobiko.openstack.stacks import _vlan @@ -92,10 +92,11 @@ QosNetworkStackFixture = _qos.QosNetworkStackFixture QosPolicyStackFixture = _qos.QosPolicyStackFixture QosServerStackFixture = _qos.QosServerStackFixture -UbuntuFlavorStackFixture = _ubuntu.UbuntuFlavorStackFixture -UbuntuImageFixture = _ubuntu.UbuntuImageFixture -UbuntuServerStackFixture = _ubuntu.UbuntuServerStackFixture -UbuntuExternalServerStackFixture = _ubuntu.UbuntuExternalServerStackFixture +AdvancedFlavorStackFixture = _advanced_vm.AdvancedFlavorStackFixture +AdvancedImageFixture = _advanced_vm.AdvancedImageFixture +AdvancedServerStackFixture = _advanced_vm.AdvancedServerStackFixture +AdvancedExternalServerStackFixture = \ + _advanced_vm.AdvancedExternalServerStackFixture VlanNetworkStackFixture = _vlan.VlanNetworkStackFixture VlanProxyServerStackFixture = _vlan.VlanProxyServerStackFixture diff --git a/tobiko/openstack/stacks/_ubuntu.py b/tobiko/openstack/stacks/_advanced_vm.py similarity index 64% rename from tobiko/openstack/stacks/_ubuntu.py rename to tobiko/openstack/stacks/_advanced_vm.py index 49a3af8e6..8090c65ae 100644 --- a/tobiko/openstack/stacks/_ubuntu.py +++ b/tobiko/openstack/stacks/_advanced_vm.py @@ -23,24 +23,10 @@ from tobiko.shell import sh CONF = config.CONF -IPERF3_SERVICE_FILE = """ -[Unit] -Description=iperf3 server on port %i -After=syslog.target network.target - -[Service] -ExecStart=/usr/bin/iperf3 -s -p %i -Restart=always -User=root - -[Install] -WantedBy=multi-user.target -DefaultInstance=5201 -""" -class UbuntuImageFixture(glance.UrlGlanceImageFixture): - """Ubuntu server image running an HTTP server +class AdvancedImageFixture(glance.UrlGlanceImageFixture): + """Advanced server image running an HTTP server The server has additional installed packages compared to the minimal one: @@ -49,32 +35,27 @@ class UbuntuImageFixture(glance.UrlGlanceImageFixture): - ping - ncat - nginx - - vlan The image will also have below running services: - nginx HTTP server listening on TCP port 80 - iperf3 server listening on TCP port 5201 """ - image_url = CONF.tobiko.ubuntu.image_url - image_name = CONF.tobiko.ubuntu.image_name - disk_format = CONF.tobiko.ubuntu.disk_format or "qcow2" - container_format = CONF.tobiko.ubuntu.container_format or "bare" - username = CONF.tobiko.ubuntu.username or 'ubuntu' - password = CONF.tobiko.ubuntu.password or 'ubuntu' - connection_timeout = CONF.tobiko.nova.ubuntu_connection_timeout - disabled_algorithms = CONF.tobiko.ubuntu.disabled_algorithms - is_reachable_timeout = CONF.tobiko.nova.ubuntu_is_reachable_timeout + image_url = CONF.tobiko.advanced_vm.image_url + image_name = CONF.tobiko.advanced_vm.image_name + disk_format = CONF.tobiko.advanced_vm.disk_format or "qcow2" + container_format = CONF.tobiko.advanced_vm.container_format or "bare" + username = CONF.tobiko.advanced_vm.username or 'cloud-user' + connection_timeout = CONF.tobiko.nova.advanced_vm_connection_timeout + disabled_algorithms = CONF.tobiko.advanced_vm.disabled_algorithms + is_reachable_timeout = CONF.tobiko.nova.advanced_vm_is_reachable_timeout # port of running HTTP server http_port = 80 - # port of running Iperf3 server iperf3_port = 5201 - @property - def iperf3_service_name(self) -> str: - return f"iperf3-server@{self.iperf3_port}.service" + iperf3_service_name = "iperf3-server.service" @property def vlan_id(self) -> int: @@ -85,14 +66,14 @@ class UbuntuImageFixture(glance.UrlGlanceImageFixture): return f'vlan{self.vlan_id}' -class UbuntuFlavorStackFixture(_nova.FlavorStackFixture): +class AdvancedFlavorStackFixture(_nova.FlavorStackFixture): ram = 256 swap = 512 -class UbuntuServerStackFixture(_nova.CloudInitServerStackFixture, - _vlan.VlanServerStackFixture): - """Ubuntu server running an HTTP server +class AdvancedServerStackFixture(_nova.CloudInitServerStackFixture, + _vlan.VlanServerStackFixture): + """Advanced server running an HTTP server The server has additional commands compared to the minimal one: @@ -101,9 +82,9 @@ class UbuntuServerStackFixture(_nova.CloudInitServerStackFixture, """ #: Glance image used to create a Nova server instance - image_fixture = tobiko.required_fixture(UbuntuImageFixture) + image_fixture = tobiko.required_fixture(AdvancedImageFixture) #: Flavor used to create a Nova server instance - flavor_stack = tobiko.required_fixture(UbuntuFlavorStackFixture) + flavor_stack = tobiko.required_fixture(AdvancedFlavorStackFixture) @property def is_reachable_timeout(self) -> tobiko.Seconds: @@ -114,6 +95,7 @@ class UbuntuServerStackFixture(_nova.CloudInitServerStackFixture, def http_port(self) -> int: return self.image_fixture.http_port + # port of running Iperf3 server @property def iperf3_port(self) -> int: return self.image_fixture.iperf3_port @@ -140,7 +122,7 @@ class UbuntuServerStackFixture(_nova.CloudInitServerStackFixture, @topology.skip_unless_osp_version('17.0', lower=True) -class UbuntuExternalServerStackFixture(UbuntuServerStackFixture, - _nova.ExternalServerStackFixture): - """Ubuntu server with port on special external network +class AdvancedExternalServerStackFixture(AdvancedServerStackFixture, + _nova.ExternalServerStackFixture): + """Advanced server with port on special external network """ diff --git a/tobiko/openstack/stacks/_octavia.py b/tobiko/openstack/stacks/_octavia.py index 1fc7ae45d..65ab51032 100644 --- a/tobiko/openstack/stacks/_octavia.py +++ b/tobiko/openstack/stacks/_octavia.py @@ -18,13 +18,13 @@ from __future__ import absolute_import from oslo_log import log from tobiko import config -from tobiko.openstack.stacks import _ubuntu +from tobiko.openstack.stacks import _advanced_vm CONF = config.CONF LOG = log.getLogger(__name__) -class OctaviaServerStackFixture(_ubuntu.UbuntuServerStackFixture): +class OctaviaServerStackFixture(_advanced_vm.AdvancedServerStackFixture): has_floating_ip = False diff --git a/tobiko/openstack/stacks/_qos.py b/tobiko/openstack/stacks/_qos.py index 711e3606f..93cc6b609 100644 --- a/tobiko/openstack/stacks/_qos.py +++ b/tobiko/openstack/stacks/_qos.py @@ -21,7 +21,7 @@ from tobiko.openstack import heat from tobiko.openstack import neutron from tobiko.openstack.stacks import _neutron from tobiko.openstack.stacks import _hot -from tobiko.openstack.stacks import _ubuntu +from tobiko.openstack.stacks import _advanced_vm CONF = config.CONF @@ -61,7 +61,7 @@ class QosNetworkStackFixture(_neutron.NetworkBaseStackFixture): super().setup_stack() -class QosServerStackFixture(_ubuntu.UbuntuServerStackFixture): +class QosServerStackFixture(_advanced_vm.AdvancedServerStackFixture): #: stack with the network with a qos policy network_stack = tobiko.required_fixture(QosNetworkStackFixture) diff --git a/tobiko/tests/faults/octavia/test_faults.py b/tobiko/tests/faults/octavia/test_faults.py index 1caefdc31..ec299038c 100644 --- a/tobiko/tests/faults/octavia/test_faults.py +++ b/tobiko/tests/faults/octavia/test_faults.py @@ -44,7 +44,7 @@ class OctaviaBasicFaultTest(testtools.TestCase): listener = None pool = None server_stack = tobiko.required_fixture( - stacks.UbuntuServerStackFixture) + stacks.AdvancedServerStackFixture) other_server_stack = tobiko.required_fixture( stacks.OctaviaOtherServerStackFixture) diff --git a/tobiko/tests/faults/octavia/test_services.py b/tobiko/tests/faults/octavia/test_services.py index bfcef507e..25664d34b 100644 --- a/tobiko/tests/faults/octavia/test_services.py +++ b/tobiko/tests/faults/octavia/test_services.py @@ -53,7 +53,7 @@ class OctaviaServicesFaultTest(testtools.TestCase): listener = None pool = None server_stack = tobiko.required_fixture( - stacks.UbuntuServerStackFixture) + stacks.AdvancedServerStackFixture) other_server_stack = tobiko.required_fixture( stacks.OctaviaOtherServerStackFixture) diff --git a/tobiko/tests/functional/openstack/neutron/test_agent.py b/tobiko/tests/functional/openstack/neutron/test_agent.py index e115d7c10..6a2f16460 100644 --- a/tobiko/tests/functional/openstack/neutron/test_agent.py +++ b/tobiko/tests/functional/openstack/neutron/test_agent.py @@ -139,7 +139,7 @@ class GetL3AgentModeTest(testtools.TestCase): class SSHGetL3AgentModeTest(GetL3AgentModeTest): server_stack = tobiko.required_fixture( - stacks.UbuntuServerStackFixture) + stacks.AdvancedServerStackFixture) @property def connection(self) -> sh.SSHShellConnection: diff --git a/tobiko/tests/functional/openstack/stacks/test_ubuntu.py b/tobiko/tests/functional/openstack/stacks/test_advanced_vm.py similarity index 88% rename from tobiko/tests/functional/openstack/stacks/test_ubuntu.py rename to tobiko/tests/functional/openstack/stacks/test_advanced_vm.py index 3d1e0832d..83dc450b9 100644 --- a/tobiko/tests/functional/openstack/stacks/test_ubuntu.py +++ b/tobiko/tests/functional/openstack/stacks/test_advanced_vm.py @@ -21,13 +21,13 @@ from tobiko.openstack import stacks from tobiko.tests.functional.openstack.stacks import test_cirros -class UbuntuServerStackTest(test_cirros.CirrosServerStackTest): +class AdvancedServerStackTest(test_cirros.CirrosServerStackTest): """Tests connectivity to Nova instances via floating IPs""" #: Stack of resources with a server attached to a floating IP - stack = tobiko.required_fixture(stacks.UbuntuServerStackFixture) + stack = tobiko.required_fixture(stacks.AdvancedServerStackFixture) - nameservers_filenames = ('/run/systemd/resolve/resolv.conf',) + nameservers_filenames = ('/etc/resolv.conf',) def test_python(self): python_version = sh.execute(['python3', '--version'], diff --git a/tobiko/tests/functional/openstack/stacks/test_vlan.py b/tobiko/tests/functional/openstack/stacks/test_vlan.py index b43eed68e..10f066f1e 100644 --- a/tobiko/tests/functional/openstack/stacks/test_vlan.py +++ b/tobiko/tests/functional/openstack/stacks/test_vlan.py @@ -29,10 +29,10 @@ class VlanProxyServerStackTest(test_cirros.CirrosServerStackTest): stack = tobiko.required_fixture(stacks.VlanProxyServerStackFixture) -class UbuntuVlanServerTest(testtools.TestCase): +class AdvancedVlanServerTest(testtools.TestCase): #: Stack of resources with a server attached to a floating IP - stack = tobiko.required_fixture(stacks.UbuntuServerStackFixture) + stack = tobiko.required_fixture(stacks.AdvancedServerStackFixture) def test_vlan_ipv4_fixed_ip(self): self._test_vlan_fixed_ip(ip_version=4) diff --git a/tobiko/tests/functional/shell/sh/test_connection.py b/tobiko/tests/functional/shell/sh/test_connection.py index 7a9f74d9a..05494d37c 100644 --- a/tobiko/tests/functional/shell/sh/test_connection.py +++ b/tobiko/tests/functional/shell/sh/test_connection.py @@ -209,7 +209,7 @@ class LocalShellConnectionTest(testtools.TestCase): class SSHShellConnectionTest(LocalShellConnectionTest): connection_class = sh.SSHShellConnection - server = tobiko.required_fixture(stacks.UbuntuServerStackFixture) + server = tobiko.required_fixture(stacks.AdvancedServerStackFixture) @property def ssh_client(self) -> ssh.SSHClientFixture: diff --git a/tobiko/tests/functional/shell/sh/test_execute.py b/tobiko/tests/functional/shell/sh/test_execute.py index 7175a4270..570090a31 100644 --- a/tobiko/tests/functional/shell/sh/test_execute.py +++ b/tobiko/tests/functional/shell/sh/test_execute.py @@ -210,7 +210,7 @@ class SSHExecuteTest(ExecuteTest): expected_shell = SSH_EXPECTED_SHELL server_stack = tobiko.required_fixture( - stacks.UbuntuServerStackFixture) + stacks.AdvancedServerStackFixture) @property def ssh_client(self): diff --git a/tobiko/tests/functional/shell/sh/test_hostname.py b/tobiko/tests/functional/shell/sh/test_hostname.py index 1b63fb72d..623c93924 100644 --- a/tobiko/tests/functional/shell/sh/test_hostname.py +++ b/tobiko/tests/functional/shell/sh/test_hostname.py @@ -68,9 +68,9 @@ class GetHostnameTest(testtools.TestCase): def test_cirros_hostname(self): self.test_ssh_hostname(ssh_client=self.cirros_server.ssh_client) - ubuntu_server = tobiko.required_fixture( - stacks.UbuntuServerStackFixture) + advanced_server = tobiko.required_fixture( + stacks.AdvancedServerStackFixture) @keystone.skip_unless_has_keystone_credentials() - def test_ubuntu_hostname(self): - self.test_ssh_hostname(ssh_client=self.ubuntu_server.ssh_client) + def test_advanced_vm_hostname(self): + self.test_ssh_hostname(ssh_client=self.advanced_server.ssh_client) diff --git a/tobiko/tests/functional/shell/sh/test_process.py b/tobiko/tests/functional/shell/sh/test_process.py index 3f47706e5..b8f05ac90 100644 --- a/tobiko/tests/functional/shell/sh/test_process.py +++ b/tobiko/tests/functional/shell/sh/test_process.py @@ -67,7 +67,7 @@ class LocalProcessTest(ProcessTest): class SSHProcessFixture(ProcessFixture): stack = tobiko.required_fixture( - stacks.UbuntuServerStackFixture) + stacks.AdvancedServerStackFixture) def setup_fixture(self): self.ssh_client = self.stack.ssh_client diff --git a/tobiko/tests/functional/shell/sh/test_which.py b/tobiko/tests/functional/shell/sh/test_which.py index 82ca75964..143a1cdf2 100644 --- a/tobiko/tests/functional/shell/sh/test_which.py +++ b/tobiko/tests/functional/shell/sh/test_which.py @@ -87,7 +87,7 @@ class ProxyJumpWhichTest(WhichTest): class SSHWhichTest(WhichTest): server_stack = tobiko.required_fixture( - stacks.UbuntuServerStackFixture) + stacks.AdvancedServerStackFixture) @property def ssh_client(self): diff --git a/tobiko/tests/functional/shell/test_curl.py b/tobiko/tests/functional/shell/test_curl.py index d648cb63e..269e8adfc 100644 --- a/tobiko/tests/functional/shell/test_curl.py +++ b/tobiko/tests/functional/shell/test_curl.py @@ -34,7 +34,7 @@ from tobiko.openstack import stacks @keystone.skip_unless_has_keystone_credentials() class CurlExecuteTest(testtools.TestCase): - stack = tobiko.required_fixture(stacks.UbuntuServerStackFixture) + stack = tobiko.required_fixture(stacks.AdvancedServerStackFixture) def test_execute_curl( self, @@ -53,7 +53,8 @@ class CurlExecuteTest(testtools.TestCase): retry_count=30, retry_timeout=300., retry_interval=10.).strip() - self.assertEqual(self.stack.server_name, result) + short_vm_name_from_curl = result.split('.')[0] + self.assertEqual(self.stack.server_name, short_vm_name_from_curl) def test_execute_curl_ipv4(self): self.test_execute_curl(ip_address=self.get_fixed_ip(ip_version=4), diff --git a/tobiko/tests/functional/shell/test_ifconfig.py b/tobiko/tests/functional/shell/test_ifconfig.py index 1cc5d0c03..20f3f63ec 100644 --- a/tobiko/tests/functional/shell/test_ifconfig.py +++ b/tobiko/tests/functional/shell/test_ifconfig.py @@ -31,8 +31,8 @@ class IfconfigTest(testtools.TestCase): cirros_stack = tobiko.required_fixture( stacks.CirrosServerStackFixture) - ubuntu_stack = tobiko.required_fixture( - stacks.UbuntuServerStackFixture) + advanced_vm_stack = tobiko.required_fixture( + stacks.AdvancedServerStackFixture) def test_list_ip_addresses(self, ip_version=None, **execute_params): result = sh.execute(command='ls /sbin/ifconfig', @@ -59,8 +59,9 @@ class IfconfigTest(testtools.TestCase): self.test_list_ip_addresses(ssh_client=self.cirros_stack.ssh_client) @keystone.skip_unless_has_keystone_credentials() - def test_list_ip_addresses_with_ubuntu_server(self): - self.test_list_ip_addresses(ssh_client=self.ubuntu_stack.ssh_client) + def test_list_ip_addresses_with_advanced_server(self): + self.test_list_ip_addresses( + ssh_client=self.advanced_vm_stack.ssh_client) def test_list_ip_addresses_with_proxy_ssh_client(self): ssh_client = ssh.ssh_proxy_client() diff --git a/tobiko/tests/functional/shell/test_ip.py b/tobiko/tests/functional/shell/test_ip.py index 9e2ff07ee..a53c6e989 100644 --- a/tobiko/tests/functional/shell/test_ip.py +++ b/tobiko/tests/functional/shell/test_ip.py @@ -32,8 +32,8 @@ class IpTest(testtools.TestCase): cirros_stack = tobiko.required_fixture( stacks.CirrosServerStackFixture) - ubuntu_stack = tobiko.required_fixture( - stacks.UbuntuServerStackFixture) + advanced_vm_stack = tobiko.required_fixture( + stacks.AdvancedServerStackFixture) namespace = tobiko.required_fixture( _fixtures.NetworkNamespaceFixture) @@ -83,8 +83,9 @@ class IpTest(testtools.TestCase): 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_ubuntu_server(self): - self.test_list_ip_addresses(ssh_client=self.ubuntu_stack.ssh_client) + def test_list_ip_addresses_with_advanced_server(self): + self.test_list_ip_addresses( + ssh_client=self.advanced_vm_stack.ssh_client) def test_list_ip_addresses_with_proxy_ssh_client(self): ssh_client = ssh.ssh_proxy_client() @@ -144,8 +145,8 @@ class IpTest(testtools.TestCase): self.test_list_ip_addresses(network_namespace=namespace) @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) + def test_list_namespaces_with_advanced_server(self): + self.test_list_namespaces(ssh_client=self.advanced_vm_stack.ssh_client) @pytest.mark.flaky(reruns=3, reruns_delay=5) def test_list_namespaces_with_proxy_ssh_client(self): diff --git a/tobiko/tests/functional/shell/test_ping.py b/tobiko/tests/functional/shell/test_ping.py index 1d2f9f6fe..9444fd9c9 100644 --- a/tobiko/tests/functional/shell/test_ping.py +++ b/tobiko/tests/functional/shell/test_ping.py @@ -220,6 +220,6 @@ class CirrosPingTest(PingTest): return self.stack.ssh_client -class UbuntuPingTest(CirrosPingTest): +class AdvancedPingTest(CirrosPingTest): - stack = tobiko.required_fixture(stacks.UbuntuServerStackFixture) + stack = tobiko.required_fixture(stacks.AdvancedServerStackFixture) diff --git a/tobiko/tests/scenario/neutron/test_port.py b/tobiko/tests/scenario/neutron/test_port.py index 375d054b3..e89579b37 100644 --- a/tobiko/tests/scenario/neutron/test_port.py +++ b/tobiko/tests/scenario/neutron/test_port.py @@ -121,12 +121,12 @@ class PortTest(testtools.TestCase): # --- Test opening ports on external network ---------------------------------- @stacks.skip_unless_has_external_network -class UbuntuExternalPortTest(PortTest): +class AdvancedExternalPortTest(PortTest): """Test Neutron ports""" #: Resources stack with Nova server to send messages to stack = tobiko.required_fixture( - stacks.UbuntuExternalServerStackFixture) + stacks.AdvancedExternalServerStackFixture) # --- Test la-h3 extension ---------------------------------------------------- diff --git a/tobiko/tests/scenario/neutron/test_trunk.py b/tobiko/tests/scenario/neutron/test_trunk.py index 3832f0fba..7b9b49296 100644 --- a/tobiko/tests/scenario/neutron/test_trunk.py +++ b/tobiko/tests/scenario/neutron/test_trunk.py @@ -30,7 +30,7 @@ CONF = config.CONF LOG = log.getLogger(__name__) -class RebootTrunkServerStackFixture(stacks.UbuntuServerStackFixture): +class RebootTrunkServerStackFixture(stacks.AdvancedServerStackFixture): def validate_created_stack(self): # (fressi) must wait cloud init to complete Nova diff --git a/tobiko/tests/scenario/nova/test_server.py b/tobiko/tests/scenario/nova/test_server.py index eab85694f..5f048c2a3 100644 --- a/tobiko/tests/scenario/nova/test_server.py +++ b/tobiko/tests/scenario/nova/test_server.py @@ -188,10 +188,10 @@ class CirrosServerTest(BaseServerTest): stack = tobiko.required_fixture(CirrosServerStackFixture) -class UbuntuServerStackFixture(stacks.UbuntuServerStackFixture): +class AdvancedServerStackFixture(stacks.AdvancedServerStackFixture): pass -class UbuntuServerTest(BaseServerTest): +class AdvancedServerTest(BaseServerTest): __test__ = True - stack = tobiko.required_fixture(UbuntuServerStackFixture) + stack = tobiko.required_fixture(AdvancedServerStackFixture) diff --git a/zuul.d/infrared.yaml b/zuul.d/infrared.yaml index 621ee26a9..7844c42d4 100644 --- a/zuul.d/infrared.yaml +++ b/zuul.d/infrared.yaml @@ -33,7 +33,11 @@ test_inventory_file: '{{ zuul_work_dir }}/ansible_hosts' test_inventory_groups: {undercloud: [primary]} tox_envlist: infrared - tox_extra_args: -- --collect-dir {{ test_collect_dir | quote }} + tox_extra_args: >- + -- + --collect-dir {{ test_collect_dir | quote }} + --customized-fedora-image-url + https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2 tox_environ: ANSIBLE_INVENTORY: '{{ test_inventory_file }}' zuul_output_dir: '{{ ansible_user_dir }}/zuul-output'