tests: fix network interfaces names in conftest.py

Set network interfaces names according to the OS distribution in
conftest.py

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/3595/head
Guillaume Abrioux 2019-02-22 10:13:53 +01:00
parent 2ed203da61
commit fa13289c65
31 changed files with 57 additions and 55 deletions

View File

@ -19,6 +19,13 @@ def setup(host):
ansible_distribution = ansible_facts["ansible_facts"]["ansible_distribution"]
if ansible_distribution == "CentOS":
public_interface = "eth1"
cluster_interface = "eth2"
else:
public_interface = "ens6"
cluster_interface = "ens7"
subnet = ".".join(ansible_vars["public_network"].split(".")[0:-1])
num_mons = len(ansible_vars["groups"]["mons"])
if osd_auto_discovery:
@ -30,13 +37,6 @@ def setup(host):
osds_per_device = ansible_vars.get("osds_per_device", 1)
num_osds = num_osds * osds_per_device
if ansible_distribution == "RedHat":
public_interface = "ens6"
cluster_interface = "ens7"
else:
public_interface = "eth1"
cluster_interface = "eth2"
# If number of devices doesn't map to number of OSDs, allow tests to define
# that custom number, defaulting it to ``num_devices``
num_osds = ansible_vars.get('num_osds', num_osds)
@ -71,6 +71,8 @@ def setup(host):
address=address,
osds=osds,
conf_path=conf_path,
public_interface=public_interface,
cluster_interface=cluster_interface,
cluster_address=cluster_address,
container_binary=container_binary)

View File

@ -6,8 +6,8 @@ containerized_deployment: true
cluster: ceph
public_network: "192.168.55.0/24"
cluster_network: "192.168.56.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
journal_size: 100
osd_objectstore: "bluestore"
osd_scenario: lvm

View File

@ -4,8 +4,8 @@ ceph_repository: community
cluster: ceph
public_network: "192.168.53.0/24"
cluster_network: "192.168.54.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
journal_size: 100
osd_objectstore: "bluestore"
osd_scenario: lvm

View File

@ -4,8 +4,8 @@
docker: True
containerized_deployment: True
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
ceph_mon_docker_subnet: "{{ public_network }}"
ceph_docker_on_openstack: False
public_network: "192.168.17.0/24"

View File

@ -1,6 +1,6 @@
[mons]
mon0 monitor_address=192.168.17.10
mon1 monitor_interface=eth1
mon1 monitor_interface="{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
mon2 monitor_address=192.168.17.12
[osds]

View File

@ -1,6 +1,6 @@
[mons]
mon0 monitor_address=192.168.17.10
mon1 monitor_interface=eth1
mon1 monitor_interface="{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
mon2 monitor_address=192.168.17.12
[osds]

View File

@ -3,7 +3,7 @@ ceph_origin: repository
ceph_repository: community
public_network: "192.168.1.0/24"
cluster_network: "192.168.2.0/24"
radosgw_interface: eth1
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
ceph_conf_overrides:
global:
osd_pool_default_size: 1

View File

@ -1,6 +1,6 @@
[mons]
mon0 monitor_address=192.168.1.10
mon1 monitor_interface=eth1
mon1 monitor_interface="{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
mon2 monitor_address=192.168.1.12
[osds]

View File

@ -3,7 +3,7 @@ docker=True
[mons]
mon0 monitor_address=192.168.1.10
mon1 monitor_interface=eth1
mon1 monitor_interface="{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
mon2 monitor_address=192.168.1.12
[osds]

View File

@ -1,6 +1,6 @@
[mons]
mon0 monitor_address=192.168.1.10
mon1 monitor_interface=eth1
mon1 monitor_interface=ens6
mon2 monitor_address=192.168.1.12
[osds]

View File

@ -9,7 +9,7 @@ ceph_repository: community
containerized_deployment: True
public_network: "192.168.39.0/24"
cluster_network: "192.168.40.0/24"
monitor_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
osd_objectstore: "bluestore"
osd_scenario: lvm
copy_admin_key: true

View File

@ -4,7 +4,7 @@ ceph_origin: repository
ceph_repository: community
public_network: "192.168.39.0/24"
cluster_network: "192.168.40.0/24"
monitor_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
osd_objectstore: "bluestore"
osd_scenario: lvm
copy_admin_key: true

View File

@ -4,8 +4,8 @@
docker: True
containerized_deployment: True
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_num_instances: 2
ceph_mon_docker_subnet: "{{ public_network }}"
ceph_docker_on_openstack: False

View File

@ -1,7 +1,7 @@
---
containerized_deployment: False
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
ceph_mon_docker_subnet: "{{ public_network }}"
ceph_docker_on_openstack: False
public_network: "192.168.15.0/24"

View File

@ -10,8 +10,8 @@ ceph_repository: dev
cluster: ceph
public_network: "192.168.39.0/24"
cluster_network: "192.168.40.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
journal_size: 100
osd_objectstore: "bluestore"
crush_device_class: test

View File

@ -5,8 +5,8 @@ ceph_repository: community
cluster: ceph
public_network: "192.168.39.0/24"
cluster_network: "192.168.40.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
osd_objectstore: "bluestore"
crush_device_class: test
osd_scenario: lvm

View File

@ -10,8 +10,8 @@ ceph_repository: community
cluster: ceph
public_network: "192.168.39.0/24"
cluster_network: "192.168.40.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
journal_size: 100
osd_objectstore: "bluestore"
crush_device_class: test

View File

@ -5,8 +5,8 @@ ceph_repository: community
cluster: ceph
public_network: "192.168.39.0/24"
cluster_network: "192.168.40.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
osd_objectstore: "bluestore"
crush_device_class: test
osd_scenario: lvm

View File

@ -8,8 +8,8 @@ ceph_origin: repository
ceph_repository: community
public_network: "192.168.39.0/24"
cluster_network: "192.168.40.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
journal_size: 100
osd_objectstore: "filestore"
copy_admin_key: true

View File

@ -4,8 +4,8 @@ ceph_origin: repository
ceph_repository: community
public_network: "192.168.39.0/24"
cluster_network: "192.168.40.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
journal_size: 100
osd_objectstore: "filestore"
copy_admin_key: true

View File

@ -4,8 +4,8 @@
docker: True
containerized_deployment: True
monitor_interface: "{{ 'ens6' if ansible_distribution == 'RedHat' else 'eth1' }}"
radosgw_interface: "{{ 'ens6' if ansible_distribution == 'RedHat' else 'eth1' }}"
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'ens1' if ansible_distribution == 'CentOS' else 'ens6' }}"
ceph_mon_docker_subnet: "{{ public_network }}"
ceph_docker_on_openstack: False
public_network: "192.168.30.0/24"

View File

@ -6,8 +6,8 @@ ceph_repository: community
cluster: ceph
public_network: "192.168.105.0/24"
cluster_network: "192.168.106.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
journal_size: 100
osd_objectstore: "bluestore"
osd_scenario: lvm

View File

@ -6,8 +6,8 @@ ceph_repository: community
cluster: ceph
public_network: "192.168.107.0/24"
cluster_network: "192.168.108.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
journal_size: 100
osd_objectstore: "bluestore"
osd_scenario: lvm

View File

@ -4,8 +4,8 @@ ceph_repository: community
cluster: ceph
public_network: "192.168.101.0/24"
cluster_network: "192.168.102.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
journal_size: 100
osd_objectstore: "bluestore"
osd_scenario: lvm

View File

@ -4,8 +4,8 @@ ceph_repository: community
cluster: ceph
public_network: "192.168.103.0/24"
cluster_network: "192.168.104.0/24"
monitor_interface: eth1
radosgw_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
radosgw_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
journal_size: 100
osd_objectstore: "bluestore"
osd_scenario: lvm

View File

@ -4,7 +4,7 @@
docker: True
containerized_deployment: True
monitor_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
ceph_mon_docker_subnet: "{{ public_network }}"
ceph_docker_on_openstack: False
public_network: "192.168.17.0/24"

View File

@ -1,6 +1,6 @@
[mons]
mon0 monitor_address=192.168.1.10
mon1 monitor_interface=eth1
mon1 monitor_interface="{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
mon2 monitor_address=192.168.1.12
[osds]

View File

@ -3,7 +3,7 @@ docker=True
[mons]
mon0 monitor_address=192.168.1.10
mon1 monitor_interface=eth1
mon1 monitor_interface="{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
mon2 monitor_address=192.168.1.12
[osds]

View File

@ -1,6 +1,6 @@
[mons]
mon0 monitor_address=192.168.1.10
mon1 monitor_interface=eth1
mon1 monitor_interface="{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
mon2 monitor_address=192.168.1.12
[osds]

View File

@ -4,7 +4,7 @@
docker: True
containerized_deployment: True
monitor_interface: eth1
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
ceph_mon_docker_subnet: "{{ public_network }}"
ceph_docker_on_openstack: False
public_network: "192.168.73.0/24"

View File

@ -52,9 +52,9 @@ class TestRGWs(object):
assert instance_name in daemons
@pytest.mark.no_docker
def test_rgw_http_endpoint(self, node, host):
# rgw frontends ip_addr is configured on eth1
ip_addr = host.interface("eth1").addresses[0]
def test_rgw_http_endpoint(self, node, host, setup):
# rgw frontends ip_addr is configured on public_interface
ip_addr = host.interface(setup['public_interface']).addresses[0]
for i in range(int(node["radosgw_num_instances"])):
assert host.socket(
"tcp://{ip_addr}:{port}".format(ip_addr=ip_addr,