Added enable_verbose_debug method

Signed-off-by: jitendracandela <jitendra.kushavah@candelatech.com>
This commit is contained in:
jitendracandela
2022-08-01 15:28:32 +05:30
parent 6a0b4097e7
commit bd35c4e07c
2 changed files with 27 additions and 4 deletions

View File

@@ -302,9 +302,9 @@ class lf_libs:
json_response = cli_base.json_get(_req_url=_req_url)
return json_response
def json_post(self, _req_url="/"):
def json_post(self, _req_url="/", data=None):
cli_base = LFCliBase(_lfjson_host=self.manager_ip, _lfjson_port=self.manager_http_port)
json_response = cli_base.json_post(_req_url=_req_url)
json_response = cli_base.json_post(_req_url=_req_url, _data=data)
return json_response
def read_cv_scenario(self):
@@ -479,6 +479,28 @@ class lf_libs:
"""
pass
def enable_verbose_debug(self, radio=None, enable=True):
"""Increase debug info in wpa-supplicant and hostapd logs"""
# radio e.g 1.1wiphy0
if radio is not None:
shelf = radio.split(".")[0]
resource = radio.split(".")[1]
radio_name = radio.split(".")[2]
if enable:
flag_value = "0x10000"
else:
flag_value = "0x00000"
data = {
"shelf": shelf,
"resource": resource,
"radio": radio_name,
"flags": flag_value
}
self.json_post("/cli-json/set_wifi_radio", data=data)
else:
logging.error("Radio name is wrong")
class Report:
def __init__(self, key1=None,

View File

@@ -246,7 +246,7 @@ class lf_tests(lf_libs):
def client_connectivity_test(self, ssid="[BLANK]", passkey="[BLANK]", security="open", extra_securities=[],
station_name=[], mode="BRIDGE", vlan_id=1, band="twog", ssid_channel=None):
station_name=[], mode="BRIDGE", vlan_id=1, band="twog", ssid_channel=None, outfile="shivam"):
# self.staConnect = StaConnect2(self.manager_ip, self.manager_http_port, debug_=self.debug)
# setup_interfaces() interface selection return radio name along no of station on each radio, upstream port
#
@@ -277,7 +277,8 @@ class lf_tests(lf_libs):
pytest.exit()
print("dict_radio_sta_list", dict_radio_sta_list)
for radio in data["radios"]:
self.enable_verbose_debug(radio=radio, enable=False)
exit(1)
self.staConnect.radio = radio
self.staConnect.admin_down(self.staConnect.radio)
self.staConnect.admin_up(self.staConnect.radio)