From 5123ecef58c8c55b75e0f4d0f11ebb0a67a353f3 Mon Sep 17 00:00:00 2001 From: bealler Date: Thu, 11 Feb 2021 09:22:14 -0500 Subject: [PATCH] Remove some use of is operator, fix log printout spelling errors --- py-scripts/tip-cicd-sanity/Nightly_Sanity.py | 4 ++-- py-scripts/tip-cicd-sanity/Throughput_Test.py | 5 ++--- py-scripts/tip-cicd-sanity/cloudsdk.py | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/py-scripts/tip-cicd-sanity/Nightly_Sanity.py b/py-scripts/tip-cicd-sanity/Nightly_Sanity.py index 616e2eb5..fd30150b 100755 --- a/py-scripts/tip-cicd-sanity/Nightly_Sanity.py +++ b/py-scripts/tip-cicd-sanity/Nightly_Sanity.py @@ -239,7 +239,7 @@ parser.add_argument("-i", "--ignore", type=str, default='no', choices=['yes', 'n help="Set to 'no' to ignore current running version on AP and run sanity including upgrade") parser.add_argument("-r", "--report", type=str, default=report_path, help="Report directory path other than default - directory must already exist!") -parser.add_argument("-m", "--model", type=str, choices=['ea8300', 'ecw5410', 'ecw5211', 'ec420', "wf188n"], +parser.add_argument("-m", "--model", type=str, choices=['ea8300', 'ecw5410', 'ecw5211', 'ec420', "wf188n", "wf194c", "ex227", "ex447", "eap101", "eap102"], help="AP model to be run") parser.add_argument("--tr_prefix", type=str, default=testRunPrefix, help="Testrail test run prefix override (default is Env variable)") parser.add_argument("--skip_upgrade", dest="skip_upgrade", action='store_true', help="Skip Upgrade testing") @@ -1866,7 +1866,7 @@ with open('sanity_status.json', 'w') as json_file: # Calculate percent of tests passed for report for key in ap_models: - if report_data['fw_available'][key] is "No": + if report_data['fw_available'][key] == "No": report_data["pass_percent"][key] = "Not Run" else: # no_of_tests = len(report_data["tests"][key]) diff --git a/py-scripts/tip-cicd-sanity/Throughput_Test.py b/py-scripts/tip-cicd-sanity/Throughput_Test.py index 8555ffcc..a62e4642 100755 --- a/py-scripts/tip-cicd-sanity/Throughput_Test.py +++ b/py-scripts/tip-cicd-sanity/Throughput_Test.py @@ -112,7 +112,7 @@ for key in equipment_id_dict: ############## Bridge Throughput Testing ################################# ########################################################################### print("Testing for Bridge SSIDs") - logger.info("Starting Brdige SSID tput tests on " + key) + logger.info("Starting Bridge SSID tput tests on " + key) ###Set Proper AP Profile for Bridge SSID Tests test_profile_id = profile_info_dict[fw_model]["profile_id"] #print(test_profile_id) @@ -385,7 +385,6 @@ for key in equipment_id_dict: ##Set port for LANForge port = vlan_upstream_port - # 5G WPA2 Enterprise UDP DS/US and TCP DS/US ap_model = fw_model firmware = ap_fw @@ -501,7 +500,7 @@ for key in equipment_id_dict: #Indicates throughput has been run for AP model sanity_status['sanity_status'][key] = "tput run" - logger.info("Trhoughput tests complete on " + key) + logger.info("Throughput tests complete on " + key) elif sanity_status['sanity_status'][key] == "tput run": print("Throughput test already run on", key) diff --git a/py-scripts/tip-cicd-sanity/cloudsdk.py b/py-scripts/tip-cicd-sanity/cloudsdk.py index c3ce204d..d285d767 100755 --- a/py-scripts/tip-cicd-sanity/cloudsdk.py +++ b/py-scripts/tip-cicd-sanity/cloudsdk.py @@ -69,7 +69,7 @@ class CloudSDK: } status_response = requests.request("GET", equip_fw_url, headers=headers, data=payload) status_code = status_response.status_code - if status_code is 200: + if status_code == 200: status_data = status_response.json() #print(status_data) try: @@ -266,7 +266,7 @@ class CloudSDK: } del_profile = requests.request("DELETE", url, headers=headers, data=payload) status_code = del_profile.status_code - if status_code is 200: + if status_code == 200: return("SUCCESS") else: return ("ERROR")