CSIT-576 HC Test: Improve SPAN test coverage
[csit.git] / resources / libraries / robot / honeycomb / l2_fib.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 | resources.libraries.python.L2Util
16 | Library | resources.libraries.python.honeycomb.HcAPIKwBridgeDomain.BridgeDomainKeywords
17 | Library | resources.libraries.python.honeycomb.HcAPIKwInterfaces.InterfaceKeywords
18 | ...     | WITH NAME | InterfaceAPI
19
20 *** Keywords ***
21 | Honeycomb adds L2 FIB entry to bridge domain
22 | | [Documentation] | Add L2 FIB entry to the specified bridge domain using \
23 | | ... | Honyecomb API.
24 | | ...
25 | | ... | *Arguments:*
26 | | ... | - node - Information about a DUT node. Type: dictionary
27 | | ... | - bd_name - Name of the bridge domain. Type: string
28 | | ... | - l2_fib_settings - The parameters of the new L2 FIB entry. \
29 | | ... | Type: dictionary
30 | | ...
31 | | ... | *Example:*
32 | | ... | \| Honeycomb adds L2 FIB entry to bridge domain \
33 | | ... | \| ${nodes['DUT1']} \| test_bd \| ${l2_fib_forward_cfg} \|
34 | | ...
35 | | [Arguments] | ${node} | ${bd_name} | ${l2_fib_settings}
36 | | ...
37 | | Add L2 FIB Entry | ${node} | ${bd_name} | ${l2_fib_settings}
38
39 | L2 FIB Table from Honeycomb should be empty
40 | | [Documentation] | Check if the L2 FIB table in the specified bridge domain \
41 | | ... | is empty.
42 | | ...
43 | | ... | *Arguments:*
44 | | ... | - node - Information about a DUT node. Type: dictionary
45 | | ... | - bd_name - Name of the bridge domain. Type: string
46 | | ...
47 | | ... | *Example:*
48 | | ... | \| L2 FIB Table from Honeycomb should be empty \
49 | | ... | \| ${nodes['DUT1']} \| test_bd \|
50 | | ...
51 | | [Arguments] | ${node} | ${bd_name}
52 | | ...
53 | | ${l2_fib_data}= | Get All L2 FIB Entries | ${node} | ${bd_name}
54 | | Should be empty | ${l2_fib_data}
55
56 | L2 FIB Entry from Honeycomb should be
57 | | [Documentation] | Retrieves the operational data about the specified L2 \
58 | | ... | FIB entry and checks if they are as expected.
59 | | ...
60 | | ... | *Arguments:*
61 | | ... | - node - Information about a DUT node. Type: dictionary
62 | | ... | - bd_name - Name of the bridge domain. Type: string
63 | | ... | - l2_fib_ref_data - L2 FIB entry referential data. Type: dictionay
64 | | ...
65 | | ... | *Example:*
66 | | ... | \| L2 FIB Entry from Honeycomb should be \
67 | | ... | \| ${nodes['DUT1']} \| test_bd \| ${l2_fib_forward_oper} \|
68 | | ...
69 | | [Arguments] | ${node} | ${bd_name} | ${l2_fib_ref_data}
70 | | ...
71 | | ${l2_fib_data}= | Get L2 FIB Entry | ${node} | ${bd_name}
72 | | ... | ${l2_fib_ref_data['phys-address']}
73 | | interfaceAPI.Compare Data Structures | ${l2_fib_data} | ${l2_fib_ref_data}
74
75 | Honeycomb removes L2 FIB entry
76 | | [Documentation] | Remove the specified L2 FIB entry from the bridge \
77 | | ... | domain's L2 FIB table.
78 | | ...
79 | | ... | *Arguments:*
80 | | ... | - node - Information about a DUT node. Type: dictionary
81 | | ... | - bd_name - Name of the bridge domain. Type: string
82 | | ... | - mac - MAC address used as the key in L2 FIB data structure. \
83 | | ... | Type: string
84 | | ...
85 | | ... | *Example:*
86 | | ... | \| Honeycomb removes L2 FIB entry \
87 | | ... | \| ${nodes['DUT1']} \| test_bd \
88 | | ... | \| ${l2_fib_forward_oper['phys-address']} \|
89 | | ...
90 | | [Arguments] | ${node} | ${bd_name} | ${mac}
91 | | ...
92 | | Remove L2 FIB Entry | ${node} | ${bd_name} | ${mac}
93
94 | Honeycomb removes all L2 FIB entries
95 | | [Documentation] | Remove all L2 FIB enties from the bridge domain's L2 FIB \
96 | | ... | table.
97 | | ...
98 | | ... | *Arguments:*
99 | | ... | - node - Information about a DUT node. Type: dictionary
100 | | ... | - bd_name - Name of the bridge domain. Type: string
101 | | ...
102 | | ... | *Example:*
103 | | ... | \| Honeycomb removes all L2 FIB entries \
104 | | ... | \| ${nodes['DUT1']} \| test_bd \|
105 | | ...
106 | | [Arguments] | ${node} | ${bd_name}
107 | | ...
108 | | Remove all L2 FIB entries | ${node} | ${bd_name}
109
110 | Honeycomb fails to add wrong L2 FIB entry
111 | | [Documentation] | Honeycomb tries to add a wrong L2 FIB entry and expects \
112 | | ... | that it fails.
113 | | ...
114 | | ... | *Arguments:*
115 | | ... | - node - Information about a DUT node. Type: dictionary
116 | | ... | - bd_name - Name of the bridge domain. Type: string
117 | | ... | - l2_fib_settings - The wrong parameters of the new L2 FIB entry. \
118 | | ... | Type: dictionary
119 | | ...
120 | | ... | *Example:*
121 | | ... | \| Honeycomb fails to add wrong L2 FIB entry \
122 | | ... | \| ${nodes['DUT1']} \| test_bd \| ${l2_fib_wrong_cfg} \|
123 | | ...
124 | | [Arguments] | ${node} | ${bd_name} | ${l2_fib_settings}
125 | | ...
126 | | Run keyword and expect error | *HoneycombError: * was not successful. *00.
127 | | ... | Add L2 FIB Entry | ${node} | ${bd_name} | ${l2_fib_settings}
128
129 | Honeycomb fails to modify L2 FIB entry
130 | | [Documentation] | Honeycomb tries to modify an existing L2 FIB entry and \
131 | | ... | expects to fail.
132 | | ...
133 | | ... | *Arguments:*
134 | | ... | - node - Information about a DUT node. Type: dictionary
135 | | ... | - bd_name - Name of the bridge domain. Type: string
136 | | ... | - mac - MAC address used as the key in L2 FIB data structure. \
137 | | ... | Type: string
138 | | ... | - param - The parameter to be modified. Type: string
139 | | ... | - value - The new value of the parameter. Type: string or integer
140 | | ...
141 | | ... | *Example:*
142 | | ... | \| Honeycomb fails to modify L2 FIB entry \
143 | | ... | \| ${nodes['DUT1']} \| test_bd \
144 | | ... | \| ${l2_fib_forward_oper['phys-address']} \| action \
145 | | ... | \| l2-fib-forward \|
146 | | ...
147 | | [Arguments] | ${node} | ${bd_name} | ${mac} | ${param} | ${value}
148 | | ...
149 | | Run keyword and expect error | *HoneycombError: * was not successful. *00.
150 | | ... | Modify L2 FIB Entry
151 | | ... | ${node} | ${bd_name} | ${mac} | ${param} | ${value}
152
153 | L2 FIB entry from VAT should be
154 | | [Documentation] | Retrieves the operational data about the specified L2 \
155 | | ... | FIB entry using VAT and checks if it is as expected.
156 | | ...
157 | | ... | *Arguments:*
158 | | ... | - node - Information about a DUT node. Type: dictionary
159 | | ... | - bd_index - Index of the bridge domain. Type: integer
160 | | ... | - l2_fib_ref_data - L2 FIB entry referential data. Type: dictionay
161 | | ...
162 | | ... | *Example:*
163 | | ... | \| L2 FIB entry from VAT should be \
164 | | ... | \| ${nodes['DUT1']} \| test_bd \| ${l2_fib_forward_oper} \|
165 | | ...
166 | | [Arguments] | ${node} | ${bd_index} | ${l2_fib_ref_data}
167 | | ...
168 | | ${l2_fib_data}= | Get L2 FIB entry VAT | ${node} | ${bd_index}
169 | | ... | ${l2_fib_ref_data['mac']}
170 | | interfaceAPI.Compare Data Structures | ${l2_fib_data} | ${l2_fib_ref_data}
171
172 | L2 FIB Table from VAT should be empty
173 | | [Documentation] | Check if the L2 FIB table in the specified bridge domain \
174 | | ... | is empty. VAT is used to get operational data.
175 | | ...
176 | | ... | *Arguments:*
177 | | ... | - node - Information about a DUT node. Type: dictionary
178 | | ... | - bd_index - Index of the bridge domain. Type: integer
179 | | ...
180 | | ... | *Example:*
181 | | ... | \| L2 FIB Table from VAT should be empty \
182 | | ... | \| ${nodes['DUT1']} \| test_bd \|
183 | | ...
184 | | [Arguments] | ${node} | ${bd_index}
185 | | ...
186 | | ${l2_fib_data}= | Get L2 FIB table VAT | ${node} | ${bd_index}
187 | | Should be empty | ${l2_fib_data}