forked from dgubanovv/qa-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fw_2x_proxy_speed.py
623 lines (493 loc) · 22.2 KB
/
fw_2x_proxy_speed.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
"""
THIS SCRIPT MUST BE EXECUTED ON LKP.
"""
import os
import shutil
import time
import tempfile
import pytest
from tools.atltoolper import AtlTool
from tools.constants import LINK_SPEED_100M, LINK_SPEED_1G, LINK_SPEED_2_5G, LINK_SPEED_5G, LINK_SPEED_10G, \
LINK_SPEED_AUTO, LINK_SPEED_NO_LINK, FELICITY_CARDS
from tools.driver import Driver, DRV_TYPE_DIAG
from tools.drv_iface_cfg import DrvEthConfig, OffloadIpInfo
from tools.mbuper import LINK_SPEED_TO_REG_VAL_MAP, LINK_SPEED_TO_REG_VAL_MAP_2X, LINK_STATE_UP
from tools.utils import get_atf_logger
from infra.test_base import TestBase
from tools.lom import LightsOutManagement
log = get_atf_logger()
def setup_module(module):
# import tools._test_setup # uncomment for manual test setup
os.environ["TEST"] = "fw_2x_proxy_speed"
class TestFw2xProxySpeed(TestBase):
"""
@description: The proxy speed test is dedicated to verify minimal link speed feature. In sleep proxy mode firmware
should negotiate minimal possible link speed. The test is running on LKP. Precondition: DUT is configured for
sleep proxy mode.
@setup: Two Aquantia devices connected back to back.
"""
@classmethod
def setup_class(cls):
super(TestFw2xProxySpeed, cls).setup_class()
try:
cls.log_server_dir = cls.create_logs_dir_on_log_server()
cls.install_firmwares()
cls.dut_driver = Driver(port=cls.dut_port, version="latest", drv_type=DRV_TYPE_DIAG, host=cls.dut_hostname)
cls.lkp_driver = Driver(port=cls.lkp_port, version="latest", drv_type=DRV_TYPE_DIAG)
cls.dut_driver.install()
cls.lkp_driver.install()
cls.setup_sleep_proxy_on_dut()
cls.lkp_atltool_wrapper = AtlTool(port=cls.lkp_port)
cls.dut_nof_pci_lanes = cls.dut_ifconfig.get_nof_pci_lines()
cls.lkp_nof_pci_lanes = cls.lkp_ifconfig.get_nof_pci_lines()
cls.lkp_fw_is_1x = cls.lkp_firmware.is_1x()
except Exception as e:
log.exception("Failed while setting up class")
raise e
def setup_method(self, method):
super(TestFw2xProxySpeed, self).setup_method(method)
if self.MCP_LOG:
self.bin_log_file, self.txt_log_file = self.lkp_atltool_wrapper.debug_buffer_enable(True)
if os.environ.get("LOM_TEST", None):
self.LOM_ctrl = LightsOutManagement(host=self.dut_hostname, port=self.dut_port)
self.LOM_ctrl.set_lom_mac_address(self.LOM_ctrl.LOM_MAC_ADDRESS)
self.LOM_ctrl.LoM_enable()
self.LOM_ctrl.set_lom_ip_address(self.LOM_ctrl.LOM_IP_ADDRESS)
def teardown_method(self, method):
super(TestFw2xProxySpeed, self).teardown_method(method)
if os.environ.get("LOM_TEST", None):
self.LOM_ctrl.LoM_disable()
if self.MCP_LOG:
self.lkp_atltool_wrapper.debug_buffer_enable(False)
shutil.copy(self.bin_log_file, self.test_log_dir)
shutil.copy(self.txt_log_file, self.test_log_dir)
@classmethod
def setup_sleep_proxy_on_dut(cls):
log.info("Configuring sleep proxy on DUT")
cfg = DrvEthConfig()
cfg.version = 0
cfg.len = 0x407 # not used
cfg.mac = cls.suggest_test_mac_address(cls.dut_port, cls.dut_hostname)
ips = OffloadIpInfo()
ips.v4_addresses = ["192.168.0.2"]
ips.v4_masks = [24]
cfg.ips = ips
beton_code = cfg.get_beton()
beton_code.insert(0, "writereg 0x36c 0x0")
beton_code.insert(1, "pause 2 s")
beton_file = os.path.join(cls.log_local_dir, "offload.txt")
with open(beton_file, "w") as f:
f.write("\n".join(beton_code))
dut_atltool_wrapper = AtlTool(port=cls.dut_port, host=cls.dut_hostname)
dut_atltool_wrapper.exec_beton(beton_code)
log.info("Sleep proxy has been configured")
def set_link_speed_on_lkp(self, speed):
if self.lkp_fw_is_1x:
self.lkp_atltool_wrapper.writereg(0x368, speed << 16 | LINK_STATE_UP)
else:
self.lkp_atltool_wrapper.writereg(0x368, speed)
time.sleep(0.1) # give firmware a chance to write zero to 0x36c
def link_speed_test(self, speed_array, expected_speed):
for s in speed_array:
if self.dut_fw_card not in FELICITY_CARDS:
if s == LINK_SPEED_10G and (self.dut_nof_pci_lanes != 4 or self.lkp_nof_pci_lanes != 4):
pytest.xfail()
else:
if self.supported_speeds is None:
raise Exception("Do not know supported speeds on Felicity")
if s not in self.supported_speeds:
pytest.xfail()
speed = 0
for s in speed_array:
if self.lkp_fw_is_1x:
speed |= LINK_SPEED_TO_REG_VAL_MAP[s]
else:
speed |= LINK_SPEED_TO_REG_VAL_MAP_2X[s]
self.set_link_speed_on_lkp(speed)
actual_speed = self.lkp_atltool_wrapper.wait_link_up(timeout=20)
assert actual_speed == expected_speed
def link_switch_test(self, speed_array):
for speed in speed_array:
assert speed != LINK_SPEED_NO_LINK # logic check
if self.dut_fw_card in FELICITY_CARDS:
if self.supported_speeds is None:
raise Exception("Do not know supported speeds on Felicity")
if speed not in self.supported_speeds:
continue
else:
if speed == LINK_SPEED_10G and (self.dut_nof_pci_lanes != 4 or self.lkp_nof_pci_lanes != 4):
log.info("Skipping 10G link check because it's not supported")
continue
if self.lkp_fw_is_1x:
s = LINK_SPEED_TO_REG_VAL_MAP[LINK_SPEED_NO_LINK]
else:
s = LINK_SPEED_TO_REG_VAL_MAP_2X[LINK_SPEED_NO_LINK]
self.set_link_speed_on_lkp(s)
if self.lkp_fw_is_1x:
_, s, __ = self.lkp_atltool_wrapper.get_link_params()
else:
s = self.lkp_atltool_wrapper.get_link_speed_2x()
assert s == LINK_SPEED_NO_LINK
if speed == LINK_SPEED_AUTO:
expected_speed = LINK_SPEED_100M
else:
expected_speed = speed
if self.lkp_fw_is_1x:
self.set_link_speed_on_lkp(LINK_SPEED_TO_REG_VAL_MAP[speed])
else:
self.set_link_speed_on_lkp(LINK_SPEED_TO_REG_VAL_MAP_2X[speed])
actual_speed = self.lkp_atltool_wrapper.wait_link_up(timeout=20)
assert actual_speed == expected_speed
# List set up tests
# Tests are mixed to make sure that link switch happens every time from test to test, i. e.
# expected link speed always differs from previous test run
# Please keep them mixed
def test_single_speed_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes only 100M.
@steps:
1. Set link speed 100M on LKP.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_100M], LINK_SPEED_100M)
def test_single_speed_1g(self):
"""
@description: This subtest checks that DUT will negotiate 1G if LKP advertizes only 1G.
@steps:
1. Set link speed 1G on LKP.
2. Wait for link up.
3. Make sure that link 1G is negotiated on LKP.
@result: 1G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_1G], LINK_SPEED_1G)
def test_multiple_speed_10g_1g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes 10G, 1G and 100M link speeds.
@steps:
1. Let LKP advertize 10G, 1G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_1G, LINK_SPEED_100M], LINK_SPEED_100M)
def test_single_speed_2_5g(self):
"""
@description: This subtest checks that DUT will negotiate 2.5G if LKP advertizes only 2.5G.
@steps:
1. Set link speed 2.5G on LKP.
2. Wait for link up.
3. Make sure that link 2.5G is negotiated on LKP.
@result: 2.5G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_2_5G], LINK_SPEED_2_5G)
def test_multiple_speed_10g_5g_2_5g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes 10G, 5G, 2.5G and
100M link speeds.
@steps:
1. Let LKP advertize 10G, 5G, 2.5G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_5G, LINK_SPEED_2_5G, LINK_SPEED_100M], LINK_SPEED_100M)
def test_single_speed_5g(self):
"""
@description: This subtest checks that DUT will negotiate 5G if LKP advertizes only 5G.
@steps:
1. Set link speed 5G on LKP.
2. Wait for link up.
3. Make sure that link 5G is negotiated on LKP.
@result: 5G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_5G], LINK_SPEED_5G)
def test_multiple_speed_10g_2_5g_1g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes 10G, 2.5G, 1G and
100M link speeds.
@steps:
1. Let LKP advertize 10G, 2.5G, 1G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_2_5G, LINK_SPEED_1G, LINK_SPEED_100M], LINK_SPEED_100M)
def test_single_speed_10g(self):
"""
@description: This subtest checks that DUT will negotiate 10G if LKP advertizes only 10G.
@steps:
1. Set link speed 10G on LKP.
2. Wait for link up.
3. Make sure that link 10G is negotiated on LKP.
@result: 10G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G], LINK_SPEED_10G)
def test_single_speed_auto(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes all link speeds.
@steps:
1. Set autoneg on LKP.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_AUTO], LINK_SPEED_100M)
def test_multiple_speed_2_5g_1g(self):
"""
@description: This subtest checks that DUT will negotiate 1G if LKP advertizes 2.5G and 1G link speeds.
@steps:
1. Let LKP advertize 2.5G and 1G link speeds.
2. Wait for link up.
3. Make sure that link 1G is negotiated on LKP.
@result: 1G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_2_5G, LINK_SPEED_1G], LINK_SPEED_1G)
def test_multiple_speed_1g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes 1G and 100M link speeds.
@steps:
1. Let LKP advertize 1G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_1G, LINK_SPEED_100M], LINK_SPEED_100M)
def test_multiple_speed_5g_1g(self):
"""
@description: This subtest checks that DUT will negotiate 1G if LKP advertizes 5G and 1G link speeds.
@steps:
1. Let LKP advertize 5G and 1G link speeds.
2. Wait for link up.
3. Make sure that link 1G is negotiated on LKP.
@result: 1G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_5G, LINK_SPEED_1G], LINK_SPEED_1G)
def test_multiple_speed_2_5g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes 2.5G and 100M link speeds.
@steps:
1. Let LKP advertize 2.5G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_2_5G, LINK_SPEED_100M], LINK_SPEED_100M)
def test_multiple_speed_10g_1g(self):
"""
@description: This subtest checks that DUT will negotiate 1G if LKP advertizes 10G and 1G link speeds.
@steps:
1. Let LKP advertize 10G and 1G link speeds.
2. Wait for link up.
3. Make sure that link 1G is negotiated on LKP.
@result: 1G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_1G], LINK_SPEED_1G)
def test_multiple_speed_5g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes 5G and 100M link speeds.
@steps:
1. Let LKP advertize 5G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_5G, LINK_SPEED_100M], LINK_SPEED_100M)
def test_multiple_speed_5g_2_5g(self):
"""
@description: This subtest checks that DUT will negotiate 2.5G if LKP advertizes 5G and 2.5G link speeds.
@steps:
1. Let LKP advertize 5G and 2.5G link speeds.
2. Wait for link up.
3. Make sure that link 2.5G is negotiated on LKP.
@result: 2.5G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_5G, LINK_SPEED_2_5G], LINK_SPEED_2_5G)
def test_multiple_speed_10g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes 10G and 100M link speeds.
@steps:
1. Let LKP advertize 10G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_100M], LINK_SPEED_100M)
def test_multiple_speed_10g_2_5g(self):
"""
@description: This subtest checks that DUT will negotiate 2.5G if LKP advertizes 10G and 2.5G link speeds.
@steps:
1. Let LKP advertize 10G and 2.5G link speeds.
2. Wait for link up.
3. Make sure that link 2.5G is negotiated on LKP.
@result: 2.5G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_2_5G], LINK_SPEED_2_5G)
def test_multiple_speed_10g_5g(self):
"""
@description: This subtest checks that DUT will negotiate 5G if LKP advertizes 10G and 5G link speeds.
@steps:
1. Let LKP advertize 10G and 5G link speeds.
2. Wait for link up.
3. Make sure that link 5G is negotiated on LKP.
@result: 5G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_5G], LINK_SPEED_5G)
def test_multiple_speed_2_5g_1g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes 2.5G, 1G and 100M link speeds.
@steps:
1. Let LKP advertize 2.5G, 1G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_2_5G, LINK_SPEED_1G, LINK_SPEED_100M], LINK_SPEED_100M)
def test_multiple_speed_5g_2_5g_1g(self):
"""
@description: This subtest checks that DUT will negotiate 1G if LKP advertizes 5G, 2.5G and 1G link speeds.
@steps:
1. Let LKP advertize 5G, 2.5G and 1G link speeds.
2. Wait for link up.
3. Make sure that link 1G is negotiated on LKP.
@result: 1G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_5G, LINK_SPEED_2_5G, LINK_SPEED_1G], LINK_SPEED_1G)
def test_multiple_speed_5g_2_5g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes 5G, 2.5G and 100M link speeds.
@steps:
1. Let LKP advertize 5G, 2.5G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_5G, LINK_SPEED_2_5G, LINK_SPEED_100M], LINK_SPEED_100M)
def test_multiple_speed_10g_5g_2_5g(self):
"""
@description: This subtest checks that DUT will negotiate 2.5G if LKP advertizes 10G, 5G and 2.5G link speeds.
@steps:
1. Let LKP advertize 10G, 5G and 2.5G link speeds.
2. Wait for link up.
3. Make sure that link 2.5G is negotiated on LKP.
@result: 2.5G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_5G, LINK_SPEED_2_5G], LINK_SPEED_2_5G)
def test_multiple_speed_10g_5g_1g(self):
"""
@description: This subtest checks that DUT will negotiate 1G if LKP advertizes 10G, 5G and 1G link speeds.
@steps:
1. Let LKP advertize 10G, 5G and 1G link speeds.
2. Wait for link up.
3. Make sure that link 1G is negotiated on LKP.
@result: 1G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_5G, LINK_SPEED_1G], LINK_SPEED_1G)
def test_multiple_speed_10g_5g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes 10G, 5G and 100M link speeds.
@steps:
1. Let LKP advertize 10G, 5G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_5G, LINK_SPEED_100M], LINK_SPEED_100M)
def test_multiple_speed_10g_2_5g_1g(self):
"""
@description: This subtest checks that DUT will negotiate 1G if LKP advertizes 10G, 2.5G and 1G link speeds.
@steps:
1. Let LKP advertize 10G, 2.5G and 1G link speeds.
2. Wait for link up.
3. Make sure that link 1G is negotiated on LKP.
@result: 1G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_2_5G, LINK_SPEED_1G], LINK_SPEED_1G)
def test_multiple_speed_10g_2_5g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes
10G, 2.5G and 100M link speeds.
@steps:
1. Let LKP advertize 10G, 2.5G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_2_5G, LINK_SPEED_100M], LINK_SPEED_100M)
def test_multiple_speed_10g_5g_2_5g_1g(self):
"""
@description: This subtest checks that DUT will negotiate 1G if LKP advertizes
10G, 5G, 2.5G and 1G link speeds.
@steps:
1. Let LKP advertize 10G, 5G, 2.5G and 1G link speeds.
2. Wait for link up.
3. Make sure that link 1G is negotiated on LKP.
@result: 1G link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_5G, LINK_SPEED_2_5G, LINK_SPEED_1G], LINK_SPEED_1G)
def test_multiple_speed_10g_5g_1g_100m(self):
"""
@description: This subtest checks that DUT will negotiate 100M if LKP advertizes
10G, 5G, 1G and 100M link speeds.
@steps:
1. Let LKP advertize 10G, 5G, 1G and 100M link speeds.
2. Wait for link up.
3. Make sure that link 100M is negotiated on LKP.
@result: 100M link is up on LKP.
@duration: 20 seconds.
"""
self.link_speed_test([LINK_SPEED_10G, LINK_SPEED_5G, LINK_SPEED_1G, LINK_SPEED_100M], LINK_SPEED_100M)
# Link switch tests
def test_switch_5g_100m_1g_auto_10g_2_5g_100m_2_5g_100m(self):
"""
@description: This subtest checks ability of firmware change link speed in sleep proxy mode.
@steps:
1. In the loop change link partner speeds and make sure that link is up: 5G, 100M, 1G, AUTO, 10G, 2.5G,
100M, 2.5G, 100M.
@result: All link switches are success.
@duration: 2 minutes seconds.
"""
self.link_switch_test([LINK_SPEED_5G, LINK_SPEED_100M, LINK_SPEED_1G, LINK_SPEED_AUTO,
LINK_SPEED_10G, LINK_SPEED_2_5G, LINK_SPEED_100M, LINK_SPEED_2_5G, LINK_SPEED_100M])
def test_switch_1g_100m_10g_5g_100m_5g_auto_10g(self):
"""
@description: This subtest checks ability of firmware change link speed in sleep proxy mode.
@steps:
1. In the loop change link partner speeds and make sure that link is up: 1G, 100M, 10G, 5G, 100M,
5G, AUTO, 10G.
@result: All link switches are success.
@duration: 2 minutes seconds.
"""
self.link_switch_test([LINK_SPEED_1G, LINK_SPEED_100M, LINK_SPEED_10G, LINK_SPEED_5G, LINK_SPEED_100M,
LINK_SPEED_5G, LINK_SPEED_AUTO, LINK_SPEED_10G])
if __name__ == "__main__":
pytest.main([__file__, "-s", "-v"])