aboutsummaryrefslogtreecommitdiffstats
path: root/core/vswitch_controller_op2p.py
diff options
context:
space:
mode:
authorDino Simeon Madarang <dino.simeonx.madarang@intel.com>2016-02-02 08:32:01 +0000
committerMaryam Tahhan <maryam.tahhan@intel.com>2016-03-16 15:05:00 +0000
commit8ee2450bd267c7dc173f62909a8a4ebe13feab84 (patch)
tree26c52f865e0470d5cc6228046196c1338399acc5 /core/vswitch_controller_op2p.py
parentbc1c22c6391745759c8e85f5d4070abf259269d8 (diff)
tunneling: Vanilla OVS decapsulation tests
Add Vanilla OVS VXLAN/GRE/GENEVE decapsulation tests Recent changes: * Line wrap * Fix GENEVE IP settings * Add GRE and GENEVE steps to integration.rst * Add DUT_NIC1_MAC and DUT_NIC2_MAC * Remove unnecessary call to vswitch.set_tunnel_arp * Move optional VXLAN/GRE/GENEVE decap settings to a different section * Add tunnel type to report files md and rst * Fix typo error: l4 to L4 in conf/integration/03_traffic.conf Change-Id: I8a43521668d5870ec893aed1df49467f0a84a07d JIRA: VSPERF-180 Signed-off-by: Dino Simeon Madarang <dino.simeonx.madarang@intel.com> Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Brian Castelli <brian.castelli@spirent.com>
Diffstat (limited to 'core/vswitch_controller_op2p.py')
-rw-r--r--core/vswitch_controller_op2p.py79
1 files changed, 74 insertions, 5 deletions
diff --git a/core/vswitch_controller_op2p.py b/core/vswitch_controller_op2p.py
index 609e5d95..77797b8f 100644
--- a/core/vswitch_controller_op2p.py
+++ b/core/vswitch_controller_op2p.py
@@ -55,7 +55,10 @@ class VswitchControllerOP2P(IVswitchController):
if self._tunnel_operation == "encapsulation":
self._setup_encap()
else:
- self._setup_decap()
+ if settings.getValue('VSWITCH').endswith('Vanilla'):
+ self._setup_decap_vanilla()
+ else:
+ self._setup_decap()
def _setup_encap(self):
""" Sets up the switch for overlay P2P encapsulation test
@@ -169,10 +172,6 @@ class VswitchControllerOP2P(IVswitchController):
self._vswitch.set_tunnel_arp(tgen_ip1,
settings.getValue('TRAFFICGEN_PORT1_MAC'),
bridge)
- self._vswitch.set_tunnel_arp(bridge_ext_ip.split('/')[0],
- settings.getValue('DUT_NIC1_MAC'),
- bridge_ext)
-
# Test is unidirectional for now
self._vswitch.del_flow(bridge_ext)
flow1 = add_ports_to_flow(_FLOW_TEMPLATE, phy3_number,
@@ -183,6 +182,76 @@ class VswitchControllerOP2P(IVswitchController):
self._vswitch.stop()
raise
+ def _setup_decap_vanilla(self):
+ """ Sets up the switch for overlay P2P decapsulation test
+ """
+ self._logger.debug('Setup decap vanilla ' + str(self._vswitch_class))
+
+ try:
+ self._vswitch.start()
+ bridge = settings.getValue('TUNNEL_INTEGRATION_BRIDGE')
+ bridge_ext = settings.getValue('TUNNEL_EXTERNAL_BRIDGE')
+ bridge_ext_ip = settings.getValue('TUNNEL_EXTERNAL_BRIDGE_IP')
+ tgen_ip1 = settings.getValue('TRAFFICGEN_PORT1_IP')
+ self._vswitch.add_switch(bridge)
+
+ tasks.run_task(['sudo', 'ifconfig', bridge,
+ settings.getValue('TUNNEL_INT_BRIDGE_IP')],
+ self._logger, 'Assign ' +
+ settings.getValue('TUNNEL_INT_BRIDGE_IP') + ' to ' + bridge, False)
+
+ tunnel_type = self._traffic['tunnel_type']
+
+ self._vswitch.add_switch(bridge_ext)
+ self._vswitch.add_phy_port(bridge_ext)
+ (_, phy2_number) = self._vswitch.add_phy_port(bridge)
+
+ if tunnel_type == "vxlan":
+ vxlan_vni = 'options:key=' + settings.getValue('VXLAN_VNI')
+ self._vswitch.add_tunnel_port(bridge, tgen_ip1, tunnel_type,
+ params=[vxlan_vni])
+ else:
+ self._vswitch.add_tunnel_port(bridge, tgen_ip1, tunnel_type)
+
+ tasks.run_task(['sudo', 'ip', 'addr', 'add',
+ bridge_ext_ip,
+ 'dev', bridge_ext],
+ self._logger, 'Assign ' +
+ bridge_ext_ip
+ + ' to ' + bridge_ext)
+
+ tasks.run_task(['sudo', 'ip', 'link', 'set', 'dev', bridge_ext,
+ 'up'],
+ self._logger,
+ 'Set ' + bridge_ext + ' status to up')
+
+ tg_port2_mac = settings.getValue('TRAFFICGEN_PORT2_MAC')
+ vtep_ip2 = settings.getValue('TRAFFICGEN_PORT2_IP')
+
+ self._vswitch.set_tunnel_arp(vtep_ip2,
+ tg_port2_mac,
+ bridge_ext)
+
+ self._vswitch.add_route(bridge,
+ settings.getValue('VTEP_IP2_SUBNET'),
+ bridge)
+
+
+ tasks.run_task(['sudo', 'arp', '-s', vtep_ip2, tg_port2_mac],
+ self._logger,
+ 'Set ' + bridge_ext + ' status to up')
+
+
+ # Test is unidirectional for now
+ self._vswitch.del_flow(bridge_ext)
+
+ flow1 = add_ports_to_flow(_FLOW_TEMPLATE, phy2_number, 'LOCAL')
+ self._vswitch.add_flow(bridge_ext, flow1)
+
+ except:
+ self._vswitch.stop()
+ raise
+
def stop(self):
"""Tears down the switch created in setup().
"""