1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
14 """Library to set up cross-connect in topology."""
16 from resources.libraries.python.VatExecutor import VatExecutor
17 from resources.libraries.python.topology import Topology
19 __all__ = ['CrossConnectSetup']
21 class CrossConnectSetup(object):
22 """Crossconnect setup in topology."""
28 def vpp_setup_bidirectional_cross_connect(node, interface1, interface2):
29 """Create crossconnect between 2 interfaces on vpp node.
31 :param node: Node to add bidirectional crossconnect
32 :param interface1: first interface
33 :param interface2: second interface
38 sw_iface1 = Topology().get_interface_sw_index(node, interface1)
39 sw_iface2 = Topology().get_interface_sw_index(node, interface2)
40 VatExecutor.cmd_from_template(node, "l2_xconnect.vat",
43 VatExecutor.cmd_from_template(node, "l2_xconnect.vat",