mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-10-31 18:58:01 +00:00
added admin up for multicase, and debugging
This commit is contained in:
@@ -518,6 +518,23 @@ class MULTICASTProfile(LFCliBase):
|
|||||||
def refresh_mc(self):
|
def refresh_mc(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def admin_up_mc_tx(self, resource, side_mc_tx):
|
||||||
|
set_port_r = LFRequest.LFRequest(self.lfclient_url, "/cli-json/set_port", debug_=self.debug)
|
||||||
|
req_json = LFUtils.portUpRequest(resource, None, debug_on=False)
|
||||||
|
req_json["port"] = side_mc_tx
|
||||||
|
set_port_r.addPostData(req_json)
|
||||||
|
json_response = set_port_r.jsonPost(self.debug)
|
||||||
|
time.sleep(0.03)
|
||||||
|
|
||||||
|
def admin_down_mc_tx(self, resource):
|
||||||
|
set_port_r = LFRequest.LFRequest(self.lfclient_url, "/cli-json/set_port", debug_=self.debug)
|
||||||
|
req_json = LFUtils.portDownRequest(resource, None, debug_on=False)
|
||||||
|
for sta_name in self.station_names:
|
||||||
|
req_json["port"] = sta_name
|
||||||
|
set_port_r.addPostData(req_json)
|
||||||
|
json_response = set_port_r.jsonPost(self.debug)
|
||||||
|
time.sleep(0.03)
|
||||||
|
|
||||||
def start_mc_tx(self, side_tx, suppress_related_commands=None, debug_ = False ):
|
def start_mc_tx(self, side_tx, suppress_related_commands=None, debug_ = False ):
|
||||||
if self.debug:
|
if self.debug:
|
||||||
debut_=True
|
debut_=True
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class L3VariableTimeLongevity(LFCliBase):
|
|||||||
side_a_min_rate=56000, side_a_max_rate=0,
|
side_a_min_rate=56000, side_a_max_rate=0,
|
||||||
side_b_min_rate=56000, side_b_max_rate=0,
|
side_b_min_rate=56000, side_b_max_rate=0,
|
||||||
number_template="00", test_duration="256s",
|
number_template="00", test_duration="256s",
|
||||||
_debug_on=False,
|
_debug_on=True,
|
||||||
_exit_on_error=False,
|
_exit_on_error=False,
|
||||||
_exit_on_fail=False):
|
_exit_on_fail=False):
|
||||||
super().__init__(host, port, _debug=_debug_on, _halt_on_error=_exit_on_error, _exit_on_fail=_exit_on_fail)
|
super().__init__(host, port, _debug=_debug_on, _halt_on_error=_exit_on_error, _exit_on_fail=_exit_on_fail)
|
||||||
@@ -111,10 +111,16 @@ class L3VariableTimeLongevity(LFCliBase):
|
|||||||
|
|
||||||
def start(self, print_pass=False, print_fail=False):
|
def start(self, print_pass=False, print_fail=False):
|
||||||
print("Bringing up stations")
|
print("Bringing up stations")
|
||||||
|
up_request = LFUtils.port_up_request(resource_id=self.resource, port_name=self.side_b)
|
||||||
|
self.local_realm.json_post("/cli-json/set_port", up_request)
|
||||||
for station_profile in self.station_profiles:
|
for station_profile in self.station_profiles:
|
||||||
print("Bringing up station {}".format(station_profile))
|
print("Bringing up station {}".format(station_profile))
|
||||||
station_profile.admin_up(self.resource)
|
station_profile.admin_up(self.resource)
|
||||||
|
|
||||||
|
if self.is_multicast:
|
||||||
|
self.multicast_profile.admin_up_mc_tx(self.resource, self.side_b)
|
||||||
|
|
||||||
|
|
||||||
temp_stations_list = []
|
temp_stations_list = []
|
||||||
for station_list in self.station_lists:
|
for station_list in self.station_lists:
|
||||||
temp_station_list = station_list.copy()
|
temp_station_list = station_list.copy()
|
||||||
@@ -125,8 +131,6 @@ class L3VariableTimeLongevity(LFCliBase):
|
|||||||
else:
|
else:
|
||||||
print("print failed to get IP's")
|
print("print failed to get IP's")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
temp_station_list = []
|
temp_station_list = []
|
||||||
if self.is_multicast:
|
if self.is_multicast:
|
||||||
for station_list in self.station_lists:
|
for station_list in self.station_lists:
|
||||||
@@ -149,7 +153,6 @@ class L3VariableTimeLongevity(LFCliBase):
|
|||||||
else:
|
else:
|
||||||
filtered_old_rx_values = old_rx_values
|
filtered_old_rx_values = old_rx_values
|
||||||
|
|
||||||
|
|
||||||
end_time = self.local_realm.parse_time(self.test_duration) + cur_time
|
end_time = self.local_realm.parse_time(self.test_duration) + cur_time
|
||||||
|
|
||||||
passes = 0
|
passes = 0
|
||||||
@@ -204,8 +207,10 @@ class L3VariableTimeLongevity(LFCliBase):
|
|||||||
|
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
# refactor in LFUtils.port_zero_request()
|
|
||||||
|
# refactor in LFUtils.port_zero_request()
|
||||||
resource = 1
|
resource = 1
|
||||||
|
|
||||||
data ={
|
data ={
|
||||||
'shelf':1,
|
'shelf':1,
|
||||||
'resource':1,
|
'resource':1,
|
||||||
@@ -219,6 +224,7 @@ class L3VariableTimeLongevity(LFCliBase):
|
|||||||
|
|
||||||
url = "cli-json/set_port"
|
url = "cli-json/set_port"
|
||||||
self.json_post(url, data)
|
self.json_post(url, data)
|
||||||
|
|
||||||
|
|
||||||
# refactor into LFUtils
|
# refactor into LFUtils
|
||||||
data ={
|
data ={
|
||||||
@@ -231,12 +237,13 @@ class L3VariableTimeLongevity(LFCliBase):
|
|||||||
url = "cli-json/add_br"
|
url = "cli-json/add_br"
|
||||||
self.json_post(url, data)
|
self.json_post(url, data)
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = LFUtils.port_dhcp_up_request(resource, self.side_b)
|
data = LFUtils.port_dhcp_up_request(resource, self.side_b)
|
||||||
self.json_post("/cli-json/set_port", data)
|
self.json_post("/cli-json/set_port", data)
|
||||||
except:
|
except:
|
||||||
print("LFUtils.port_dhcp_up_request didn't complete ")
|
print("LFUtils.port_dhcp_up_request didn't complete ")
|
||||||
print("or the json_post failed either way {} did not set up dhcp so test may no pass ".format(self.side_b))
|
print("or the json_post failed either way {} did not set up dhcp so test may not pass data ".format(self.side_b))
|
||||||
|
|
||||||
resource = 1
|
resource = 1
|
||||||
index = 0
|
index = 0
|
||||||
@@ -250,7 +257,7 @@ class L3VariableTimeLongevity(LFCliBase):
|
|||||||
for station_list in self.station_lists:
|
for station_list in self.station_lists:
|
||||||
for station in range(len(station_list)):
|
for station in range(len(station_list)):
|
||||||
temp_station_list.append(str(self.resource) + "." + station_list[station])
|
temp_station_list.append(str(self.resource) + "." + station_list[station])
|
||||||
station_profile.create(resource=1, radio=self.radio_list[index], sta_names_=station_list, debug=False )
|
station_profile.create(resource=1, radio=self.radio_list[index], sta_names_=station_list, debug=True )
|
||||||
index += 1
|
index += 1
|
||||||
if self.is_multicast:
|
if self.is_multicast:
|
||||||
self.multicast_profile.create_mc_tx(self.side_b)
|
self.multicast_profile.create_mc_tx(self.side_b)
|
||||||
|
|||||||
Reference in New Issue
Block a user