4 Vhosts setup test
[csit.git] / resources / libraries / robot / vxlan.robot
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:
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 | Resource | resources/libraries/robot/default.robot
17 | Resource | resources/libraries/robot/interfaces.robot
18 | Resource | resources/libraries/robot/bridge_domain.robot
19 | Resource | resources/libraries/robot/l2_xconnect.robot
20 | Library  | resources.libraries.python.L2Util
21 | Library  | resources.libraries.python.IPUtil
22 | Library  | resources.libraries.python.IPv4Util
23 | Library  | resources.libraries.python.IPv4Setup
24 | Library  | resources.libraries.python.NodePath
25
26 *** Keywords ***
27 | IP addresses are set on interfaces
28 | | [Documentation] | *Set IPv4 addresses on interfaces on DUTs.*
29 | | ... | If interface index is None then is determines with Get Interface Sw Index
30 | | ... | It also executes VPP IP Probe to determine MACs to IPs on DUTs
31 | | ...
32 | | ... | _Set testcase variables with IP addresses and prefix length:_
33 | | ... | - ${dut1s_ip_address}
34 | | ... | - ${dut2s_ip_address}
35 | | ... | - ${duts_ip_address_prefix}
36 | | ...
37 | | [Arguments] | ${DUT1} | ${DUT1_INT_NAME} | ${DUT1_INT_INDEX}
38 | | ...         | ${DUT2} | ${DUT2_INT_NAME} | ${DUT2_INT_INDEX}
39 | | Set Test Variable | ${dut1s_ip_address} | 172.16.0.1
40 | | Set Test Variable | ${dut2s_ip_address} | 172.16.0.2
41 | | Set Test Variable | ${duts_ip_address_prefix} | 24
42 | | ${DUT1_INT_INDEX}= | Run Keyword If | ${DUT1_INT_INDEX} is None
43 | |                    | ... | Get Interface Sw Index | ${DUT1} | ${DUT1_INT_NAME}
44 | |                    | ... | ELSE | Set Variable | ${DUT1_INT_INDEX}
45 | | ${DUT2_INT_INDEX}= | Run Keyword If | ${DUT2_INT_INDEX} is None
46 | |                    | ... | Get Interface Sw Index | ${DUT2} | ${DUT2_INT_NAME}
47 | |                    | ... | ELSE | Set Variable | ${DUT2_INT_INDEX}
48 | | Set Interface Address | ${DUT1} | ${DUT1_INT_INDEX}
49 | | ... | ${dut1s_ip_address} | ${duts_ip_address_prefix}
50 | | Set Interface Address | ${DUT2} | ${DUT2_INT_INDEX}
51 | | ... | ${dut2s_ip_address} | ${duts_ip_address_prefix}
52 | | VPP IP Probe | ${DUT1} | ${DUT1_INT_NAME} | ${dut2s_ip_address}
53 | | VPP IP Probe | ${DUT2} | ${DUT2_INT_NAME} | ${dut1s_ip_address}
54
55 | VXLAN interface is created
56 | | [Arguments] | ${DUT} | ${VNI} | ${SRC_IP} | ${DST_IP}
57 | | Create VXLAN interface | ${DUT} | ${VNI} | ${SRC_IP} | ${DST_IP}
58
59 | Interfaces are added to BD
60 | | [Arguments] | ${DUT} | ${BID} | ${INTERFACE_1} | ${INTERFACE_2}
61 | | Vpp Add L2 Bridge Domain | ${DUT} | ${BID} | ${INTERFACE_1} | ${INTERFACE_2}
62
63 | Interfaces are added to xconnect
64 | | [Arguments] | ${DUT} | ${INTERFACE_1} | ${INTERFACE_2}
65 | | L2 setup xconnect on DUT | ${DUT} | ${INTERFACE_1} | ${INTERFACE_2}
66
67 | Vlan interfaces for VXLAN are created
68 | | [Documentation] | *Create VLAN subinterface on interfaces on DUTs with given VLAN ID.*
69 | | ...
70 | | ... | _Set testcase variables with name and index of created interfaces:_
71 | | ... | - ${dut1s_vlan_name}
72 | | ... | - ${dut1s_vlan_index}
73 | | ... | - ${dut2s_vlan_name}
74 | | ... | - ${dut2s_vlan_index}
75 | | ...
76 | | [Arguments] | ${VLAN} | ${DUT1} | ${INT1} | ${DUT2} | ${INT2}
77 | | ${dut1s_vlan_name} | ${dut1s_vlan_index}= | Create Vlan Subinterface
78 | |                    | ...                  | ${DUT1} | ${INT1} | ${VLAN}
79 | | ${dut2s_vlan_name} | ${dut2s_vlan_index}= | Create Vlan Subinterface
80 | |                    | ...                  | ${DUT2} | ${INT2} | ${VLAN}
81 | | Set Interface State | ${DUT1} | ${dut1s_vlan_index} | up
82 | | Set Interface State | ${DUT2} | ${dut2s_vlan_index} | up
83 | | Set Test Variable | ${dut1s_vlan_name}
84 | | Set Test Variable | ${dut1s_vlan_index}
85 | | Set Test Variable | ${dut2s_vlan_name}
86 | | Set Test Variable | ${dut2s_vlan_index}

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.