aboutsummaryrefslogtreecommitdiffstats
path: root/vswitches
diff options
context:
space:
mode:
authorSugesh Chandran <sugesh.chandran@intel.com>2016-07-07 10:24:36 +0100
committerMaryam Tahhan <maryam.tahhan@intel.com>2016-08-16 15:12:11 +0000
commitffc55a6bbbfafc36a2e28e2e28e737966fb9bb31 (patch)
tree3d6381b043883aa14ae624cb6e60e06a55793fe3 /vswitches
parenta8ef2c308d4c385b8eb0cae0f7f1f2d039affaaf (diff)
integration: Support for VxLAN TC without using overlay traffic gen.
The test case for verifying the vxlan tunneling feature without using any ingress tunnel traffic. The virtual switch(OVS) is configured to mangle and generate tunnel traffic in the deployment. The packet flow in the test case is as follows TRAFFIC-IN --> [ENCAP-PKT] --> [MOD-PKT] --> [DECAP-PKT] --> TRAFFIC-OUT ENCAP-PKT - Encapsulate the ingress packet to a tunnel type. MOD-PKT - Modify the tunnel header to match the following decap interface. DECAP-PKT - Decapsulate the newly generated tunneled packet. Change-Id: Ie24bacb3cb1c069bd60403e5a4ef8bcdf0e12e54 Signed-off-by: Sugesh Chandran <sugesh.chandran@intel.com>
Diffstat (limited to 'vswitches')
-rw-r--r--vswitches/ovs.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/vswitches/ovs.py b/vswitches/ovs.py
index 243619b6..d2814b6a 100644
--- a/vswitches/ovs.py
+++ b/vswitches/ovs.py
@@ -122,6 +122,38 @@ class IVSwitchOvs(IVSwitch, tasks.Process):
"""
raise NotImplementedError
+ def add_veth_pair_port(self, switch_name=None, remote_switch_name=None,
+ local_opts=None, remote_opts=None):
+ """Creates veth-pair port between 'switch_name' and 'remote_switch_name'
+
+ """
+ if switch_name is None or remote_switch_name is None:
+ return
+
+ bridge = self._bridges[switch_name]
+ remote_bridge = self._bridges[remote_switch_name]
+ pcount = str(self._get_port_count('type=patch'))
+ # TODO ::: What if interface name longer than allowed width??
+ local_port_name = switch_name + '-' + remote_switch_name + '-' + pcount
+ remote_port_name = remote_switch_name + '-' + switch_name + '-' + pcount
+ local_params = ['--', 'set', 'Interface', local_port_name,
+ 'type=patch',
+ 'options:peer=' + remote_port_name]
+ remote_params = ['--', 'set', 'Interface', remote_port_name,
+ 'type=patch',
+ 'options:peer=' + local_port_name]
+
+ if local_opts is not None:
+ local_params = local_params + local_opts
+
+ if remote_opts is not None:
+ remote_params = remote_params + remote_opts
+
+ local_of_port = bridge.add_port(local_port_name, local_params)
+ remote_of_port = remote_bridge.add_port(remote_port_name, remote_params)
+ return [(local_port_name, local_of_port),
+ (remote_port_name, remote_of_port)]
+
def add_tunnel_port(self, switch_name, remote_ip, tunnel_type='vxlan', params=None):
"""Creates tunneling port
"""