Minor print changes, set cloudSDK version to unknown if AP is unreachable

This commit is contained in:
bealler
2020-12-07 22:08:57 -05:00
parent 7d94d974f9
commit 285d16a54b

View File

@@ -32,6 +32,7 @@ from shutil import copyfile
# For finding files # For finding files
# https://stackoverflow.com/questions/3207219/how-do-i-list-all-files-of-a-directory # https://stackoverflow.com/questions/3207219/how-do-i-list-all-files-of-a-directory
import glob import glob
# external_results_dir=/var/tmp/lanforge # external_results_dir=/var/tmp/lanforge
if sys.version_info[0] != 3: if sys.version_info[0] != 3:
@@ -41,6 +42,7 @@ if 'py-json' not in sys.path:
sys.path.append('../../py-json') sys.path.append('../../py-json')
from LANforge.LFUtils import * from LANforge.LFUtils import *
# if you lack __init__.py in this directory you will not find sta_connect module# # if you lack __init__.py in this directory you will not find sta_connect module#
if 'py-json' not in sys.path: if 'py-json' not in sys.path:
@@ -59,7 +61,6 @@ import ap_ssh
from ap_ssh import ssh_cli_active_fw from ap_ssh import ssh_cli_active_fw
from ap_ssh import iwinfo_status from ap_ssh import iwinfo_status
### Set CloudSDK URL ### ### Set CloudSDK URL ###
cloudSDK_url = os.getenv('CLOUD_SDK_URL') cloudSDK_url = os.getenv('CLOUD_SDK_URL')
### Directories ### Directories
@@ -103,7 +104,6 @@ class GetBuild:
ssl._create_default_https_context = ssl._create_unverified_context ssl._create_default_https_context = ssl._create_unverified_context
def get_latest_image(self, url): def get_latest_image(self, url):
auth = str( auth = str(
base64.b64encode( base64.b64encode(
bytes('%s:%s' % (self.user, self.password), 'utf-8') bytes('%s:%s' % (self.user, self.password), 'utf-8')
@@ -124,6 +124,7 @@ class GetBuild:
latest_fw = latest_file.replace('.tar.gz', '') latest_fw = latest_file.replace('.tar.gz', '')
return latest_fw return latest_fw
###Class for Tests ###Class for Tests
class RunTest: class RunTest:
def Single_Client_Connectivity(self, port, radio, ssid_name, ssid_psk, security, station, test_case, rid): def Single_Client_Connectivity(self, port, radio, ssid_name, ssid_psk, security, station, test_case, rid):
@@ -202,10 +203,12 @@ class RunTest:
return ("failed") return ("failed")
def testrail_retest(self, test_case, rid, ssid_name): def testrail_retest(self, test_case, rid, ssid_name):
client.update_testrail(case_id=test_case, run_id=rid, status_id=4, msg='Error in Client Connectivity Test. Needs to be Re-run') client.update_testrail(case_id=test_case, run_id=rid, status_id=4,
msg='Error in Client Connectivity Test. Needs to be Re-run')
print("Error in test for single client connection to", ssid_name) print("Error in test for single client connection to", ssid_name)
logger.warning("ERROR testing Client connectivity to " + ssid_name) logger.warning("ERROR testing Client connectivity to " + ssid_name)
######Testrail Project and Run ID Information ############################## ######Testrail Project and Run ID Information ##############################
Test: RunTest = RunTest() Test: RunTest = RunTest()
@@ -223,18 +226,9 @@ ap_latest_dict = {
"ecw5410": "unknown" "ecw5410": "unknown"
} }
#All values start empty
ap_updated_dict = {
"ec420": "",
"ea8300": "",
"ecw5211": "",
"ecw5410": ""
}
# import json file used by throughput test # import json file used by throughput test
sanity_status = json.load(open("sanity_status.json")) sanity_status = json.load(open("sanity_status.json"))
##Equipment IDs for Lab APs under test ##Equipment IDs for Lab APs under test
from lab_ap_info import equipment_id_dict from lab_ap_info import equipment_id_dict
from lab_ap_info import profile_info_dict from lab_ap_info import profile_info_dict
@@ -242,7 +236,6 @@ from lab_ap_info import cloud_sdk_models
from lab_ap_info import equipment_ip_dict from lab_ap_info import equipment_ip_dict
from lab_ap_info import eqiupment_credentials_dict from lab_ap_info import eqiupment_credentials_dict
##Test Cases to be included in Test Runs ##Test Cases to be included in Test Runs
test_cases = [ test_cases = [
2233, 2233,
@@ -308,10 +301,26 @@ tc_results = dict.fromkeys(test_cases, "not run")
report_data = dict() report_data = dict()
report_data['cloud_sdk'] = { report_data['cloud_sdk'] = {
"ea8300" : "", "ea8300": {
"ecw5211": "", "date": "unknown",
"ecw5410": "", "commitId": "unknown",
"ec420": "" "projectVersion": "unknown"
},
"ecw5211": {
"date": "unknown",
"commitId": "unknown",
"projectVersion": "unknown"
},
"ecw5410": {
"date": "unknown",
"commitId": "unknown",
"projectVersion": "unknown"
},
"ec420": {
"date": "unknown",
"commitId": "unknown",
"projectVersion": "unknown"
}
} }
report_data["fw_available"] = dict.fromkeys(ap_models, "Unknown") report_data["fw_available"] = dict.fromkeys(ap_models, "Unknown")
report_data["fw_under_test"] = dict.fromkeys(ap_models, "N/A") report_data["fw_under_test"] = dict.fromkeys(ap_models, "N/A")
@@ -404,7 +413,8 @@ for key in equipment_id_dict:
###Create Test Run ###Create Test Run
today = str(date.today()) today = str(date.today())
test_run_name = "Daily_Sanity_" + fw_model + "_" + today + "_" + latest_ap_image test_run_name = "Daily_Sanity_" + fw_model + "_" + today + "_" + latest_ap_image
client.create_testrun(name=test_run_name, case_ids=test_cases, project_id=projId, milestone_id=milestoneId, description="Automated Nightly Sanity test run for new firmware build") client.create_testrun(name=test_run_name, case_ids=test_cases, project_id=projId, milestone_id=milestoneId,
description="Automated Nightly Sanity test run for new firmware build")
rid = client.get_run_id(test_run_name="Daily_Sanity_" + fw_model + "_" + today + "_" + latest_ap_image) rid = client.get_run_id(test_run_name="Daily_Sanity_" + fw_model + "_" + today + "_" + latest_ap_image)
print("TIP run ID is:", rid) print("TIP run ID is:", rid)
@@ -422,8 +432,8 @@ for key in equipment_id_dict:
cloudsdk_cluster_info['commitId'] = cluster_ver['commitID'] cloudsdk_cluster_info['commitId'] = cluster_ver['commitID']
cloudsdk_cluster_info['projectVersion'] = cluster_ver['projectVersion'] cloudsdk_cluster_info['projectVersion'] = cluster_ver['projectVersion']
report_data['cloud_sdk'][key] = cloudsdk_cluster_info report_data['cloud_sdk'][key] = cloudsdk_cluster_info
logger.info('CloudSDK version info: ',cluster_ver) client.update_testrail(case_id="5540", run_id=rid, status_id=1,
client.update_testrail(case_id="5540", run_id=rid, status_id=1, msg='Read CloudSDK version from API successfully') msg='Read CloudSDK version from API successfully')
report_data['tests'][key][5540] = "passed" report_data['tests'][key][5540] = "passed"
except: except:
@@ -435,7 +445,8 @@ for key in equipment_id_dict:
"commitId": "unknown", "commitId": "unknown",
"projectVersion": "unknown" "projectVersion": "unknown"
} }
client.update_testrail(case_id="5540", run_id=rid, status_id=5, msg='Could not read CloudSDK version from API') client.update_testrail(case_id="5540", run_id=rid, status_id=5,
msg='Could not read CloudSDK version from API')
report_data['cloud_sdk'][key] = cloudsdk_cluster_info report_data['cloud_sdk'][key] = cloudsdk_cluster_info
report_data['tests'][key][5540] = "failed" report_data['tests'][key][5540] = "failed"
@@ -456,15 +467,18 @@ for key in equipment_id_dict:
fw_url = "https://" + jfrog_user + ":" + jfrog_pwd + "@tip.jfrog.io/artifactory/tip-wlan-ap-firmware/" + key + "/dev/" + latest_image + ".tar.gz" fw_url = "https://" + jfrog_user + ":" + jfrog_pwd + "@tip.jfrog.io/artifactory/tip-wlan-ap-firmware/" + key + "/dev/" + latest_image + ".tar.gz"
commit = latest_image.split("-")[-1] commit = latest_image.split("-")[-1]
try: try:
fw_upload_status = CloudSDK.firwmare_upload(commit, cloudModel, latest_image, fw_url, cloudSDK_url, bearer) fw_upload_status = CloudSDK.firwmare_upload(commit, cloudModel, latest_image, fw_url, cloudSDK_url,
bearer)
fw_id = fw_upload_status['id'] fw_id = fw_upload_status['id']
print("Upload Complete.", latest_image, "FW ID is", fw_id) print("Upload Complete.", latest_image, "FW ID is", fw_id)
client.update_testrail(case_id="5548", run_id=rid, status_id=1, msg='Create new FW version by API successful') client.update_testrail(case_id="5548", run_id=rid, status_id=1,
msg='Create new FW version by API successful')
report_data['tests'][key][5548] = "passed" report_data['tests'][key][5548] = "passed"
except: except:
fw_upload_status = 'error' fw_upload_status = 'error'
print("Unable to upload new FW version. Skipping Sanity on AP Model") print("Unable to upload new FW version. Skipping Sanity on AP Model")
client.update_testrail(case_id="5548", run_id=rid, status_id=5, msg='Error creating new FW version by API') client.update_testrail(case_id="5548", run_id=rid, status_id=5,
msg='Error creating new FW version by API')
report_data['tests'][key][5548] = "failed" report_data['tests'][key][5548] = "failed"
continue continue
else: else:
@@ -472,15 +486,18 @@ for key in equipment_id_dict:
fw_url = "https://" + jfrog_user + ":" + jfrog_pwd + "@tip.jfrog.io/artifactory/tip-wlan-ap-firmware/" + key + "/dev/" + latest_image + ".tar.gz" fw_url = "https://" + jfrog_user + ":" + jfrog_pwd + "@tip.jfrog.io/artifactory/tip-wlan-ap-firmware/" + key + "/dev/" + latest_image + ".tar.gz"
commit = latest_image.split("-")[-1] commit = latest_image.split("-")[-1]
try: try:
fw_upload_status = CloudSDK.firwmare_upload(commit, cloudModel, latest_image, fw_url, cloudSDK_url, bearer) fw_upload_status = CloudSDK.firwmare_upload(commit, cloudModel, latest_image, fw_url, cloudSDK_url,
bearer)
fw_id = fw_upload_status['id'] fw_id = fw_upload_status['id']
print("Upload Complete.", latest_image, "FW ID is", fw_id) print("Upload Complete.", latest_image, "FW ID is", fw_id)
client.update_testrail(case_id="5548", run_id=rid, status_id=1, msg='Create new FW version by API successful') client.update_testrail(case_id="5548", run_id=rid, status_id=1,
msg='Create new FW version by API successful')
report_data['tests'][key][5548] = "passed" report_data['tests'][key][5548] = "passed"
except: except:
fw_upload_status = 'error' fw_upload_status = 'error'
print("Unable to upload new FW version. Skipping Sanity on AP Model") print("Unable to upload new FW version. Skipping Sanity on AP Model")
client.update_testrail(case_id="5548", run_id=rid, status_id=5, msg='Error creating new FW version by API') client.update_testrail(case_id="5548", run_id=rid, status_id=5,
msg='Error creating new FW version by API')
report_data['tests'][key][5548] = "failed" report_data['tests'][key][5548] = "failed"
continue continue
@@ -527,13 +544,16 @@ for key in equipment_id_dict:
ap_cli_info = "ERROR" ap_cli_info = "ERROR"
print("Cannot Reach AP CLI to confirm upgrade!") print("Cannot Reach AP CLI to confirm upgrade!")
logger.warning('Cannot Reach AP CLI to confirm upgrade!') logger.warning('Cannot Reach AP CLI to confirm upgrade!')
client.update_testrail(case_id="2233", run_id=rid, status_id=4, msg='Cannot reach AP after upgrade to check CLI - re-test required') client.update_testrail(case_id="2233", run_id=rid, status_id=4,
msg='Cannot reach AP after upgrade to check CLI - re-test required')
continue continue
if cloud_ap_fw == latest_ap_image and ap_cli_fw == latest_ap_image: if cloud_ap_fw == latest_ap_image and ap_cli_fw == latest_ap_image:
print("CloudSDK and AP CLI both show upgrade success, passing upgrade test case") print("CloudSDK and AP CLI both show upgrade success, passing upgrade test case")
client.update_testrail(case_id="2233", run_id=rid, status_id=1, msg='Upgrade to ' + latest_ap_image + ' successful') client.update_testrail(case_id="2233", run_id=rid, status_id=1,
client.update_testrail(case_id="5247", run_id=rid, status_id=1, msg='CLOUDSDK reporting correct firmware version.') msg='Upgrade to ' + latest_ap_image + ' successful')
client.update_testrail(case_id="5247", run_id=rid, status_id=1,
msg='CLOUDSDK reporting correct firmware version.')
report_data['tests'][key][2233] = "passed" report_data['tests'][key][2233] = "passed"
report_data['tests'][key][5247] = "passed" report_data['tests'][key][5247] = "passed"
print(report_data['tests'][key]) print(report_data['tests'][key])
@@ -541,8 +561,10 @@ for key in equipment_id_dict:
elif cloud_ap_fw != latest_ap_image and ap_cli_fw == latest_ap_image: elif cloud_ap_fw != latest_ap_image and ap_cli_fw == latest_ap_image:
print("AP CLI shows upgrade success - CloudSDK reporting error!") print("AP CLI shows upgrade success - CloudSDK reporting error!")
##Raise CloudSDK error but continue testing ##Raise CloudSDK error but continue testing
client.update_testrail(case_id="2233", run_id=rid, status_id=1, msg='Upgrade to ' + latest_ap_image + ' successful.') client.update_testrail(case_id="2233", run_id=rid, status_id=1,
client.update_testrail(case_id="5247", run_id=rid, status_id=5,msg='CLOUDSDK reporting incorrect firmware version.') msg='Upgrade to ' + latest_ap_image + ' successful.')
client.update_testrail(case_id="5247", run_id=rid, status_id=5,
msg='CLOUDSDK reporting incorrect firmware version.')
report_data['tests'][key][2233] = "passed" report_data['tests'][key][2233] = "passed"
report_data['tests'][key][5247] = "failed" report_data['tests'][key][5247] = "failed"
print(report_data['tests'][key]) print(report_data['tests'][key])
@@ -550,8 +572,10 @@ for key in equipment_id_dict:
elif cloud_ap_fw == latest_ap_image and ap_cli_fw != latest_ap_image: elif cloud_ap_fw == latest_ap_image and ap_cli_fw != latest_ap_image:
print("AP CLI shows upgrade failed - CloudSDK reporting error!") print("AP CLI shows upgrade failed - CloudSDK reporting error!")
# Testrail TC fail # Testrail TC fail
client.update_testrail(case_id="2233", run_id=rid, status_id=5, msg='AP failed to download or apply new FW. Upgrade to ' + latest_ap_image + ' Failed') client.update_testrail(case_id="2233", run_id=rid, status_id=5,
client.update_testrail(case_id="5247", run_id=rid, status_id=5,msg='CLOUDSDK reporting incorrect firmware version.') msg='AP failed to download or apply new FW. Upgrade to ' + latest_ap_image + ' Failed')
client.update_testrail(case_id="5247", run_id=rid, status_id=5,
msg='CLOUDSDK reporting incorrect firmware version.')
report_data['tests'][key][2233] = "failed" report_data['tests'][key][2233] = "failed"
report_data['tests'][key][5247] = "failed" report_data['tests'][key][5247] = "failed"
print(report_data['tests'][key]) print(report_data['tests'][key])
@@ -560,7 +584,8 @@ for key in equipment_id_dict:
elif cloud_ap_fw != latest_ap_image and ap_cli_fw != latest_ap_image: elif cloud_ap_fw != latest_ap_image and ap_cli_fw != latest_ap_image:
print("Upgrade Failed! Confirmed on CloudSDK and AP CLI. Upgrade test case failed.") print("Upgrade Failed! Confirmed on CloudSDK and AP CLI. Upgrade test case failed.")
##fail TR testcase and exit ##fail TR testcase and exit
client.update_testrail(case_id="2233", run_id=rid, status_id=5, msg='AP failed to download or apply new FW. Upgrade to ' + latest_ap_image + ' Failed') client.update_testrail(case_id="2233", run_id=rid, status_id=5,
msg='AP failed to download or apply new FW. Upgrade to ' + latest_ap_image + ' Failed')
report_data['tests'][key][2233] = "failed" report_data['tests'][key][2233] = "failed"
print(report_data['tests'][key]) print(report_data['tests'][key])
continue continue
@@ -568,7 +593,8 @@ for key in equipment_id_dict:
else: else:
print("Unable to determine upgrade status. Skipping AP variant") print("Unable to determine upgrade status. Skipping AP variant")
# update TR testcase as error # update TR testcase as error
client.update_testrail(case_id="2233", run_id=rid, status_id=4, msg='Cannot determine upgrade status - re-test required') client.update_testrail(case_id="2233", run_id=rid, status_id=4,
msg='Cannot determine upgrade status - re-test required')
report_data['tests'][key][2233] = "error" report_data['tests'][key][2233] = "error"
print(report_data['tests'][key]) print(report_data['tests'][key])
continue continue
@@ -633,16 +659,19 @@ for key in equipment_id_dict:
if set(ssid_list) == set(ssid_config): if set(ssid_list) == set(ssid_config):
print("SSIDs in Wifi_VIF_Config Match AP Profile Config") print("SSIDs in Wifi_VIF_Config Match AP Profile Config")
client.update_testrail(case_id="5541", run_id=rid, status_id=1, msg='SSIDs in VIF Config matches AP Profile Config') client.update_testrail(case_id="5541", run_id=rid, status_id=1,
msg='SSIDs in VIF Config matches AP Profile Config')
report_data['tests'][key][5541] = "passed" report_data['tests'][key][5541] = "passed"
else: else:
print("SSIDs in Wifi_VIF_Config do not match desired AP Profile Config") print("SSIDs in Wifi_VIF_Config do not match desired AP Profile Config")
client.update_testrail(case_id="5541", run_id=rid, status_id=5, msg='SSIDs in VIF Config do not match AP Profile Config') client.update_testrail(case_id="5541", run_id=rid, status_id=5,
msg='SSIDs in VIF Config do not match AP Profile Config')
report_data['tests'][key][5541] = "failed" report_data['tests'][key][5541] = "failed"
except: except:
ssid_list = "ERROR" ssid_list = "ERROR"
print("Error accessing VIF Config from AP CLI") print("Error accessing VIF Config from AP CLI")
client.update_testrail(case_id="5541", run_id=rid, status_id=4, msg='Cannot determine VIF Config - re-test required') client.update_testrail(case_id="5541", run_id=rid, status_id=4,
msg='Cannot determine VIF Config - re-test required')
report_data['tests'][key][5541] = "error" report_data['tests'][key][5541] = "error"
# VIF State # VIF State
try: try:
@@ -651,17 +680,20 @@ for key in equipment_id_dict:
if set(ssid_state) == set(ssid_config): if set(ssid_state) == set(ssid_config):
print("SSIDs properly applied on AP") print("SSIDs properly applied on AP")
client.update_testrail(case_id="5544", run_id=rid, status_id=1, msg='SSIDs in VIF Config applied to VIF State') client.update_testrail(case_id="5544", run_id=rid, status_id=1,
msg='SSIDs in VIF Config applied to VIF State')
report_data['tests'][key][5544] = "passed" report_data['tests'][key][5544] = "passed"
else: else:
print("SSIDs not applied on AP") print("SSIDs not applied on AP")
client.update_testrail(case_id="5544", run_id=rid, status_id=5, msg='SSIDs in VIF Config not applied to VIF State') client.update_testrail(case_id="5544", run_id=rid, status_id=5,
msg='SSIDs in VIF Config not applied to VIF State')
report_data['tests'][key][5544] = "failed" report_data['tests'][key][5544] = "failed"
except: except:
ssid_list = "ERROR" ssid_list = "ERROR"
print("Error accessing VIF State from AP CLI") print("Error accessing VIF State from AP CLI")
print("Error accessing VIF Config from AP CLI") print("Error accessing VIF Config from AP CLI")
client.update_testrail(case_id="5544", run_id=rid, status_id=4, msg='Cannot determine VIF State - re-test required') client.update_testrail(case_id="5544", run_id=rid, status_id=4,
msg='Cannot determine VIF State - re-test required')
report_data['tests'][key][5544] = "error" report_data['tests'][key][5544] = "error"
### Set LANForge port for tests ### Set LANForge port for tests
@@ -680,7 +712,8 @@ for key in equipment_id_dict:
security = "wpa2" security = "wpa2"
eap_type = "TTLS" eap_type = "TTLS"
try: try:
test_result = RunTest.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, test_case, rid) test_result = RunTest.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type, identity,
ttls_password, test_case, rid)
except: except:
test_result = "error" test_result = "error"
Test.testrail_retest(test_case, rid, ssid_name) Test.testrail_retest(test_case, rid, ssid_name)
@@ -699,7 +732,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model]["twoFourG_WPA2_PSK"] ssid_psk = profile_info_dict[fw_model]["twoFourG_WPA2_PSK"]
security = "wpa2" security = "wpa2"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case,
rid) rid)
except: except:
test_result = "error" test_result = "error"
@@ -718,7 +752,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model]["twoFourG_WPA_PSK"] ssid_psk = profile_info_dict[fw_model]["twoFourG_WPA_PSK"]
security = "wpa" security = "wpa"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case,
rid) rid)
except: except:
test_result = "error" test_result = "error"
@@ -749,7 +784,8 @@ for key in equipment_id_dict:
security = "wpa2" security = "wpa2"
eap_type = "TTLS" eap_type = "TTLS"
try: try:
test_result = RunTest.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, test_case, rid) test_result = RunTest.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type, identity,
ttls_password, test_case, rid)
except: except:
test_result = "error" test_result = "error"
Test.testrail_retest(test_case, rid, ssid_name) Test.testrail_retest(test_case, rid, ssid_name)
@@ -767,7 +803,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model]["fiveG_WPA2_PSK"] ssid_psk = profile_info_dict[fw_model]["fiveG_WPA2_PSK"]
security = "wpa2" security = "wpa2"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case,
rid) rid)
except: except:
test_result = "error" test_result = "error"
@@ -786,7 +823,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model]["fiveG_WPA_PSK"] ssid_psk = profile_info_dict[fw_model]["fiveG_WPA_PSK"]
security = "wpa" security = "wpa"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case,
rid) rid)
except: except:
test_result = "error" test_result = "error"
@@ -887,7 +925,8 @@ for key in equipment_id_dict:
security = "wpa2" security = "wpa2"
eap_type = "TTLS" eap_type = "TTLS"
try: try:
test_result = RunTest.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, test_case, rid) test_result = RunTest.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type, identity,
ttls_password, test_case, rid)
except: except:
test_result = "error" test_result = "error"
Test.testrail_retest(test_case, rid, ssid_name) Test.testrail_retest(test_case, rid, ssid_name)
@@ -897,7 +936,6 @@ for key in equipment_id_dict:
time.sleep(10) time.sleep(10)
# TC 4325 - 2.4 GHz WPA2 NAT # TC 4325 - 2.4 GHz WPA2 NAT
test_case = "4325" test_case = "4325"
radio = "wiphy0" radio = "wiphy0"
@@ -906,7 +944,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model + '_nat']["twoFourG_WPA2_PSK"] ssid_psk = profile_info_dict[fw_model + '_nat']["twoFourG_WPA2_PSK"]
security = "wpa2" security = "wpa2"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case,
rid) rid)
except: except:
test_result = "error" test_result = "error"
@@ -925,7 +964,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model + '_nat']["twoFourG_WPA_PSK"] ssid_psk = profile_info_dict[fw_model + '_nat']["twoFourG_WPA_PSK"]
security = "wpa" security = "wpa"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, rid) test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case, rid)
except: except:
test_result = "error" test_result = "error"
Test.testrail_retest(test_case, rid, ssid_name) Test.testrail_retest(test_case, rid, ssid_name)
@@ -955,7 +995,8 @@ for key in equipment_id_dict:
security = "wpa2" security = "wpa2"
eap_type = "TTLS" eap_type = "TTLS"
try: try:
test_result = RunTest.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, test_case, rid) test_result = RunTest.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type, identity,
ttls_password, test_case, rid)
except: except:
test_result = "error" test_result = "error"
Test.testrail_retest(test_case, rid, ssid_name) Test.testrail_retest(test_case, rid, ssid_name)
@@ -973,7 +1014,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model]["fiveG_WPA2_PSK"] ssid_psk = profile_info_dict[fw_model]["fiveG_WPA2_PSK"]
security = "wpa2" security = "wpa2"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case,
rid) rid)
except: except:
test_result = "error" test_result = "error"
@@ -992,7 +1034,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model]["fiveG_WPA_PSK"] ssid_psk = profile_info_dict[fw_model]["fiveG_WPA_PSK"]
security = "wpa" security = "wpa"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case,
rid) rid)
except: except:
test_result = "error" test_result = "error"
@@ -1051,7 +1094,8 @@ for key in equipment_id_dict:
except: except:
ssid_list = "ERROR" ssid_list = "ERROR"
print("Error accessing VIF Config from AP CLI") print("Error accessing VIF Config from AP CLI")
client.update_testrail(case_id="5543", run_id=rid, status_id=4, msg='Cannot determine VIF Config - re-test required') client.update_testrail(case_id="5543", run_id=rid, status_id=4,
msg='Cannot determine VIF Config - re-test required')
report_data['tests'][key][5543] = "error" report_data['tests'][key][5543] = "error"
# VIF State # VIF State
try: try:
@@ -1060,11 +1104,13 @@ for key in equipment_id_dict:
if set(ssid_state) == set(ssid_config): if set(ssid_state) == set(ssid_config):
print("SSIDs properly applied on AP") print("SSIDs properly applied on AP")
client.update_testrail(case_id="5546", run_id=rid, status_id=1, msg='SSIDs in VIF Config applied to VIF State') client.update_testrail(case_id="5546", run_id=rid, status_id=1,
msg='SSIDs in VIF Config applied to VIF State')
report_data['tests'][key][5546] = "passed" report_data['tests'][key][5546] = "passed"
else: else:
print("SSIDs not applied on AP") print("SSIDs not applied on AP")
client.update_testrail(case_id="5546", run_id=rid, status_id=5, msg='SSIDs in VIF Config not applied to VIF State') client.update_testrail(case_id="5546", run_id=rid, status_id=5,
msg='SSIDs in VIF Config not applied to VIF State')
report_data['tests'][key][5546] = "failed" report_data['tests'][key][5546] = "failed"
except: except:
ssid_list = "ERROR" ssid_list = "ERROR"
@@ -1109,7 +1155,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA2_PSK"] ssid_psk = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA2_PSK"]
security = "wpa2" security = "wpa2"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case,
rid) rid)
except: except:
test_result = "error" test_result = "error"
@@ -1128,7 +1175,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA_PSK"] ssid_psk = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA_PSK"]
security = "wpa" security = "wpa"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, rid) test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case, rid)
except: except:
test_result = "error" test_result = "error"
Test.testrail_retest(test_case, rid, ssid_name) Test.testrail_retest(test_case, rid, ssid_name)
@@ -1177,7 +1225,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model]["fiveG_WPA2_PSK"] ssid_psk = profile_info_dict[fw_model]["fiveG_WPA2_PSK"]
security = "wpa2" security = "wpa2"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case,
rid) rid)
except: except:
test_result = "error" test_result = "error"
@@ -1196,7 +1245,8 @@ for key in equipment_id_dict:
ssid_psk = profile_info_dict[fw_model]["fiveG_WPA_PSK"] ssid_psk = profile_info_dict[fw_model]["fiveG_WPA_PSK"]
security = "wpa" security = "wpa"
try: try:
test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station, test_case, test_result = Test.Single_Client_Connectivity(port, radio, ssid_name, ssid_psk, security, station,
test_case,
rid) rid)
except: except:
test_result = "error" test_result = "error"
@@ -1211,7 +1261,6 @@ for key in equipment_id_dict:
logger.info("Testing for " + fw_model + "Complete") logger.info("Testing for " + fw_model + "Complete")
# Add indication of complete TC pass/fail to sanity_status for pass to external json used by Throughput Test # Add indication of complete TC pass/fail to sanity_status for pass to external json used by Throughput Test
x = all(status == "passed" for status in report_data["tests"][key].values()) x = all(status == "passed" for status in report_data["tests"][key].values())
print(x) print(x)
@@ -1231,7 +1280,6 @@ for key in equipment_id_dict:
with open('sanity_status.json', 'w') as json_file: with open('sanity_status.json', 'w') as json_file:
json.dump(sanity_status, json_file) json.dump(sanity_status, json_file)
# write to report_data contents to json file so it has something in case of unexpected fail # write to report_data contents to json file so it has something in case of unexpected fail
print(report_data) print(report_data)
with open(report_path + today + '/report_data.json', 'w') as report_json_file: with open(report_path + today + '/report_data.json', 'w') as report_json_file:
@@ -1254,7 +1302,6 @@ for key in ap_models:
print(key, "pass rate is", str(percent_pass) + "%") print(key, "pass rate is", str(percent_pass) + "%")
report_data["pass_percent"][key] = str(percent_pass) + '%' report_data["pass_percent"][key] = str(percent_pass) + '%'
# write to report_data contents to json file # write to report_data contents to json file
print(report_data) print(report_data)
with open(report_path + today + '/report_data.json', 'w') as report_json_file: with open(report_path + today + '/report_data.json', 'w') as report_json_file: