Add qinq through xconnect tests.
[csit.git] / resources / libraries / robot / tagging.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 | Documentation | Keywords for VLAN tests
16 | Resource | resources/libraries/robot/default.robot
17 | Resource | resources/libraries/robot/l2_xconnect.robot
18 | Library | resources.libraries.python.L2Util
19 | Library | resources.libraries.python.InterfaceUtil
20 | Library | resources.libraries.python.NodePath
21
22 *** Keywords ***
23
24 | Node path computed for 3-node topology
25 | | [Arguments] | ${TG} | ${DUT1} | ${DUT2} | ${TG}
26 | | [Documentation] | *Create interface variables for 3-node topology.*
27 | | ...
28 | | ... | *Arguments:*
29 | | ... | - ${TG} - Node attached to the path. Type: dictionary
30 | | ... | - ${DUT1} - Node attached to the path. Type: dictionary
31 | | ... | - ${DUT2} - Node attached to the path. Type: dictionary
32 | | ...
33 | | ... | _Set testcase variables for nodes and interfaces._
34 | | ... | - ${tg} - Variable for node in path. Type: dictionary
35 | | ... | - ${dut1} - Variable for node in path. Type: dictionary
36 | | ... | - ${dut2} - Variable for node in path. Type: dictionary
37 | | ... | - ${tg_if1} - First interface of TG node. Type: str
38 | | ... | - ${tg_if2} - Second interface of TG node. Type: str
39 | | ... | - ${dut1_if1} - First interface of first DUT node. Type: str
40 | | ... | - ${dut1_if2} - Second interface of first DUT node. Type: str
41 | | ... | - ${dut2_if1} - First interface of second DUT node. Type: str
42 | | ... | - ${dut2_if2} - Second interface of second DUT node. Type: str
43 | | ...
44 | | Append Nodes | ${TG} | ${DUT1} | ${DUT2} | ${TG}
45 | | Compute Path
46 | | ${tg_if1} | ${tg}= | Next Interface
47 | | ${dut1_if1} | ${dut1}= | Next Interface
48 | | ${dut1_if2} | ${dut1}= | Next Interface
49 | | ${dut2_if1} | ${dut2}= | Next Interface
50 | | ${dut2_if2} | ${dut2}= | Next Interface
51 | | ${tg_if2} | ${tg}= | Next Interface
52 | | Set Test Variable | ${tg}
53 | | Set Test Variable | ${tg_if1}
54 | | Set Test Variable | ${tg_if2}
55 | | Set Test Variable | ${dut1}
56 | | Set Test Variable | ${dut1_if1}
57 | | Set Test Variable | ${dut1_if2}
58 | | Set Test Variable | ${dut2}
59 | | Set Test Variable | ${dut2_if1}
60 | | Set Test Variable | ${dut2_if2}
61
62 | Interfaces in path are up
63 | | [Documentation] | *Set UP state on interfaces in path on nodes.*
64 | | ...
65 | | Set Interface State | ${tg} | ${tg_if1} | up
66 | | Set Interface State | ${tg} | ${tg_if2} | up
67 | | Set Interface State | ${dut1} | ${dut1_if1} | up
68 | | Set Interface State | ${dut1} | ${dut1_if2} | up
69 | | Set Interface State | ${dut2} | ${dut2_if1} | up
70 | | Set Interface State | ${dut2} | ${dut2_if2} | up
71 | | Vpp Node Interfaces Ready Wait | ${dut1}
72 | | Vpp Node Interfaces Ready Wait | ${dut2}
73
74 | VLAN subinterfaces initialized on 3-node topology
75 | | [Arguments] | ${DUT1} | ${INT1} | ${DUT2} | ${INT2} | ${SUB_ID}
76 | | ...         | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID} | ${TYPE_SUBIF}
77 | | [Documentation] | *Create two subinterfaces on DUTs.*
78 | | ...
79 | | ... | *Arguments:*
80 | | ... | - ${DUT1} - Node to add sub-interface.
81 | | ... | - ${INT1} - Interface name on which create sub-interface.
82 | | ... | - ${DUT2} - Node to add sub-interface.
83 | | ... | - ${INT2} - Interface name on which create sub-interface.
84 | | ... | - ${SUB_ID} - ID of the sub-interface to be created.
85 | | ... | - ${OUTER_VLAN_ID} - Outer VLAN ID.
86 | | ... | - ${INNER_VLAN_ID} - Inner VLAN ID.
87 | | ... | - ${TYPE_SUBIF} - Type of sub-interface.
88 | | ...
89 | | ... | _Set testcase variables with name and index of created interfaces:_
90 | | ... | - ${subif_name_1}
91 | | ... | - ${subif_index_1}
92 | | ... | - ${subif_name_2}
93 | | ... | - ${subif_index_2}
94 | | ...
95 | | ${subif_name_1} | ${subif_index_1}= | Create subinterface | ${DUT1}
96 | | ...                                 | ${INT1} | ${SUB_ID}
97 | | ...                                 | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID}
98 | | ...                                 | ${TYPE_SUBIF}
99 | | ${subif_name_2} | ${subif_index_2}= | Create subinterface | ${DUT2}
100 | | ...                                 | ${INT2} | ${SUB_ID}
101 | | ...                                 | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID}
102 | | ...                                 | ${TYPE_SUBIF}
103 | | Set Interface State | ${DUT1} | ${subif_index_1} | up
104 | | Set Interface State | ${DUT2} | ${subif_index_2} | up
105 | | Set Test Variable | ${subif_name_1}
106 | | Set Test Variable | ${subif_index_1}
107 | | Set Test Variable | ${subif_name_2}
108 | | Set Test Variable | ${subif_index_2}
109
110 | L2 tag rewrite pop 2 tags setup on interfaces
111 | | [Arguments] | ${DUT1} | ${SUB_INT1} | ${DUT2} | ${SUB_INT2}
112 | | ...         | ${TAG_REWRITE_METHOD}
113 | | [Documentation] | *Setup tag rewrite on sub-interfaces on DUTs.*
114 | | ...
115 | | ... | *Arguments:*
116 | | ... | - ${DUT1} - Node to rewrite tags.
117 | | ... | - ${SUB_INT1} - Interface on which rewrite tags.
118 | | ... | - ${DUT2} - Node to rewrite tags.
119 | | ... | - ${SUB_INT2} - Interface on which rewrite tags.
120 | | ... | - ${TAG_REWRITE_METHOD} - Method of tag rewrite.
121 | | ...
122 | | L2 tag rewrite | ${DUT1} | ${SUB_INT1} | ${TAG_REWRITE_METHOD}
123 | | L2 tag rewrite | ${DUT2} | ${SUB_INT2} | ${TAG_REWRITE_METHOD}
124
125 | Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect
126 | | [Arguments] | ${DUT1} | ${INT1} | ${SUB_INT1}
127 | | ...         | ${DUT2} | ${INT2} | ${SUB_INT2}
128 | | [Documentation] | *Add interface and subinterface to bidirectional
129 | | ...             | L2-xconnect on DUTs.*
130 | | ...
131 | | ... | *Arguments:*
132 | | ... | - ${DUT1} - Node to add bidirectional cross-connect.
133 | | ... | - ${INT1} - Interface to add to the cross-connect.
134 | | ... | - ${SUB_INT1} - Sub-interface to add to the cross-connect.
135 | | ... | - ${DUT2} - Node to add bidirectional cross-connect.
136 | | ... | - ${INT2} - Interface to add to the cross-connect.
137 | | ... | - ${SUB_INT2} - Sub-interface to add to the cross-connect.
138 | | ...
139 | | L2 setup xconnect on DUT | ${DUT1} | ${INT1} | ${SUB_INT1}
140 | | L2 setup xconnect on DUT | ${DUT2} | ${INT2} | ${SUB_INT2}