diff options
author | Patrik Hrnciar <phrnciar@cisco.com> | 2016-02-29 14:28:41 +0100 |
---|---|---|
committer | Patrik Hrnciar <phrnciar@cisco.com> | 2016-03-02 13:03:10 +0100 |
commit | 8adf454177cc4df3335a26cc7567add8a40870c4 (patch) | |
tree | 6ae7e8aefaa15cc6ce670f89ddd9746138b86793 /resources/libraries/python/L2Util.py | |
parent | 3a19fb6215e08e8ef432adc443bcfbe49c807ba7 (diff) |
Transfer l2_xconnect setup to L2Util
Change-Id: I7a661c9ce8b5f9ca8fbd36858f7a9cd6f1da8ffd
Signed-off-by: Patrik Hrnciar <phrnciar@cisco.com>
Diffstat (limited to 'resources/libraries/python/L2Util.py')
-rw-r--r-- | resources/libraries/python/L2Util.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/resources/libraries/python/L2Util.py b/resources/libraries/python/L2Util.py index b39515dcee..a89130814c 100644 --- a/resources/libraries/python/L2Util.py +++ b/resources/libraries/python/L2Util.py @@ -15,7 +15,7 @@ from robot.api.deco import keyword from resources.libraries.python.topology import Topology -from resources.libraries.python.VatExecutor import VatExecutor +from resources.libraries.python.VatExecutor import VatExecutor, VatTerminal class L2Util(object): @@ -153,3 +153,25 @@ class L2Util(object): sw_if_id2=sw_if_index2, bd_id=bd_id, learn=int(learn)) + + @staticmethod + def vpp_setup_bidirectional_cross_connect(node, interface1, interface2): + """Create bidirectional cross-connect between 2 interfaces on vpp node. + + :param node: Node to add bidirectional cross-connect + :param interface1: first interface + :param interface2: second interface + :type node: dict + :type interface1: str + :type interface2: str + """ + sw_iface1 = Topology().get_interface_sw_index(node, interface1) + sw_iface2 = Topology().get_interface_sw_index(node, interface2) + vat = VatTerminal(node) + vat.vat_terminal_exec_cmd_from_template('l2_xconnect.vat', + interface1=sw_iface1, + interface2=sw_iface2) + vat.vat_terminal_exec_cmd_from_template('l2_xconnect.vat', + interface1=sw_iface2, + interface2=sw_iface1) + vat.vat_terminal_close() |