Replace Ubuntu guest images with Fedora
Tobiko has always used Ubuntu images as advanced guest images to create VM instances during its tests. This patch replaces the Ubuntu image with a Fedora image that is customized to work with Tobiko tests properly. The different files, config parameters, classes and attributes are renamed to use the generic "advanced_vm" and "Advanced" prefixes to make it easier in case another change of guest images is done in the future. Depends-On: I6015af347dba6b8a587fa3b3811ca4c8cdd41b7a Change-Id: Ie4ed523eb9646b6e79553341500c2e3314af8c3d
This commit is contained in:
parent
b73f595bad
commit
7b67ccba2e
@ -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 = <None>
|
||||
|
||||
# Default ubuntu image URL (string value)
|
||||
# Default advanced_vm image URL (string value)
|
||||
#image_url = <None>
|
||||
|
||||
# Default ubuntu container format (string value)
|
||||
# Default advanced_vm container format (string value)
|
||||
#container_format = <None>
|
||||
|
||||
# Default ubuntu disk format (string value)
|
||||
# Default advanced_vm disk format (string value)
|
||||
#disk_format = <None>
|
||||
|
||||
# Default ubuntu username (string value)
|
||||
# Default advanced_vm username (string value)
|
||||
#username = <None>
|
||||
|
||||
# Default ubuntu password (string value)
|
||||
# Default advanced_vm password (string value)
|
||||
#password = <None>
|
||||
|
||||
# Default ubuntu SSH connection timeout (seconds) (floating point value)
|
||||
# Default advanced_vm SSH connection timeout (seconds) (floating point value)
|
||||
#connection_timeout = <None>
|
||||
|
||||
# Allow to disable SSH auth algorithmsin order to SSH to old servers likeCirrOS ones
|
||||
|
@ -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: |
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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: ''
|
||||
|
@ -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:
|
||||
|
11
roles/tobiko-download-images/files/iperf3-server.service
Normal file
11
roles/tobiko-download-images/files/iperf3-server.service
Normal file
@ -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
|
5
roles/tobiko-download-images/files/nginx_id.conf
Normal file
5
roles/tobiko-download-images/files/nginx_id.conf
Normal file
@ -0,0 +1,5 @@
|
||||
server{
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
location /id { add_header Content-Type text/plain; return 200 '$hostname';}
|
||||
}
|
@ -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
|
@ -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
|
||||
|
@ -28,7 +28,7 @@ OPTIONS = [
|
||||
|
||||
|
||||
GLANCE_IMAGE_NAMES = ['cirros',
|
||||
'ubuntu']
|
||||
'advanced_vm']
|
||||
|
||||
|
||||
def register_tobiko_options(conf):
|
||||
|
@ -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',
|
||||
|
@ -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 "
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
"""
|
@ -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
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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'],
|
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -87,7 +87,7 @@ class ProxyJumpWhichTest(WhichTest):
|
||||
class SSHWhichTest(WhichTest):
|
||||
|
||||
server_stack = tobiko.required_fixture(
|
||||
stacks.UbuntuServerStackFixture)
|
||||
stacks.AdvancedServerStackFixture)
|
||||
|
||||
@property
|
||||
def ssh_client(self):
|
||||
|
@ -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),
|
||||
|
@ -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()
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
@ -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 ----------------------------------------------------
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user