VPPD: VXLAN
[csit.git] / resources / libraries / robot / overlay / vxlan.robot
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:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
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.
13
14 *** Settings ***
15 | Library  | Collections
16 | Library  | resources.libraries.python.InterfaceUtil
17 | Library  | resources.libraries.python.IPUtil
18 | Library  | resources.libraries.python.IPv6Util
19 | Library  | resources.libraries.python.L2Util
20 | Library  | resources.libraries.python.NodePath
21 | ...
22 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
23 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
24 | Resource | resources/libraries/robot/shared/default.robot
25 | Resource | resources/libraries/robot/shared/interfaces.robot
26 | ...
27 | Documentation | VXLAN keywords
28
29 *** Keywords ***
30 | Create vlan interfaces for VXLAN
31 | | [Documentation] | *Create VLAN subinterface on interfaces on DUTs with given
32 | | ... | VLAN ID.*
33 | | ...
34 | | ... | _Set testcase variables with name and index of created interfaces:_
35 | | ... | - ${dut1s_vlan_name}
36 | | ... | - ${dut1s_vlan_index}
37 | | ... | - ${dut2s_vlan_name}
38 | | ... | - ${dut2s_vlan_index}
39 | | ...
40 | | [Arguments] | ${VLAN} | ${DUT1} | ${INT1} | ${DUT2} | ${INT2}
41 | | ${INT1_NAME}= | Get interface name | ${DUT1} | ${INT1}
42 | | ${INT2_NAME}= | Get interface name | ${DUT2} | ${INT2}
43 | | ${dut1s_vlan_name} | ${dut1s_vlan_index}= | Create Vlan Subinterface
44 | | ... | ${DUT1} | ${INT1_NAME} | ${VLAN}
45 | | ${dut2s_vlan_name} | ${dut2s_vlan_index}= | Create Vlan Subinterface
46 | | ... | ${DUT2} | ${INT2_NAME} | ${VLAN}
47 | | Set Interface State | ${DUT1} | ${dut1s_vlan_index} | up
48 | | Set Interface State | ${DUT2} | ${dut2s_vlan_index} | up
49 | | Set Test Variable | ${dut1s_vlan_name}
50 | | Set Test Variable | ${dut1s_vlan_index}
51 | | Set Test Variable | ${dut2s_vlan_name}
52 | | Set Test Variable | ${dut2s_vlan_index}
53
54 | Get VXLAN dump
55 | | [Documentation] | Get VXLAN dump.
56 | | ...
57 | | ... | *Arguments:*
58 | | ... | - node - DUT node data. Type: dictionary
59 | | ... | - interface - Interface on the VPP node (Optional). Type: string
60 | | ...
61 | | [Arguments] | ${dut_node} | ${interface}=${None}
62 | | ...
63 | | [Return] | ${vxlan_dump}
64 | | ...
65 | | ${vxlan_dump}= | VXLAN Dump | ${dut_node} | ${interface}