Skip to content

Commit

Permalink
Merge "Support for EVPN VxLAN and removing the tor-agent setup"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul v3 CI authored and opencontrail-ci-admin committed May 3, 2018
2 parents 0faf2eb + 49e3ca9 commit 982482c
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 75 deletions.
24 changes: 0 additions & 24 deletions common/contrail_test_init.py
Expand Up @@ -1177,7 +1177,6 @@ def read_prov_file(self):
if self.ns_agilio_vrouter_data:
self.pcap_on_vm = True

self._process_tor_data()
self._process_for_vcenter_gateway()
self._process_other_orchestrators(json_data)

Expand Down Expand Up @@ -1279,29 +1278,6 @@ def _process_qos_data(self, host_ip):
pass
return (qos_queue_per_host, qos_queue_pg_properties_per_host)

def _process_tor_data(self):
for (device_name, device_dict) in self.physical_routers_data.iteritems():
device_dict['tor_agents'] = []
device_dict['tor_agent_dicts'] = []
device_dict['tor_tsn_ips'] = []
for (host_str, ta_list) in self.tor_agent_data.iteritems():
for ta in ta_list:
if ta['tor_name'] == device_dict['name']:
ta['tor_agent_host_string'] = host_str
device_dict['tor_ovs_port'] = ta['tor_ovs_port']
device_dict['tor_ovs_protocol'] = ta[
'tor_ovs_protocol']
device_dict['tor_agents'].append('%s:%s' % (host_str,
ta['tor_id']))
device_dict['tor_agent_dicts'].append(ta)
device_dict['tor_tsn_ips'].append(ta['tor_tsn_ip'])
if self.ha_setup == True:
device_dict['controller_ip'] = self.contrail_external_vip
else:
device_dict['controller_ip'] = ta['tor_tsn_ip']

# end _process_tor_data

def get_host_ip(self, name):
try:
ip = self.host_data[name]['host_ip']
Expand Down
5 changes: 5 additions & 0 deletions contrail_test_input.yaml.sample
Expand Up @@ -4,6 +4,7 @@ deployment:
version: master-1
orchestrator: openstack # kubernetes/vcenter/openstack
slave_orchestrator: # kubernetes
deployer: contrail-ansible-deployer #openshift/helm

provider_config:
bms:
Expand Down Expand Up @@ -87,6 +88,8 @@ orchestrator_configuration:
region:
ssl:
certs:
internal_vip:
external_vip:

# Optional test specific configurations
test_configuration:
Expand Down Expand Up @@ -159,6 +162,8 @@ test_configuration:
tunnel_ip: 7.7.7.7
ports :
type : router
role : leaf
dm_managed: True
web_server:
server:
username:
Expand Down
27 changes: 16 additions & 11 deletions fixtures/physical_device_fixture.py
Expand Up @@ -48,13 +48,16 @@ def __init__(self, *args, **kwargs):
self.ssh_password = kwargs.get('ssh_password', 'Embe1mpls')
self.tunnel_ip = kwargs.get('tunnel_ip', None)
self.ports = kwargs.get('ports', [])
self.role = kwargs.get('role')
self.dm_managed = False
self.device_details = {}

self.phy_device = None
self.nc_handle = None

self.already_present = False
self.physical_port_fixtures = {}
self.tsn = kwargs.get('tsn')
try:
if self.inputs.verify_thru_gui():
connections = kwargs.get('connections', None)
Expand All @@ -73,6 +76,10 @@ def _get_ip_fabric_ri_obj(self):
# end _get_ip_fabric_ri_obj

def create_physical_device(self):
def add_tsn():
fq_name = ['default-global-system-config', self.tsn]
vr_obj = self.vnc_api_h.virtual_router_read(fq_name=fq_name)
pr.add_virtual_router(vr_obj)
pr = vnc_api_test.PhysicalRouter(self.name)
pr.physical_router_management_ip = self.mgmt_ip
pr.physical_router_dataplane_ip = self.tunnel_ip
Expand All @@ -81,12 +88,12 @@ def create_physical_device(self):
pr.physical_router_vnc_managed = True
uc = vnc_api_test.UserCredentials(self.ssh_username, self.ssh_password)
pr.set_physical_router_user_credentials(uc)
try:
if self.inputs.is_gui_based_config():
self.webui.create_physical_router(self)
else:
pr_id = self.vnc_api_h.physical_router_create(pr)
except Exception as e:
if self.tsn:
add_tsn()
pr.physical_router_role = self.role #One of leaf/spine or None
if self.inputs.is_gui_based_config():
self.webui.create_physical_router(self)
else:
pr_id = self.vnc_api_h.physical_router_create(pr)
self.logger.info('Created Physical device %s with ID %s' % (
pr.fq_name, pr.uuid))
Expand All @@ -99,6 +106,8 @@ def delete_device(self):

def setUp(self):
super(PhysicalDeviceFixture, self).setUp()
if not self.dm_managed:
return
pr_fq_name = ['default-global-system-config', self.name]
try:
self.phy_device = self.vnc_api_h.physical_router_read(
Expand Down Expand Up @@ -132,7 +141,7 @@ def cleanUp(self):
do_cleanup = False
self.logger.info('Skipping deletion of device %s' % (
self.phy_device.fq_name))
if do_cleanup:
if self.dm_managed and do_cleanup:
if self.inputs.is_gui_based_config():
self.webui.delete_physical_router(self)
else:
Expand Down Expand Up @@ -191,7 +200,3 @@ def get_connection_obj(self, *args, **kwargs):


# end PhysicalDeviceFixture

if __name__ == "__main__":
import pdb
pdb.set_trace()
1 change: 1 addition & 0 deletions fixtures/physical_router_fixture.py
Expand Up @@ -44,6 +44,7 @@ def __init__(self, *args, **kwargs):

self.bgp_router = None
self.bgp_router_already_present = False
self.dm_managed = kwargs.get('dm_managed', False)
try:
if self.inputs.verify_thru_gui():
from webui_test import WebuiTest
Expand Down
15 changes: 3 additions & 12 deletions run_tests.sh
Expand Up @@ -338,18 +338,10 @@ function apply_junitxml_patch {
fi
}

function setup_tors {
function setup_physical_routers {
(
export PYTHONPATH=$PATH:$PWD:$PWD/fixtures;
source /etc/contrail/openstackrc
python tools/tor/setup_tors.py $TEST_CONFIG_FILE
)
}

function setup_tor_agents {
(
export PYTHONPATH=$PWD:$PWD/fixtures;
python tools/tor/setup_tor_agents.py $TEST_CONFIG_FILE
python tools/setup_physical_routers.py $TEST_CONFIG_FILE
)
}

Expand Down Expand Up @@ -413,8 +405,7 @@ fi

check_test_discovery

setup_tor_agents
setup_tors
setup_physical_routers

if [[ -n $JENKINS_TRIGGERED && $JENKINS_TRIGGERED -eq 1 ]]; then
export REPORT_DETAILS_FILE=report_details_${SCRIPT_TS}_$(date +"%Y_%m_%d_%H_%M_%S").ini
Expand Down
45 changes: 17 additions & 28 deletions tools/tor/setup_tors.py → tools/setup_physical_routers.py
Expand Up @@ -5,7 +5,6 @@
import ast
import logging

from tor_fixture import ToRFixtureFactory
from physical_router_fixture import PhysicalRouterFixture
from common.contrail_test_init import ContrailTestInit
from physical_device_fixture import PhysicalDeviceFixture
Expand All @@ -19,35 +18,28 @@
if __name__ == "__main__":
init_obj = ContrailTestInit(sys.argv[1])
for (device, device_dict) in init_obj.physical_routers_data.iteritems():
if device_dict['type'] == 'tor':
tor_obj = ToRFixtureFactory.get_tor(
if device_dict['type'] in ['router', 'tor']:
dm_managed = True if device_dict['type'] == 'tor' else False
phy_router_obj = PhysicalRouterFixture(
device_dict['name'],
device_dict['mgmt_ip'],
vendor=device_dict['vendor'],
ssh_username=device_dict['ssh_username'],
ssh_password=device_dict['ssh_password'],
tunnel_ip=device_dict['tunnel_ip'],
ports=device_dict['ports'],
tor_ovs_port=device_dict['tor_ovs_port'],
tor_ovs_protocol=device_dict['tor_ovs_protocol'],
controller_ip=device_dict['controller_ip'],
cfgm_ip=init_obj.cfgm_ip,
auth_server_ip=init_obj.auth_ip,
bringup=True)
tor_obj.setUp()
if device_dict['type'] == 'router':
phy_router_obj = PhysicalRouterFixture(
device_dict['name'], device_dict['mgmt_ip'],
model=device_dict['model'],
vendor=device_dict['vendor'],
asn=device_dict['asn'],
ssh_username=device_dict['ssh_username'],
ssh_password=device_dict['ssh_password'],
mgmt_ip=device_dict['mgmt_ip'],
tunnel_ip=device_dict['tunnel_ip'],
ports=device_dict['ports'],
model=device_dict.get('model', 'mx'),
vendor=device_dict.get('vendor', 'juniper'),
ssh_username=device_dict.get('ssh_username'),
ssh_password=device_dict.get('ssh_password'),
tunnel_ip=device_dict.get('tunnel_ip'),
ports=device_dict.get('ports'),
dm_managed=device_dict.get('dm_managed', dm_managed),
tsn=device_dict.get('tsn'),
role=device_dict.get('role'),
cfgm_ip=init_obj.cfgm_ip,
auth_server_ip=init_obj.auth_ip,
inputs=init_obj,
username=init_obj.admin_username,
password=init_obj.admin_password,
project_name=init_obj.admin_tenant,
domain=init_obj.admin_domain
)
phy_router_obj.setUp()
if device_dict['type'] == 'vcenter_gateway':
Expand All @@ -74,6 +66,3 @@
ifup_cmd = 'ifconfig %s up'%port
init_obj.run_cmd_on_server(device_dict['mgmt_ip'],ifup_cmd )
# end for



0 comments on commit 982482c

Please sign in to comment.