mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-22 13:05:11 +00:00
sta_connect2.py: The pre-cleanup text in StaConnect.setup was redundant frmo the pre_cleanup function.
It was also spouting errors if the station did not exist, so I made it so setup calls pre_cleanup and replaces the old noisy code. Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -153,19 +153,7 @@ class StaConnect2(Realm):
|
|||||||
self._fail("Warning: %s lacks ip address" % self.get_upstream_url(), print_=True)
|
self._fail("Warning: %s lacks ip address" % self.get_upstream_url(), print_=True)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# remove old stations
|
self.pre_cleanup()
|
||||||
if self.clean_all_sta:
|
|
||||||
print("Removing all stations on resource.")
|
|
||||||
self.remove_all_stations(self.resource)
|
|
||||||
else:
|
|
||||||
print("Removing old stations to be created by this test.")
|
|
||||||
for sta_name in self.station_names:
|
|
||||||
sta_url = self.get_station_url(sta_name)
|
|
||||||
response = self.json_get(sta_url)
|
|
||||||
if (response) and (response["interface"]):
|
|
||||||
for station in self.station_names:
|
|
||||||
LFUtils.removePort(self.resource, station, self.lfclient_url)
|
|
||||||
LFUtils.wait_until_ports_disappear(self.lfclient_url, self.station_names)
|
|
||||||
|
|
||||||
# Create stations and turn dhcp on
|
# Create stations and turn dhcp on
|
||||||
self.station_profile = self.new_station_profile()
|
self.station_profile = self.new_station_profile()
|
||||||
@@ -479,7 +467,6 @@ Example:
|
|||||||
staConnect.station_names = ["%s0000" % args.prefix]
|
staConnect.station_names = ["%s0000" % args.prefix]
|
||||||
staConnect.bringup_time_sec = args.bringup_time
|
staConnect.bringup_time_sec = args.bringup_time
|
||||||
|
|
||||||
staConnect.pre_cleanup()
|
|
||||||
staConnect.setup()
|
staConnect.setup()
|
||||||
staConnect.start()
|
staConnect.start()
|
||||||
print("napping %f sec" % staConnect.runtime_secs)
|
print("napping %f sec" % staConnect.runtime_secs)
|
||||||
|
|||||||
Reference in New Issue
Block a user