Add library for set path variables for testing.
[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 | VLAN subinterfaces initialized on 3-node topology
24 | | [Arguments] | ${DUT1} | ${INT1} | ${DUT2} | ${INT2} | ${SUB_ID}
25 | | ...         | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID} | ${TYPE_SUBIF}
26 | | [Documentation] | *Create two subinterfaces on DUTs.*
27 | | ...
28 | | ... | *Arguments:*
29 | | ... | - ${DUT1} - Node to add sub-interface.
30 | | ... | - ${INT1} - Interface name on which create sub-interface.
31 | | ... | - ${DUT2} - Node to add sub-interface.
32 | | ... | - ${INT2} - Interface name on which create sub-interface.
33 | | ... | - ${SUB_ID} - ID of the sub-interface to be created.
34 | | ... | - ${OUTER_VLAN_ID} - Outer VLAN ID.
35 | | ... | - ${INNER_VLAN_ID} - Inner VLAN ID.
36 | | ... | - ${TYPE_SUBIF} - Type of sub-interface.
37 | | ...
38 | | ... | _Set testcase variables with name and index of created interfaces:_
39 | | ... | - ${subif_name_1}
40 | | ... | - ${subif_index_1}
41 | | ... | - ${subif_name_2}
42 | | ... | - ${subif_index_2}
43 | | ...
44 | | ${subif_name_1} | ${subif_index_1}= | Create subinterface | ${DUT1}
45 | | ...                                 | ${INT1} | ${SUB_ID}
46 | | ...                                 | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID}
47 | | ...                                 | ${TYPE_SUBIF}
48 | | ${subif_name_2} | ${subif_index_2}= | Create subinterface | ${DUT2}
49 | | ...                                 | ${INT2} | ${SUB_ID}
50 | | ...                                 | ${OUTER_VLAN_ID} | ${INNER_VLAN_ID}
51 | | ...                                 | ${TYPE_SUBIF}
52 | | Set Interface State | ${DUT1} | ${subif_index_1} | up
53 | | Set Interface State | ${DUT2} | ${subif_index_2} | up
54 | | Set Test Variable | ${subif_name_1}
55 | | Set Test Variable | ${subif_index_1}
56 | | Set Test Variable | ${subif_name_2}
57 | | Set Test Variable | ${subif_index_2}
58
59 | L2 tag rewrite pop 2 tags setup on interfaces
60 | | [Arguments] | ${DUT1} | ${SUB_INT1} | ${DUT2} | ${SUB_INT2}
61 | | ...         | ${TAG_REWRITE_METHOD}
62 | | [Documentation] | *Setup tag rewrite on sub-interfaces on DUTs.*
63 | | ...
64 | | ... | *Arguments:*
65 | | ... | - ${DUT1} - Node to rewrite tags.
66 | | ... | - ${SUB_INT1} - Interface on which rewrite tags.
67 | | ... | - ${DUT2} - Node to rewrite tags.
68 | | ... | - ${SUB_INT2} - Interface on which rewrite tags.
69 | | ... | - ${TAG_REWRITE_METHOD} - Method of tag rewrite.
70 | | ...
71 | | L2 tag rewrite | ${DUT1} | ${SUB_INT1} | ${TAG_REWRITE_METHOD}
72 | | L2 tag rewrite | ${DUT2} | ${SUB_INT2} | ${TAG_REWRITE_METHOD}
73
74 | Interfaces and VLAN sub-interfaces inter-connected using L2-xconnect
75 | | [Arguments] | ${DUT1} | ${INT1} | ${SUB_INT1}
76 | | ...         | ${DUT2} | ${INT2} | ${SUB_INT2}
77 | | [Documentation] | *Add interface and subinterface to bidirectional
78 | | ...             | L2-xconnect on DUTs.*
79 | | ...
80 | | ... | *Arguments:*
81 | | ... | - ${DUT1} - Node to add bidirectional cross-connect.
82 | | ... | - ${INT1} - Interface to add to the cross-connect.
83 | | ... | - ${SUB_INT1} - Sub-interface to add to the cross-connect.
84 | | ... | - ${DUT2} - Node to add bidirectional cross-connect.
85 | | ... | - ${INT2} - Interface to add to the cross-connect.
86 | | ... | - ${SUB_INT2} - Sub-interface to add to the cross-connect.
87 | | ...
88 | | L2 setup xconnect on DUT | ${DUT1} | ${INT1} | ${SUB_INT1}
89 | | L2 setup xconnect on DUT | ${DUT2} | ${INT2} | ${SUB_INT2}