Check public ip and gw for vmware related roles

Change-Id: I07d6d3e53e729c5a99c6a1685882cb5bcce22ea1
Closes-bug: #1569387
(cherry picked from commit be282374d9)
This commit is contained in:
Ilya Bumarskov 2016-04-12 17:37:29 +03:00
parent 62506fde4b
commit b686d57c70
3 changed files with 111 additions and 0 deletions

View File

@ -15,9 +15,13 @@
from random import randrange
from proboscis import SkipTest
from proboscis.asserts import assert_equal
from proboscis.asserts import assert_not_equal
from proboscis.asserts import assert_true
from fuelweb_test.helpers.os_actions import OpenStackActions
from fuelweb_test.helpers.ssh_manager import SSHManager
from fuelweb_test.settings import NEUTRON
from system_test import logger
from system_test import deferred_decorator
from system_test import action
@ -269,3 +273,33 @@ class VMwareActions(object):
self.fuel_web.deploy_cluster_wait(self.cluster_id,
check_services=False)
@deferred_decorator([make_snapshot_if_step_fail])
@action
def check_neutron_public(self):
"""Check that public network was assigned to all nodes"""
cluster = self.fuel_web.client.get_cluster(self.cluster_id)
assert_equal(str(cluster['net_provider']), NEUTRON)
os_conn = OpenStackActions(
self.fuel_web.get_public_vip(self.cluster_id))
self.fuel_web.check_fixed_network_cidr(
self.cluster_id, os_conn)
@deferred_decorator([make_snapshot_if_step_fail])
@action
def check_gw_on_vmware_nodes(self):
"""Check that default gw != fuel node ip"""
vmware_nodes = []
vmware_nodes.extend(self.fuel_web.get_nailgun_cluster_nodes_by_roles(
self.cluster_id, ["compute-vmware"]))
vmware_nodes.extend(self.fuel_web.get_nailgun_cluster_nodes_by_roles(
self.cluster_id, ["cinder-vmware"]))
logger.debug('Fuel ip is {0}'.format(self.fuel_web.admin_node_ip))
for node in vmware_nodes:
cmd = "ip route | grep default | awk '{print $3}'"
gw_ip = SSHManager().execute_on_remote(node['ip'], cmd)
logger.debug('Default gw for node {0} is {1}'.format(
node['name'], gw_ip['stdout_str']))
assert_not_equal(gw_ip['stdout_str'], self.fuel_web.admin_node_ip)

View File

@ -293,3 +293,40 @@ class CheckCinderVmwareSrv(ActionTest, BaseActions, VMwareActions):
'check_cinder_vmware_srv',
'health_check_sanity_smoke_ha'
]
@testcase(groups=['system_test',
'system_test.vcenter',
'system_test.vcenter.neutron_public_net'])
class DeployNeutronPublicNet(ActionTest, BaseActions, VMwareActions):
"""Deploy cluster with vCenter and dvs plugin
Scenario:
1. Upload plugin to the master node
2. Install plugin
3. Create cluster
4. Configure dvs settings (depends on yaml config)
5. Add nodes (depends on yaml config)
6. Configure vmware settings (depends on yaml config)
7. Deploy the cluster
8. Run OSTF
Duration 2h 00min
Snapshot deploy_vcenter_dvs
"""
plugin_name = "fuel-plugin-vmware-dvs"
plugin_path = DVS_PLUGIN_PATH
plugin_version = DVS_PLUGIN_VERSION
actions_order = [
'prepare_env_with_plugin',
'create_env',
'enable_plugin',
'configure_dvs_plugin',
'add_nodes',
'configure_vcenter',
'deploy_cluster',
'check_neutron_public',
'check_gw_on_vmware_nodes'
]

View File

@ -0,0 +1,40 @@
---
template:
name: 1 controller, 1 cinder-vmware, 1 compute-vmware on Neutron/VLAN with DVS plugin
slaves: 3
cluster_template:
name: vcenter_roles_pub_ip
release: ubuntu
network:
provider: neutron
segment-type: vlan
pubip-to-all: true
settings:
components:
!include cluster_configs/settings/components/wo_components.yaml
storages:
!include cluster_configs/settings/storages/cinder_only.yaml
vmware_vcenter:
settings:
!include cluster_configs/settings/vmware/vcenter_main.yaml
nova-compute:
!include cluster_configs/settings/vmware/nova_compute/2clusters_ctrl_comp-vmware.yaml
glance:
enable: false
vmware_dvs:
!include cluster_configs/settings/vmware/dvs/dvs_main.yaml
nodes:
- roles:
- controller
iface: !include cluster_configs/settings/vmware/vcenter_ifaces.yaml
count: 1
- roles:
- cinder-vmware
iface: !include cluster_configs/settings/vmware/vcenter_ifaces.yaml
count: 1
- roles:
- compute-vmware
iface: !include cluster_configs/settings/vmware/vcenter_ifaces.yaml
count: 1