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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
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
21 | Honeycomb adds L2 FIB entry to bridge domain
22 | | [Documentation] | Add L2 FIB entry to the specified bridge domain using \
23 | | ... | Honyecomb API.
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
32 | | ... | \| Honeycomb adds L2 FIB entry to bridge domain \
33 | | ... | \| ${nodes['DUT1']} \| test_bd \| ${l2_fib_forward_cfg} \|
35 | | [Arguments] | ${node} | ${bd_name} | ${l2_fib_settings}
37 | | Add L2 FIB Entry | ${node} | ${bd_name} | ${l2_fib_settings}
39 | L2 FIB Table from Honeycomb should be empty
40 | | [Documentation] | Check if the L2 FIB table in the specified bridge domain \
43 | | ... | *Arguments:*
44 | | ... | - node - Information about a DUT node. Type: dictionary
45 | | ... | - bd_name - Name of the bridge domain. Type: string
48 | | ... | \| L2 FIB Table from Honeycomb should be empty \
49 | | ... | \| ${nodes['DUT1']} \| test_bd \|
51 | | [Arguments] | ${node} | ${bd_name}
53 | | ${l2_fib_data}= | Get All L2 FIB Entries | ${node} | ${bd_name}
54 | | Should be empty | ${l2_fib_data}
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.
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
66 | | ... | \| L2 FIB Entry from Honeycomb should be \
67 | | ... | \| ${nodes['DUT1']} \| test_bd \| ${l2_fib_forward_oper} \|
69 | | [Arguments] | ${node} | ${bd_name} | ${l2_fib_ref_data}
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}
75 | Honeycomb removes L2 FIB entry
76 | | [Documentation] | Remove the specified L2 FIB entry from the bridge \
77 | | ... | domain's L2 FIB table.
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
86 | | ... | \| Honeycomb removes L2 FIB entry \
87 | | ... | \| ${nodes['DUT1']} \| test_bd \
88 | | ... | \| ${l2_fib_forward_oper['phys-address']} \|
90 | | [Arguments] | ${node} | ${bd_name} | ${mac}
92 | | Remove L2 FIB Entry | ${node} | ${bd_name} | ${mac}
94 | Honeycomb removes all L2 FIB entries
95 | | [Documentation] | Remove all L2 FIB enties from the bridge domain's L2 FIB \
98 | | ... | *Arguments:*
99 | | ... | - node - Information about a DUT node. Type: dictionary
100 | | ... | - bd_name - Name of the bridge domain. Type: string
103 | | ... | \| Honeycomb removes all L2 FIB entries \
104 | | ... | \| ${nodes['DUT1']} \| test_bd \|
106 | | [Arguments] | ${node} | ${bd_name}
108 | | Remove all L2 FIB entries | ${node} | ${bd_name}
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.
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
121 | | ... | \| Honeycomb fails to add wrong L2 FIB entry \
122 | | ... | \| ${nodes['DUT1']} \| test_bd \| ${l2_fib_wrong_cfg} \|
124 | | [Arguments] | ${node} | ${bd_name} | ${l2_fib_settings}
126 | | Run keyword and expect error | *HoneycombError: * was not successful. *00.
127 | | ... | Add L2 FIB Entry | ${node} | ${bd_name} | ${l2_fib_settings}
129 | Honeycomb fails to modify L2 FIB entry
130 | | [Documentation] | Honeycomb tries to modify an existing L2 FIB entry and \
131 | | ... | expects to fail.
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
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 \|
147 | | [Arguments] | ${node} | ${bd_name} | ${mac} | ${param} | ${value}
149 | | Run keyword and expect error | *HoneycombError: * was not successful. *00.
150 | | ... | Modify L2 FIB Entry
151 | | ... | ${node} | ${bd_name} | ${mac} | ${param} | ${value}
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.
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
163 | | ... | \| L2 FIB entry from VAT should be \
164 | | ... | \| ${nodes['DUT1']} \| test_bd \| ${l2_fib_forward_oper} \|
166 | | [Arguments] | ${node} | ${bd_index} | ${l2_fib_ref_data}
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}
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.
176 | | ... | *Arguments:*
177 | | ... | - node - Information about a DUT node. Type: dictionary
178 | | ... | - bd_index - Index of the bridge domain. Type: integer
181 | | ... | \| L2 FIB Table from VAT should be empty \
182 | | ... | \| ${nodes['DUT1']} \| test_bd \|
184 | | [Arguments] | ${node} | ${bd_index}
186 | | ${l2_fib_data}= | Get L2 FIB table VAT | ${node} | ${bd_index}
187 | | Should be empty | ${l2_fib_data}