mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 18:58:01 +00:00 
			
		
		
		
	working now
This commit is contained in:
		| @@ -22,6 +22,7 @@ from LANforge.lfcli_base import LFCliBase | ||||
| from LANforge.LFUtils import * | ||||
| import realm | ||||
| from realm import Realm | ||||
| import pprint | ||||
|  | ||||
| OPEN="open" | ||||
| WEP="wep" | ||||
| @@ -141,7 +142,7 @@ class StaConnect2(LFCliBase): | ||||
|             if (response is not None) and (response["interface"] is not None): | ||||
|                 for sta_name in self.station_names: | ||||
|                     LFUtils.removePort(self.resource, sta_name, self.lfclient_url) | ||||
|         LFUtils.wait_until_ports_disappear(self.resource, self.lfclient_url, self.station_names) | ||||
|         LFUtils.wait_until_ports_disappear(self.lfclient_url, self.station_names) | ||||
|  | ||||
|         # Create stations and turn dhcp on | ||||
|         self.station_profile = self.localrealm.new_station_profile() | ||||
| @@ -153,8 +154,8 @@ class StaConnect2(LFCliBase): | ||||
|         self.station_profile.set_command_flag("add_sta", "create_admin_down", 1) | ||||
|  | ||||
|         print("Adding new stations ", end="") | ||||
|         self.station_profile.create(resource=self.resource, radio=self.radio, sta_names_=self.station_names, up_=False, debug=self.debug, suppress_related_commands_=True) | ||||
|         LFUtils.wait_until_ports_appear(self.resource, self.lfclient_url, self.station_names, debug=self.debug) | ||||
|         self.station_profile.create(radio=self.radio, sta_names_=self.station_names, up_=False, debug=self.debug, suppress_related_commands_=True) | ||||
|         LFUtils.wait_until_ports_appear(self.lfclient_url, self.station_names, debug=self.debug) | ||||
|  | ||||
|         # Create UDP endpoints | ||||
|         self.l3_udp_profile = self.localrealm.new_l3_cx_profile() | ||||
| @@ -193,7 +194,7 @@ class StaConnect2(LFCliBase): | ||||
|                      "port": "ALL", | ||||
|                      "probe_flags": 1} | ||||
|             self.json_post("/cli-json/nc_show_ports", data) | ||||
|             self.station_profile.admin_up(self.resource) | ||||
|             self.station_profile.admin_up() | ||||
|             LFUtils.waitUntilPortsAdminUp(self.resource, self.lfclient_url, self.station_names) | ||||
|  | ||||
|         # station_info = self.jsonGet(self.mgr_url, "%s?fields=port,ip,ap" % (self.getStaUrl())) | ||||
| @@ -329,14 +330,16 @@ class StaConnect2(LFCliBase): | ||||
|         if self.cleanup_on_exit: | ||||
|             for sta_name in self.station_names: | ||||
|                 LFUtils.removePort(self.resource, sta_name, self.lfclient_url) | ||||
|             endp_names = [] | ||||
|  | ||||
|             curr_endp_names = [] | ||||
|             removeCX(self.lfclient_url, self.l3_udp_profile.get_cx_names()) | ||||
|             removeCX(self.lfclient_url, self.l3_tcp_profile.get_cx_names()) | ||||
|             for (cx_name, endp_names) in self.l3_udp_profile.created_cx.items(): | ||||
|                 endp_names.append(endp_names[0]) | ||||
|                 endp_names.append(endp_names[1]) | ||||
|             removeEndps(self.lfclient_url, endp_names) | ||||
|                 curr_endp_names.append(endp_names[0]) | ||||
|                 curr_endp_names.append(endp_names[1]) | ||||
|             for (cx_name, endp_names) in self.l3_tcp_profile.created_cx.items(): | ||||
|                 curr_endp_names.append(endp_names[0]) | ||||
|                 curr_endp_names.append(endp_names[1])         | ||||
|             removeEndps(self.lfclient_url, curr_endp_names, debug= self.debug) | ||||
|  | ||||
| # ~class | ||||
|  | ||||
| @@ -408,6 +411,7 @@ Example: | ||||
|     if args.dut_security is not None: | ||||
|         staConnect.dut_security = args.dut_security | ||||
|  | ||||
|    # staConnect.cleanup() | ||||
|     staConnect.setup() | ||||
|     staConnect.start() | ||||
|     print("napping %f sec" % staConnect.runtime_secs) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Dipti Dhond
					Dipti Dhond