Commit ed0c43f
[QOS - Test PFC Pause] Multi VLAN Support (sonic-net#16725)
What is the motivation for this PR?
As new testbeds are being created with more VLANs, the assumption that a device should only contain 1 VLAN no longer holds. As such, certain helpers/parts of the framework need to be modified to allow for multiple VLANs to be present and tested.
How did you do it?
Added a get_all_vlans function to extract all vlans from the duthost object
The functions which get information related to vlans (get_active_vlan_members and get_vlan_subnet) now take a vlan configuration dictionary (which itself is taken from the get_all_vlans function)
pfc_test_setup now returns a list of VLAN configurations, instead of just one
The run_test wrapper now runs the relevant test for each VLAN supplied
Also removed gen_testbed_t0, which is not used anywhere (validated with grep)
How did you verify/test it?
Before this change, running the qos/test_pfc_pause.py on a testbed with multiple VLANs produced the following output:
@pytest.fixture(scope="module", autouse=True)
def pfc_test_setup(duthosts, rand_one_dut_hostname, tbinfo, ptfhost):
"""
Generate configurations for the tests
Args:
duthosts(AnsibleHost) : multi dut instance
rand_one_dut_hostname(string) : one of the dut instances from the multi dut
Yields:
setup(dict): DUT interfaces, PTF interfaces, PTF IP addresses, and PTF MAC addresses
"""
""" Get all the active physical interfaces enslaved to the Vlan """
""" These interfaces are actually server-faced interfaces at T0 """
duthost = duthosts[rand_one_dut_hostname]
> vlan_members, vlan_id = get_active_vlan_members(duthost)
E TypeError: cannot unpack non-iterable NoneType object
With these changes, it is now successfully running:
image
Any platform specific information?
Any platform with only one VLAN - as each of the new lists/dicts will only contain one VLAN, iterating through them will cause the same behaviour as before.1 parent 09494dc commit ed0c43f
2 files changed
+163
-179
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
148 | 147 | | |
149 | 148 | | |
150 | 149 | | |
151 | | - | |
| 150 | + | |
152 | 151 | | |
153 | | - | |
| 152 | + | |
154 | 153 | | |
155 | | - | |
| 154 | + | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
161 | | - | |
162 | | - | |
163 | | - | |
| 160 | + | |
| 161 | + | |
164 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
165 | 170 | | |
166 | | - | |
167 | | - | |
| 171 | + | |
168 | 172 | | |
169 | | - | |
170 | | - | |
171 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
| |||
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
180 | | - | |
| 184 | + | |
181 | 185 | | |
182 | 186 | | |
183 | 187 | | |
| 188 | + | |
184 | 189 | | |
185 | 190 | | |
186 | 191 | | |
187 | 192 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | 200 | | |
231 | 201 | | |
232 | 202 | | |
| |||
0 commit comments