mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-30 18:27:53 +00:00 
			
		
		
		
	Add: roam test to lf_tests
Signed-off-by: anil-tegala <anil.tegala@candelatech.com>
This commit is contained in:
		| @@ -63,6 +63,8 @@ lf_pcap = importlib.import_module("py-scripts.lf_pcap") | ||||
| LfPcap = lf_pcap.LfPcap | ||||
| lf_ap_auto_test = importlib.import_module("py-scripts.lf_ap_auto_test") | ||||
| ApAutoTest = lf_ap_auto_test.ApAutoTest | ||||
| roam_test = importlib.import_module("py-scripts.lf_hard_roam_test") | ||||
| RoamTest = roam_test.HardRoam | ||||
|  | ||||
|  | ||||
| class lf_tests(lf_libs): | ||||
| @@ -1641,7 +1643,8 @@ class lf_tests(lf_libs): | ||||
|                 upstream_port = list(self.lanforge_data['wan_ports'].keys())[0] + "." + str(vlan_id[0]) | ||||
|         logging.info("Upstream data: " + str(upstream_port)) | ||||
|         skip_bandv2 = [['Skip 2.4Ghz Tests', f'{skip_twog}'], ['Skip 5Ghz Tests', f'{skip_fiveg}'], | ||||
|                        ['2.4Ghz Channel', f'{channel_2g}'], ['5Ghz Channel', f'{channel_5g}'], ["use_virtual_ax_sta", "1"], | ||||
|                        ['2.4Ghz Channel', f'{channel_2g}'], ['5Ghz Channel', f'{channel_5g}'], | ||||
|                        ["use_virtual_ax_sta", "1"], | ||||
|                        ["Use Issue-3 Behaviour", "0"], ["Skip 6Ghz Tests", "1"]] | ||||
|         enable_tests = [['rxsens: 0'], ['max_cx: 0'], ['max_tput: 0'], ['peak_perf: 0'], ['max_tput_bi: 0'], | ||||
|                         ['dual_band_tput: 0'], ['multi_band_tput: 0'], ['atf: 0'], ['atf3: 0'], ['qos3: 0'], | ||||
| @@ -2649,7 +2652,8 @@ class lf_tests(lf_libs): | ||||
|         elif num_sta == 1:  # else between a 2G/5G station and uplink port | ||||
|             radio_name = radio_name_2g if band_2g is True else radio_name_5g | ||||
|             sta_got_ip.append(self.client_connect_using_radio(ssid=ssid1, passkey=passkey, band=band, security=security, | ||||
|                                                               mode=mode, radio=radio_name[0], station_name=[station_name], | ||||
|                                                               mode=mode, radio=radio_name[0], | ||||
|                                                               station_name=[station_name], | ||||
|                                                               dut_data=dut_data, sniff_radio=sniff_radio, | ||||
|                                                               attach_port_info=False, attach_station_data=False)) | ||||
|             self.create_layer3(side_a_min_rate=side_a_min_rate, side_a_max_rate=side_a_max_rate, | ||||
| @@ -2955,6 +2959,60 @@ class lf_tests(lf_libs): | ||||
|                 description = f"{e}" | ||||
|         return pass_fail, description | ||||
|  | ||||
|     def roam_test(self, ap1_bssid="90:3c:b3:6c:46:dd", ap2_bssid="90:3c:b3:6c:47:2d", fiveg_radio="1.1.wiphy4", | ||||
|                   twog_radio="1.1.wiphy4", sixg_radio="1.1.wiphy4", | ||||
|                   band="twog", sniff_radio_="1.1.wiphy5", num_sta=1, security="wpa2", security_key="Openwifi", | ||||
|                   ssid="OpenWifi", upstream="1.1.eth1", duration=None, iteration=1, channel="11", option="ota", | ||||
|                   dut_name=["edgecore_eap101", "edgecore_eap102"], traffic_type="lf_udp", identity="identity", | ||||
|                   ttls_pass="ttls_pass", sta_type="11r"): | ||||
|         roam_obj = RoamTest(lanforge_ip=self.manager_ip, | ||||
|                             lanforge_port=self.manager_http_port, | ||||
|                             lanforge_ssh_port=self.manager_ssh_port, | ||||
|                             c1_bssid=ap1_bssid, | ||||
|                             c2_bssid=ap2_bssid, | ||||
|                             fiveg_radio=fiveg_radio, | ||||
|                             twog_radio=twog_radio, | ||||
|                             sixg_radio=sixg_radio, | ||||
|                             band=band, | ||||
|                             sniff_radio_=sniff_radio_, | ||||
|                             num_sta=num_sta, | ||||
|                             security=security, | ||||
|                             security_key=security_key, | ||||
|                             ssid=ssid, | ||||
|                             upstream=upstream, | ||||
|                             duration=duration, | ||||
|                             iteration=iteration, | ||||
|                             channel=channel, | ||||
|                             option=option, | ||||
|                             duration_based=False, | ||||
|                             iteration_based=True, | ||||
|                             dut_name=dut_name, | ||||
|                             traffic_type=traffic_type, | ||||
|                             scheme="ssh", | ||||
|                             dest="localhost", | ||||
|                             user="admin", | ||||
|                             passwd="OpenWifi123", | ||||
|                             prompt="WLC2", | ||||
|                             series_cc="9800", | ||||
|                             ap="AP687D.B45C.1D1C", | ||||
|                             port="8888", | ||||
|                             band_cc="5g", | ||||
|                             timeout="10", | ||||
|                             identity=identity, | ||||
|                             ttls_pass=ttls_pass, | ||||
|                             soft_roam=False, | ||||
|                             sta_type=sta_type, | ||||
|                             multicast=False | ||||
|                             ) | ||||
|         x = os.getcwd() | ||||
|         logging.info("Current Working Directory :", x) | ||||
|         file = roam_obj.generate_csv() | ||||
|         logging.info("CSV File :", file) | ||||
|         roam_obj.precleanup() | ||||
|         kernel, message = roam_obj.run(file_n=file) | ||||
|         report_dir_name = roam_obj.generate_report(csv_list=file, kernel_lst=kernel, current_path=str(x) + "/11r") | ||||
|         logging.info(report_dir_name) | ||||
|  | ||||
|  | ||||
| if __name__ == '__main__': | ||||
|     basic = { | ||||
|   | ||||
| @@ -88,7 +88,7 @@ stability of the network when clients move between APs. | ||||
|  | ||||
|     1. The BSSID of the station should change after roaming from one AP to another | ||||
|     2  The station should not experience any disconnections during/after the roaming process. | ||||
|     3. The duration of the roaming process should be less than 50 ms. | ||||
|     3. The duration of the roaming process should be less than 100 ms. | ||||
|  | ||||
|  The following are the criteria for FAIL the test: | ||||
|  | ||||
| @@ -96,7 +96,7 @@ stability of the network when clients move between APs. | ||||
|     2. No roaming occurs, as all stations are connected to the same AP. | ||||
|     3. The captured packet does not contain a Reassociation Response Frame. | ||||
|     4. The station experiences disconnection during/after the roaming process. | ||||
|     5. The duration of the roaming process exceeds 50 ms. | ||||
|     5. The duration of the roaming process exceeds 100 ms. | ||||
|  | ||||
| STATUS: BETA RELEASE (MORE TESTING ONLY WITH MULTICAST) | ||||
|  | ||||
| @@ -941,13 +941,13 @@ class HardRoam(Realm): | ||||
|                             if self.duration is not None: | ||||
|                                 if time.time() > timeout: | ||||
|                                     break | ||||
|                         #  Get the serial number of attenuators from lf | ||||
|                         ser_no = self.attenuator_serial() | ||||
|                         print(ser_no[0]) | ||||
|                         logging.info(str(ser_no[0])) | ||||
|                         ser_1 = ser_no[0].split(".")[2] | ||||
|                         ser_2 = ser_no[1].split(".")[2] | ||||
|                         if self.soft_roam: | ||||
|                             #  Get the serial number of attenuators from lf | ||||
|                             ser_no = self.attenuator_serial() | ||||
|                             print(ser_no[0]) | ||||
|                             logging.info(str(ser_no[0])) | ||||
|                             ser_1 = ser_no[0].split(".")[2] | ||||
|                             ser_2 = ser_no[1].split(".")[2] | ||||
|                             if iterations % 2 == 0: | ||||
|                                 print("even set c1 to lowest and c2 to highest attenuation ") | ||||
|                                 logging.info("even set c1 to lowest and c2 to highest attenuation ") | ||||
| @@ -1518,14 +1518,14 @@ class HardRoam(Realm): | ||||
|                                                             logging.info("Roam Time (ms)" + str(roam_time)) | ||||
|                                                             roam_time1.append(roam_time) | ||||
|                                                             if self.option == "ota": | ||||
|                                                                 if roam_time < 50: | ||||
|                                                                 if roam_time < 100: | ||||
|                                                                     pass_fail_list.append("PASS") | ||||
|                                                                     pcap_file_list.append(str(file_name)) | ||||
|                                                                     remark.append("Passed all criteria") | ||||
|                                                                 else: | ||||
|                                                                     pass_fail_list.append("FAIL") | ||||
|                                                                     pcap_file_list.append(str(file_name)) | ||||
|                                                                     remark.append("Roam time is greater then 50 ms") | ||||
|                                                                     remark.append("Roam time is greater then 100 ms") | ||||
|                                                             else: | ||||
|                                                                 pass_fail_list.append("PASS") | ||||
|                                                                 pcap_file_list.append(str(file_name)) | ||||
| @@ -1638,7 +1638,7 @@ class HardRoam(Realm): | ||||
|                                                                     pass_fail_list.append("FAIL") | ||||
|                                                                     pcap_file_list.append(str(file_name)) | ||||
|                                                                     remark.append( | ||||
|                                                                         "(BSSID mismatched)Roam time is greater then 50 ms,") | ||||
|                                                                         "(BSSID mismatched)Roam time is greater then 100 ms,") | ||||
|                                                             else: | ||||
|                                                                 pass_fail_list.append("FAIL") | ||||
|                                                                 pcap_file_list.append(str(file_name)) | ||||
| @@ -1957,14 +1957,14 @@ class HardRoam(Realm): | ||||
|                                     "<b>The following are the criteria for PASS the test:</b><br><br>" | ||||
|                                     "1. The BSSID of the station should change after roaming from one AP to another.<br>" | ||||
|                                     "2. The station should not experience any disconnections during/after the roaming process.<br>" | ||||
|                                     "3. The duration of the roaming process should be less than 50 ms.<br>" | ||||
|                                     "3. The duration of the roaming process should be less than 100 ms.<br>" | ||||
|                                     "<br>" | ||||
|                                     "<b>The following are the criteria for FAIL the test:</b><br><br>" | ||||
|                                     "1. The BSSID of the station remains unchanged after roaming from one AP to another.<br>" | ||||
|                                     "2. No roaming occurs, as all stations are connected to the same AP.<br>" | ||||
|                                     "3. The captured packet does not contain a Reassociation Response Frame.<br>" | ||||
|                                     "4. The station experiences disconnection during/after the roaming process.<br>" | ||||
|                                     "5. The duration of the roaming process exceeds 50 ms.<br>") | ||||
|                                     "5. The duration of the roaming process exceeds 100 ms.<br>") | ||||
|             report.build_objective() | ||||
|             for i in csv_list: | ||||
|                 report.move_data(directory="csv_data", _file_name=str(i)) | ||||
| @@ -2103,7 +2103,7 @@ stability of the network when clients move between APs. | ||||
|  | ||||
|     1. The BSSID of the station should change after roaming from one AP to another | ||||
|     2  The station should not experience any disconnections during/after the roaming process. | ||||
|     3. The duration of the roaming process should be less than 50 ms. | ||||
|     3. The duration of the roaming process should be less than 100 ms. | ||||
|  | ||||
|  The following are the criteria for FAIL the test: | ||||
|  | ||||
| @@ -2111,7 +2111,7 @@ stability of the network when clients move between APs. | ||||
|     2. No roaming occurs, as all stations are connected to the same AP. | ||||
|     3. The captured packet does not contain a Reassociation Response Frame. | ||||
|     4. The station experiences disconnection during/after the roaming process. | ||||
|     5. The duration of the roaming process exceeds 50 ms. | ||||
|     5. The duration of the roaming process exceeds 100 ms. | ||||
|  | ||||
|  | ||||
| ############################################ | ||||
| @@ -2289,4 +2289,4 @@ EXAMPLE: For multiple station and multiple iteration | ||||
|  | ||||
|  | ||||
| if __name__ == '__main__': | ||||
|     main() | ||||
|     main() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 anil-tegala
					anil-tegala