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