mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 02:38:03 +00:00 
			
		
		
		
	bands mode with multiple ssid added
This commit is contained in:
		| @@ -40,6 +40,12 @@ class ThroughputQOS(Realm): | |||||||
|                  ssid=None, |                  ssid=None, | ||||||
|                  security=None, |                  security=None, | ||||||
|                  password=None, |                  password=None, | ||||||
|  |                  ssid_2g=None, | ||||||
|  |                  security_2g=None, | ||||||
|  |                  password_2g=None, | ||||||
|  |                  ssid_5g=None, | ||||||
|  |                  security_5g=None, | ||||||
|  |                  password_5g=None, | ||||||
|                  sta_list=[], |                  sta_list=[], | ||||||
|                  create_sta=True, |                  create_sta=True, | ||||||
|                  name_prefix=None, |                  name_prefix=None, | ||||||
| @@ -65,11 +71,17 @@ class ThroughputQOS(Realm): | |||||||
|         self.host = host |         self.host = host | ||||||
|         self.port = port |         self.port = port | ||||||
|         self.ssid = ssid |         self.ssid = ssid | ||||||
|         self.sta_list = sta_list |  | ||||||
|         self.create_sta = create_sta |  | ||||||
|         self.security = security |         self.security = security | ||||||
|         self.password = password |         self.password = password | ||||||
|  |         self.ssid_2g = ssid_2g | ||||||
|  |         self.security_2g = security_2g | ||||||
|  |         self.password_2g = password_2g | ||||||
|  |         self.ssid_5g = ssid_5g | ||||||
|  |         self.security_5g = security_5g | ||||||
|  |         self.password_5g = password_5g | ||||||
|         self.radio = radio.split(",") |         self.radio = radio.split(",") | ||||||
|  |         self.sta_list = sta_list | ||||||
|  |         self.create_sta = create_sta | ||||||
|         self.mode = mode |         self.mode = mode | ||||||
|         self.ap = ap |         self.ap = ap | ||||||
|         self.traffic_type = traffic_type |         self.traffic_type = traffic_type | ||||||
| @@ -133,17 +145,30 @@ class ThroughputQOS(Realm): | |||||||
|     def build(self): |     def build(self): | ||||||
|         for key in self.bands: |         for key in self.bands: | ||||||
|             if self.create_sta: |             if self.create_sta: | ||||||
|                 self.station_profile.use_security(self.security, self.ssid, self.password) |                 if key == "2.4G" or key == "2,4g": | ||||||
|  |                     if self.ssid is None: | ||||||
|  |                         self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) | ||||||
|  |                     else: | ||||||
|  |                         self.station_profile.use_security(self.security, self.ssid, self.password) | ||||||
|  |                 elif key == "5G" or key == "5G": | ||||||
|  |                     if self.ssid is None: | ||||||
|  |                         self.station_profile.use_security(self.security_5g, self.ssid_5g, self.password_5g) | ||||||
|  |                     else: | ||||||
|  |                         self.station_profile.use_security(self.security, self.ssid, self.password) | ||||||
|  |                 else: | ||||||
|  |                     self.station_profile.use_security(self.security, self.ssid, self.password) | ||||||
|                 self.station_profile.set_number_template(self.number_template) |                 self.station_profile.set_number_template(self.number_template) | ||||||
|                 print("Creating stations") |                 print("Creating stations") | ||||||
|                 self.station_profile.set_command_flag("add_sta", "create_admin_down", 1) |                 self.station_profile.set_command_flag("add_sta", "create_admin_down", 1) | ||||||
|                 self.station_profile.set_command_param("set_port", "report_timer", 1500) |                 self.station_profile.set_command_param("set_port", "report_timer", 1500) | ||||||
|                 self.station_profile.set_command_flag("set_port", "rpt_timer", 1) |                 self.station_profile.set_command_flag("set_port", "rpt_timer", 1) | ||||||
|                 if key == "BOTH" or key == "both": |                 if key == "BOTH" or key == "both": | ||||||
|  |                     if (self.ssid is None) and (self.password is None) and (self.security is None): | ||||||
|  |                         self.station_profile.use_security(self.security_2g, self.ssid_2g, self.password_2g) | ||||||
|                     split = len(self.sta_list) // 2 |                     split = len(self.sta_list) // 2 | ||||||
|                     self.station_profile.mode = 9 |                     self.station_profile.mode = 2 | ||||||
|                     self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list[:split], debug=self.debug) |                     self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list[:split], debug=self.debug) | ||||||
|                     self.station_profile.mode = 11 |                     self.station_profile.mode = 9 | ||||||
|                     self.station_profile.create(radio=self.radio[1], sta_names_=self.sta_list[split:], debug=self.debug) |                     self.station_profile.create(radio=self.radio[1], sta_names_=self.sta_list[split:], debug=self.debug) | ||||||
|                 else: |                 else: | ||||||
|                     self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list, debug=self.debug) |                     self.station_profile.create(radio=self.radio[0], sta_names_=self.sta_list, debug=self.debug) | ||||||
| @@ -258,13 +283,22 @@ python3 ./throughput_QOS.py | |||||||
|                         default="Best Effort") |                         default="Best Effort") | ||||||
|     parser.add_argument('--bands', help='used to run on multiple radio bands,can be used with multiple stations', |     parser.add_argument('--bands', help='used to run on multiple radio bands,can be used with multiple stations', | ||||||
|                         default="2,4G, 5G, BOTH") |                         default="2,4G, 5G, BOTH") | ||||||
|  |     parser.add_argument('--ssid_2g', help="ssid for  2.4Ghz band") | ||||||
|  |     parser.add_argument('--security_2g', help="security type for  2.4Ghz band") | ||||||
|  |     parser.add_argument('--passwd_2g', help="password for 2.4Ghz band") | ||||||
|  |     parser.add_argument('--ssid_5g', help="ssid for  5Ghz band") | ||||||
|  |     parser.add_argument('--security_5g', help="security type  for  5Ghz band") | ||||||
|  |     parser.add_argument('--passwd_5g', help="password for  5Ghz band") | ||||||
|     args = parser.parse_args() |     args = parser.parse_args() | ||||||
|     print("--------------------------------------------") |     print("--------------------------------------------") | ||||||
|     print(args) |     print(args) | ||||||
|     print("--------------------------------------------") |     print("--------------------------------------------") | ||||||
|     test_results = [] |     test_results = [] | ||||||
|     test_cases = {} |     test_cases = {} | ||||||
|  |     if (args.a_min is not None) and (args.b_min is not None): | ||||||
|  |         args.a_min = args.a_min.split(',') | ||||||
|  |         args.b_min = args.b_min.split(',') | ||||||
|  |         loads = {"a_min": args.a_min, "b_min": args.b_min} | ||||||
|     if args.bands is not None: |     if args.bands is not None: | ||||||
|         bands = args.bands.split(',') |         bands = args.bands.split(',') | ||||||
|  |  | ||||||
| @@ -322,52 +356,58 @@ python3 ./throughput_QOS.py | |||||||
|         print(args.mode) |         print(args.mode) | ||||||
|         print(station_list) |         print(station_list) | ||||||
|         print("-----------------") |         print("-----------------") | ||||||
|  |         for index in range(len(loads["a_min"])): | ||||||
|  |             throughput_qos = ThroughputQOS(host=args.mgr, | ||||||
|  |                                            port=args.mgr_port, | ||||||
|  |                                            number_template="0000", | ||||||
|  |                                            sta_list=station_list, | ||||||
|  |                                            create_sta=args.create_sta, | ||||||
|  |                                            name_prefix="TOS-", | ||||||
|  |                                            upstream=args.upstream_port, | ||||||
|  |                                            ssid=args.ssid, | ||||||
|  |                                            password=args.passwd, | ||||||
|  |                                            security=args.security, | ||||||
|  |                                            ssid_2g=args.ssid_2g, | ||||||
|  |                                            password_2g=args.passwd_2g, | ||||||
|  |                                            security_2g=args.security_2g, | ||||||
|  |                                            ssid_5g=args.ssid_5g, | ||||||
|  |                                            password_5g=args.passwd_5g, | ||||||
|  |                                            security_5g=args.security_5g, | ||||||
|  |                                            radio=args.radio, | ||||||
|  |                                            test_duration=args.test_duration, | ||||||
|  |                                            use_ht160=False, | ||||||
|  |                                            side_a_min_rate=loads['a_min'][index], | ||||||
|  |                                            side_b_min_rate=loads['b_min'][index], | ||||||
|  |                                            mode=args.mode, | ||||||
|  |                                            bands=args.bands, | ||||||
|  |                                            ap=args.ap, | ||||||
|  |                                            traffic_type=args.traffic_type, | ||||||
|  |                                            tos=args.tos, | ||||||
|  |                                            _debug_on=args.debug) | ||||||
|  |             throughput_qos.pre_cleanup() | ||||||
|  |             throughput_qos.build() | ||||||
|  |  | ||||||
|         throughput_qos = ThroughputQOS(host=args.mgr, |             if args.create_sta: | ||||||
|                                        port=args.mgr_port, |                 if not throughput_qos.passes(): | ||||||
|                                        number_template="0000", |                     print(throughput_qos.get_fail_message()) | ||||||
|                                        sta_list=station_list, |                     throughput_qos.exit_fail() | ||||||
|                                        create_sta=args.create_sta, |             # try: | ||||||
|                                        name_prefix="TOS-", |             #     layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) | ||||||
|                                        upstream=args.upstream_port, |             # except: | ||||||
|                                        ssid=args.ssid, |             #     raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') | ||||||
|                                        password=args.passwd, |  | ||||||
|                                        radio=args.radio, |  | ||||||
|                                        security=args.security, |  | ||||||
|                                        test_duration=args.test_duration, |  | ||||||
|                                        use_ht160=False, |  | ||||||
|                                        side_a_min_rate=args.a_min, |  | ||||||
|                                        side_b_min_rate=args.b_min, |  | ||||||
|                                        mode=args.mode, |  | ||||||
|                                        bands=args.bands, |  | ||||||
|                                        ap=args.ap, |  | ||||||
|                                        traffic_type=args.traffic_type, |  | ||||||
|                                        tos=args.tos, |  | ||||||
|                                        _debug_on=args.debug) |  | ||||||
|         throughput_qos.pre_cleanup() |  | ||||||
|         throughput_qos.build() |  | ||||||
|  |  | ||||||
|         if args.create_sta: |             throughput_qos.start(False, False) | ||||||
|             if not throughput_qos.passes(): |             time.sleep(int(args.test_duration) * 60) | ||||||
|                 print(throughput_qos.get_fail_message()) |             throughput_qos.stop() | ||||||
|                 throughput_qos.exit_fail() |             test_results.append(throughput_qos.evaluate_throughput()) | ||||||
|         # try: |             if args.create_sta: | ||||||
|         #     layer3connections = ','.join([[*x.keys()][0] for x in throughput_qos.json_get('endp')['endpoint']]) |                 if not throughput_qos.passes(): | ||||||
|         # except: |                     print(throughput_qos.get_fail_message()) | ||||||
|         #     raise ValueError('Try setting the upstream port flag if your device does not have an eth1 port') |                     throughput_qos.exit_fail() | ||||||
|  |                 LFUtils.wait_until_ports_admin_up(port_list=station_list) | ||||||
|         throughput_qos.start(False, False) |                 if throughput_qos.passes(): | ||||||
|         time.sleep(int(args.test_duration) * 60) |                     throughput_qos.success() | ||||||
|         throughput_qos.stop() |             throughput_qos.cleanup() | ||||||
|         test_results.append(throughput_qos.evaluate_throughput()) |  | ||||||
|         if args.create_sta: |  | ||||||
|             if not throughput_qos.passes(): |  | ||||||
|                 print(throughput_qos.get_fail_message()) |  | ||||||
|                 throughput_qos.exit_fail() |  | ||||||
|             LFUtils.wait_until_ports_admin_up(port_list=station_list) |  | ||||||
|             if throughput_qos.passes(): |  | ||||||
|                 throughput_qos.success() |  | ||||||
|         throughput_qos.cleanup() |  | ||||||
|     # ---------------------------------------# |     # ---------------------------------------# | ||||||
|     print('+++++++++++++++++') |     print('+++++++++++++++++') | ||||||
|     print(test_results) |     print(test_results) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 anil-tegala
					anil-tegala