Add Create AP Profile test cases to Nightly Sanity

This commit is contained in:
bealler
2020-12-10 13:10:18 -05:00
parent d4b5f3e71d
commit d7f1c922ae
4 changed files with 274 additions and 49 deletions

View File

@@ -267,7 +267,10 @@ test_cases = [
5545,
5546,
5547,
5548
5548,
5641,
5642,
5643
]
##AP models for jfrog
@@ -636,9 +639,26 @@ for key in equipment_id_dict:
############## Bridge Mode Client Connectivity ############################
###########################################################################
###Set Proper AP Profile for Bridge SSID Tests
### 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(test_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
@@ -827,9 +847,26 @@ for key in equipment_id_dict:
################# NAT Mode Client Connectivity ############################
###########################################################################
###Set Proper AP Profile for NAT SSID Tests
### 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(test_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
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
### 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(test_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

View File

@@ -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

View File

@@ -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",
@@ -80,6 +90,16 @@ profile_info_dict = {
"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",
@@ -108,6 +128,16 @@ profile_info_dict = {
"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",
@@ -132,6 +162,16 @@ profile_info_dict = {
"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",
@@ -156,6 +196,16 @@ profile_info_dict = {
"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",
@@ -180,6 +230,16 @@ profile_info_dict = {
"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",
@@ -208,6 +268,16 @@ profile_info_dict = {
"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",
@@ -232,6 +302,16 @@ profile_info_dict = {
"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",
@@ -256,6 +336,16 @@ profile_info_dict = {
"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",
@@ -280,6 +370,16 @@ profile_info_dict = {
"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",
@@ -308,6 +408,16 @@ profile_info_dict = {
"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",
@@ -332,6 +442,16 @@ profile_info_dict = {
"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",

View File

@@ -175,6 +175,16 @@ $json = json_decode($results, true);
<TD><?php echo print_r($json['tests']['ec420']['5222'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5641</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create AP Profile - Bridge Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5641'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5641'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5641'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5641'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5541</TD>
<TD>CloudSDK</TD>
@@ -249,6 +259,16 @@ $json = json_decode($results, true);
<TD><?php echo print_r($json['tests']['ecw5410']['2419'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['2419'],true) ?></TD>
<TR ALIGN="CENTER">
<TD>5642</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create AP Profile - NAT Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5642'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5642'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5642'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5642'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5542</TD>
<TD>CloudSDK</TD>
@@ -322,6 +342,17 @@ $json = json_decode($results, true);
<TD><?php echo print_r($json['tests']['ecw5410']['4324'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['4324'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5643</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create AP Profile - Custom VLAN Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5643'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5643'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5643'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5643'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5543</TD>
<TD>CloudSDK</TD>