From f84332d591d5b683a7c980ea51c3c9c5448e28a1 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Tue, 4 Aug 2020 15:37:47 -0700 Subject: [PATCH 1/4] Fixed typo, removed unnecessary mode set --- py-scripts/test_ipv4_variable_time.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/py-scripts/test_ipv4_variable_time.py b/py-scripts/test_ipv4_variable_time.py index 111fa916..22be50b6 100755 --- a/py-scripts/test_ipv4_variable_time.py +++ b/py-scripts/test_ipv4_variable_time.py @@ -45,10 +45,9 @@ class IPV4VariableTime(LFCliBase): self.station_profile.lfclient_url = self.lfclient_url self.station_profile.ssid = self.ssid - self.station_profile.ssid_pass = self.password, + self.station_profile.ssid_pass = self.password self.station_profile.security = self.security self.station_profile.number_template_ = self.number_template - self.station_profile.mode = 0 self.station_profile.use_ht160 = use_ht160 if self.station_profile.use_ht160: self.station_profile.mode = 9 From 5bf449c3f7c30eebc278b3e997aa48fd0832aee7 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Wed, 5 Aug 2020 13:29:10 -0700 Subject: [PATCH 2/4] Added PortUtils class, set_ftp method WIP --- py-json/realm.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/py-json/realm.py b/py-json/realm.py index 4168ce53..186233b5 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -1575,6 +1575,29 @@ class VAPProfile(LFCliBase): data["port"] = current_stations["interface"]["alias"] self.local_realm.json_post(req_url, data, debug_=self.debug) +class PortUtils(LFCliBase): + def __init__(self, local_realm): + self.local_realm = local_realm + + def set_ftp(self, port_name="", resource=1, on=False): + if port_name != "": + data = { + "shelf": 1, + "resource": resource, + "port": port_name, + "current_flags": 0, + "interest": 0 + } + + if on: + data["current_flags"] = 0x400000000000 + data["interest"] = 0x10000000 + else: + data["interest"] = 0x10000000 + + self.local_realm.json_post("cli-json/set_port", data) + else: + raise ValueError("Port name required") # use the station profile to set the combination of features you want on your stations # once this combination is configured, build the stations with the build(resource, radio, number) call From f717676f358d48d8111ccc12bbd1a16c3d12ac55 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Wed, 5 Aug 2020 14:19:30 -0700 Subject: [PATCH 3/4] Fixed StationProfile use of name_to_eid, now uses realm method --- py-json/realm.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/py-json/realm.py b/py-json/realm.py index 186233b5..53c7cc0c 100755 --- a/py-json/realm.py +++ b/py-json/realm.py @@ -1803,7 +1803,7 @@ class StationProfile: # First, request remove on the list. for port_eid in desired_stations: - eid = self.name_to_eid(port_eid) + eid = self.local_realm.name_to_eid(port_eid) data["shelf"] = eid[0] data["resource"] = eid[1] data["port"] = eid[2] @@ -1811,11 +1811,11 @@ class StationProfile: time.sleep(delay) # And now see if they are gone - count = 0; + count = 0 while count < (del_count + 10): found_one = False for port_eid in desired_stations: - eid = self.name_to_eid(port_eid) + eid = self.local_realm.name_to_eid(port_eid) data["shelf"] = eid[0] data["resource"] = eid[1] data["port"] = eid[2] @@ -1872,7 +1872,7 @@ class StationProfile: add_sta_r = LFRequest.LFRequest(self.lfclient_url + "/cli-json/add_sta") set_port_r = LFRequest.LFRequest(self.lfclient_url + "/cli-json/set_port") - my_sta_names = []; + my_sta_names = [] if num_stations > 0: my_sta_names = LFUtils.portNameSeries("sta", 0, num_stations - 1, int("1" + self.number_template)) else: @@ -1895,7 +1895,7 @@ class StationProfile: self.add_sta_data["radio"] = radio_port self.add_sta_data["sta_name"] = name - self.station_names.append("%s.%s.%s" %(radio_shelf, radio_resource, name)) + self.station_names.append("%s.%s.%s" % (radio_shelf, radio_resource, name)) add_sta_r.addPostData(self.add_sta_data) if debug: print("- 381 - %s- - - - - - - - - - - - - - - - - - " % name) From d8aaab8546726d5de77a9c59f69f70c5a836025d Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Wed, 5 Aug 2020 16:16:13 -0700 Subject: [PATCH 4/4] Removed unnecessary usage of resource params, cleanup WIP --- py-scripts/test_ipv4_variable_time.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/py-scripts/test_ipv4_variable_time.py b/py-scripts/test_ipv4_variable_time.py index 22be50b6..ce5d75f1 100755 --- a/py-scripts/test_ipv4_variable_time.py +++ b/py-scripts/test_ipv4_variable_time.py @@ -48,6 +48,7 @@ class IPV4VariableTime(LFCliBase): self.station_profile.ssid_pass = self.password self.station_profile.security = self.security self.station_profile.number_template_ = self.number_template + self.station_profile.debug = self.debug self.station_profile.use_ht160 = use_ht160 if self.station_profile.use_ht160: self.station_profile.mode = 9 @@ -95,7 +96,7 @@ class IPV4VariableTime(LFCliBase): self.station_profile.admin_up(self.resource) temp_stas = self.sta_list.copy() temp_stas.append("eth1") - if self.local_realm.wait_for_ip(self.resource, temp_stas): + if self.local_realm.wait_for_ip(temp_stas): self._pass("All stations got IPs", print_pass) else: self._fail("Stations failed to get IPs", print_fail) @@ -138,7 +139,7 @@ class IPV4VariableTime(LFCliBase): def cleanup(self, sta_list): self.cx_profile.cleanup() - self.station_profile.cleanup(self.resource, sta_list) + self.station_profile.cleanup(sta_list) LFUtils.wait_until_ports_disappear(resource_id=self.resource, base_url=self.lfclient_url, port_list=sta_list, debug=self.debug) @@ -152,7 +153,7 @@ class IPV4VariableTime(LFCliBase): temp_sta_list = [] for station in range(len(self.sta_list)): temp_sta_list.append(str(self.resource) + "." + self.sta_list[station]) - self.station_profile.create(resource=1, radio=self.radio, sta_names_=self.sta_list, debug=self.debug) + self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug) self.cx_profile.create(endp_type="lf_udp", side_a=temp_sta_list, side_b="1.eth1", sleep_time=.5) self._pass("PASS: Station build finished") @@ -168,7 +169,7 @@ def main(): resource=1, radio="wiphy2", security="wpa2", test_duration="5m", use_ht160=False, - side_a_min_rate=256000, side_b_min_rate=256000, _debug_on=False) + side_a_min_rate=256000, side_b_min_rate=256000, _debug_on=True) ip_var_test.cleanup(station_list) ip_var_test.build()