mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 04:07:52 +00:00
Delete created profiles at end of test run
This commit is contained in:
@@ -457,7 +457,7 @@ for key in equipment_ids:
|
|||||||
|
|
||||||
# Skip EAP argument
|
# Skip EAP argument
|
||||||
if args.skip_eap == True:
|
if args.skip_eap == True:
|
||||||
#case_ids.remove(test_cases["radius_profile"])
|
case_ids.remove(test_cases["radius_profile"])
|
||||||
for x in test_cases:
|
for x in test_cases:
|
||||||
if "eap" in x and test_cases[x] in case_ids:
|
if "eap" in x and test_cases[x] in case_ids:
|
||||||
case_ids.remove(test_cases[x])
|
case_ids.remove(test_cases[x])
|
||||||
@@ -705,11 +705,14 @@ for key in equipment_ids:
|
|||||||
print(report_data['tests'][key])
|
print(report_data['tests'][key])
|
||||||
# Pass cloud connectivity test case
|
# Pass cloud connectivity test case
|
||||||
|
|
||||||
###Update report json
|
# Update report json
|
||||||
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:
|
||||||
json.dump(report_data, report_json_file)
|
json.dump(report_data, report_json_file)
|
||||||
|
|
||||||
### Create RADIUS profile - used for all EAP SSIDs
|
# Create List of Created Profiles to Delete After Test
|
||||||
|
delete_list = []
|
||||||
|
|
||||||
|
# Create RADIUS profile - used for all EAP SSIDs
|
||||||
if args.skip_eap != True:
|
if args.skip_eap != True:
|
||||||
radius_template = "templates/radius_profile_template.json"
|
radius_template = "templates/radius_profile_template.json"
|
||||||
radius_name = radius_info['name']
|
radius_name = radius_info['name']
|
||||||
@@ -730,6 +733,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["radius_profile"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["radius_profile"], run_id=rid, status_id=1,
|
||||||
msg='RADIUS profile created successfully')
|
msg='RADIUS profile created successfully')
|
||||||
report_data['tests'][key][test_cases["radius_profile"]] = "passed"
|
report_data['tests'][key][test_cases["radius_profile"]] = "passed"
|
||||||
|
# Add created RADIUS profile to list for deletion at end of test
|
||||||
|
delete_list.append(radius_profile)
|
||||||
except:
|
except:
|
||||||
radius_profile = 'error'
|
radius_profile = 'error'
|
||||||
print("RADIUS Profile Create Error, will use existing profile for tests")
|
print("RADIUS Profile Create Error, will use existing profile for tests")
|
||||||
@@ -761,7 +766,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_5g_eap_bridge"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_5g_eap_bridge"], run_id=rid, status_id=1,
|
||||||
msg='5G EAP SSID created successfully - bridge mode')
|
msg='5G EAP SSID created successfully - bridge mode')
|
||||||
report_data['tests'][key][test_cases["ssid_5g_eap_bridge"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_5g_eap_bridge"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(fiveG_eap)
|
||||||
except:
|
except:
|
||||||
fiveG_eap = "error"
|
fiveG_eap = "error"
|
||||||
print("5G EAP SSID create failed - bridge mode")
|
print("5G EAP SSID create failed - bridge mode")
|
||||||
@@ -783,6 +789,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_5g_wpa2_bridge"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_5g_wpa2_bridge"], run_id=rid, status_id=1,
|
||||||
msg='5G WPA2 SSID created successfully - bridge mode')
|
msg='5G WPA2 SSID created successfully - bridge mode')
|
||||||
report_data['tests'][key][test_cases["ssid_5g_wpa2_bridge"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_5g_wpa2_bridge"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(fiveG_wpa2)
|
||||||
except:
|
except:
|
||||||
fiveG_wpa2 = "error"
|
fiveG_wpa2 = "error"
|
||||||
print("5G WPA2 SSID create failed - bridge mode")
|
print("5G WPA2 SSID create failed - bridge mode")
|
||||||
@@ -802,6 +810,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_5g_wpa_bridge"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_5g_wpa_bridge"], run_id=rid, status_id=1,
|
||||||
msg='5G WPA SSID created successfully - bridge mode')
|
msg='5G WPA SSID created successfully - bridge mode')
|
||||||
report_data['tests'][key][test_cases["ssid_5g_wpa_bridge"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_5g_wpa_bridge"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(fiveG_wpa)
|
||||||
except:
|
except:
|
||||||
fiveG_wpa = "error"
|
fiveG_wpa = "error"
|
||||||
print("5G WPA SSID create failed - bridge mode")
|
print("5G WPA SSID create failed - bridge mode")
|
||||||
@@ -823,6 +833,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_2g_eap_bridge"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_2g_eap_bridge"], run_id=rid, status_id=1,
|
||||||
msg='2.4G EAP SSID created successfully - bridge mode')
|
msg='2.4G EAP SSID created successfully - bridge mode')
|
||||||
report_data['tests'][key][test_cases["ssid_2g_eap_bridge"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_2g_eap_bridge"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(twoFourG_eap)
|
||||||
except:
|
except:
|
||||||
twoFourG_eap = "error"
|
twoFourG_eap = "error"
|
||||||
print("2.4G EAP SSID create failed - bridge mode")
|
print("2.4G EAP SSID create failed - bridge mode")
|
||||||
@@ -844,6 +856,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_2g_wpa2_bridge"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_2g_wpa2_bridge"], run_id=rid, status_id=1,
|
||||||
msg='2.4G WPA2 SSID created successfully - bridge mode')
|
msg='2.4G WPA2 SSID created successfully - bridge mode')
|
||||||
report_data['tests'][key][test_cases["ssid_2g_wpa2_bridge"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_2g_wpa2_bridge"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(twoFourG_wpa2)
|
||||||
except:
|
except:
|
||||||
twoFourG_wpa2 = "error"
|
twoFourG_wpa2 = "error"
|
||||||
print("2.4G WPA2 SSID create failed - bridge mode")
|
print("2.4G WPA2 SSID create failed - bridge mode")
|
||||||
@@ -863,6 +877,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_2g_wpa_bridge"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_2g_wpa_bridge"], run_id=rid, status_id=1,
|
||||||
msg='2.4G WPA SSID created successfully - bridge mode')
|
msg='2.4G WPA SSID created successfully - bridge mode')
|
||||||
report_data['tests'][key][test_cases["ssid_2g_wpa_bridge"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_2g_wpa_bridge"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(twoFourG_wpa)
|
||||||
except:
|
except:
|
||||||
twoFourG_wpa = "error"
|
twoFourG_wpa = "error"
|
||||||
print("2.4G WPA SSID create failed - bridge mode")
|
print("2.4G WPA SSID create failed - bridge mode")
|
||||||
@@ -893,6 +909,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ap_bridge"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ap_bridge"], run_id=rid, status_id=1,
|
||||||
msg='AP profile for bridge tests created successfully')
|
msg='AP profile for bridge tests created successfully')
|
||||||
report_data['tests'][key][test_cases["ap_bridge"]] = "passed"
|
report_data['tests'][key][test_cases["ap_bridge"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(test_profile_id)
|
||||||
except:
|
except:
|
||||||
create_ap_profile = "error"
|
create_ap_profile = "error"
|
||||||
test_profile_id = profile_info_dict[fw_model]["profile_id"]
|
test_profile_id = profile_info_dict[fw_model]["profile_id"]
|
||||||
@@ -1120,6 +1138,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_5g_eap_nat"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_5g_eap_nat"], run_id=rid, status_id=1,
|
||||||
msg='5G EAP SSID created successfully - NAT mode')
|
msg='5G EAP SSID created successfully - NAT mode')
|
||||||
report_data['tests'][key][test_cases["ssid_5g_eap_nat"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_5g_eap_nat"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(fiveG_eap)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
fiveG_eap = "error"
|
fiveG_eap = "error"
|
||||||
@@ -1142,6 +1162,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_5g_wpa2_nat"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_5g_wpa2_nat"], run_id=rid, status_id=1,
|
||||||
msg='5G WPA2 SSID created successfully - NAT mode')
|
msg='5G WPA2 SSID created successfully - NAT mode')
|
||||||
report_data['tests'][key][test_cases["ssid_5g_wpa2_nat"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_5g_wpa2_nat"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(fiveG_wpa2)
|
||||||
except:
|
except:
|
||||||
fiveG_wpa2 = "error"
|
fiveG_wpa2 = "error"
|
||||||
print("5G WPA2 SSID create failed - NAT mode")
|
print("5G WPA2 SSID create failed - NAT mode")
|
||||||
@@ -1161,6 +1183,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_5g_wpa_nat"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_5g_wpa_nat"], run_id=rid, status_id=1,
|
||||||
msg='5G WPA SSID created successfully - NAT mode')
|
msg='5G WPA SSID created successfully - NAT mode')
|
||||||
report_data['tests'][key][test_cases["ssid_5g_wpa_nat"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_5g_wpa_nat"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(fiveG_wpa)
|
||||||
except:
|
except:
|
||||||
fiveG_wpa = "error"
|
fiveG_wpa = "error"
|
||||||
print("5G WPA SSID create failed - NAT mode")
|
print("5G WPA SSID create failed - NAT mode")
|
||||||
@@ -1182,6 +1206,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_2g_eap_nat"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_2g_eap_nat"], run_id=rid, status_id=1,
|
||||||
msg='2.4G EAP SSID created successfully - NAT mode')
|
msg='2.4G EAP SSID created successfully - NAT mode')
|
||||||
report_data['tests'][key][test_cases["ssid_2g_eap_nat"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_2g_eap_nat"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(twoFourG_eap)
|
||||||
except:
|
except:
|
||||||
twoFourG_eap = "error"
|
twoFourG_eap = "error"
|
||||||
print("2.4G EAP SSID create failed - NAT mode")
|
print("2.4G EAP SSID create failed - NAT mode")
|
||||||
@@ -1203,6 +1229,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_2g_wpa2_nat"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_2g_wpa2_nat"], run_id=rid, status_id=1,
|
||||||
msg='2.4G WPA2 SSID created successfully - NAT mode')
|
msg='2.4G WPA2 SSID created successfully - NAT mode')
|
||||||
report_data['tests'][key][test_cases["ssid_2g_wpa2_nat"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_2g_wpa2_nat"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(twoFourG_wpa2)
|
||||||
except:
|
except:
|
||||||
twoFourG_wpa2 = "error"
|
twoFourG_wpa2 = "error"
|
||||||
print("2.4G WPA2 SSID create failed - NAT mode")
|
print("2.4G WPA2 SSID create failed - NAT mode")
|
||||||
@@ -1222,6 +1250,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_2g_wpa_nat"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_2g_wpa_nat"], run_id=rid, status_id=1,
|
||||||
msg='2.4G WPA SSID created successfully - NAT mode')
|
msg='2.4G WPA SSID created successfully - NAT mode')
|
||||||
report_data['tests'][key][test_cases["ssid_2g_wpa_nat"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_2g_wpa_nat"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(twoFourG_wpa)
|
||||||
except:
|
except:
|
||||||
twoFourG_wpa = "error"
|
twoFourG_wpa = "error"
|
||||||
print("2.4G WPA SSID create failed - NAT mode")
|
print("2.4G WPA SSID create failed - NAT mode")
|
||||||
@@ -1251,6 +1281,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ap_nat"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ap_nat"], run_id=rid, status_id=1,
|
||||||
msg='AP profile for NAT tests created successfully')
|
msg='AP profile for NAT tests created successfully')
|
||||||
report_data['tests'][key][test_cases["ap_nat"]] = "passed"
|
report_data['tests'][key][test_cases["ap_nat"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(test_profile_id)
|
||||||
except:
|
except:
|
||||||
create_ap_profile = "error"
|
create_ap_profile = "error"
|
||||||
test_profile_id = profile_info_dict[fw_model + '_nat']["profile_id"]
|
test_profile_id = profile_info_dict[fw_model + '_nat']["profile_id"]
|
||||||
@@ -1475,6 +1507,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_5g_eap_vlan"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_5g_eap_vlan"], run_id=rid, status_id=1,
|
||||||
msg='5G EAP SSID created successfully - Custom VLAN mode')
|
msg='5G EAP SSID created successfully - Custom VLAN mode')
|
||||||
report_data['tests'][key][test_cases["ssid_5g_eap_vlan"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_5g_eap_vlan"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(fiveG_eap)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
fiveG_eap = "error"
|
fiveG_eap = "error"
|
||||||
@@ -1497,6 +1531,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_5g_wpa2_vlan"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_5g_wpa2_vlan"], run_id=rid, status_id=1,
|
||||||
msg='5G WPA2 SSID created successfully - custom VLAN mode')
|
msg='5G WPA2 SSID created successfully - custom VLAN mode')
|
||||||
report_data['tests'][key][test_cases["ssid_5g_wpa2_vlan"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_5g_wpa2_vlan"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(fiveG_wpa2)
|
||||||
except:
|
except:
|
||||||
fiveG_wpa2 = "error"
|
fiveG_wpa2 = "error"
|
||||||
print("5G WPA2 SSID create failed - custom VLAN mode")
|
print("5G WPA2 SSID create failed - custom VLAN mode")
|
||||||
@@ -1516,6 +1552,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_5g_wpa_vlan"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_5g_wpa_vlan"], run_id=rid, status_id=1,
|
||||||
msg='5G WPA SSID created successfully - custom VLAN mode')
|
msg='5G WPA SSID created successfully - custom VLAN mode')
|
||||||
report_data['tests'][key][test_cases["ssid_5g_wpa_vlan"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_5g_wpa_vlan"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(fiveG_wpa)
|
||||||
except:
|
except:
|
||||||
fiveG_wpa = "error"
|
fiveG_wpa = "error"
|
||||||
print("5G WPA SSID create failed - custom VLAN mode")
|
print("5G WPA SSID create failed - custom VLAN mode")
|
||||||
@@ -1538,6 +1576,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_2g_eap_vlan"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_2g_eap_vlan"], run_id=rid, status_id=1,
|
||||||
msg='2.4G EAP SSID created successfully - custom VLAN mode')
|
msg='2.4G EAP SSID created successfully - custom VLAN mode')
|
||||||
report_data['tests'][key][test_cases["ssid_2g_eap_vlan"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_2g_eap_vlan"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(twoFourG_eap)
|
||||||
except:
|
except:
|
||||||
twoFourG_eap = "error"
|
twoFourG_eap = "error"
|
||||||
print("2.4G EAP SSID create failed - custom VLAN mode")
|
print("2.4G EAP SSID create failed - custom VLAN mode")
|
||||||
@@ -1560,6 +1600,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_2g_wpa2_vlan"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_2g_wpa2_vlan"], run_id=rid, status_id=1,
|
||||||
msg='2.4G WPA2 SSID created successfully - custom VLAN mode')
|
msg='2.4G WPA2 SSID created successfully - custom VLAN mode')
|
||||||
report_data['tests'][key][test_cases["ssid_2g_wpa2_vlan"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_2g_wpa2_vlan"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(twoFourG_wpa2)
|
||||||
except:
|
except:
|
||||||
twoFourG_wpa2 = "error"
|
twoFourG_wpa2 = "error"
|
||||||
print("2.4G WPA2 SSID create failed - custom VLAN mode")
|
print("2.4G WPA2 SSID create failed - custom VLAN mode")
|
||||||
@@ -1579,6 +1621,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ssid_2g_wpa_vlan"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ssid_2g_wpa_vlan"], run_id=rid, status_id=1,
|
||||||
msg='2.4G WPA SSID created successfully - custom VLAN mode')
|
msg='2.4G WPA SSID created successfully - custom VLAN mode')
|
||||||
report_data['tests'][key][test_cases["ssid_2g_wpa_vlan"]] = "passed"
|
report_data['tests'][key][test_cases["ssid_2g_wpa_vlan"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(twoFourG_wpa)
|
||||||
except:
|
except:
|
||||||
twoFourG_wpa = "error"
|
twoFourG_wpa = "error"
|
||||||
print("2.4G WPA SSID create failed - custom VLAN mode")
|
print("2.4G WPA SSID create failed - custom VLAN mode")
|
||||||
@@ -1608,6 +1652,8 @@ for key in equipment_ids:
|
|||||||
client.update_testrail(case_id=test_cases["ap_vlan"], run_id=rid, status_id=1,
|
client.update_testrail(case_id=test_cases["ap_vlan"], run_id=rid, status_id=1,
|
||||||
msg='AP profile for VLAN tests created successfully')
|
msg='AP profile for VLAN tests created successfully')
|
||||||
report_data['tests'][key][test_cases["ap_vlan"]] = "passed"
|
report_data['tests'][key][test_cases["ap_vlan"]] = "passed"
|
||||||
|
# Add created profile to list for deletion at end of test
|
||||||
|
delete_list.append(test_profile_id)
|
||||||
except:
|
except:
|
||||||
create_ap_profile = "error"
|
create_ap_profile = "error"
|
||||||
test_profile_id = profile_info_dict[fw_model + '_vlan']["profile_id"]
|
test_profile_id = profile_info_dict[fw_model + '_vlan']["profile_id"]
|
||||||
@@ -1837,8 +1883,23 @@ for key in equipment_ids:
|
|||||||
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:
|
||||||
json.dump(report_data, report_json_file)
|
json.dump(report_data, report_json_file)
|
||||||
|
|
||||||
## Post-test Profile Cleanup
|
###########################################################################
|
||||||
|
################# Post-test Prfofile Cleanup ##############################
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
# Set AP to use permanently available profile to allow for deletion of RADIUS, SSID, and AP profiles
|
||||||
|
print("Cleaning up! Deleting created test profiles")
|
||||||
|
print("Set AP to profile not created in test")
|
||||||
|
ap_profile = CloudSDK.set_ap_profile(equipment_id, profile_info_dict[fw_model]["profile_id"], cloudSDK_url, bearer)
|
||||||
|
time.sleep(5)
|
||||||
|
|
||||||
|
# Delete profiles in delete_list
|
||||||
|
for x in delete_list:
|
||||||
|
delete_profile = CloudSDK.delete_profile(cloudSDK_url, bearer, str(x))
|
||||||
|
if delete_profile == "SUCCESS":
|
||||||
|
print("profile", x, "delete successful")
|
||||||
|
else:
|
||||||
|
print("Error deleting profile")
|
||||||
|
|
||||||
# Dump all sanity test results to external json file again just to be sure
|
# Dump all sanity test results to external json file again just to be sure
|
||||||
with open('sanity_status.json', 'w') as json_file:
|
with open('sanity_status.json', 'w') as json_file:
|
||||||
|
|||||||
@@ -265,3 +265,16 @@ class CloudSDK:
|
|||||||
#print(ssid_profile)
|
#print(ssid_profile)
|
||||||
radius_profile_id = radius_profile['id']
|
radius_profile_id = radius_profile['id']
|
||||||
return radius_profile_id
|
return radius_profile_id
|
||||||
|
|
||||||
|
def delete_profile(cloudSDK_url, bearer, profile_id):
|
||||||
|
url = cloudSDK_url + "/portal/profile?profileId="+profile_id
|
||||||
|
payload = {}
|
||||||
|
headers = {
|
||||||
|
'Authorization': 'Bearer ' + bearer
|
||||||
|
}
|
||||||
|
del_profile = requests.request("DELETE", url, headers=headers, data=payload)
|
||||||
|
status_code = del_profile.status_code
|
||||||
|
if status_code is 200:
|
||||||
|
return("SUCCESS")
|
||||||
|
else:
|
||||||
|
return ("ERROR")
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ test_cases = {
|
|||||||
|
|
||||||
## Other profiles
|
## Other profiles
|
||||||
radius_profile = 129
|
radius_profile = 129
|
||||||
rf_profile = 3459
|
rf_profile = 10
|
||||||
|
|
||||||
###Testing AP Profile Information
|
###Testing AP Profile Information
|
||||||
profile_info_dict = {
|
profile_info_dict = {
|
||||||
@@ -146,7 +146,7 @@ profile_info_dict = {
|
|||||||
"childProfileIds": [
|
"childProfileIds": [
|
||||||
129,
|
129,
|
||||||
3,
|
3,
|
||||||
3459,
|
10,
|
||||||
11,
|
11,
|
||||||
12,
|
12,
|
||||||
13,
|
13,
|
||||||
@@ -189,7 +189,7 @@ profile_info_dict = {
|
|||||||
18,
|
18,
|
||||||
201,
|
201,
|
||||||
202,
|
202,
|
||||||
3459,
|
10,
|
||||||
14,
|
14,
|
||||||
15
|
15
|
||||||
],
|
],
|
||||||
@@ -235,7 +235,7 @@ profile_info_dict = {
|
|||||||
22,
|
22,
|
||||||
24,
|
24,
|
||||||
25,
|
25,
|
||||||
3459
|
10
|
||||||
],
|
],
|
||||||
"fiveG_WPA2_SSID": "EC420_5G_WPA2",
|
"fiveG_WPA2_SSID": "EC420_5G_WPA2",
|
||||||
"fiveG_WPA2_PSK": "Connectus123$",
|
"fiveG_WPA2_PSK": "Connectus123$",
|
||||||
@@ -270,7 +270,7 @@ profile_info_dict = {
|
|||||||
"childProfileIds": [
|
"childProfileIds": [
|
||||||
32,
|
32,
|
||||||
129,
|
129,
|
||||||
3459,
|
10,
|
||||||
28,
|
28,
|
||||||
29,
|
29,
|
||||||
205,
|
205,
|
||||||
@@ -313,7 +313,7 @@ profile_info_dict = {
|
|||||||
81,
|
81,
|
||||||
193,
|
193,
|
||||||
82,
|
82,
|
||||||
3459,
|
10,
|
||||||
78,
|
78,
|
||||||
79
|
79
|
||||||
],
|
],
|
||||||
@@ -351,7 +351,7 @@ profile_info_dict = {
|
|||||||
129,
|
129,
|
||||||
72,
|
72,
|
||||||
73,
|
73,
|
||||||
3459,
|
10,
|
||||||
75,
|
75,
|
||||||
203,
|
203,
|
||||||
76,
|
76,
|
||||||
@@ -396,7 +396,7 @@ profile_info_dict = {
|
|||||||
211,
|
211,
|
||||||
212,
|
212,
|
||||||
90,
|
90,
|
||||||
3459,
|
10,
|
||||||
91,
|
91,
|
||||||
93,
|
93,
|
||||||
94
|
94
|
||||||
@@ -438,7 +438,7 @@ profile_info_dict = {
|
|||||||
85,
|
85,
|
||||||
87,
|
87,
|
||||||
88,
|
88,
|
||||||
3459,
|
10,
|
||||||
207
|
207
|
||||||
],
|
],
|
||||||
"fiveG_WPA2_SSID": "ECW5211_5G_WPA2_NAT",
|
"fiveG_WPA2_SSID": "ECW5211_5G_WPA2_NAT",
|
||||||
@@ -476,7 +476,7 @@ profile_info_dict = {
|
|||||||
320,
|
320,
|
||||||
129,
|
129,
|
||||||
337,
|
337,
|
||||||
3459,
|
10,
|
||||||
333,
|
333,
|
||||||
334,
|
334,
|
||||||
335
|
335
|
||||||
@@ -514,7 +514,7 @@ profile_info_dict = {
|
|||||||
"childProfileIds": [
|
"childProfileIds": [
|
||||||
129,
|
129,
|
||||||
313,
|
313,
|
||||||
3459,
|
10,
|
||||||
314,
|
314,
|
||||||
315,
|
315,
|
||||||
316,
|
316,
|
||||||
@@ -562,7 +562,7 @@ profile_info_dict = {
|
|||||||
354,
|
354,
|
||||||
355,
|
355,
|
||||||
356,
|
356,
|
||||||
3459,
|
10,
|
||||||
351
|
351
|
||||||
],
|
],
|
||||||
"fiveG_WPA2_SSID": "EC420_5G_WPA2_VLAN",
|
"fiveG_WPA2_SSID": "EC420_5G_WPA2_VLAN",
|
||||||
@@ -601,7 +601,7 @@ profile_info_dict = {
|
|||||||
359,
|
359,
|
||||||
360,
|
360,
|
||||||
361,
|
361,
|
||||||
3459,
|
10,
|
||||||
362,
|
362,
|
||||||
363
|
363
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user