-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlf_tr398v2_test.py
More file actions
executable file
·491 lines (440 loc) · 15.5 KB
/
lf_tr398v2_test.py
File metadata and controls
executable file
·491 lines (440 loc) · 15.5 KB
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
#!/usr/bin/env python3
"""
Note: To Run this script gui should be opened with
path: cd LANforgeGUI_5.4.4 (5.4.4 can be changed with GUI version)
pwd (Output : /home/lanforge/LANforgeGUI_5.4.4)
./lfclient.bash -cli-socket 3990
This script is used to automate running TR398v2 tests. You
may need to view a TR398v2 test configured through the GUI to understand
the options and how best to input data.
Example 1 :
./lf_tr398v2_test.py --mgr localhost --port 8080 --lf_user lanforge --lf_password lanforge \
--instance_name tr398-instance --config_name test_con \
--upstream 1.2.eth2 \
--test_rig Testbed-01 --pull_report \
--local_lf_report_dir=/tmp/my_report \
--dut5 'TR398-DUT ruckus750-5 4c:b1:cd:18:e8:ec (1)' \
--dut2 'TR398-DUT ruckus750-2 4c:b1:cd:18:e8:e8 (2)' \
--raw_lines_file cv_examples/example_cfgs/tr398v2-ferndale-ac-cfg.txt \
--set 'Calibrate 802.11AX Attenuators' 0 \
--set 'Calibrate Virt-Sta Attenuators' 0 \
--set '6.1.1 Receiver Sensitivity' 0 \
--set '6.2.1 Maximum Connection' 0 \
--set '6.2.2 Maximum Throughput' 1 \
--set '6.2.3 Airtime Fairness' 0 \
--set '6.2.4 Dual-Band Throughput' 0 \
--set '6.2.5 Bi-Directional Throughput' 0 \
--set '6.3.1 Range Versus Rate' 0 \
--set '6.3.2 Spatial Consistency' 0 \
--set '6.3.3 AX Peak Performance' 0 \
--set '6.4.1 Multiple STAs Performance' 0 \
--set '6.4.2 Multiple Assoc Stability' 0 \
--set '6.4.3 Downlink MU-MIMO' 0 \
--set '6.5.2 AP Coexistence' 0 \
--set '6.5.1 Long Term Stability' 0
Example 2:
./lf_tr398v2_test.py --mgr localhost --port 8080 --lf_user lanforge --lf_password lanforge \
--instance_name tr398-max-throughput --upstream 1.1.eth2 --local_lf_report_dir /home/lanforge/Desktop \
--pull_report --config_name MAX_THROUGHPUT
Note:
--raw_line 'line contents' will add any setting to the test config. It is not required. This is
useful way to support any options not specifically enabled by the
command options.
--set modifications will be applied after the other config has happened,
so it can be used to override any other config. Above, we are disabling many
of the subtests, and enabling just Maximum Connection and Maximum Throughput
tests.
The RSSI values are calibrated, so you will need to run the calibration step and
call with appropriate values for your particular testbed. This is loaded from
cv_examples/example_cfgs/tr398v2-ferndale-ac-cfg.txt in this example.
Contents of that file is a list of raw lines, for instance:
rssi_0_2-0: -26
rssi_0_2-1: -26
rssi_0_2-2: -26
....
Example of raw text config for TR-398v2, to show other possible options. You
can configure the TR398v2 test in the LANforge GUI and use the 'Show Config' option
on the 'Advanced Configuration' tab to show this config info:
show_events: 1
show_log: 1
port_sorting: 2
kpi_id: TR_398v2
bg: 0xE0ECF8
dut_info_override: Anonymous Enterprise AX AP
test_rig:
test_tag:
show_scan: 1
auto_helper: 1
skip_ac: 0
skip_ax: 0
skip_2: 0
skip_5: 0
skip_5b: 1
skip_dual: 0
skip_tri: 1
selected_dut5: TR398-DUT-r750 ruckus-r750-5g 4c:b1:cd:18:e8:ec (1)
selected_dut2: TR398-DUT-r750 ruckus-r750-2g 4c:b1:cd:18:e8:e8 (2)
upstream_port: 1.2.2 eth2
operator:
mconn: 5
txpower: 20
band2_freq: 2437
band5_freq: 5180
tos: 0
speed: 65%
ospeed: 20000
max_cx_random: 0
speed_max_cx_adjust: 1000000
speed_max_cx_2: 2000000
speed_max_cx_ax_2: 3000000
speed_max_cx_5: 8000000
speed_max_cx_ax_5: 10000000
max_tput_speed_2: 100000000
max_tput_speed_5: 560000000
max_tput_speed_ax_2: 200000000
max_tput_speed_ax_5: 720000000
max_peak_tput_speed_ax_2: 300000000
max_peak_tput_speed_ax_5: 1100000000
max_peak_tput_speed_ax_5_4: 1100000000
atf_max_nss: 2
atf_extra_2m_atten: 0
rxsens_deg_rot: 180
rxsens_pre_steps: 4
stability_udp_dur: 900
stability_iter: 16
calibrate_mode: 4
calibrate_nss: 1
dur120: 30
dur180: 180
i_5g_80: 195000000
i_5g_40: 90000000
i_2g_20: 32000000
i_5g_80_ax: 195000000
i_5g_40_ax: 90000000
i_2g_20_ax: 32000000
spatial_deg_rot: 30
spatial_retry: 0
reset_pp: 99
bidir_dp_prcnt: 0.05
rxsens_stop_at_pass: 0
spatial_pause_on_zero_tput: 0
auto_coex: 0
use_virtual_ax_sta: 0
rvr_adj: 0
rssi_2m_2: -26
rssi_2m_5: -30
extra_dl_path_loss: 0
dur60: 20
turn_table: TR-398
radio-0: 1.1.2 wiphy0
radio-1: 1.1.3 wiphy1
radio-2: 1.1.4 wiphy2
radio-3: 1.1.5 wiphy3
radio-4: 1.1.6 wiphy4
radio-5: 1.1.7 wiphy5
ax_radio-0: 1.2.wiphy0
ax_radio-1: 1.2.wiphy1
ax_radio-2: 1.2.wiphy2
ax_radio-3: 1.2.wiphy3
ax_radio-4: 1.2.wiphy4
ax_radio-5: 1.2.wiphy5
ax_radio-6: 1.2.wiphy6
ax_radio-7: 1.2.wiphy7
ax_radio-8: 1.2.wiphy8
ax_radio-9: 1.2.wiphy9
ax_radio-10: 1.2.wiphy10
ax_radio-11: 1.2.wiphy11
ax_radio-12: 1.3.wiphy0
ax_radio-13: 1.3.wiphy5
ax_radio-14: 1.3.wiphy10
ax_radio-15: 1.3.wiphy15
ax_radio-16: 1.3.wiphy1
ax_radio-17: 1.3.wiphy6
ax_radio-18: 1.3.wiphy11
ax_radio-19: 1.3.wiphy16
ax_radio-20: 1.3.wiphy2
ax_radio-21: 1.3.wiphy7
ax_radio-22: 1.3.wiphy12
ax_radio-23: 1.3.wiphy17
ax_radio-24: 1.3.wiphy3
ax_radio-25: 1.3.wiphy8
ax_radio-26: 1.3.wiphy13
ax_radio-27: 1.3.wiphy18
ax_radio-28: 1.3.wiphy4
ax_radio-29: 1.3.wiphy9
ax_radio-30: 1.3.wiphy14
ax_radio-31: 1.3.wiphy19
rssi_0_2-0: -28
rssi_0_2-1: -28
rssi_0_2-2: -28
rssi_0_2-3: -28
rssi_0_2-4: -22
rssi_0_2-5: -22
rssi_0_2-6: -22
rssi_0_2-7: -22
rssi_0_2-8: -25
rssi_0_2-9: -25
rssi_0_2-10: -25
rssi_0_2-11: -25
ax_rssi_0_2-0: -29
ax_rssi_0_2-1: -29
ax_rssi_0_2-2: -29
ax_rssi_0_2-3: -29
ax_rssi_0_2-4: -23
ax_rssi_0_2-5: -23
ax_rssi_0_2-6: -23
ax_rssi_0_2-7: -23
ax_rssi_0_2-8: -26
ax_rssi_0_2-9: -26
ax_rssi_0_2-10: -26
ax_rssi_0_2-11: -26
rssi_0_5-0: -35
rssi_0_5-1: -35
rssi_0_5-2: -35
rssi_0_5-3: -35
rssi_0_5-4: -33
rssi_0_5-5: -33
rssi_0_5-6: -33
rssi_0_5-7: -33
rssi_0_5-8: -39
rssi_0_5-9: -39
rssi_0_5-10: -39
rssi_0_5-11: -39
ax_rssi_0_5-0: -35
ax_rssi_0_5-1: -35
ax_rssi_0_5-2: -35
ax_rssi_0_5-3: -35
ax_rssi_0_5-4: -32
ax_rssi_0_5-5: -32
ax_rssi_0_5-6: -32
ax_rssi_0_5-7: -32
ax_rssi_0_5-8: -39
ax_rssi_0_5-9: -39
ax_rssi_0_5-10: -39
ax_rssi_0_5-11: -39
atten-0: 1.1.3094.0
atten-1: 1.1.3094.1
atten-2: 1.1.3094.2
atten-3: 1.1.3094.3
atten-4: 1.1.3102.0
atten-5: 1.1.3102.1
atten-6: 1.1.3099.0
atten-7: 1.1.3099.1
atten-8: 1.1.3102.2
atten-9: 1.1.3102.3
ax_atten-0: 1.1.3100.3
ax_atten-1: 1.1.3100.2
ax_atten-2: NA
ax_atten-3: NA
ax_atten-4: 1.1.3100.1
ax_atten-5: 1.1.3100.0
ax_atten-8: 1.1.3099.3
ax_atten-9: 1.1.3099.2
atten_cal_ac: 0
atten_cal_ax: 0
rxsens: 0
max_cx: 0
max_tput: 1
peak_perf: 0
max_tput_bi: 0
dual_band_tput: 0
atf: 0
atf3: 0
qos3: 0
rvr: 0
spatial: 0
multi_sta: 0
reset: 0
mu_mimo: 0
stability: 0
ap_coex: 0
"""
import sys
import os
import importlib
import argparse
import time
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
cv_test_manager = importlib.import_module("py-json.cv_test_manager")
cvtest = cv_test_manager.cv_test
cv_add_base_parser = cv_test_manager.cv_add_base_parser
cv_base_adjust_parser = cv_test_manager.cv_base_adjust_parser
class TR398v2Test(cvtest):
def __init__(self,
lf_host="localhost",
lf_port=8080,
lf_user="lanforge",
lf_password="lanforge",
instance_name="tr398_instance",
config_name="tr398_config",
upstream="1.2.eth2",
test_rig="",
local_lf_report_dir="",
pull_report=False,
load_old_cfg=False,
raw_lines_file="",
dut6="",
dut5="",
dut2="",
enables=None,
disables=None,
raw_lines=None,
sets=None,
):
super().__init__(lfclient_host=lf_host, lfclient_port=lf_port)
if enables is None:
enables = []
if disables is None:
disables = []
if raw_lines is None:
raw_lines = []
if sets is None:
sets = []
self.lf_host = lf_host
self.lf_port = lf_port
self.lf_user = lf_user
self.lf_password = lf_password
self.instance_name = instance_name
self.config_name = config_name
self.dut6 = dut6
self.dut5 = dut5
self.dut2 = dut2
self.raw_lines_file = raw_lines_file
self.upstream = upstream
self.pull_report = pull_report
self.load_old_cfg = load_old_cfg
self.test_name = "TR-398 Issue 2"
self.enables = enables
self.disables = disables
self.raw_lines = raw_lines
self.sets = sets
self.local_lf_report_dir = local_lf_report_dir
self.test_rig = test_rig
def setup(self):
# Nothing to do at this time.
return
def run(self):
self.sync_cv()
time.sleep(2)
self.sync_cv()
blob_test = "TR-398v2-"
self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name
self.show_text_blob(None, None, False)
# Test related settings
# These options are so that the config is 3rd priority, the built-in method is first, and any raw-line is 2nd.
# all cfgs are added to the cfg options and the array will be read top to bottom. so last cfg option will override the old c
cfg_options = []
self.apply_cfg_options(cfg_options, self.enables, self.disables, self.raw_lines, self.raw_lines_file)
# cmd line args take precedence
if self.upstream != "":
cfg_options.append("upstream_port: " + self.upstream)
if self.dut6 != "":
cfg_options.append("selected_dut6: " + self.dut6)
if self.dut5 != "":
cfg_options.append("selected_dut5: " + self.dut5)
if self.dut2 != "":
cfg_options.append("selected_dut2: " + self.dut2)
if self.test_rig != "":
cfg_options.append("test_rig: " + self.test_rig)
# We deleted the scenario earlier, now re-build new one line at a time.
# print("here are the cfg options: ", cfg_options)
self.build_cfg(self.config_name, blob_test, cfg_options)
cv_cmds = []
self.create_and_run_test(self.load_old_cfg, self.test_name, self.instance_name,
self.config_name, self.sets,
self.pull_report, self.lf_host, self.lf_user, self.lf_password,
cv_cmds, local_lf_report_dir=self.local_lf_report_dir)
self.rm_text_blob(self.config_name, blob_test) # To delete old config with same name
def main():
parser = argparse.ArgumentParser("""
Open this file in an editor and read the top notes for more details.
Example:
./lf_tr398v2_test.py --mgr localhost --port 8080 --lf_user lanforge --lf_password lanforge \\
--instance_name tr398-instance --config_name test_con \\
--upstream 1.2.eth2 \\
--test_rig Testbed-01 --pull_report \\
--local_lf_report_dir /tmp/my-report \\
--dut5 'TR398-DUT-r750 ruckus-r750-5g 4c:b1:cd:18:e8:ec (1)' \\
--dut2 'TR398-DUT-r750 ruckus-r750-2g 4c:b1:cd:18:e8:e8 (2)' \\
--raw_lines_file cv_examples/example_cfgs/tr398v2-ferndale-ac-cfg.txt \\
--set 'Calibrate 802.11AX Attenuators' 0 \\
--set 'Calibrate 802.11AC Attenuators' 0 \\
--set '6.1.1 Receiver Sensitivity' 0 \\
--set '6.2.1 Maximum Connection' 0 \\
--set '6.2.2 Maximum Throughput' 1 \\
--set '6.2.3 Airtime Fairness' 0 \\
--set '6.2.4 Dual-Band Throughput' 0 \\
--set '6.2.5 Bi-Directional Throughput' 0 \\
--set '6.3.1 Range Versus Rate' 0 \\
--set '6.3.2 Spatial Consistency' 0 \\
--set '6.3.3 AX Peak Performance' 0 \\
--set '6.4.1 Multiple STAs Performance' 0 \\
--set '6.4.2 Multiple Assoc Stability' 0 \\
--set '6.4.3 Downlink MU-MIMO' 0 \\
--set '6.5.2 AP Coexistence' 0 \\
--set '6.5.1 Long Term Stability' 0
./lf_tr398v2_test.py --mgr 192.168.100.105 --port 8080 --lf_user lanforge\\
--lf_password lanforge --instance_name x \\
--config_name testing --pull_report \\
--local_lf_report_dir /tmp --dut5 'ASUS_70 ASUS_70 f0:2f:74:7c:a5:70 (1)' \\
--dut2 'ASUS_70 ASUS_70 f0:2f:74:7c:a5:70 (1)' --raw_line "upstream_port: 1.1.eth2"
The contents of the 'raw_lines_file' argument can be obtained by manually configuring the
TR398 issue 2 test in the LANforge GUI, then selecting 'Show Config' in the Advanced configuration tab, then
highlighting and pasting that text into file. That file is the argument to the --raw_lines_file parameter.
Each TR398 test's setting values can be specified by the python script in multiple ways.
For example, each test needs an upstream port. The python script can specify upstream port in several ways
and below is the hierarchy of which upstream port will be the final one in the settings.
1. --upstream_port argument
2. --raw_lines argument in the command line
3. upstream port specified in the --raw_lines_file file.txt
4. upsteam port loaded from the --config argument
"""
)
cv_add_base_parser(parser) # see cv_test_manager.py
parser.add_argument("-u", "--upstream", type=str, default="",
help="Upstream port for wifi capacity test ex. 1.1.eth2")
parser.add_argument("--dut2", default="",
help="Specify 2Ghz DUT used by this test, example: 'TR398-DUT-r750 ruckus-r750-2g 4c:b1:cd:18:e8:e8 (2)'")
parser.add_argument("--dut5", default="",
help="Specify 5Ghz DUT used by this test, example: 'TR398-DUT-r750 ruckus-r750-5g 4c:b1:cd:18:e8:ec (1)'")
parser.add_argument("--dut6", default="",
help="Specify 6Ghz DUT used by this test, example: 'TR398-DUT-r750 ruckus-r750-6g 4c:b1:cd:18:e8:eb (3)'")
parser.add_argument("--local_lf_report_dir",
help="--local_lf_report_dir <where to pull reports to> default '' means put in current working directory",
default="")
parser.add_argument('--help_summary', action="store_true", help='Show summary of what this script does')
help_summary = "This script is used to automate running TR398v2 tests. " \
"You may need to view a TR398v2 test configured through " \
"the GUI to understand the options and how best to input data."
args = parser.parse_args()
if args.help_summary:
print(help_summary)
exit(0)
cv_base_adjust_parser(args)
CV_Test = TR398v2Test(lf_host=args.mgr,
lf_port=args.port,
lf_user=args.lf_user,
lf_password=args.lf_password,
instance_name=args.instance_name,
config_name=args.config_name,
upstream=args.upstream,
pull_report=args.pull_report,
local_lf_report_dir=args.local_lf_report_dir,
load_old_cfg=args.load_old_cfg,
dut2=args.dut2,
dut5=args.dut5,
dut6=args.dut6,
raw_lines_file=args.raw_lines_file,
enables=args.enable,
disables=args.disable,
raw_lines=args.raw_line,
sets=args.set,
test_rig=args.test_rig
)
CV_Test.setup()
CV_Test.run()
if __name__ == "__main__":
main()