forked from greearb/lanforge-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cc_module_test.py
executable file
·1301 lines (1092 loc) · 44.7 KB
/
cc_module_test.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
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
"""
NAME: cc_module_test.py
CLASSIFICATION:
module unit test
PURPOSE:
to test the dynamic import of a controller module
SETUP:
None
EXAMPLE:
There is a unit test included to try sample command scenarios
./cc_module_test.py --scheme ssh --dest localhost --port 8887 --user admin --passwd Cisco123 --ap AP687D.B45C.2B24 --series 9800 --prompt "WLC1" --timeout 10 --band '6g' --module 'cc_module_9800_3504' 2>&1 | tee cc_tx_output_6g.txt
COPYRIGHT:
Copyright 2021 Candela Technologies Inc
License: Free to distribute and modify. LANforge systems must be licensed.
INCLUDE_IN_README
RELEASE STATUS: in development
RELEASE NOTES:
"""
import sys
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit()
import argparse
import logging
import importlib
import os
from time import sleep
sys.path.append(os.path.join(os.path.abspath(__file__ + "././")))
logger = logging.getLogger(__name__)
lf_logger_config = importlib.import_module("py-scripts.lf_logger_config")
class create_module_test_object:
def __init__(self,
cs=None):
if cs is None:
raise ValueError('Controller series must be passed in ')
else:
self.cs = cs
# please do not delete
# modifying existing tests.
# This sample runs thought dumping status
def sample_test_dump_status(self):
self.cs.show_ap_config_slots()
self.cs.show_ap_summary()
self.cs.no_logging_console()
self.cs.line_console_0()
self.cs.show_wlan_summary()
# cs.show_ap_dot11_5gz_summary()
# cs.show_ap_dot11_24gz_summary()
self.cs.show_ap_bssid_5ghz()
# sample setting dtim dot11 5ghz : delivery traffic indication message
def sample_test_setting_dtim(self):
logger.info("sample_test_setting_dtim")
# This needs to be here to disable and delete
self.cs.dtim = '2'
self.cs.wlan = '6G-wpa3-AP3'
self.cs.wlanID = '7'
self.cs.wlanSSID = '6g-wpa3-AP3'
self.cs.tx_power = '1'
self.cs.security_key = 'hello123'
self.cs.tag_policy = 'RM204-TB1-AP5'
self.cs.policy_profile = 'default-policy-profile'
# summary
self.cs.show_ap_summary()
# disable
self.cs.show_ap_dot11_6gz_shutdown()
self.cs.show_ap_dot11_5gz_shutdown()
self.cs.show_ap_dot11_24gz_shutdown()
# disable_wlan
self.cs.wlan_shutdown()
# disable_network_6ghz
self.cs.ap_dot11_6ghz_shutdown()
# disable_network_5ghz
self.cs.ap_dot11_5ghz_shutdown()
# disable_network_24ghz
self.cs.ap_dot11_24ghz_shutdown()
# manual
self.cs.ap_dot11_6ghz_radio_role_manual_client_serving()
self.cs.ap_dot11_5ghz_radio_role_manual_client_serving()
self.cs.ap_dot11_24ghz_radio_role_manual_client_serving()
# Configuration for 5g
# txPower
self.cs.config_dot11_6ghz_tx_power()
self.cs.config_dot11_5ghz_tx_power()
# self.cs.bandwidth = '20'
# bandwidth (to set to 20 if channel change does not support)
# self.cs.config_dot11_5ghz_channel_width()
self.cs.channel = '33'
# channel
self.cs.config_dot11_6ghz_channel()
# self.cs.config_dot11_5ghz_channel()
self.cs.bandwidth = '40'
# bandwidth
self.cs.config_dot11_6ghz_channel_width()
# show_wlan_summary
self.cs.show_wlan_summary()
# delete wlan
# self.cs.config_no_wlan()
# create_wlan_wpa3
self.cs.config_wlan_wpa3()
# wireless_tag_policy
self.cs.config_wireless_tag_policy_and_policy_profile()
# show_wlan_summary
self.cs.show_wlan_summary()
# somehow during the configure the WLAN gets enabled
# disable_wlan
self.cs.wlan_shutdown()
# show_wlan_summary
self.cs.show_wlan_summary()
# % WLAN needs to be disabled before performing this operation.
self.cs.config_dtim_dot11_6ghz()
# enable_wlan
self.cs.config_enable_wlan_send_no_shutdown()
# enable_network_6ghz
self.cs.config_no_ap_dot11_6ghz_shutdown()
# enable_network_24ghz
# self.cs.config_no_ap_dot11_5ghz_shutdown()
# enable
self.cs.config_ap_no_dot11_6ghz_shutdown()
# config_ap_no_dot11_24ghz_shutdown
# advanced
self.cs.show_ap_dot11_6gz_summary()
# self.cs.show_ap_dot11_24gz_summary()
# show_wlan_summary
self.cs.show_wlan_summary()
# This sample runs though the sequence of commands used
# by tx_power script
# TODO unit test for 6g wlan, 5g wlan, 2g wlan, and all three
def sample_test_tx_power_sequence(self):
# series of commands to create a wlan , similiar to how tx_power works.
# pass in the ap and band from the command line
# self.cs.ap = 'APA453.0E7B.CF9C'
# self.cs.band = '5g'
logger.info("sample_test_tx_power_sequence")
# This needs to be here to disable and delete
self.cs.wlan = 'wpa2_wlan_3'
self.cs.wlanID = '3'
self.cs.wlanSSID = 'wpa2_wlan_3'
self.cs.tx_power = '1'
self.cs.security_key = 'wpa2_wlan_3'
self.cs.tag_policy = 'RM204-TB1'
self.cs.policy_profile = 'default-policy-profile'
# no_logging_console
self.cs.no_logging_console()
# line_console_0
self.cs.line_console_0()
# summary
self.cs.show_ap_summary()
# disable
self.cs.show_ap_dot11_5gz_shutdown()
self.cs.show_ap_dot11_24gz_shutdown()
# disable_wlan
self.cs.wlan_shutdown()
# disable_network_5ghz
self.cs.ap_dot11_5ghz_shutdown()
# disable_network_24ghz
self.cs.ap_dot11_24ghz_shutdown()
# manual
self.cs.ap_dot11_5ghz_radio_role_manual_client_serving()
self.cs.ap_dot11_24ghz_radio_role_manual_client_serving()
# Configuration for 5g
# txPower
self.cs.config_dot11_5ghz_tx_power()
self.cs.bandwidth = '20'
# bandwidth (to set to 20 if channel change does not support)
self.cs.config_dot11_5ghz_channel_width()
self.cs.channel = '100'
# channel
self.cs.config_dot11_5ghz_channel()
self.cs.bandwidth = '40'
# bandwidth
self.cs.config_dot11_5ghz_channel_width()
# show_wlan_summary
self.cs.show_wlan_summary()
# Configuration for 6g
# txPower
# self.cs.config_dot11_6ghz_tx_power()
# self.cs.bandwidth = '20'
# # bandwidth (to set to 20 if channel change does not support)
# self.cs.config_dot11_6ghz_channel_width()
# self.cs.channel = '36'
# # channel
# self.cs.config_dot11_6ghz_channel()
# self.cs.bandwidth = '40'
# # bandwidth
# self.cs.config_dot11_6ghz_channel_width()
# # show_wlan_summary
# self.cs.show_wlan_summary()
# delete_wlan
# TODO (there were two in tx_power the logs)
# need to check if wlan present
# delete wlan
self.cs.config_no_wlan()
# Create open
# self.cs.wlan = 'open-wlan_3'
# self.cs.wlanID = '3'
# self.cs.wlanSSID = 'open-wlan_3'
# create_wlan open
# self.cs.wlan = 'open-wlan'
# self.cs.wlanID = '1'
# self.cs.wlanSSID = 'open-wlan'
# self.cs.config_wlan_open()
# create_wlan_wpa2
self.cs.config_wlan_wpa2()
# create_wlan_wpa3
# self.cs.wlan = 'wpa3_wlan_4'
# self.cs.wlanID = '4'
# self.cs.wlanSSID = 'wpa3_wlan_4'
# self.cs.security_key = 'hello123'
# self.cs.config_wlan_wpa3()
# wireless_tag_policy
self.cs.config_wireless_tag_policy_and_policy_profile()
# enable_wlan
self.cs.config_enable_wlan_send_no_shutdown()
# enable_network_5ghz
self.cs.config_no_ap_dot11_5ghz_shutdown()
# enable_network_24ghz
# self.cs.config_no_ap_dot11_5ghz_shutdown()
# enable
self.cs.config_ap_no_dot11_5ghz_shutdown()
# config_ap_no_dot11_24ghz_shutdown
# advanced
self.cs.show_ap_dot11_5gz_summary()
# self.cs.show_ap_dot11_24gz_summary()
# show_wlan_summary
self.cs.show_wlan_summary()
# Test dual-band 6g
def test_config_tx_power_dual_band_6g_wpa3(self):
# TODO : leave for now for reference
# WLC1#show ap summary
# Number of APs: 3
#
# WLC1 show ap summary
# Number of APs: 5
#
# AP Name Slots AP Model Ethernet MAC Radio MAC Location Country IP Address State
# -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# APCC9C.3EF4.E0B0 3 CW9166I-B cc9c.3ef4.e0b0 10f9.20fd.e7a0 RM204-TB1-9166 US 172.16.223.41 Registered
# APCC9C.3EF1.0AE0 3 CW9164I-B cc9c.3ef1.0ae0 10f9.20fd.eda0 RM204-TB1-9164 US 172.16.223.40 Registered
# AP687D.B45C.25EC 4 C9136I-B 687d.b45c.25ec 687d.b45f.c5f0 RM204-TB1-AP4 US 172.16.222.199 Registered
# AP687D.B45C.2B24 4 C9136I-B 687d.b45c.2b24 687d.b460.04b0 RM204-TB1-AP5 US 172.16.222.201 Registered
# APA453.0E7B.CF9C 2 C9120AXE-B a453.0e7b.cf9c d4ad.bda2.2ce0 RM204-TB1-AP2 US 172.16.222.176 Registered
# helper commands
# WLC# ap slots , shows the ap slots shows slot dual band
# show ap dot11 5ghz summary # slot 2 enabled
# show ap slots check
# show ap dot11 dual-band summary # will show if in 5g or 6g
# show ap name <ap name> dot11
# config file / Cisco - yaml file
#
# Flow of script -for roaming - skeleton.
# show ap summary
# configure wlan - (config file - security combo)
# configure band (config file , 2g/5g/6g)
# config channel / channel width
# AP min state up
# check admin state of AP
# Bring down unused band ( if 2g, bring down 5g)
# show ap dot11 5ghz summary : verify the configuration
# Siffer capture
#
# Client side connections
# Sniffer verification - 11r configuration (if 11r)
# check in controller/AP -> client connected -> also check 11r (sh wireless client details)
# Ping traffic or dup traffie - insure smotth
# Siffer capture
# Roam
# Siffer verification
# Keep the iteration for above steps from the ping traffice
# Common clean up
# Table display
# Isaac : there needs to be a 5g ssid present for 6E to 6E roaming
# Nikita - multi client , pass fail criteria
# Sythia (Cisco) - 10 20 50 , table per client , number of iterations
# Nikita - show transitions using bssi , roam time
# Sythia would like data per client,
# pytest / Allure has limitations to show the proper data in Allure
# Sythia would prefer data as compared to pass / fail
# Nikia - how to push voice traffic when attempting to roam
# Sythia - VO platinum, VI , the clients need to choose traffic (do rdp traffic)
# ingress / egress configured by wifi controller.
#
logger.info("test_config_tx_power_dual_6g_wpa3")
# This needs to be here to disable and delete
self.cs.wlan = '6G-wpa3'
self.cs.wlanID = '1'
self.cs.wlanSSID = '6G-wpa3'
self.cs.tx_power = '1'
self.cs.security_key = 'hello123'
self.cs.tag_policy = 'RM204-TB1-9166'
self.cs.policy_profile = 'default-policy-profile'
# no_logging_console
self.cs.no_logging_console()
# line_console_0
self.cs.line_console_0()
# summary
self.cs.show_ap_summary()
# set the dual-band slot
self.cs.ap_dual_band_slot_6g = '2'
# configure dual-band to be 6G
# disable dual-band mode
if self.cs.band == "dual_band_6g":
logger.info("ap_dot11_dual_band_mode_shutdown_6ghz")
self.cs.ap_dot11_dual_band_mode_shutdown_6ghz()
elif self.cs.band == "dual_band_5g":
logger.info("ap_dot11_dual_band_mode_shutdown_6ghz")
self.cs.ap_dot11_dual_band_mode_shutdown_5ghz()
# ap name APCC9C.3EF4.E0B0 dot11 dual-band slot 2 band 6ghz
# % Error: AP APCC9C.3EF4.E0B0 Slot 2 - Failed to change band, Radio role selection is not Manual
# set the radio role selection
if self.cs.band == 'dual_band_6g':
logger.info("ap_dot11_dual_band_6ghz_radio_role_manual_client_serving")
self.cs.ap_dot11_dual_band_6ghz_radio_role_manual_client_serving()
elif self.cs.band == 'dual_band_5g':
logger.info("ap_dot11_dual_band_5ghz_radio_role_manual_client_serving")
self.cs.ap_dot11_dual_band_5ghz_radio_role_manual_client_serving()
# elif self.cs.band == '6g':
# self.cs.ap_dot11_6ghz_radio_role_manual_client_serving()
# self.cs.ap_dot11_5ghz_radio_role_manual_client_serving()
# self.cs.ap_dot11_24ghz_radio_role_manual_client_serving()
# config dual-band mode
if self.cs.band == "dual_band_6g":
logger.info("config_ap_dot11_dual_band_to_6ghz")
self.cs.config_ap_dot11_dual_band_to_6ghz()
elif self.cs.band == "dual_band_5g":
logger.info("config_ap_dot11_dual_band_to_5ghz")
self.cs.config_ap_dot11_dual_band_to_5ghz
# enable dual-band mode
if self.cs.band == "dual_band_6g":
logger.info("ap_dot11_dual_band_no_mode_shutdown_6ghz")
self.cs.ap_dot11_dual_band_no_mode_shutdown_6ghz()
elif self.cs.band == "dual_band_5g":
logger.info("ap_dot11_dual_band_no_mode_shutdown_5ghz")
self.cs.ap_dot11_dual_band_no_mode_shutdown_5ghz()
# Configuration for 6g
# txPower
# TODO is this still needed
logger.info("config_dot11_dual_band_6ghz_tx_power")
self.cs.config_dot11_dual_band_6ghz_tx_power()
# channel
# self.cs.channel = '1'
# self.cs.channel = '33'
self.cs.channel = '65'
logger.info("config_dot11_dual_band_6ghz_channel")
self.cs.config_dot11_dual_band_6ghz_channel()
# bandwidth
self.cs.bandwidth = '40'
# self.cs.bandwidth = '20'
self.cs.config_dot11_dual_band_6ghz_channel_width()
# show_wlan_summary
self.cs.show_wlan_summary()
# enable_wlan
self.cs.config_enable_wlan_send_no_shutdown()
# enable_network_6ghz or enable_network_5ghz or enable_network_24ghz
if self.cs.band == 'dual_band_6g':
# enable 6g wlan
logger.info("config_no_ap_dot11_dual_band_6ghz_shutdown")
pss = self.cs.config_no_ap_dot11_dual_band_6ghz_shutdown()
logger.info(pss)
# enable 6g operation status
pss = self.cs.config_ap_no_dot11_dual_band_6ghz_shutdown()
logger.info(pss)
# enable 5g wlan to show scans
pss = self.cs.config_no_ap_dot11_5ghz_shutdown()
logger.info(pss)
# enable 5g operation status
pss = self.cs.config_ap_no_dot11_5ghz_shutdown()
logger.info(pss)
elif self.cs.band == 'dual_band_5g':
# enable 5g wlan
pss = self.cs.config_no_ap_dot11_dual_band_5ghz_shutdown()
logger.info(pss)
# enable 5g operation status
pss = self.cs.config_ap_no_dot11_dual_band_5ghz_shutdown()
logger.info(pss)
elif self.cs.band == '6g':
# enable 6g wlan
pss = self.cs.config_no_ap_dot11_6ghz_shutdown()
logger.info(pss)
# enable 6g operation status
pss = self.cs.config_ap_no_dot11_6ghz_shutdown()
logger.info(pss)
# enable 5g wlan
pss = self.cs.config_no_ap_dot11_5ghz_shutdown()
logger.info(pss)
# enable 5g operation status
pss = self.cs.config_ap_no_dot11_5ghz_shutdown()
logger.info(pss)
# 6g needs to see the 5g bands
elif self.cs.band == '5g':
# enable 5g wlan
pss = self.cs.config_no_ap_dot11_5ghz_shutdown()
logger.info(pss)
# enable 5g operation status
pss = self.cs.config_ap_no_dot11_5ghz_shutdown()
logger.info(pss)
elif self.cs.band == '24g':
# enable wlan 24ghz
pss = self.cs.config_no_ap_dot11_24ghz_shutdown()
logger.info(pss)
# enable 24ghz operation status
self.cs.config_ap_no_dot11_24ghz_shutdown()
logger.info(pss)
if self.cs.band == 'dual_band_6g':
pss = self.cs.show_ap_dot11_dual_band_6gz_summary()
logger.info("show ap dot11 dual-band (6ghz) summary")
logger.info("ap: {ap} ap_band_slot_6g: {slot} ".format(ap=self.cs.ap, slot=self.cs.ap_band_slot))
logger.info(pss)
elif self.cs.band == 'dual_band_5g':
pss = self.cs.show_ap_dot11_dual_band_5gz_summary()
logger.info("show ap dot11 dual-band (5ghz) summary")
logger.info("ap: {ap} ap_band_slot_5g: {slot} ".format(ap=self.cs.ap, slot=self.cs.ap_band_slot_5g))
logger.info(pss)
elif self.cs.band == '6g':
pss = self.cs.show_ap_dot11_6gz_summary()
logger.info("show ap dot11 6ghz summary")
logger.info("ap: {ap} ap_band_slot_6g: {slot} ".format(ap=self.cs.ap, slot=self.cs.ap_band_slot_6g))
logger.info(pss)
elif self.cs.band == '5g':
logger.info("show ap dot11 5ghz summary")
logger.info("ap: {ap} ap_band_slot_5g: {slot} ".format(ap=self.cs.ap, slot=self.cs.ap_band_slot_5g))
pss = self.cs.show_ap_dot11_5gz_summary()
logger.info(pss)
else:
logger.info("show ap dot11 24ghz summary")
logger.info("ap: {ap} ap_band_slot_24g: {slot} ".format(ap=self.cs.ap, slot=self.cs.ap_band_slot_24g))
pss = self.cs.show_ap_dot11_24gz_summary()
logger.info(pss)
# Temporary Work around
# disable the AP for 6g and enable
if self.cs.band == '6g':
self.cs.ap_name_shutdown()
sleep(5)
self.cs.ap_name_no_shutdown()
# show_wlan_summary
self.cs.show_wlan_summary()
def test_config_tx_power_6g_wpa3(self):
# TODO : leave for now for reference
# WLC1#show ap summary
# Number of APs: 3
#
# AP Name Slots AP Model Ethernet MAC Radio MAC Location
# -------------------------------------------------------------------------------------------------------------------------
# APCC9C.3EF4.DDE0 3 CW9166I-B cc9c.3ef4.dde0 10f9.20fd.e200 default location
# APCC9C.3EF1.1140 3 CW9164I-B cc9c.3ef1.1140 10f9.20fd.fa60 default location
# APA453.0E7B.CF9C 2 C9120AXE-B a453.0e7b.cf9c d4ad.bda2.2ce0 default location
# series of commands to create a wlan , similiar to how tx_power works.
# pass in the ap and band from the command line
# self.cs.ap = 'APA453.0E7B.CF9C'
# self.cs.band = '5g'
logger.info("test_config_tx_power_6g_wpa3")
# This needs to be here to disable and delete
self.cs.wlan = '6G-wpa3-AP3'
self.cs.wlanID = '15'
self.cs.wlanSSID = '6G-wpa3-AP3'
self.cs.tx_power = '1'
# self.cs.security_key = 'wpa3_wlan_4_6g'
self.cs.security_key = 'hello123'
self.cs.tag_policy = 'RM204-TB1-AP3'
self.cs.policy_profile = 'default-policy-profile'
# no_logging_console
self.cs.no_logging_console()
# line_console_0
self.cs.line_console_0()
# summary
self.cs.show_ap_summary()
# disable
self.cs.show_ap_dot11_6gz_shutdown()
self.cs.show_ap_dot11_5gz_shutdown()
self.cs.show_ap_dot11_24gz_shutdown()
# disable_wlan
self.cs.wlan_shutdown()
# disable_network_6ghz
self.cs.ap_dot11_6ghz_shutdown()
# disable_network_5ghz
self.cs.ap_dot11_5ghz_shutdown()
# disable_network_24ghz
self.cs.ap_dot11_24ghz_shutdown()
# manual
self.cs.ap_dot11_6ghz_radio_role_manual_client_serving()
self.cs.ap_dot11_5ghz_radio_role_manual_client_serving()
self.cs.ap_dot11_24ghz_radio_role_manual_client_serving()
# Configuration for 6g
# Configuration for 6g
# txPower
# TODO is this still needed
self.cs.config_dot11_6ghz_tx_power()
self.cs.bandwidth = '20'
# bandwidth (to set to 20 if channel change does not support)
self.cs.config_dot11_6ghz_channel_width()
self.cs.channel = '1'
# channel
self.cs.config_dot11_6ghz_channel()
self.cs.bandwidth = '40'
# bandwidth
self.cs.config_dot11_6ghz_channel_width()
# show_wlan_summary
self.cs.show_wlan_summary()
# delete_wlan
# TODO (there were two in tx_power the logs)
# need to check if wlan present
# delete wlan
self.cs.config_no_wlan()
# create_wlan_wpa3
self.cs.config_wlan_wpa3()
# wireless_tag_policy
self.cs.config_wireless_tag_policy_and_policy_profile()
# enable_wlan
self.cs.config_enable_wlan_send_no_shutdown()
# enable_network_5ghz
self.cs.config_no_ap_dot11_6ghz_shutdown()
# enable_network_24ghz
# self.cs.config_no_ap_dot11_5ghz_shutdown()
# enable
self.cs.config_ap_no_dot11_6ghz_shutdown()
# config_ap_no_dot11_24ghz_shutdown
# advanced
self.cs.show_ap_dot11_6gz_summary()
# show_wlan_summary
self.cs.show_wlan_summary()
def test_config_tx_power_6g_wpa3_attempt2(self):
# TODO : leave for now for reference
# WLC1#show ap summary
# Number of APs: 3
#
# AP Name Slots AP Model Ethernet MAC Radio MAC Location
# -------------------------------------------------------------------------------------------------------------------------
# OTA
# APCC9C.3EF4.DDE0 3 CW9166I-B cc9c.3ef4.dde0 10f9.20fd.e200 default location
# Cabled together
# APCC9C.3EF1.1140 3 CW9164I-B cc9c.3ef1.1140 10f9.20fd.fa60 default location
# APA453.0E7B.CF9C 2 C9120AXE-B a453.0e7b.cf9c d4ad.bda2.2ce0 default location
# series of commands to create a wlan , similiar to how tx_power works.
# pass in the ap and band from the command line
# self.cs.ap = 'APA453.0E7B.CF9C'
# self.cs.band = '5g'
logger.info("test_config_tx_power_6g_wpa3")
# This needs to be here to disable and delete
self.cs.wlan = '6G-wpa3-AP3'
self.cs.wlanID = '15'
self.cs.wlanSSID = '6G-wpa3-AP3'
self.cs.tx_power = '1'
# self.cs.security_key = 'wpa3_wlan_4_6g'
self.cs.security_key = 'hello123'
self.cs.tag_policy = 'RM204-TB1-AP3'
self.cs.policy_profile = 'default-policy-profile'
# no_logging_console
self.cs.no_logging_console()
# line_console_0
self.cs.line_console_0()
# summary
self.cs.show_ap_summary()
# disable
self.cs.show_ap_dot11_6gz_shutdown()
self.cs.show_ap_dot11_5gz_shutdown()
self.cs.show_ap_dot11_24gz_shutdown()
# disable_wlan
self.cs.wlan_shutdown()
# disable_network_6ghz
self.cs.ap_dot11_6ghz_shutdown()
# disable_network_5ghz
self.cs.ap_dot11_5ghz_shutdown()
# disable_network_24ghz
self.cs.ap_dot11_24ghz_shutdown()
# manual
self.cs.ap_dot11_6ghz_radio_role_manual_client_serving()
self.cs.ap_dot11_5ghz_radio_role_manual_client_serving()
self.cs.ap_dot11_24ghz_radio_role_manual_client_serving()
# Configuration for 6g
# Configuration for 6g
# txPower
# TODO is this still needed
self.cs.config_dot11_6ghz_tx_power()
self.cs.bandwidth = '20'
# bandwidth (to set to 20 if channel change does not support)
self.cs.config_dot11_6ghz_channel_width()
self.cs.channel = '59'
# channel
self.cs.config_dot11_6ghz_channel()
self.cs.bandwidth = '20'
# bandwidth
self.cs.config_dot11_6ghz_channel_width()
# show_wlan_summary
self.cs.show_wlan_summary()
# delete_wlan
# TODO (there were two in tx_power the logs)
# need to check if wlan present
# delete wlan
self.cs.config_no_wlan()
# create_wlan_wpa3
self.cs.config_wlan_wpa3()
# wireless_tag_policy
self.cs.config_wireless_tag_policy_and_policy_profile()
# enable_wlan
self.cs.config_enable_wlan_send_no_shutdown()
# enable_network_5ghz
self.cs.config_no_ap_dot11_6ghz_shutdown()
# enable_network_24ghz
# self.cs.config_no_ap_dot11_5ghz_shutdown()
# enable
self.cs.config_ap_no_dot11_6ghz_shutdown()
# config_ap_no_dot11_24ghz_shutdown
# advanced
self.cs.show_ap_dot11_6gz_summary()
# show_wlan_summary
self.cs.show_wlan_summary()
def test_config_tx_power_5g_open(self):
logger.info("test_config_tx_power_open")
# configure once at the top
self.cs.wlan = 'open-wlan-14'
self.cs.wlanID = '14'
self.cs.wlanSSID = 'open-wlan-14'
self.cs.config_wlan_open()
# wireless_tag_policy
self.cs.tag_policy = 'RM204-TB1-AP2'
self.cs.policy_profile = 'default-policy-profile'
self.cs.config_wireless_tag_policy_and_policy_profile()
self.cs.tx_power = '1'
self.cs.channel = '149'
self.cs.bandwidth = '40'
# no_logging_console
self.cs.no_logging_console()
# line_console_0
self.cs.line_console_0()
# summary
self.cs.show_ap_summary()
# disable
self.cs.show_ap_dot11_5gz_shutdown()
self.cs.show_ap_dot11_24gz_shutdown()
# disable_wlan only need wlan
self.cs.wlan_shutdown()
# disable_network_5ghz
self.cs.ap_dot11_5ghz_shutdown()
# disable_network_24ghz
self.cs.ap_dot11_24ghz_shutdown()
# manual
self.cs.ap_dot11_5ghz_radio_role_manual_client_serving()
self.cs.ap_dot11_24ghz_radio_role_manual_client_serving()
# Configuration for 5g
# txPower
self.cs.config_dot11_5ghz_tx_power()
# bandwidth (to set to 20 if channel change does not support)
self.cs.bandwidth = '20'
self.cs.config_dot11_5ghz_channel_width()
# channel
self.cs.channel = '100'
self.cs.config_dot11_5ghz_channel()
self.cs.channel = '5'
self.cs.config_dot11_24ghz_channel()
# bandwidth
self.cs.bandwidth = '40'
self.cs.config_dot11_5ghz_channel_width()
# show_wlan_summary
self.cs.show_wlan_summary()
# delete_wlan
# TODO (there were two in tx_power the logs)
# need to check if wlan present
# delete wlan
# self.cs.config_no_wlan()
# create_wlan open
# enable_wlan
self.cs.config_enable_wlan_send_no_shutdown()
# enable_network_5ghz
self.cs.config_no_ap_dot11_5ghz_shutdown()
# enable_network_24ghz
self.cs.config_no_ap_dot11_24ghz_shutdown()
# enable
self.cs.config_ap_no_dot11_5ghz_shutdown()
self.cs.config_ap_no_dot11_24ghz_shutdown()
# config_ap_no_dot11_24ghz_shutdown
# advanced
self.cs.show_ap_dot11_5gz_summary()
self.cs.show_ap_dot11_24gz_summary()
# show_wlan_summary
self.cs.show_wlan_summary()
self.cs.show_ap_dot11_5gz_summary()
self.cs.show_ap_bssid_5ghz()
# 2g test
def test_config_tx_power_2g_open(self):
logger.info("test_config_tx_power_open_2g")
# configure once at the top
self.cs.wlan = 'open-wlan-2-2g'
self.cs.wlanID = '2'
self.cs.wlanSSID = 'open-wlan-2-2g'
self.cs.config_wlan_open()
# wireless_tag_policy
self.cs.tag_policy = 'RM204-TB1-AP2'
self.cs.policy_profile = 'default-policy-profile'
self.cs.config_wireless_tag_policy_and_policy_profile()
self.cs.tx_power = '5'
self.cs.channel = '2'
self.cs.bandwidth = '20'
# no_logging_console
self.cs.no_logging_console()
# line_console_0
self.cs.line_console_0()
# summary
self.cs.show_ap_summary()
# disable
self.cs.show_ap_dot11_5gz_shutdown()
self.cs.show_ap_dot11_24gz_shutdown()
# disable_wlan only need wlan
self.cs.wlan_shutdown()
# disable_network_5ghz
self.cs.ap_dot11_5ghz_shutdown()
# disable_network_24ghz
self.cs.ap_dot11_24ghz_shutdown()
# manual
self.cs.ap_dot11_5ghz_radio_role_manual_client_serving()
# self.cs.ap_dot11_24ghz_radio_role_manual_client_serving()
# Configuration for 5g
# txPower
self.cs.config_dot11_24ghz_tx_power()
# bandwidth (to set to 20 if channel change does not support)
self.cs.bandwidth = '20'
# self.cs.config_dot11_24ghz_channel_width()
# channel
self.cs.config_dot11_24ghz_channel()
# bandwidth
self.cs.bandwidth = '20'
# self.cs.config_dot11_24ghz_channel_width()
# show_wlan_summary
self.cs.show_wlan_summary()
# delete_wlan
# TODO (there were two in tx_power the logs)
# need to check if wlan present
# delete wlan
self.cs.config_no_wlan()
# create_wlan open
# enable_wlan
self.cs.config_enable_wlan_send_no_shutdown()
# enable_network_5ghz
# self.cs.config_no_ap_dot11_5ghz_shutdown()
# enable_network_24ghz
self.cs.config_no_ap_dot11_24ghz_shutdown()
# enable
# self.cs.config_ap_no_dot11_5ghz_shutdown()
self.cs.config_ap_no_dot11_24ghz_shutdown()
# config_ap_no_dot11_24ghz_shutdown
# advanced
# self.cs.show_ap_dot11_5gz_summary()
self.cs.show_ap_dot11_24gz_summary()
# show_wlan_summary
self.cs.show_wlan_summary()
self.cs.show_ap_dot11_24gz_summary()
self.cs.show_ap_bssid_24ghz()
# tb2
def test_config_tx_power_5g_open_tb2_AP3(self):
logger.info("test_config_tx_power_open")
# configure once at the top
self.cs.wlan = 'open-wlan-13'
self.cs.wlanID = '13'
self.cs.wlanSSID = 'open-wlan-13'
self.cs.config_wlan_open()
# wireless_tag_policy
self.cs.tag_policy = 'RM204-TB2-AP1'
self.cs.policy_profile = 'default-policy-profile'
self.cs.config_wireless_tag_policy_and_policy_profile()
self.cs.tx_power = '1'
self.cs.channel = '100'
self.cs.bandwidth = '40'
# no_logging_console
self.cs.no_logging_console()
# line_console_0
self.cs.line_console_0()
# summary
self.cs.show_ap_summary()
# disable
self.cs.show_ap_dot11_5gz_shutdown()
self.cs.show_ap_dot11_24gz_shutdown()
# disable_wlan only need wlan
self.cs.wlan_shutdown()
# disable_network_5ghz
self.cs.ap_dot11_5ghz_shutdown()
# disable_network_24ghz
self.cs.ap_dot11_24ghz_shutdown()
# manual
self.cs.ap_dot11_5ghz_radio_role_manual_client_serving()
self.cs.ap_dot11_24ghz_radio_role_manual_client_serving()
# Configuration for 5g
# txPower
self.cs.config_dot11_5ghz_tx_power()
# bandwidth (to set to 20 if channel change does not support)
self.cs.bandwidth = '20'
self.cs.config_dot11_5ghz_channel_width()
# channel
self.cs.config_dot11_5ghz_channel()
# bandwidth
self.cs.bandwidth = '40'
self.cs.config_dot11_5ghz_channel_width()
# show_wlan_summary
self.cs.show_wlan_summary()
# delete_wlan
# TODO (there were two in tx_power the logs)
# need to check if wlan present
# delete wlan
# self.cs.config_no_wlan()
# create_wlan open
# enable_wlan
self.cs.config_enable_wlan_send_no_shutdown()
# enable_network_5ghz
self.cs.config_no_ap_dot11_5ghz_shutdown()
# enable_network_24ghz
self.cs.config_no_ap_dot11_24ghz_shutdown()
# enable
self.cs.config_ap_no_dot11_5ghz_shutdown()
self.cs.config_ap_no_dot11_24ghz_shutdown()
# config_ap_no_dot11_24ghz_shutdown
# advanced
self.cs.show_ap_dot11_5gz_summary()
self.cs.show_ap_dot11_24gz_summary()
# show_wlan_summary
self.cs.show_wlan_summary()
def test_config_tx_power_5g_wpa2_AP3(self):
logger.info("sample_test_tx_power_sequence on AP")
# no_logging_console
self.cs.no_logging_console()
# line_console_0
self.cs.line_console_0()
# summary
self.cs.show_ap_summary()
# disable
self.cs.show_ap_dot11_5gz_shutdown()
self.cs.show_ap_dot11_24gz_shutdown()
# This needs to be here to disable and delete
self.cs.wlan = 'wpa2_wlan_3'
# disable_wlan
self.cs.wlan_shutdown()
# disable_network_5ghz
self.cs.ap_dot11_5ghz_shutdown()
# disable_network_24ghz
self.cs.ap_dot11_24ghz_shutdown()
# manual
self.cs.ap_dot11_5ghz_radio_role_manual_client_serving()
# self.cs.ap_dot11_24ghz_radio_role_manual_client_serving()
self.cs.tx_power = '1'
# Configuration for 5g
# txPower
self.cs.config_dot11_5ghz_tx_power()
self.cs.bandwidth = '20'
# bandwidth (to set to 20 if channel change does not support)
self.cs.config_dot11_5ghz_channel_width()
self.cs.channel = '100'
# channel
self.cs.config_dot11_5ghz_channel()
self.cs.bandwidth = '40'
# bandwidth