diff --git a/py-scripts/tip-cicd-sanity/Nightly_Sanity.py b/py-scripts/tip-cicd-sanity/Nightly_Sanity.py index 1f93e62e..cd0e6149 100755 --- a/py-scripts/tip-cicd-sanity/Nightly_Sanity.py +++ b/py-scripts/tip-cicd-sanity/Nightly_Sanity.py @@ -267,7 +267,10 @@ test_cases = [ 5545, 5546, 5547, - 5548 + 5548, + 5641, + 5642, + 5643 ] ##AP models for jfrog @@ -636,15 +639,32 @@ for key in equipment_id_dict: ############## Bridge Mode Client Connectivity ############################ ########################################################################### - ###Set Proper AP Profile for Bridge SSID Tests - test_profile_id = profile_info_dict[fw_model]["profile_id"] - print(test_profile_id) + ### Create AP Bridge Profile + template = "templates/ap_profile_template.json" + name = "Nightly_Sanity_" + fw_model + "_" + today + "_bridge" + child_profiles = profile_info_dict[fw_model]["childProfileIds"] + try: + create_ap_profile = CloudSDK.create_ap_profile(cloudSDK_url, bearer, template, name, child_profiles) + test_profile_id = create_ap_profile + print("Test Profile ID for Test is:",test_profile_id) + client.update_testrail(case_id="5641", run_id=rid, status_id=1, + msg='AP profile for bridge tests created successfully') + report_data['tests'][key][5641] = "passed" + except: + create_ap_profile = "error" + test_profile_id = profile_info_dict[fw_model]["profile_id"] + print("Error creating AP profile for bridge tests. Will use existing AP profile") + client.update_testrail(case_id="5641", run_id=rid, status_id=5, + msg='AP profile for bridge tests could not be created using API') + report_data['tests'][key][5641] = "failed" + + ### Set Proper AP Profile for Bridge SSID Tests ap_profile = CloudSDK.set_ap_profile(equipment_id, test_profile_id, cloudSDK_url, bearer) ### Wait for Profile Push time.sleep(180) - ###Check if VIF Config and VIF State reflect AP Profile from CloudSDK + ### Check if VIF Config and VIF State reflect AP Profile from CloudSDK ## VIF Config try: ssid_config = profile_info_dict[key]["ssid_list"] @@ -827,9 +847,26 @@ for key in equipment_id_dict: ################# NAT Mode Client Connectivity ############################ ########################################################################### + ### Create AP NAT Profile + template = "templates/ap_profile_template.json" + name = "Nightly_Sanity_" + fw_model + "_" + today + "_nat" + child_profiles = profile_info_dict[fw_model + '_nat']["childProfileIds"] + try: + create_ap_profile = CloudSDK.create_ap_profile(cloudSDK_url, bearer, template, name, child_profiles) + test_profile_id = create_ap_profile + print("Test Profile ID for Test is:", test_profile_id) + client.update_testrail(case_id="5642", run_id=rid, status_id=1, + msg='AP profile for NAT tests created successfully') + report_data['tests'][key][5642] = "passed" + except: + create_ap_profile = "error" + test_profile_id = profile_info_dict[fw_model + '_nat']["profile_id"] + print("Error creating AP profile for NAT tests. Will use existing AP profile") + client.update_testrail(case_id="5642", run_id=rid, status_id=5, + msg='AP profile for NAT tests could not be created using API') + report_data['tests'][key][5642] = "failed" + ###Set Proper AP Profile for NAT SSID Tests - test_profile_id = profile_info_dict[fw_model + '_nat']["profile_id"] - print(test_profile_id) ap_profile = CloudSDK.set_ap_profile(equipment_id, test_profile_id, cloudSDK_url, bearer) ### Wait for Profile Push @@ -1016,9 +1053,26 @@ for key in equipment_id_dict: ################# Customer VLAN Client Connectivity ####################### ########################################################################### - ###Set Proper AP Profile for VLAN SSID Tests - test_profile_id = profile_info_dict[fw_model + '_vlan']["profile_id"] - print(test_profile_id) + ### Create AP VLAN Profile + template = "templates/ap_profile_template.json" + name = "Nightly_Sanity_" + fw_model + "_" + today + "_vlan" + child_profiles = profile_info_dict[fw_model + '_vlan']["childProfileIds"] + try: + create_ap_profile = CloudSDK.create_ap_profile(cloudSDK_url, bearer, template, name, child_profiles) + test_profile_id = create_ap_profile + print("Test Profile ID for Test is:", test_profile_id) + client.update_testrail(case_id="5643", run_id=rid, status_id=1, + msg='AP profile for VLAN tests created successfully') + report_data['tests'][key][5643] = "passed" + except: + create_ap_profile = "error" + test_profile_id = profile_info_dict[fw_model + '_vlan']["profile_id"] + print("Error creating AP profile for bridge tests. Will use existing AP profile") + client.update_testrail(case_id="5643", run_id=rid, status_id=5, + msg='AP profile for VLAN tests could not be created using API') + report_data['tests'][key][5643] = "failed" + + ### Set Proper AP Profile for VLAN SSID Tests ap_profile = CloudSDK.set_ap_profile(equipment_id, test_profile_id, cloudSDK_url, bearer) ### Wait for Profile Push diff --git a/py-scripts/tip-cicd-sanity/cloudsdk.py b/py-scripts/tip-cicd-sanity/cloudsdk.py index 6ca44ee1..6050e849 100755 --- a/py-scripts/tip-cicd-sanity/cloudsdk.py +++ b/py-scripts/tip-cicd-sanity/cloudsdk.py @@ -179,3 +179,23 @@ class CloudSDK: cloud_sdk_version = response.json() return cloud_sdk_version + def create_ap_profile(cloudSDK_url, bearer, template, name, child_profiles): + with open(template, 'r+') as ap_profile: + profile = json.load(ap_profile) + profile["name"] = name + profile["childProfileIds"] = child_profiles + print(profile["childProfileIds"]) + + with open(template, 'w') as ap_profile: + json.dump(profile, ap_profile) + + url = cloudSDK_url+"/portal/profile" + headers = { + 'Content-Type': 'application/json', + 'Authorization': 'Bearer ' + bearer + } + response = requests.request("POST", url, headers=headers, data=open(template, 'rb')) + ap_profile = response.json() + print(ap_profile) + ap_profile_id = ap_profile['id'] + return ap_profile_id diff --git a/py-scripts/tip-cicd-sanity/lab_ap_info.py b/py-scripts/tip-cicd-sanity/lab_ap_info.py index 3d25f018..4ca18823 100755 --- a/py-scripts/tip-cicd-sanity/lab_ap_info.py +++ b/py-scripts/tip-cicd-sanity/lab_ap_info.py @@ -56,6 +56,16 @@ eqiupment_credentials_dict = { profile_info_dict = { "ecw5410": { "profile_id": "2", + "childProfileIds": [ + 129, + 3, + 10, + 11, + 12, + 13, + 190, + 191 + ], "fiveG_WPA2_SSID": "ECW5410_5G_WPA2", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "ECW5410_5G_WPA", @@ -75,11 +85,21 @@ profile_info_dict = { "ECW5410_2dot4G_WPA2", "ECW5410_2dot4G_WPA", "ECW5410_2dot4G_WPA2-EAP" - ] - }, + ] + }, "ea8300": { "profile_id": "153", + "childProfileIds": [ + 17, + 129, + 18, + 201, + 202, + 10, + 14, + 15 + ], "fiveG_WPA2_SSID": "EA8300_5G_WPA2", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "EA8300_5G_WPA", @@ -89,10 +109,10 @@ profile_info_dict = { "twoFourG_OPEN_SSID": "EA8300_2dot4G_OPEN", "twoFourG_WPA2_SSID": "EA8300_2dot4G_WPA2", "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID":"EA8300_2dot4G_WPA", + "twoFourG_WPA_SSID": "EA8300_2dot4G_WPA", "twoFourG_WPA_PSK": "Connectus123$", "twoFourG_WPA2-EAP_SSID": "EA8300_2dot4G_WPA2-EAP", - #EA8300 has 2x 5GHz SSIDs because it is a tri-radio AP! + # EA8300 has 2x 5GHz SSIDs because it is a tri-radio AP! "ssid_list": [ "EA8300_5G_WPA2", "EA8300_5G_WPA2", @@ -103,11 +123,21 @@ profile_info_dict = { "EA8300_2dot4G_WPA2", "EA8300_2dot4G_WPA", "EA8300_2dot4G_WPA2-EAP" - ] - }, + ] + }, "ec420": { "profile_id": "20", + "childProfileIds": [ + 129, + 209, + 210, + 21, + 22, + 24, + 25, + 10 + ], "fiveG_WPA2_SSID": "EC420_5G_WPA2", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "EC420_5G_WPA", @@ -117,7 +147,7 @@ profile_info_dict = { "twoFourG_OPEN_SSID": "EC420_2dot4G_OPEN", "twoFourG_WPA2_SSID": "EC420_2dot4G_WPA2", "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID":"EC420_2dot4G_WPA", + "twoFourG_WPA_SSID": "EC420_2dot4G_WPA", "twoFourG_WPA_PSK": "Connectus123$", "twoFourG_WPA2-EAP_SSID": "EC420_2dot4G_WPA2-EAP", "ssid_list": [ @@ -127,11 +157,21 @@ profile_info_dict = { "EC420_2dot4G_WPA2", "EC420_2dot4G_WPA", "EC420_2dot4G_WPA2-EAP" - ] - }, + ] + }, "ecw5211": { "profile_id": "27", + "childProfileIds": [ + 32, + 129, + 10, + 28, + 29, + 205, + 206, + 31 + ], "fiveG_WPA2_SSID": "ECW5211_5G_WPA2", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "ECW5211_5G_WPA", @@ -141,7 +181,7 @@ profile_info_dict = { "twoFourG_OPEN_SSID": "ECW5211_2dot4G_OPEN", "twoFourG_WPA2_SSID": "ECW5211_2dot4G_WPA2", "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID":"ECW5211_2dot4G_WPA", + "twoFourG_WPA_SSID": "ECW5211_2dot4G_WPA", "twoFourG_WPA_PSK": "Connectus123$", "twoFourG_WPA2-EAP_SSID": "ECW5211_2dot4G_WPA2-EAP", "ssid_list": [ @@ -151,11 +191,21 @@ profile_info_dict = { "ECW5211_2dot4G_WPA2", "ECW5211_2dot4G_WPA", "ECW5211_2dot4G_WPA2-EAP" - ] - }, - + ] + }, + "ecw5410_nat": { "profile_id": "68", + "childProfileIds": [ + 192, + 129, + 81, + 193, + 82, + 10, + 78, + 79 + ], "fiveG_WPA2_SSID": "ECW5410_5G_WPA2_NAT", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "ECW5410_5G_WPA_NAT", @@ -165,7 +215,7 @@ profile_info_dict = { "twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN_NAT", "twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2_NAT", "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID":"ECW5410_2dot4G_WPA_NAT", + "twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA_NAT", "twoFourG_WPA_PSK": "Connectus123$", "twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP_NAT", "ssid_list": [ @@ -175,11 +225,21 @@ profile_info_dict = { "ECW5410_2dot4G_WPA2_NAT", "ECW5410_2dot4G_WPA_NAT", "ECW5410_2dot4G_WPA2-EAP_NAT" - ] - }, + ] + }, "ea8300_nat": { "profile_id": "67", + "childProfileIds": [ + 129, + 72, + 73, + 10, + 75, + 203, + 76, + 204 + ], "fiveG_WPA2_SSID": "EA8300_5G_WPA2_NAT", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "EA8300_5G_WPA_NAT", @@ -189,10 +249,10 @@ profile_info_dict = { "twoFourG_OPEN_SSID": "EA8300_2dot4G_OPEN_NAT", "twoFourG_WPA2_SSID": "EA8300_2dot4G_WPA2_NAT", "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID":"EA8300_2dot4G_WPA_NAT", + "twoFourG_WPA_SSID": "EA8300_2dot4G_WPA_NAT", "twoFourG_WPA_PSK": "Connectus123$", "twoFourG_WPA2-EAP_SSID": "EA8300_2dot4G_WPA2-EAP_NAT", - #EA8300 has 2x 5GHz SSIDs because it is a tri-radio AP! + # EA8300 has 2x 5GHz SSIDs because it is a tri-radio AP! "ssid_list": [ "EA8300_5G_WPA2_NAT", "EA8300_5G_WPA2_NAT", @@ -203,11 +263,21 @@ profile_info_dict = { "EA8300_2dot4G_WPA2_NAT", "EA8300_2dot4G_WPA_NAT", "EA8300_2dot4G_WPA2-EAP_NAT" - ] - }, + ] + }, "ec420_nat": { "profile_id": "70", + "childProfileIds": [ + 129, + 211, + 212, + 90, + 10, + 91, + 93, + 94 + ], "fiveG_WPA2_SSID": "EC420_5G_WPA2_NAT", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "EC420_5G_WPA_NAT", @@ -217,7 +287,7 @@ profile_info_dict = { "twoFourG_OPEN_SSID": "EC420_2dot4G_OPEN_NAT", "twoFourG_WPA2_SSID": "EC420_2dot4G_WPA2_NAT", "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID":"EC420_2dot4G_WPA_NAT", + "twoFourG_WPA_SSID": "EC420_2dot4G_WPA_NAT", "twoFourG_WPA_PSK": "Connectus123$", "twoFourG_WPA2-EAP_SSID": "EC420_2dot4G_WPA2-EAP_NAT", "ssid_list": [ @@ -227,11 +297,21 @@ profile_info_dict = { "EC420_2dot4G_WPA2_NAT", "EC420_2dot4G_WPA_NAT", "EC420_2dot4G_WPA2-EAP_NAT" - ] - }, + ] + }, "ecw5211_nat": { "profile_id": "69", + "childProfileIds": [ + 208, + 129, + 84, + 85, + 87, + 88, + 10, + 207 + ], "fiveG_WPA2_SSID": "ECW5211_5G_WPA2_NAT", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "ECW5211_5G_WPA_NAT", @@ -241,7 +321,7 @@ profile_info_dict = { "twoFourG_OPEN_SSID": "ECW5211_2dot4G_OPEN_NAT", "twoFourG_WPA2_SSID": "ECW5211_2dot4G_WPA2_NAT", "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID":"ECW5211_2dot4G_WPA_NAT", + "twoFourG_WPA_SSID": "ECW5211_2dot4G_WPA_NAT", "twoFourG_WPA_PSK": "Connectus123$", "twoFourG_WPA2-EAP_SSID": "ECW5211_2dot4G_WPA2-EAP_NAT", "ssid_list": [ @@ -251,11 +331,21 @@ profile_info_dict = { "ECW5211_2dot4G_WPA2_NAT", "ECW5211_2dot4G_WPA_NAT", "ECW5211_2dot4G_WPA2-EAP_NAT" - ] - }, + ] + }, "ecw5410_vlan": { "profile_id": "338", + "childProfileIds": [ + 336, + 320, + 129, + 337, + 10, + 333, + 334, + 335 + ], "fiveG_WPA2_SSID": "ECW5410_5G_WPA2_VLAN", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "ECW5410_5G_WPA_VLAN", @@ -265,7 +355,7 @@ profile_info_dict = { "twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN_VLAN", "twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2_VLAN", "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID":"ECW5410_2dot4G_WPA_VLAN", + "twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA_VLAN", "twoFourG_WPA_PSK": "Connectus123$", "twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP_VLAN", "ssid_list": [ @@ -275,11 +365,21 @@ profile_info_dict = { "ECW5410_2dot4G_WPA2_VLAN", "ECW5410_2dot4G_WPA_VLAN", "ECW5410_2dot4G_WPA2-EAP_VLAN" - ] - }, + ] + }, "ea8300_vlan": { "profile_id": "319", + "childProfileIds": [ + 129, + 313, + 10, + 314, + 315, + 316, + 317, + 318 + ], "fiveG_WPA2_SSID": "EA8300_5G_WPA2_VLAN", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "EA8300_5G_WPA_VLAN", @@ -289,10 +389,10 @@ profile_info_dict = { "twoFourG_OPEN_SSID": "EA8300_2dot4G_OPEN_VLAN", "twoFourG_WPA2_SSID": "EA8300_2dot4G_WPA2_VLAN", "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID":"EA8300_2dot4G_WPA_VLAN", + "twoFourG_WPA_SSID": "EA8300_2dot4G_WPA_VLAN", "twoFourG_WPA_PSK": "Connectus123$", "twoFourG_WPA2-EAP_SSID": "EA8300_2dot4G_WPA2-EAP_VLAN", - #EA8300 has 2x 5GHz SSIDs because it is a tri-radio AP! + # EA8300 has 2x 5GHz SSIDs because it is a tri-radio AP! "ssid_list": [ "EA8300_5G_WPA2_VLAN", "EA8300_5G_WPA2_VLAN", @@ -303,11 +403,21 @@ profile_info_dict = { "EA8300_2dot4G_WPA2_VLAN", "EA8300_2dot4G_WPA_VLAN", "EA8300_2dot4G_WPA2-EAP_VLAN" - ] - }, + ] + }, "ec420_vlan": { "profile_id": "357", + "childProfileIds": [ + 352, + 129, + 353, + 354, + 355, + 356, + 10, + 351 + ], "fiveG_WPA2_SSID": "EC420_5G_WPA2_VLAN", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "EC420_5G_WPA_VLAN", @@ -317,7 +427,7 @@ profile_info_dict = { "twoFourG_OPEN_SSID": "EC420_2dot4G_OPEN_VLAN", "twoFourG_WPA2_SSID": "EC420_2dot4G_WPA2_VLAN", "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID":"EC420_2dot4G_WPA_VLAN", + "twoFourG_WPA_SSID": "EC420_2dot4G_WPA_VLAN", "twoFourG_WPA_PSK": "Connectus123$", "twoFourG_WPA2-EAP_SSID": "EC420_2dot4G_WPA2-EAP_VLAN", "ssid_list": [ @@ -327,11 +437,21 @@ profile_info_dict = { "EC420_2dot4G_WPA2_VLAN", "EC420_2dot4G_WPA_VLAN", "EC420_2dot4G_WPA2-EAP_VLAN" - ] - }, + ] + }, "ecw5211_vlan": { "profile_id": "364", + "childProfileIds": [ + 129, + 358, + 359, + 360, + 361, + 10, + 362, + 363 + ], "fiveG_WPA2_SSID": "ECW5211_5G_WPA2_VLAN", "fiveG_WPA2_PSK": "Connectus123$", "fiveG_WPA_SSID": "ECW5211_5G_WPA_VLAN", @@ -341,7 +461,7 @@ profile_info_dict = { "twoFourG_OPEN_SSID": "ECW5211_2dot4G_OPEN_VLAN", "twoFourG_WPA2_SSID": "ECW5211_2dot4G_WPA2_VLAN", "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID":"ECW5211_2dot4G_WPA_VLAN", + "twoFourG_WPA_SSID": "ECW5211_2dot4G_WPA_VLAN", "twoFourG_WPA_PSK": "Connectus123$", "twoFourG_WPA2-EAP_SSID": "ECW5211_2dot4G_WPA2-EAP_VLAN", "ssid_list": [ @@ -351,6 +471,6 @@ profile_info_dict = { "ECW5211_2dot4G_WPA2_VLAN", "ECW5211_2dot4G_WPA_VLAN", "ECW5211_2dot4G_WPA2-EAP_VLAN" - ] - } + ] + } } diff --git a/py-scripts/tip-cicd-sanity/reports/report_template.php b/py-scripts/tip-cicd-sanity/reports/report_template.php index 1671ffda..183fc5d7 100755 --- a/py-scripts/tip-cicd-sanity/reports/report_template.php +++ b/py-scripts/tip-cicd-sanity/reports/report_template.php @@ -175,6 +175,16 @@ $json = json_decode($results, true); + + 5641 + CloudSDK + Create AP Profile - Bridge Mode + + + + + + 5541 CloudSDK @@ -249,6 +259,16 @@ $json = json_decode($results, true); + + 5642 + CloudSDK + Create AP Profile - NAT Mode + + + + + + 5542 CloudSDK @@ -322,6 +342,17 @@ $json = json_decode($results, true); + + + 5643 + CloudSDK + Create AP Profile - Custom VLAN Mode + + + + + + 5543 CloudSDK