1 # Copyright (c) 2019 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.
15 | Library | resources.libraries.python.L2Util
16 | Library | resources.libraries.python.InterfaceUtil
20 | | [Documentation] | Setup Bidirectional Cross Connect on DUTs
21 | | [Arguments] | ${node} | ${if1} | ${if2} |
22 | | Set Interface State | ${node} | ${if1} | up
23 | | Set Interface State | ${node} | ${if2} | up
24 | | Vpp Setup Bidirectional Cross Connect | ${node} | ${if1} | ${if2}
26 | Initialize L2 cross connect on node
28 | | ... | Setup L2 cross connect topology by connecting RX/TX of two interfaces
29 | | ... | on each DUT. Interfaces are brought up.
31 | | ... | *Arguments:*
32 | | ... | - dut - DUT node. Type: string
33 | | ... | - count - Number of interfaces pairs to connect. Type: integer
37 | | ... | \| Initialize L2 cross connect on node \| DUT1 \| 1 \|
39 | | [Arguments] | ${dut} | ${count}=${1}
41 | | :FOR | ${id} | IN RANGE | 1 | ${count} + 1
42 | | | ${dut_str}= | Convert To Lowercase | ${dut}
43 | | | Vpp Setup Bidirectional Cross Connect | ${nodes['${dut}']}
44 | | | ... | ${${dut_str}_${prev_layer}_${id}_1}
45 | | | ... | ${${dut_str}_${prev_layer}_${id}_2}
47 | Initialize L2 cross connect
49 | | ... | Setup L2 cross connect topology by connecting RX/TX of two interfaces
50 | | ... | on each DUT. Interfaces are brought up.
52 | | ... | *Arguments:*
53 | | ... | - count - Number of interfaces pairs to connect. Type: integer
57 | | ... | \| Initialize L2 cross connect \| 1 \|
59 | | [Arguments] | ${count}=${1}
61 | | :FOR | ${dut} | IN | @{duts}
62 | | | Initialize L2 cross connect on node | ${dut} | count=${count}