mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 11:57:49 +00:00
resolved merge issues with staging-wifi-1960
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
1
lanforge/lanforge-scripts
Submodule
1
lanforge/lanforge-scripts
Submodule
Submodule lanforge/lanforge-scripts added at de86a454b2
@@ -87,6 +87,8 @@ class APNOS:
|
||||
f"cmd --value \"{cmd}\" "
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
output = stdout.read()
|
||||
allure.attach(body=str("VIF Config: " + str(vif_config) + "\n" + "VIF State: " + str(vif_state)),
|
||||
name="SSID Profiles in VIF Config and VIF State: ")
|
||||
client.close()
|
||||
allure.attach(name="iwinfo Output Msg: ", body=str(output))
|
||||
allure.attach(name="iwinfo config Err Msg: ", body=str(stderr))
|
||||
|
||||
@@ -5,6 +5,7 @@ make sure pexpect is installed:
|
||||
$ sudo yum install python3-pexpect
|
||||
|
||||
You might need to install pexpect-serial using pip:
|
||||
$ pip3 install serial
|
||||
$ pip3 install pexpect-serial
|
||||
|
||||
./openwrt_ctl.py -l stdout -u root -p TIP -s serial --tty ttyUSB0
|
||||
|
||||
@@ -13,10 +13,13 @@ import urllib
|
||||
import requests
|
||||
import swagger_client
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from swagger_client import EquipmentGatewayApi
|
||||
from swagger_client import FirmwareManagementApi
|
||||
import allure
|
||||
|
||||
import threading
|
||||
|
||||
|
||||
class ConfigureController:
|
||||
|
||||
@@ -74,31 +77,34 @@ class Controller(ConfigureController):
|
||||
if customer_id is None:
|
||||
self.customer_id = 2
|
||||
print("Setting to default Customer ID 2")
|
||||
|
||||
#
|
||||
# Setting the Controller Client Configuration
|
||||
self.select_controller_data(controller_data=controller_data)
|
||||
self.set_credentials(controller_data=controller_data)
|
||||
# self.configuration.refresh_api_key_hook = self.get_bearer_token
|
||||
self.configuration.refresh_api_key_hook = self.get_bearer_token
|
||||
|
||||
# Connecting to Controller
|
||||
self.api_client = swagger_client.ApiClient(self.configuration)
|
||||
self.login_client = swagger_client.LoginApi(api_client=self.api_client)
|
||||
self.bearer = self.get_bearer_token()
|
||||
self.bearer = False
|
||||
self.disconnect = False
|
||||
self.semaphore = False
|
||||
try:
|
||||
self.bearer = self.get_bearer_token()
|
||||
# t1 = threading.Thread(target=self.refresh_instance)
|
||||
# t1.start()
|
||||
self.api_client.default_headers['Authorization'] = "Bearer " + self.bearer._access_token
|
||||
self.status_client = swagger_client.StatusApi(api_client=self.api_client)
|
||||
self.equipment_client = swagger_client.EquipmentApi(self.api_client)
|
||||
self.profile_client = swagger_client.ProfileApi(self.api_client)
|
||||
self.api_client.configuration.api_key_prefix = {
|
||||
"Authorization": "Bearer " + self.bearer._access_token
|
||||
}
|
||||
self.api_client.configuration.refresh_api_key_hook = self.refresh_instance
|
||||
except Exception as e:
|
||||
self.bearer = False
|
||||
print(e)
|
||||
|
||||
self.api_client.default_headers['Authorization'] = "Bearer " + self.bearer._access_token
|
||||
self.status_client = swagger_client.StatusApi(api_client=self.api_client)
|
||||
self.equipment_client = swagger_client.EquipmentApi(self.api_client)
|
||||
self.profile_client = swagger_client.ProfileApi(self.api_client)
|
||||
self.api_client.configuration.api_key_prefix = {
|
||||
"Authorization": "Bearer " + self.bearer._access_token
|
||||
}
|
||||
self.api_client.configuration.refresh_api_key_hook = self.get_bearer_token()
|
||||
self.ping_response = self.portal_ping()
|
||||
self.default_profiles = {}
|
||||
# print(self.bearer)
|
||||
if self.ping_response._application_name != 'PortalServer':
|
||||
print("Server not Reachable")
|
||||
exit()
|
||||
print("Connected to Controller Server")
|
||||
|
||||
def get_bearer_token(self):
|
||||
@@ -110,6 +116,15 @@ class Controller(ConfigureController):
|
||||
|
||||
def refresh_instance(self):
|
||||
# Connecting to Controller
|
||||
# while True:
|
||||
# print("Controller Refresh Thread Started")
|
||||
# for i in range(0, 800):
|
||||
# if self.disconnect:
|
||||
# break
|
||||
# time.sleep(1)
|
||||
# if self.disconnect:
|
||||
# break
|
||||
# self.semaphore = True
|
||||
self.api_client = swagger_client.ApiClient(self.configuration)
|
||||
self.login_client = swagger_client.LoginApi(api_client=self.api_client)
|
||||
self.bearer = self.get_bearer_token()
|
||||
@@ -121,7 +136,7 @@ class Controller(ConfigureController):
|
||||
self.api_client.configuration.api_key_prefix = {
|
||||
"Authorization": "Bearer " + self.bearer._access_token
|
||||
}
|
||||
self.api_client.configuration.refresh_api_key_hook = self.get_bearer_token()
|
||||
self.api_client.configuration.refresh_api_key_hook = self.refresh_instance
|
||||
self.ping_response = self.portal_ping()
|
||||
self.default_profiles = {}
|
||||
# print(self.bearer)
|
||||
@@ -129,11 +144,13 @@ class Controller(ConfigureController):
|
||||
print("Server not Reachable")
|
||||
exit()
|
||||
print("Connected to Controller Server")
|
||||
# self.semaphore = False
|
||||
|
||||
def portal_ping(self):
|
||||
return self.login_client.portal_ping()
|
||||
|
||||
def disconnect_Controller(self):
|
||||
self.disconnect = True
|
||||
self.api_client.__del__()
|
||||
|
||||
# Returns a List of All the Equipments that are available in the cloud instances
|
||||
@@ -451,21 +468,16 @@ class ProfileUtility:
|
||||
method call: used to create a ssid profile with the given parameters
|
||||
"""
|
||||
|
||||
def create_open_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
def create_open_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'open'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
@@ -473,22 +485,17 @@ class ProfileUtility:
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = "error"
|
||||
|
||||
return profile
|
||||
|
||||
def create_wpa_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
def create_wpa_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
@@ -500,21 +507,17 @@ class ProfileUtility:
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
def create_wpa2_personal_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
def create_wpa2_personal_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
@@ -526,43 +529,39 @@ class ProfileUtility:
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
def create_wpa3_personal_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['keyStr'] = profile_data['security_key']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'wpa3OnlyPSK'
|
||||
profile_id = self.profile_client.create_profile(body=default_profile)._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
return True
|
||||
|
||||
def create_wpa2_enterprise_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
def create_wpa3_personal_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['keyStr'] = profile_data['security_key']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'wpa3OnlyPSK'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
def create_wpa2_enterprise_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
@@ -579,29 +578,27 @@ class ProfileUtility:
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
def create_wpa3_enterprise_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['keyStr'] = profile_data['security_key']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'wpa3OnlyRadius'
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
profile_id = self.profile_client.create_profile(body=default_profile)._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
return True
|
||||
def create_wpa3_enterprise_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
default_profile._details['secureMode'] = 'wpa3OnlyEAP'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
"""
|
||||
method call: used to create a ap profile that contains the given ssid profiles
|
||||
|
||||
@@ -4,34 +4,50 @@
|
||||
#########################################################################################################
|
||||
|
||||
from sta_connect2 import StaConnect2
|
||||
import time
|
||||
from eap_connect import EAPConnect
|
||||
|
||||
|
||||
class RunTest:
|
||||
|
||||
def __init__(self, lanforge_ip, lanforge_port, lanforge_prefix):
|
||||
self.lanforge_ip = lanforge_ip
|
||||
self.lanforge_port = lanforge_port
|
||||
self.lanforge_prefix = lanforge_prefix
|
||||
def __init__(self, lanforge_data=None, debug=False):
|
||||
self.lanforge_ip = lanforge_data["ip"]
|
||||
self.lanforge_port = lanforge_data["port"]
|
||||
self.twog_radios = lanforge_data["2.4G-Radio"]
|
||||
self.fiveg_radios = lanforge_data["5G-Radio"]
|
||||
self.ax_radios = lanforge_data["AX-Radio"]
|
||||
self.upstream_port = lanforge_data["upstream"]
|
||||
self.twog_prefix = lanforge_data["2.4G-Station-Name"]
|
||||
self.fiveg_prefix = lanforge_data["5G-Station-Name"]
|
||||
self.ax_prefix = lanforge_data["AX-Station-Name"]
|
||||
self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=debug)
|
||||
|
||||
def Single_Client_Connectivity(self, upstream_port="eth1", radio="wiphy0", ssid="TestAP", passkey="ssid_psk",
|
||||
security="open",
|
||||
station_name="sta0000", test_case=None, rid=None, client=None, logger=None):
|
||||
def Client_Connectivity(self, ssid="[BLANK]", passkey="[BLANK]", security="open", station_name=[],
|
||||
mode="BRIDGE", vlan_id=1, band="twog"):
|
||||
'''SINGLE CLIENT CONNECTIVITY using test_connect2.py'''
|
||||
self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=False)
|
||||
self.staConnect.sta_mode = 0
|
||||
self.staConnect.upstream_resource = 1
|
||||
self.staConnect.upstream_port = upstream_port
|
||||
self.staConnect.radio = radio
|
||||
if mode == "BRIDGE":
|
||||
self.staConnect.upstream_port = self.upstream_port
|
||||
elif mode == "NAT":
|
||||
self.staConnect.upstream_port = self.upstream_port
|
||||
else:
|
||||
self.staConnect.upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
if band == "twog":
|
||||
self.staConnect.radio = self.twog_radios[0]
|
||||
self.staConnect.sta_prefix = self.twog_prefix
|
||||
if band == "fiveg":
|
||||
self.staConnect.radio = self.fiveg_radios[0]
|
||||
self.staConnect.sta_prefix = self.fiveg_prefix
|
||||
self.staConnect.resource = 1
|
||||
self.staConnect.dut_ssid = ssid
|
||||
self.staConnect.dut_passwd = passkey
|
||||
self.staConnect.dut_security = security
|
||||
self.staConnect.station_names = station_name
|
||||
self.staConnect.sta_prefix = self.lanforge_prefix
|
||||
self.staConnect.runtime_secs = 10
|
||||
self.staConnect.runtime_secs = 40
|
||||
self.staConnect.bringup_time_sec = 60
|
||||
self.staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
# self.staConnect.cleanup()
|
||||
self.staConnect.setup()
|
||||
self.staConnect.start()
|
||||
print("napping %f sec" % self.staConnect.runtime_secs)
|
||||
@@ -41,18 +57,15 @@ class RunTest:
|
||||
run_results = self.staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", self.staConnect.passes)
|
||||
if self.staConnect.passes() == True:
|
||||
print("Single client connection to", self.staConnect.dut_ssid, "successful. Test Passed")
|
||||
client.update_testrail(case_id=test_case, run_id=rid, status_id=1, msg='Client connectivity passed')
|
||||
logger.info("Client connectivity to " + self.staConnect.dut_ssid + " Passed")
|
||||
return ("passed")
|
||||
result = True
|
||||
print("Client Connectivity :", self.staConnect.passes)
|
||||
if self.staConnect.passes():
|
||||
print("client connection to", self.staConnect.dut_ssid, "successful. Test Passed")
|
||||
else:
|
||||
client.update_testrail(case_id=test_case, run_id=rid, status_id=5, msg='Client connectivity failed')
|
||||
print("Single client connection to", self.staConnect.dut_ssid, "unsuccessful. Test Failed")
|
||||
logger.warning("Client connectivity to " + self.staConnect.dut_ssid + " FAILED")
|
||||
return ("failed")
|
||||
print("client connection to", self.staConnect.dut_ssid, "unsuccessful. Test Failed")
|
||||
result = False
|
||||
time.sleep(3)
|
||||
return self.staConnect.passes(), result
|
||||
|
||||
def Single_Client_EAP(self, port, sta_list, ssid_name, radio, security, eap_type,
|
||||
identity, ttls_password, test_case, rid, client, logger):
|
||||
@@ -68,7 +81,7 @@ class RunTest:
|
||||
eap_connect.eap = eap_type
|
||||
eap_connect.identity = identity
|
||||
eap_connect.ttls_passwd = ttls_password
|
||||
eap_connect.runtime_secs = 10
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
@@ -78,21 +91,11 @@ class RunTest:
|
||||
run_results = eap_connect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
result = True
|
||||
print("Single Client Connectivity :", eap_connect.passes)
|
||||
if eap_connect.passes() == True:
|
||||
if eap_connect.passes():
|
||||
print("Single client connection to", ssid_name, "successful. Test Passed")
|
||||
client.update_testrail(case_id=test_case, run_id=rid, status_id=1, msg='Client connectivity passed')
|
||||
logger.info("Client connectivity to " + ssid_name + " Passed")
|
||||
return ("passed")
|
||||
else:
|
||||
client.update_testrail(case_id=test_case, run_id=rid, status_id=5, msg='Client connectivity failed')
|
||||
print("Single client connection to", ssid_name, "unsuccessful. Test Failed")
|
||||
logger.warning("Client connectivity to " + ssid_name + " FAILED")
|
||||
return ("failed")
|
||||
|
||||
def testrail_retest(self, test_case, rid, ssid_name, client, logger):
|
||||
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)
|
||||
logger.warning("ERROR testing Client connectivity to " + ssid_name)
|
||||
result = False
|
||||
return self.staConnect.passes(), result
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class Reporting:
|
||||
|
||||
def __init__(self):
|
||||
self.rid = None
|
||||
pass
|
||||
|
||||
def update_testrail(self, case_id=None, run_id=None, status_id=1, msg=None):
|
||||
|
||||
@@ -27,6 +27,7 @@ class APIClient:
|
||||
self.user = tr_user
|
||||
self.password = tr_pw
|
||||
self.project = project
|
||||
self.rid = None
|
||||
if not base_url.endswith('/'):
|
||||
base_url += '/'
|
||||
self.__url = base_url + 'index.php?/api/v2/'
|
||||
@@ -148,9 +149,10 @@ class APIClient:
|
||||
break
|
||||
return run_id
|
||||
|
||||
def update_testrail(self, case_id, run_id, status_id, msg):
|
||||
def update_testrail(self, case_id, status_id, msg):
|
||||
"Update TestRail for a given run_id and case_id"
|
||||
update_flag = False
|
||||
run_id = self.rid
|
||||
# Get the TestRail client account details
|
||||
# Update the result in TestRail using send_post function.
|
||||
# Parameters for add_result_for_case is the combination of runid and case id.
|
||||
|
||||
@@ -1,17 +1,90 @@
|
||||
|
||||
CONFIGURATION = {
|
||||
"ext-03": {
|
||||
"basic-ext-03-01": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.0.0-SNAPSHOT',
|
||||
'commit_date': '2021-03-01'
|
||||
'version': "1.1.0-SNAPSHOT",
|
||||
'commit_date': "2021-04-27"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode' : "wifi5",
|
||||
'mode': "wifi5",
|
||||
'serial': '903cb3944807',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.230",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "ecw5410-2021-03-30-pending-9cb289b"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "localhost",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "eth1",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan1",
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
}
|
||||
},
|
||||
"basic-ext-03-02": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': "1.1.0-SNAPSHOT",
|
||||
'commit_date': "2021-04-27"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb394486f',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.233",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "ecw5410-2021-04-26-pending-3fc41fa"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.233",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "eth1",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan1",
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
}
|
||||
},
|
||||
"basic-ext-03-03": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': "1.1.0-SNAPSHOT",
|
||||
'commit_date': "2021-04-27"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb3944857',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.80",
|
||||
@@ -22,7 +95,7 @@ CONFIGURATION = {
|
||||
'version': "ecw5410-2021-04-26-pending-3fc41fa"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.80",
|
||||
@@ -30,94 +103,17 @@ CONFIGURATION = {
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "eth1",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan1",
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
}
|
||||
},
|
||||
"ext-04": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.0.0-SNAPSHOT',
|
||||
'commit_date': '2021-03-01'
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb394486f',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.81",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "ecw5410-2021-04-26-pending-3fc41fa"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.81",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "eth1",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan1",
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
}
|
||||
},
|
||||
"ext-05": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.0.0-SNAPSHOT',
|
||||
'commit_date': '2021-03-01'
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb3944817',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.82",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "ecw5410-2021-04-26-pending-3fc41fa"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.82",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "1.1.eth1",
|
||||
"uplink": "1.1.eth2",
|
||||
"upstream_subnet": "192.168.200.1/24",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan1",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
FIRMWARE = {
|
||||
# jFrog parameters
|
||||
"JFROG":
|
||||
@@ -132,7 +128,7 @@ FIRMWARE = {
|
||||
}
|
||||
|
||||
RADIUS_SERVER_DATA = {
|
||||
"ip": "192.168.200.75",
|
||||
"ip": "10.28.3.100",
|
||||
"port": 1812,
|
||||
"secret": "testing123",
|
||||
"user": "nolaradius",
|
||||
|
||||
@@ -3,6 +3,7 @@ import datetime
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import allure
|
||||
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
@@ -26,7 +27,19 @@ sys.path.append(
|
||||
)
|
||||
if "libs" not in sys.path:
|
||||
sys.path.append(f'../libs')
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
|
||||
sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
from apnos.apnos import APNOS
|
||||
from controller.controller import Controller
|
||||
from controller.controller import ProfileUtility
|
||||
@@ -39,7 +52,13 @@ from configuration import CONFIGURATION
|
||||
from configuration import FIRMWARE
|
||||
from testrails.testrail_api import APIClient
|
||||
from testrails.reporting import Reporting
|
||||
<<<<<<< HEAD
|
||||
from cv_test_manager import cv_test
|
||||
=======
|
||||
import sta_connect2
|
||||
from sta_connect2 import StaConnect2
|
||||
|
||||
>>>>>>> staging-wifi-1960
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addini("tr_url", "Test Rail URL")
|
||||
@@ -73,16 +92,10 @@ def pytest_addoption(parser):
|
||||
)
|
||||
# this has to be the last argument
|
||||
# example: --access-points ECW5410 EA8300-EU
|
||||
parser.addoption(
|
||||
"--model",
|
||||
# nargs="+",
|
||||
default="ecw5410",
|
||||
help="AP Model which is needed to test"
|
||||
)
|
||||
parser.addoption(
|
||||
"--testbed",
|
||||
# nargs="+",
|
||||
default="lab-info",
|
||||
default="basic-01",
|
||||
help="AP Model which is needed to test"
|
||||
)
|
||||
parser.addoption(
|
||||
@@ -133,9 +146,22 @@ Test session base fixture
|
||||
"""
|
||||
|
||||
|
||||
# To be depreciated as testrails will go
|
||||
@pytest.fixture(scope="session")
|
||||
def test_cases():
|
||||
yield TEST_CASES
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_jFrog():
|
||||
yield FIRMWARE["JFROG"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def testbed(request):
|
||||
var = request.config.getoption("--testbed")
|
||||
allure.attach(body=str(var),
|
||||
name="Testbed Selected : ")
|
||||
yield var
|
||||
|
||||
|
||||
@@ -149,57 +175,90 @@ def should_upgrade_firmware(request):
|
||||
yield request.config.getoption("--force-upgrade")
|
||||
|
||||
|
||||
"""
|
||||
Instantiate Objects for Test session
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_controller(request, testbed):
|
||||
try:
|
||||
sdk_client = Controller(controller_data=CONFIGURATION[testbed]["controller"])
|
||||
def radius_info():
|
||||
allure.attach(body=str(RADIUS_SERVER_DATA), name="Radius server Info: ")
|
||||
yield RADIUS_SERVER_DATA
|
||||
|
||||
def teardown_session():
|
||||
|
||||
# Get Configuration data f
|
||||
@pytest.fixture(scope="session")
|
||||
def get_configuration(testbed):
|
||||
allure.attach(body=str(testbed), name="Testbed Selected: ")
|
||||
yield CONFIGURATION[testbed]
|
||||
|
||||
|
||||
# APNOS Library
|
||||
@pytest.fixture(scope="session")
|
||||
def get_apnos():
|
||||
yield APNOS
|
||||
|
||||
|
||||
# APNOS SETUP
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_access_point(testbed, get_apnos, get_configuration):
|
||||
# Used to add openwrtctl.py in case of serial console mode
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
if access_point_info["jumphost"]:
|
||||
allure.attach(name="added openwrtctl.py to :",
|
||||
body=access_point_info['ip'] + ":" + str(access_point_info["port"]))
|
||||
get_apnos(access_point_info, pwd="../libs/apnos/")
|
||||
else:
|
||||
allure.attach(name="Direct AP SSH : ",
|
||||
body=access_point_info['ip'] + ":" + str(access_point_info["port"]))
|
||||
# Write a code to verify Access Point Connectivity
|
||||
yield True
|
||||
|
||||
|
||||
# Controller Fixture
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_controller(request, get_configuration, instantiate_access_point):
|
||||
try:
|
||||
sdk_client = Controller(controller_data=get_configuration["controller"])
|
||||
allure.attach(body=str(get_configuration["controller"]), name="Controller Instantiated: ")
|
||||
|
||||
def teardown_controller():
|
||||
print("\nTest session Completed")
|
||||
allure.attach(body=str(get_configuration["controller"]), name="Controller Teardown: ")
|
||||
sdk_client.disconnect_Controller()
|
||||
|
||||
request.addfinalizer(teardown_session)
|
||||
request.addfinalizer(teardown_controller)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(body=str(e), name="Controller Instantiation Failed: ")
|
||||
sdk_client = False
|
||||
yield sdk_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def instantiate_firmware(setup_controller, instantiate_jFrog, get_configuration):
|
||||
firmware_client_obj = []
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=setup_controller,
|
||||
model=access_point_info["model"],
|
||||
version=access_point_info["version"])
|
||||
firmware_client_obj.append(firmware_client)
|
||||
yield firmware_client_obj
|
||||
|
||||
|
||||
"""
|
||||
Instantiate Reporting
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_testrail(request):
|
||||
def update_report(request, testbed, get_configuration):
|
||||
if request.config.getoption("--skip-testrail"):
|
||||
tr_client = Reporting()
|
||||
else:
|
||||
tr_client = APIClient(request.config.getini("tr_url"), request.config.getini("tr_user"),
|
||||
request.config.getini("tr_pass"), request.config.getini("tr_project_id"))
|
||||
yield tr_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_firmware(instantiate_controller, instantiate_jFrog, testbed):
|
||||
firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_controller,
|
||||
model=CONFIGURATION[testbed]["access_point"][0]["model"],
|
||||
version=CONFIGURATION[testbed]["access_point"][0]["version"])
|
||||
yield firmware_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_jFrog():
|
||||
yield FIRMWARE["JFROG"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_project(request, instantiate_testrail, testbed, get_latest_firmware):
|
||||
if request.config.getoption("--skip-testrail"):
|
||||
rid = "skip testrails"
|
||||
tr_client.rid = "skip testrails"
|
||||
else:
|
||||
projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
projId = tr_client.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
test_run_name = request.config.getini("tr_prefix") + testbed + "_" + str(
|
||||
<<<<<<< HEAD
|
||||
datetime.date.today()) + "_" + get_latest_firmware
|
||||
instantiate_testrail.create_testrun(name=test_run_name, case_ids=list(TEST_CASES.values()), project_id=projId,
|
||||
milestone_id=request.config.getini("milestone"),
|
||||
@@ -279,41 +338,27 @@ def access_point_connectivity(apnos_obj, get_configuration, testbed):
|
||||
else:
|
||||
ap_conn["mgr"] = True
|
||||
yield ap_conn
|
||||
=======
|
||||
datetime.date.today()) + "_" + get_configuration['access_point'][0]['version']
|
||||
tr_client.create_testrun(name=test_run_name, case_ids=list(TEST_CASES.values()), project_id=projId,
|
||||
milestone_id=request.config.getini("milestone"),
|
||||
description="Automated Nightly Sanity test run for new firmware build")
|
||||
rid = tr_client.get_run_id(test_run_name=test_run_name)
|
||||
tr_client.rid = rid
|
||||
yield tr_client
|
||||
|
||||
>>>>>>> staging-wifi-1960
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_profile_data(testbed):
|
||||
model = CONFIGURATION[testbed]["access_point"][0]["model"]
|
||||
profile_data = {}
|
||||
for mode in "BRIDGE", "NAT", "VLAN":
|
||||
profile_data[mode] = {}
|
||||
for security in "OPEN", "WPA", "WPA2_P", "WPA2_E", "WEP":
|
||||
profile_data[mode][security] = {}
|
||||
for radio in "2G", "5G":
|
||||
profile_data[mode][security][radio] = {}
|
||||
name_string = f"{'Sanity'}-{testbed}-{model}-{radio}_{security}_{mode}"
|
||||
ssid_name = f"{'Sanity'}-{model}-{radio}_{security}_{mode}"
|
||||
passkey_string = f"{radio}-{security}_{mode}"
|
||||
profile_data[mode][security][radio]["profile_name"] = name_string
|
||||
profile_data[mode][security][radio]["ssid_name"] = ssid_name
|
||||
if mode == "VLAN":
|
||||
profile_data[mode][security][radio]["vlan"] = 100
|
||||
else:
|
||||
profile_data[mode][security][radio]["vlan"] = 1
|
||||
if mode != "NAT":
|
||||
profile_data[mode][security][radio]["mode"] = "BRIDGE"
|
||||
else:
|
||||
profile_data[mode][security][radio]["mode"] = "NAT"
|
||||
if security != "OPEN":
|
||||
profile_data[mode][security][radio]["security_key"] = passkey_string
|
||||
else:
|
||||
profile_data[mode][security][radio]["security_key"] = "[BLANK]"
|
||||
yield profile_data
|
||||
"""
|
||||
FRAMEWORK MARKER LOGIC
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_security_flags():
|
||||
security = ["open", "wpa", "wpa2_personal", "wpa2_enterprise", "twog", "fiveg", "radius"]
|
||||
# Add more classifications as we go
|
||||
security = ["open", "wpa", "wpa2_personal", "wpa2_enterprise", "wpa3_enterprise", "twog", "fiveg", "radius"]
|
||||
yield security
|
||||
|
||||
|
||||
@@ -333,32 +378,34 @@ def get_markers(request, get_security_flags):
|
||||
else:
|
||||
security_dict[i] = False
|
||||
# print(security_dict)
|
||||
allure.attach(body=str(security_dict), name="Test Cases Requires: ")
|
||||
yield security_dict
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_latest_firmware(instantiate_firmware):
|
||||
try:
|
||||
latest_firmware = instantiate_firmware.get_fw_version()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
latest_firmware = False
|
||||
yield latest_firmware
|
||||
|
||||
|
||||
# Will be availabe as a test case
|
||||
@pytest.fixture(scope="function")
|
||||
def check_ap_firmware_ssh(testbed):
|
||||
try:
|
||||
ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0])
|
||||
active_fw = ap_ssh.get_active_firmware()
|
||||
print(active_fw)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
active_fw = False
|
||||
yield active_fw
|
||||
def test_access_point(testbed, get_apnos, get_configuration):
|
||||
mgr_status = []
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(access_point_info)
|
||||
ap_ssh.reboot()
|
||||
time.sleep(100)
|
||||
status = ap_ssh.get_manager_state()
|
||||
if "ACTIVE" not in status:
|
||||
time.sleep(30)
|
||||
ap_ssh = APNOS(access_point_info)
|
||||
status = ap_ssh.get_manager_state()
|
||||
mgr_status.append(status)
|
||||
yield mgr_status
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def client_connectivity():
|
||||
yield StaConnect2
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
<<<<<<< HEAD
|
||||
def radius_info():
|
||||
yield RADIUS_SERVER_DATA
|
||||
|
||||
@@ -366,3 +413,22 @@ def radius_info():
|
||||
@pytest.fixture(scope="session")
|
||||
def get_configuration(testbed):
|
||||
yield CONFIGURATION[testbed]
|
||||
=======
|
||||
def get_lanforge_data(get_configuration):
|
||||
lanforge_data = {}
|
||||
if get_configuration['traffic_generator']['name'] == 'lanforge':
|
||||
lanforge_data = {
|
||||
"lanforge_ip": get_configuration['traffic_generator']['details']['ip'],
|
||||
"lanforge-port-number": get_configuration['traffic_generator']['details']['port'],
|
||||
"lanforge_2dot4g": get_configuration['traffic_generator']['details']['2.4G-Radio'][0],
|
||||
"lanforge_5g": get_configuration['traffic_generator']['details']['5G-Radio'][0],
|
||||
"lanforge_2dot4g_prefix": get_configuration['traffic_generator']['details']['2.4G-Station-Name'],
|
||||
"lanforge_5g_prefix": get_configuration['traffic_generator']['details']['5G-Station-Name'],
|
||||
"lanforge_2dot4g_station": get_configuration['traffic_generator']['details']['2.4G-Station-Name'],
|
||||
"lanforge_5g_station": get_configuration['traffic_generator']['details']['5G-Station-Name'],
|
||||
"lanforge_bridge_port": get_configuration['traffic_generator']['details']['upstream'],
|
||||
"lanforge_vlan_port": get_configuration['traffic_generator']['details']['upstream'] + ".100",
|
||||
"vlan": 100
|
||||
}
|
||||
yield lanforge_data
|
||||
>>>>>>> staging-wifi-1960
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
"""
|
||||
Test Case Module: setup test cases for basic test cases
|
||||
Details: Firmware Upgrade
|
||||
@@ -109,3 +110,86 @@ def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_tes
|
||||
|
||||
assert check_ap_firmware_ssh == get_latest_firmware
|
||||
|
||||
=======
|
||||
# """
|
||||
# Test Case Module: setup test cases for basic test cases
|
||||
# Details: Firmware Upgrade
|
||||
#
|
||||
# """
|
||||
# import pytest
|
||||
#
|
||||
# @pytest.mark.configure_lanforge
|
||||
# def test_configure_lanforge(configure_lanforge):
|
||||
#
|
||||
# assert True
|
||||
#
|
||||
#
|
||||
# @pytest.mark.sanity
|
||||
# @pytest.mark.bridge
|
||||
# @pytest.mark.nat
|
||||
# @pytest.mark.vlan
|
||||
# @pytest.mark.firmware
|
||||
# class TestFirmware(object):
|
||||
#
|
||||
# @pytest.mark.firmware_create
|
||||
# def test_firmware_create(self, upload_firmware, instantiate_testrail, instantiate_project, test_cases):
|
||||
# if upload_firmware != 0:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='Create new FW version by API successful')
|
||||
# PASS = True
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
|
||||
# status_id=5,
|
||||
# msg='Error creating new FW version by API')
|
||||
# PASS = False
|
||||
# assert PASS
|
||||
#
|
||||
# @pytest.mark.firmware_upgrade
|
||||
# def test_firmware_upgrade_request(self, upgrade_firmware, instantiate_testrail, instantiate_project, test_cases):
|
||||
# print()
|
||||
# if not upgrade_firmware:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
|
||||
# status_id=0,
|
||||
# msg='Error requesting upgrade via API')
|
||||
# PASS = False
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='Upgrade request using API successful')
|
||||
# PASS = True
|
||||
# assert PASS
|
||||
#
|
||||
# @pytest.mark.check_active_firmware_cloud
|
||||
# def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, instantiate_testrail,
|
||||
# instantiate_project, test_cases):
|
||||
# if get_latest_firmware != check_ap_firmware_cloud:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
|
||||
# status_id=5,
|
||||
# msg='CLOUDSDK reporting incorrect firmware version.')
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='CLOUDSDK reporting correct firmware version.')
|
||||
#
|
||||
# assert get_latest_firmware == check_ap_firmware_cloud
|
||||
#
|
||||
#
|
||||
# @pytest.mark.sanity
|
||||
# @pytest.mark.bridge
|
||||
# @pytest.mark.nat
|
||||
# @pytest.mark.vlan
|
||||
# @pytest.mark.check_active_firmware_ap
|
||||
# def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_testrail, instantiate_project,
|
||||
# test_cases):
|
||||
# if check_ap_firmware_ssh == get_latest_firmware:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='Upgrade to ' + get_latest_firmware + ' successful')
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
|
||||
# status_id=4,
|
||||
# msg='Cannot reach AP after upgrade to check CLI - re-test required')
|
||||
#
|
||||
# assert check_ap_firmware_ssh == get_latest_firmware
|
||||
>>>>>>> staging-wifi-1960
|
||||
|
||||
@@ -1,31 +1,5 @@
|
||||
"""
|
||||
conftest.py : Contains fixtures that are specific to basic testbed environment
|
||||
|
||||
Basic Test Scenario : 1 AP, 1 LANforge, 1 Controller Instance
|
||||
|
||||
Includes:
|
||||
|
||||
Setup:
|
||||
setup_profiles
|
||||
create_profiles
|
||||
|
||||
Utilities:
|
||||
update_ssid
|
||||
|
||||
Information:
|
||||
Setup Fixtures: Every Test case Needs to use setup fixtures
|
||||
Setup Fixtures can be customised for all different levels of execution:
|
||||
session level
|
||||
package level
|
||||
module level
|
||||
class level
|
||||
function level
|
||||
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import sys
|
||||
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
@@ -49,11 +23,11 @@ sys.path.append(
|
||||
if "libs" not in sys.path:
|
||||
sys.path.append(f'../libs')
|
||||
|
||||
from apnos.apnos import APNOS
|
||||
from controller.controller import Controller
|
||||
from controller.controller import ProfileUtility
|
||||
from controller.controller import FirmwareUtility
|
||||
import time
|
||||
from lanforge.lf_tests import RunTest
|
||||
import pytest
|
||||
|
||||
import logging
|
||||
from configuration import RADIUS_SERVER_DATA
|
||||
from configuration import TEST_CASES
|
||||
@@ -61,7 +35,7 @@ from configuration import CONFIGURATION
|
||||
from configuration import FIRMWARE
|
||||
from testrails.testrail_api import APIClient
|
||||
from testrails.reporting import Reporting
|
||||
|
||||
import allure
|
||||
from cv_test_manager import cv_test
|
||||
from create_chamberview import CreateChamberview
|
||||
from create_chamberview_dut import DUT
|
||||
@@ -101,223 +75,313 @@ def instantiate_profile(instantiate_controller):
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_equipment_id(instantiate_controller, testbed):
|
||||
def get_equipment_id(setup_controller, testbed, get_configuration):
|
||||
equipment_id = 0
|
||||
if len(CONFIGURATION[testbed]['access_point']) == 1:
|
||||
equipment_id = instantiate_controller.get_equipment_id(
|
||||
serial_number=CONFIGURATION[testbed]['access_point'][0]['serial'])
|
||||
if len(get_configuration['access_point']) == 1:
|
||||
equipment_id = setup_controller.get_equipment_id(
|
||||
serial_number=get_configuration['access_point'][0]['serial'])
|
||||
print(equipment_id)
|
||||
yield equipment_id
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def upload_firmware(should_upload_firmware, instantiate_firmware, get_latest_firmware):
|
||||
firmware_id = instantiate_firmware.upload_fw_on_cloud(fw_version=get_latest_firmware,
|
||||
force_upload=should_upload_firmware)
|
||||
yield firmware_id
|
||||
def instantiate_profile():
|
||||
yield ProfileUtility
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware,
|
||||
should_upgrade_firmware):
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
if request.config.getoption("--skip-upgrade"):
|
||||
status = "skip-upgrade"
|
||||
else:
|
||||
status = instantiate_firmware.upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
else:
|
||||
if should_upgrade_firmware:
|
||||
status = instantiate_firmware.upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
else:
|
||||
status = "skip-upgrade"
|
||||
yield status
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_vlan():
|
||||
vlan_id = [100]
|
||||
allure.attach(body=str(vlan_id), name="VLAN Created: ")
|
||||
yield vlan_id[0]
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def check_ap_firmware_cloud(instantiate_controller, get_equipment_id):
|
||||
yield instantiate_controller.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Profiles Related Fixtures
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def get_current_profile_cloud(instantiate_profile):
|
||||
ssid_names = []
|
||||
for i in instantiate_profile.profile_creation_ids["ssid"]:
|
||||
ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i))
|
||||
yield ssid_names
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def setup_profiles(request, create_profiles, instantiate_profile, get_equipment_id, get_current_profile_cloud, testbed):
|
||||
@allure.feature("CLIENT CONNECTIVITY SETUP")
|
||||
@pytest.fixture(scope="class")
|
||||
def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment_id,
|
||||
instantiate_profile, get_markers,
|
||||
get_security_flags, get_configuration, radius_info, get_apnos):
|
||||
instantiate_profile = instantiate_profile(sdk_client=setup_controller)
|
||||
vlan_id, mode = 0, 0
|
||||
instantiate_profile.cleanup_objects()
|
||||
parameter = dict(request.param)
|
||||
test_cases = {}
|
||||
mode = str(request.param[0]).lower()
|
||||
profile_data = {}
|
||||
if parameter['mode'] not in ["BRIDGE", "NAT", "VLAN"]:
|
||||
print("Invalid Mode: ", parameter['mode'])
|
||||
allure.attach(body=parameter['mode'], name="Invalid Mode: ")
|
||||
yield test_cases
|
||||
|
||||
if parameter['mode'] == "NAT":
|
||||
mode = "NAT"
|
||||
vlan_id = 1
|
||||
if parameter['mode'] == "BRIDGE":
|
||||
mode = "BRIDGE"
|
||||
vlan_id = 1
|
||||
if parameter['mode'] == "VLAN":
|
||||
mode = "BRIDGE"
|
||||
vlan_id = setup_vlan
|
||||
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Equipment-AP-" + parameter['mode'])
|
||||
|
||||
profile_data["equipment_ap"] = {"profile_name": testbed + "-Equipment-AP-" + parameter['mode']}
|
||||
profile_data["ssid"] = {}
|
||||
for i in parameter["ssid_modes"]:
|
||||
profile_data["ssid"][i] = []
|
||||
for j in range(len(parameter["ssid_modes"][i])):
|
||||
profile_name = testbed + "-SSID-" + i + "-" + str(j) + "-" + parameter['mode']
|
||||
data = parameter["ssid_modes"][i][j]
|
||||
data["profile_name"] = profile_name
|
||||
if "mode" not in dict(data).keys():
|
||||
data["mode"] = mode
|
||||
if "vlan" not in dict(data).keys():
|
||||
data["vlan"] = vlan_id
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
profile_data["ssid"][i].append(data)
|
||||
# print(profile_name)
|
||||
# print(profile_data)
|
||||
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + mode)
|
||||
time.sleep(10)
|
||||
"""
|
||||
Setting up rf profile
|
||||
"""
|
||||
rf_profile_data = {
|
||||
"name": "RF-Profile-" + testbed + "-" + parameter['mode'] + "-" +
|
||||
get_configuration['access_point'][0]['mode']
|
||||
}
|
||||
|
||||
for i in parameter["rf"]:
|
||||
rf_profile_data[i] = parameter['rf'][i]
|
||||
# print(rf_profile_data)
|
||||
|
||||
try:
|
||||
instantiate_profile.delete_profile_by_name(profile_name=rf_profile_data['name'])
|
||||
instantiate_profile.set_rf_profile(profile_data=rf_profile_data,
|
||||
mode=get_configuration['access_point'][0]['mode'])
|
||||
allure.attach(body=str(rf_profile_data),
|
||||
name="RF Profile Created : " + get_configuration['access_point'][0]['mode'])
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(body=str(e), name="Exception ")
|
||||
|
||||
# Radius Profile Creation
|
||||
if parameter["radius"]:
|
||||
radius_info = radius_info
|
||||
radius_info["name"] = testbed + "-Automation-Radius-Profile-" + testbed
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + testbed)
|
||||
try:
|
||||
# pass
|
||||
instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
allure.attach(body=str(radius_info),
|
||||
name="Radius Profile Created")
|
||||
test_cases['radius_profile'] = True
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases['radius_profile'] = False
|
||||
|
||||
# SSID Profile Creation
|
||||
print(get_markers)
|
||||
for mode in profile_data['ssid']:
|
||||
if mode == "open":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
|
||||
test_cases["open_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["open_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
|
||||
test_cases["open_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["open_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa_ssid_profile(profile_data=j)
|
||||
test_cases["wpa_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa_ssid_profile(profile_data=j)
|
||||
test_cases["wpa_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
if mode == "wpa2_personal":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_personal_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa2_personal_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_personal_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa2_personal_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa3_personal":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa3_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_personal_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_personal_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa3_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_personal_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_personal_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa2_enterprise":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_enterprise_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa2_enterprise_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_enterprise_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa2_enterprise_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa3_enterprise":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa3_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_enterprise_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_enterprise_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa3_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_enterprise_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_enterprise_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
# Equipment AP Profile Creation
|
||||
try:
|
||||
instantiate_profile.set_ap_profile(profile_data=profile_data['equipment_ap'])
|
||||
test_cases["equipment_ap"] = True
|
||||
allure.attach(body=str(profile_data['equipment_ap']),
|
||||
name="Equipment AP Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["equipment_ap"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="Equipment AP Profile Creation Failed")
|
||||
|
||||
# Push the Equipment AP Profile to AP
|
||||
try:
|
||||
instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("failed to Push Profile")
|
||||
ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0], pwd="../libs/apnos/")
|
||||
get_current_profile_cloud.sort()
|
||||
# This loop will check the VIF Config with cloud profile
|
||||
for i in range(0, 18):
|
||||
vif_config = list(ap_ssh.get_vif_config_ssids())
|
||||
vif_config.sort()
|
||||
print(vif_config)
|
||||
print(get_current_profile_cloud)
|
||||
if get_current_profile_cloud == vif_config:
|
||||
test_cases[mode + '_vifc'] = True
|
||||
break
|
||||
time.sleep(10)
|
||||
ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0], pwd="../libs/apnos/")
|
||||
# This loop will check the VIF Config with VIF State
|
||||
for i in range(0, 18):
|
||||
vif_state = list(ap_ssh.get_vif_state_ssids())
|
||||
vif_state.sort()
|
||||
vif_config = list(ap_ssh.get_vif_config_ssids())
|
||||
vif_config.sort()
|
||||
print(vif_config)
|
||||
print(vif_state)
|
||||
if vif_state == vif_config:
|
||||
test_cases[mode + '_vifs'] = True
|
||||
break
|
||||
time.sleep(10)
|
||||
#
|
||||
yield test_cases
|
||||
print("failed to create AP Profile")
|
||||
|
||||
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
|
||||
ssid_names = []
|
||||
for i in instantiate_profile.profile_creation_ids["ssid"]:
|
||||
ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i))
|
||||
ssid_names.sort()
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def create_profiles(request, testbed, get_security_flags, get_markers, instantiate_profile, setup_profile_data):
|
||||
profile_id = {"ssid": [], "rf": None, "radius": None, "equipment_ap": None}
|
||||
mode = str(request.param[0])
|
||||
test_cases = {}
|
||||
if mode not in ["BRIDGE", "NAT", "VLAN"]:
|
||||
print("Invalid Mode: ", mode)
|
||||
yield False
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Equipment-AP-" + mode)
|
||||
for i in setup_profile_data[mode]:
|
||||
for j in setup_profile_data[mode][i]:
|
||||
instantiate_profile.delete_profile_by_name(
|
||||
profile_name=setup_profile_data[mode][i][j]['profile_name'])
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + mode)
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile_data = {
|
||||
"name": "RF-Profile-" + CONFIGURATION[testbed]['access_point'][0]['mode'] +
|
||||
CONFIGURATION[testbed]['access_point'][0]['model'] + "_" + mode + "_" + testbed
|
||||
}
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_data['name'])
|
||||
instantiate_profile.set_rf_profile(profile_data=profile_data,
|
||||
mode=CONFIGURATION[testbed]['access_point'][0]['mode'])
|
||||
# Create RF Profile Here
|
||||
if get_markers["radius"]:
|
||||
radius_info = RADIUS_SERVER_DATA
|
||||
radius_info["name"] = testbed + "-Automation-Radius-Profile-" + mode
|
||||
try:
|
||||
instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
test_cases['radius_profile'] = True
|
||||
except Exception as e:
|
||||
test_cases['radius_profile'] = False
|
||||
for i in get_security_flags:
|
||||
if get_markers[i] and i == "open":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["OPEN"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_open_ssid_profile(two4g=True, fiveg=False,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_open_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_2g_open_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["OPEN"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_open_ssid_profile(two4g=False, fiveg=True,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_open_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_5g_open_' + mode.lower()] = False
|
||||
if get_markers[i] and i == "wpa":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa_ssid_profile(two4g=True, fiveg=False, profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_wpa_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_5g_wpa_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa_ssid_profile(two4g=False, fiveg=True, profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_wpa_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_5g_wpa_' + mode.lower()] = False
|
||||
if get_markers[i] and i == "wpa2_personal":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_P"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_personal_ssid_profile(two4g=True, fiveg=False,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_wpa2_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_2g_wpa2_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_P"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_personal_ssid_profile(two4g=False, fiveg=True,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_wpa2_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_5g_wpa2_' + mode.lower()] = False
|
||||
if get_markers[i] and i == "wpa2_enterprise":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_E"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_enterprise_ssid_profile(two4g=True, fiveg=False,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_eap_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_2g_eap_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_E"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_enterprise_ssid_profile(two4g=False, fiveg=True,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_eap_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_5g_eap_' + mode.lower()] = False
|
||||
|
||||
# Create Equipment AP Profile Here
|
||||
profile_data = {
|
||||
"profile_name": testbed + "-Equipment-AP-" + mode
|
||||
}
|
||||
try:
|
||||
instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
test_cases['ap_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases['ap_' + mode.lower()] = False
|
||||
|
||||
def teardown_profiles():
|
||||
print("\nRemoving Profiles")
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_data['profile_name'])
|
||||
time.sleep(20)
|
||||
|
||||
request.addfinalizer(teardown_profiles)
|
||||
yield test_cases
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@@ -385,3 +449,9 @@ def create_lanforge_chamberview_dut(get_configuration, testbed):
|
||||
)
|
||||
dut.setup()
|
||||
yield dut
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def lf_test(get_configuration):
|
||||
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'])
|
||||
yield obj
|
||||
|
||||
|
||||
81
tests/e2e/basic/test_firmware.py
Normal file
81
tests/e2e/basic/test_firmware.py
Normal file
@@ -0,0 +1,81 @@
|
||||
"""
|
||||
Test Case Module: setup test cases for basic test cases
|
||||
Details: Firmware Upgrade
|
||||
|
||||
"""
|
||||
import pytest
|
||||
|
||||
@pytest.mark.configure_lanforge
|
||||
def test_configure_lanforge(configure_lanforge):
|
||||
|
||||
assert True
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.bridge
|
||||
@pytest.mark.nat
|
||||
@pytest.mark.vlan
|
||||
@pytest.mark.firmware
|
||||
class TestFirmware(object):
|
||||
|
||||
@pytest.mark.firmware_create
|
||||
def test_firmware_create(self, upload_firmware, instantiate_testrail, instantiate_project, test_cases):
|
||||
if upload_firmware != 0:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='Create new FW version by API successful')
|
||||
PASS = True
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Error creating new FW version by API')
|
||||
PASS = False
|
||||
assert PASS
|
||||
|
||||
@pytest.mark.firmware_upgrade
|
||||
def test_firmware_upgrade_request(self, upgrade_firmware, instantiate_testrail, instantiate_project, test_cases):
|
||||
print()
|
||||
if not upgrade_firmware:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
|
||||
status_id=0,
|
||||
msg='Error requesting upgrade via API')
|
||||
PASS = False
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='Upgrade request using API successful')
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
@pytest.mark.check_active_firmware_cloud
|
||||
def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, instantiate_testrail,
|
||||
instantiate_project, test_cases):
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='CLOUDSDK reporting incorrect firmware version.')
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='CLOUDSDK reporting correct firmware version.')
|
||||
|
||||
assert get_latest_firmware == check_ap_firmware_cloud
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.bridge
|
||||
@pytest.mark.nat
|
||||
@pytest.mark.vlan
|
||||
@pytest.mark.check_active_firmware_ap
|
||||
def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
if check_ap_firmware_ssh == get_latest_firmware:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='Upgrade to ' + get_latest_firmware + ' successful')
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
|
||||
status_id=4,
|
||||
msg='Cannot reach AP after upgrade to check CLI - re-test required')
|
||||
|
||||
assert check_ap_firmware_ssh == get_latest_firmware
|
||||
6
tests/e2e/basic/test_something.py
Normal file
6
tests/e2e/basic/test_something.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.test_lanforge_connectivity
|
||||
def test_cv(create_lanforge_chamberview):
|
||||
assert True
|
||||
@@ -0,0 +1,266 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.basic
|
||||
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeConnectivity(object):
|
||||
|
||||
@pytest.mark.configuration
|
||||
def test_basic_configuration(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, request, setup_profiles, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_open_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
def test_wpa_ssid_2g(self, request, get_lanforge_data, update_report,
|
||||
lf_test, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, request, lf_test, update_report, test_cases, get_lanforge_data):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, request, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, request, get_lanforge_data, update_report, test_cases, lf_test):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="package"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, ):
|
||||
# print(setup_client_connectivity)
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self):
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self):
|
||||
# print(setup_client_connectivity)
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self):
|
||||
assert "setup_client_connectivity"
|
||||
@@ -0,0 +1,260 @@
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestNATModeConnectivity(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, request, setup_profiles, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_open_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
def test_wpa_ssid_2g(self, request, get_lanforge_data, update_report,
|
||||
lf_test, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, request, lf_test, update_report, test_cases, get_lanforge_data):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, request, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, request, get_lanforge_data, update_report, test_cases, lf_test):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="package"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestNATModeEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self):
|
||||
# print(setup_client_connectivity)
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self):
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self):
|
||||
# print(setup_client_connectivity)
|
||||
assert "setup_client_connectivity"
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self):
|
||||
assert "setup_client_connectivity"
|
||||
@@ -0,0 +1,261 @@
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.feature("VLAN MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeConnectivity(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, request, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_open_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
def test_wpa_ssid_2g(self, request, get_lanforge_data, update_report,
|
||||
lf_test, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, request, lf_test, update_report, test_cases, get_lanforge_data):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, request, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, request, get_lanforge_data, update_report, test_cases, lf_test):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
# setup_params_enterprise = {
|
||||
# "mode": "BRIDGE",
|
||||
# "ssid_modes": {
|
||||
# "wpa2_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
# {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
# "security_key": "something"}],
|
||||
# "wpa3_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
#
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
#
|
||||
# [setup_params_enterprise],
|
||||
# indirect=True,
|
||||
# scope="package"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestBridgeModeEnterprise(object):
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa2_enterprise_2g(self, ):
|
||||
# # print(setup_client_connectivity)
|
||||
# assert "setup_client_connectivity"
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa2_enterprise_5g(self):
|
||||
# assert "setup_client_connectivity"
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self):
|
||||
# # print(setup_client_connectivity)
|
||||
# assert "setup_client_connectivity"
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self):
|
||||
# assert "setup_client_connectivity"
|
||||
@@ -4,7 +4,7 @@ norecursedirs = .svn _build tmp*
|
||||
addopts= --junitxml=test_everything.xml
|
||||
log_format = %(asctime)s %(levelname)s %(message)s
|
||||
log_date_format = %Y-%m-%d %H:%M:%S
|
||||
|
||||
;norecursedirs=out build
|
||||
num_stations=1
|
||||
|
||||
# Cloud SDK settings
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
"""
|
||||
Test Case Module: Testing Basic Connectivity with Resources
|
||||
Mode: BRIDGE
|
||||
|
||||
"""
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
<<<<<<< HEAD
|
||||
pytestmark = [pytest.mark.test_connectivity]
|
||||
|
||||
|
||||
@@ -51,3 +49,49 @@ def test_access_points_connectivity(access_point_connectivity, instantiate_testr
|
||||
@pytest.mark.test_lanforge_connectivity
|
||||
def test_lanforge_connectiity(check_lanforge_connectivity):
|
||||
assert True
|
||||
=======
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.test_resources]
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@allure.testcase(name="Test Resources", url="")
|
||||
class TestResources(object):
|
||||
|
||||
@pytest.mark.test_cloud_controller
|
||||
@allure.testcase(name="test_controller_connectivity", url="")
|
||||
def test_controller_connectivity(self, setup_controller, update_report, test_cases):
|
||||
if setup_controller.bearer:
|
||||
allure.attach(name="Controller Connectivity Success", body="")
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=1, msg='Read CloudSDK version from API successfully')
|
||||
else:
|
||||
allure.attach(name="Controller Connectivity Failed", body="")
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=0, msg='Could not read CloudSDK version from API')
|
||||
pytest.exit("Resource Not Available")
|
||||
print(setup_controller.bearer)
|
||||
assert setup_controller.bearer
|
||||
|
||||
@pytest.mark.test_access_points_connectivity
|
||||
@allure.testcase(name="test_access_points_connectivity", url="")
|
||||
def test_access_points_connectivity(self, test_access_point, update_report, test_cases):
|
||||
print(test_access_point)
|
||||
# if "ACTIVE" not in test_access_point:
|
||||
# allure.attach(name="Access Point Connectivity Success", body=str(test_access_point))
|
||||
# update_report.update_testrail(case_id=test_cases["cloud_connection"],
|
||||
# status_id=5,
|
||||
# msg='CloudSDK connectivity failed')
|
||||
#
|
||||
# sys.exit()
|
||||
# else:
|
||||
# allure.attach(name="Access Point Connectivity Failed", body=str(test_access_point))
|
||||
# update_report.update_testrail(case_id=test_cases["cloud_connection"],
|
||||
# status_id=1,
|
||||
# msg='Manager status is Active')
|
||||
#
|
||||
# assert "ACTIVE" in test_access_point
|
||||
assert True
|
||||
>>>>>>> staging-wifi-1960
|
||||
|
||||
Reference in New Issue
Block a user