lf_check.py : initial work on getting radio information

ct_us_001_tests.json : created a shorter test

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-08-27 18:04:36 -06:00
parent fe135708de
commit b809e10747
2 changed files with 103 additions and 3 deletions

View File

@@ -114,6 +114,57 @@
}
},
"suite_wc_dp_shorter":{
"CT-US-001_create_chamberview_dut_0":{
"enabled":"TRUE",
"load_db":"skip",
"command":"create_chamberview_dut.py",
"args":"",
"args_list":[
" --lfmgr LF_MGR_IP --port LF_MGR_PORT --dut_name DUT_NAME",
" --ssid 'ssid_idx=0 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'",
" --ssid 'ssid_idx=1 ssid=asus11ax-5 security=WPA2 password=hello123 bssid=DUT_BSSID_5G'",
" --sw_version DUT_SW --hw_version DUT_HW --serial_num DUT_SERIAL --model_num DUT_NAME"
]
},
"CT-US-001_create_chamberview_mt7915e_sta19":{
"enabled":"TRUE",
"load_db":"skip",
"command":"create_chamberview.py",
"args":"",
"args_list":[
" --lfmgr LF_MGR_IP --port LF_MGR_PORT --delete_scenario",
" --create_scenario ct-us-001-scenario ",
" --raw_line \"profile_link 1.1 STA-AC 19 'DUT: DUT_NAME Radio-1' NA wiphy7,AUTO -1 NA\" ",
" --raw_line \"profile_link 1.1 upstream-dhcp 1 NA NA UPSTREAM_PORT,AUTO -1 NA\""
]
},
"CT-US-001_wifi_capacity_mt7915e":{
"enabled":"TRUE",
"timeout":"600",
"iterations":"1",
"load_db":"skip",
"command":"lf_wifi_capacity_test.py",
"args":"",
"args_list":[
" --mgr LF_MGR_IP --port LF_MGR_PORT --lf_user lanforge --lf_password lanforge --instance_name cicd-wct",
" --upstream 1.1.eth2 --batch_size 1,10,19 --loop_iter 1 --protocol UDP-IPv4 --duration 6000",
" --pull_report --local_lf_report_dir REPORT_PATH --test_tag 'mt7915e'",
" --test_rig TEST_RIG",
" --set DUT_SET_NAME"
]
},
"CT-US-001_QA":{
"enabled":"TRUE",
"timeout":"600",
"load_db":"skip",
"command":"./tools/lf_qa.py",
"args":"",
"args_list":[
" --path REPORT_PATH --store --png --database ./tools/qa_001_test_db"
]
}
},
"suite_wc_dp_short":{
"CT-US-001_create_chamberview_dut_for_ATH10K":{
"enabled":"TRUE",

View File

@@ -257,6 +257,27 @@ class lf_check():
scripts_git_sha = commit_hash.decode('utf-8', 'ignore')
return scripts_git_sha
'''
self.lf_mgr_ip = "192.168.0.102"
self.lf_mgr_port = "8080"
self.lf_mgr_user = "lanforge"
self.lf_mgr_pass = "lanforge"
'''
def get_lanforge_radio_information(self):
# https://docs.python-requests.org/en/latest/
# https://stackoverflow.com/questions/26000336/execute-curl-command-within-a-python-script - use requests
# curl --user "lanforge:lanforge" -H 'Accept: application/json' http://192.168.100.116:8080/radiostatus/all | json_pp , where --user "USERNAME:PASSWORD"
request_command = 'http://{lfmgr}:{port}/radiostatus/all'.format(lfmgr=self.lf_mgr_ip,port=self.lf_mgr_port)
request = requests.get(request_command, auth=(self.lf_mgr_user,self.lf_mgr_pass))
print("radio request command: {request_command}".format(request_command=request_command))
print("radio request status_code {status}".format(status=request.status_code))
lanforge_radio_json = request.json()
print("radio request.json: {json}".format(json=lanforge_radio_json))
lanforge_radio_text = request.text
print("radio request.test: {text}".format(text=lanforge_radio_text))
return lanforge_radio_json, lanforge_radio_text
def get_lanforge_system_node_version(self):
ssh = paramiko.SSHClient() # creating shh client object we use this object to connect to router
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # automatically adds the missing host key
@@ -330,10 +351,10 @@ class lf_check():
message_txt = """{email_txt} lanforge target {lf_mgr_ip}
Results from {hostname}:
http://{hostname}/{report}
""".format(email_txt=self.email_txt,lf_mgr_ip=self.lf_mgr_ip,hostname=hostname, ip=ip,report=report_url)
""".format(email_txt=self.email_txt,lf_mgr_ip=self.lf_mgr_ip,hostname=hostname,report=report_url)
else:
message_txt = """Results from {hostname}:
http://{hostname}/{report}""".format(hostname=hostname, ip=ip,report=report_url)
http://{hostname}/{report}""".format(hostname=hostname,report=report_url)
# Put in report information current two methods supported,
if(self.json_igg != "" ):
@@ -1144,12 +1165,25 @@ NOTE: Diagrams are links in dashboard""".format(ip_qa=ip,qa_url=qa_url)
self.html_results += """<td></td>"""
self.html_results += """</tr>"""
#TODO - plase copy button at end and selectable , so individual sections may be copied
if command != short_cmd:
self.html_results += f"""<tr><td colspan='8' class='scriptdetails'>
'''self.html_results += f"""<tr><td colspan='8' class='scriptdetails'>
<span class='copybtn'>Copy</span>
<tt onclick='copyTextToClipboard(this)'>{command}</tt>
</td></tr>
""".format(command=command)
'''
self.html_results += f"""<tr><td colspan='8' class='scriptdetails'>
<tt <button onclick='copyTextToClipboard(this)>Copy</button>'>{command}</tt>
</td></tr>
""".format(command=command)
'''
self.html_results += f"""<tr><td colspan='8' class='scriptdetails'>
<tt>{command}</tt>
</td></tr>
""".format(command=command)
'''
row = [test, command, self.test_result, stdout_log_txt, stderr_log_txt]
self.csv_results_writer.writerow(row)
@@ -1328,6 +1362,21 @@ Example :
print("lanforge_gui_version exception, tests aborted check lanforge ip")
exit(1)
#try:
lanforge_radio_json, lanforge_radio_text = check.get_lanforge_radio_information()
#lanforge_radio_obj = json.loads(lanforge_radio_json)
lanforge_radio_formatted_str = json.dumps(lanforge_radio_json, indent = 2)
print("lanforge_radio_json: {lanforge_radio_json}".format(lanforge_radio_json=lanforge_radio_formatted_str))
for key in lanforge_radio_json:
if 'wiphy' in key:
print("key {}".format(key))
print("lanforge_radio_json[{}]: {}".format(key,lanforge_radio_json[key]))
#except:
# print("get_lanforge_radio_json excption, no radio data")
#check.get_radio_status()
# LANforge and scripts config for results