mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-01 19:37:54 +00:00
new sanity with all security modes except tls and wep
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
@@ -87,8 +87,9 @@ class Controller(ConfigureController):
|
||||
self.login_client = swagger_client.LoginApi(api_client=self.api_client)
|
||||
self.bearer = False
|
||||
self.disconnect = False
|
||||
self.semaphore = False
|
||||
self.start_time = time.time()
|
||||
try:
|
||||
|
||||
self.bearer = self.get_bearer_token()
|
||||
# t1 = threading.Thread(target=self.refresh_instance)
|
||||
# t1.start()
|
||||
@@ -114,41 +115,34 @@ class Controller(ConfigureController):
|
||||
return self.login_client.get_access_token(request_body)
|
||||
|
||||
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()
|
||||
|
||||
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
|
||||
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")
|
||||
if (time.time() - self.start_time) >= 500:
|
||||
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.start_time = time.time()
|
||||
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
|
||||
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")
|
||||
# self.semaphore = False
|
||||
|
||||
def portal_ping(self):
|
||||
self.refresh_instance()
|
||||
return self.login_client.portal_ping()
|
||||
|
||||
def disconnect_Controller(self):
|
||||
self.refresh_instance()
|
||||
self.disconnect = True
|
||||
self.api_client.__del__()
|
||||
|
||||
@@ -158,13 +152,14 @@ class Controller(ConfigureController):
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": """ + str(max_items) + """
|
||||
}"""
|
||||
|
||||
self.refresh_instance()
|
||||
equipment_data = self.equipment_client.get_equipment_by_customer_id(customer_id=self.customer_id,
|
||||
pagination_context=pagination_context)
|
||||
return equipment_data._items
|
||||
|
||||
# check if equipment with the given equipment_id is available in cloud instance or not
|
||||
def validate_equipment_availability(self, equipment_id=None):
|
||||
self.refresh_instance()
|
||||
data = self.get_equipment_by_customer_id()
|
||||
for i in data:
|
||||
if i._id == equipment_id:
|
||||
@@ -173,10 +168,12 @@ class Controller(ConfigureController):
|
||||
|
||||
# Need to be added in future
|
||||
def request_ap_reboot(self):
|
||||
self.refresh_instance()
|
||||
pass
|
||||
|
||||
# Get the equipment id, of a equipment with a serial number
|
||||
def get_equipment_id(self, serial_number=None):
|
||||
self.refresh_instance()
|
||||
equipment_data = self.get_equipment_by_customer_id(max_items=100)
|
||||
# print(len(equipment_data))
|
||||
for equipment in equipment_data:
|
||||
@@ -185,6 +182,7 @@ class Controller(ConfigureController):
|
||||
|
||||
# Get the equipment model name of a given equipment_id
|
||||
def get_model_name(self, equipment_id=None):
|
||||
self.refresh_instance()
|
||||
if equipment_id is None:
|
||||
return None
|
||||
data = self.equipment_client.get_equipment_by_id(equipment_id=equipment_id)
|
||||
@@ -193,13 +191,14 @@ class Controller(ConfigureController):
|
||||
|
||||
# Needs Bug fix from swagger code generation side
|
||||
def get_ap_firmware_new_method(self, equipment_id=None):
|
||||
|
||||
self.refresh_instance()
|
||||
response = self.status_client.get_status_by_customer_equipment(customer_id=self.customer_id,
|
||||
equipment_id=equipment_id)
|
||||
print(response[2])
|
||||
|
||||
# Old Method, will be depreciated in future
|
||||
def get_ap_firmware_old_method(self, equipment_id=None):
|
||||
self.refresh_instance()
|
||||
url = self.configuration.host + "/portal/status/forEquipment?customerId=" + str(
|
||||
self.customer_id) + "&equipmentId=" + str(equipment_id)
|
||||
payload = {}
|
||||
@@ -224,11 +223,13 @@ class Controller(ConfigureController):
|
||||
"""
|
||||
|
||||
def get_current_profile_on_equipment(self, equipment_id=None):
|
||||
self.refresh_instance()
|
||||
default_equipment_data = self.equipment_client.get_equipment_by_id(equipment_id=equipment_id, async_req=False)
|
||||
return default_equipment_data._profile_id
|
||||
|
||||
# Get the ssid's that are used by the equipment
|
||||
def get_ssids_on_equipment(self, equipment_id=None):
|
||||
self.refresh_instance()
|
||||
profile_id = self.get_current_profile_on_equipment(equipment_id=equipment_id)
|
||||
all_profiles = self.profile_client.get_profile_with_children(profile_id=profile_id)
|
||||
ssid_name_list = []
|
||||
@@ -239,6 +240,7 @@ class Controller(ConfigureController):
|
||||
|
||||
# Get the child ssid profiles that are used by equipment ap profile of given profile id
|
||||
def get_ssid_profiles_from_equipment_profile(self, profile_id=None):
|
||||
self.refresh_instance()
|
||||
equipment_ap_profile = self.profile_client.get_profile_by_id(profile_id=profile_id)
|
||||
ssid_name_list = []
|
||||
child_profile_ids = equipment_ap_profile.child_profile_ids
|
||||
@@ -272,6 +274,7 @@ class ProfileUtility:
|
||||
if sdk_client is None:
|
||||
sdk_client = Controller(controller_data=controller_data, customer_id=customer_id)
|
||||
self.sdk_client = sdk_client
|
||||
self.sdk_client.refresh_instance()
|
||||
self.profile_client = swagger_client.ProfileApi(api_client=self.sdk_client.api_client)
|
||||
self.profile_creation_ids = {
|
||||
"ssid": [],
|
||||
@@ -283,6 +286,7 @@ class ProfileUtility:
|
||||
self.profile_ids = []
|
||||
|
||||
def cleanup_objects(self):
|
||||
self.sdk_client.refresh_instance()
|
||||
self.profile_creation_ids = {
|
||||
"ssid": [],
|
||||
"ap": [],
|
||||
@@ -293,6 +297,7 @@ class ProfileUtility:
|
||||
self.profile_ids = []
|
||||
|
||||
def get_profile_by_name(self, profile_name=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
pagination_context = """{
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": 1000
|
||||
@@ -306,6 +311,7 @@ class ProfileUtility:
|
||||
return None
|
||||
|
||||
def get_ssid_name_by_profile_id(self, profile_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
profiles = self.profile_client.get_profile_by_id(profile_id=profile_id)
|
||||
return profiles._details["ssid"]
|
||||
|
||||
@@ -324,6 +330,7 @@ class ProfileUtility:
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": 100
|
||||
}"""
|
||||
self.sdk_client.refresh_instance()
|
||||
items = self.profile_client.get_profiles_by_customer_id(customer_id=self.sdk_client.customer_id,
|
||||
pagination_context=pagination_context)
|
||||
|
||||
@@ -346,6 +353,7 @@ class ProfileUtility:
|
||||
# This will delete the Profiles associated with an equipment of givwn equipment_id, and associate it to default
|
||||
# equipment_ap profile
|
||||
def delete_current_profile(self, equipment_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
equipment_data = self.sdk_client.equipment_client.get_equipment_by_id(equipment_id=equipment_id)
|
||||
|
||||
data = self.profile_client.get_profile_with_children(profile_id=equipment_data._profile_id)
|
||||
@@ -364,6 +372,7 @@ class ProfileUtility:
|
||||
|
||||
# This will delete all the profiles on an controller instance, except the default profiles
|
||||
def cleanup_profiles(self):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
self.get_default_profiles()
|
||||
pagination_context = """{
|
||||
@@ -396,6 +405,7 @@ class ProfileUtility:
|
||||
|
||||
# Delete any profile with the given name
|
||||
def delete_profile_by_name(self, profile_name=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
pagination_context = """{
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": 5000
|
||||
@@ -414,6 +424,7 @@ class ProfileUtility:
|
||||
# This method will set all the equipments to default equipment_ap profile, those having the profile_id passed in
|
||||
# argument
|
||||
def set_equipment_to_profile(self, profile_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
pagination_context = """{
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": 5000
|
||||
@@ -434,6 +445,7 @@ class ProfileUtility:
|
||||
"""
|
||||
|
||||
def set_rf_profile(self, profile_data=None, mode=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
self.get_default_profiles()
|
||||
if mode == "wifi5":
|
||||
default_profile = self.default_profiles['rf']
|
||||
@@ -473,6 +485,7 @@ class ProfileUtility:
|
||||
|
||||
# Open
|
||||
def create_open_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -496,6 +509,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa personal
|
||||
def create_wpa_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
self.get_default_profiles()
|
||||
try:
|
||||
if profile_data is None:
|
||||
@@ -519,6 +533,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa2 personal
|
||||
def create_wpa2_personal_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -542,6 +557,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa3 personal
|
||||
def create_wpa3_personal_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -565,6 +581,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa3 personal mixed mode
|
||||
def create_wpa3_personal_mixed_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -588,6 +605,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa wpa2 personal mixed mode
|
||||
def create_wpa_wpa2_personal_mixed_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -611,6 +629,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa enterprise done
|
||||
def create_wpa_enterprise_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -620,7 +639,6 @@ class ProfileUtility:
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
print("shivams", self.profile_creation_ids["radius"][0])
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
default_profile._details['secureMode'] = 'wpaRadius'
|
||||
@@ -635,6 +653,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa wpa2 enterprise mixed mode done
|
||||
def create_wpa_wpa2_enterprise_mixed_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -659,6 +678,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa2 enterprise mode ssid profile
|
||||
def create_wpa2_enterprise_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -683,6 +703,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa3 enterprise mode
|
||||
def create_wpa3_enterprise_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -706,6 +727,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa3 enterprise mixed mode done
|
||||
def create_wpa3_enterprise_mixed_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -729,6 +751,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa3 enterprise mixed mode done
|
||||
def create_wep_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -773,6 +796,7 @@ class ProfileUtility:
|
||||
"""
|
||||
|
||||
def set_ap_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['equipment_ap_2_radios']
|
||||
@@ -794,6 +818,7 @@ class ProfileUtility:
|
||||
"""
|
||||
|
||||
def create_radius_profile(self, radius_info=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
default_profile = self.default_profiles['radius']
|
||||
default_profile._name = radius_info['name']
|
||||
default_profile._details['primaryRadiusAuthServer'] = {}
|
||||
@@ -811,6 +836,7 @@ class ProfileUtility:
|
||||
|
||||
# Under a Bug, depreciated until resolved, should be used primarily
|
||||
def push_profile(self, equipment_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
pagination_context = """{
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": 100
|
||||
@@ -825,6 +851,7 @@ class ProfileUtility:
|
||||
"""
|
||||
|
||||
def update_ssid_name(self, profile_name=None, new_profile_name=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
if profile_name is None:
|
||||
print("profile name is None, Please specify the ssid profile name that you want to modify")
|
||||
return False
|
||||
@@ -845,11 +872,13 @@ class ProfileUtility:
|
||||
"""
|
||||
|
||||
def delete_profile(self, profile_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
for i in profile_id:
|
||||
self.profile_client.delete_profile(profile_id=i)
|
||||
|
||||
# Need to be depreciated by using push_profile method
|
||||
def push_profile_old_method(self, equipment_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
if equipment_id is None:
|
||||
return 0
|
||||
url = self.sdk_client.configuration.host + "/portal/equipment?equipmentId=" + str(equipment_id)
|
||||
@@ -868,53 +897,8 @@ class ProfileUtility:
|
||||
return response
|
||||
|
||||
|
||||
"""
|
||||
JfrogUtility base class used for FirmwareUtility for Artifactory Management
|
||||
Used for getting the latest firmware image
|
||||
credentials required are as follows:
|
||||
username
|
||||
password
|
||||
jfrog-base-url
|
||||
build [pending]
|
||||
branch [dev, trunk]
|
||||
"""
|
||||
|
||||
|
||||
class JFrogUtility:
|
||||
|
||||
def __init__(self, credentials=None):
|
||||
if credentials is None:
|
||||
exit()
|
||||
self.jfrog_url = credentials["jfrog-base-url"]
|
||||
self.build = credentials["build"]
|
||||
self.branch = credentials["branch"]
|
||||
ssl._create_default_https_context = ssl._create_unverified_context
|
||||
|
||||
def get_build(self, model=None, version=None):
|
||||
jfrog_url = self.jfrog_url + "/" + model + "/" + self.branch + "/"
|
||||
|
||||
''' FIND THE LATEST FILE NAME'''
|
||||
print(jfrog_url)
|
||||
req = urllib.request.Request(jfrog_url)
|
||||
response = urllib.request.urlopen(req)
|
||||
# print(response)
|
||||
html = response.read()
|
||||
soup = BeautifulSoup(html, features="html.parser")
|
||||
if self.branch == "trunk":
|
||||
self.build = model
|
||||
last_link = soup.find_all('a', href=re.compile(self.build))
|
||||
latest_fw = None
|
||||
for i in last_link:
|
||||
|
||||
if str(i['href']).__contains__(version):
|
||||
latest_fw = i['href']
|
||||
|
||||
latest_fw = latest_fw.replace('.tar.gz', '')
|
||||
print("Using Firmware Image: ", latest_fw)
|
||||
return latest_fw
|
||||
|
||||
|
||||
"""
|
||||
FirmwareUtility class
|
||||
uses JfrogUtility base class
|
||||
sdk_client [ controller_tests instance ]
|
||||
@@ -923,70 +907,66 @@ class JFrogUtility:
|
||||
"""
|
||||
|
||||
|
||||
class FirmwareUtility(JFrogUtility):
|
||||
class FirmwareUtility:
|
||||
|
||||
def __init__(self,
|
||||
sdk_client=None,
|
||||
jfrog_credentials=None,
|
||||
controller_data=None,
|
||||
customer_id=None,
|
||||
customer_id=2,
|
||||
model=None,
|
||||
version=None):
|
||||
super().__init__(credentials=jfrog_credentials)
|
||||
version_url=None):
|
||||
# super().__init__(credentials=jfrog_credentials)
|
||||
if sdk_client is None:
|
||||
sdk_client = Controller(controller_data=controller_data, customer_id=customer_id)
|
||||
self.sdk_client = sdk_client
|
||||
self.sdk_client.refresh_instance()
|
||||
self.firmware_client = FirmwareManagementApi(api_client=sdk_client.api_client)
|
||||
self.jfrog_client = JFrogUtility(credentials=jfrog_credentials)
|
||||
# self.jfrog_client = JFrogUtility(credentials=jfrog_credentials)
|
||||
self.equipment_gateway_client = EquipmentGatewayApi(api_client=sdk_client.api_client)
|
||||
self.model = model
|
||||
self.fw_version = version
|
||||
self.fw_version = version_url
|
||||
|
||||
def get_fw_version(self):
|
||||
# Get The equipment model
|
||||
self.latest_fw = self.get_build(model=self.model, version=self.fw_version)
|
||||
# print("shivam", self.latest_fw)
|
||||
return self.latest_fw
|
||||
fw_version = self.fw_version.split("/")[-1]
|
||||
return fw_version
|
||||
|
||||
def upload_fw_on_cloud(self, fw_version=None, force_upload=False):
|
||||
print("Upload fw version :", fw_version)
|
||||
# force_upload = True
|
||||
# if fw_latest available and force upload is False -- Don't upload
|
||||
# if fw_latest available and force upload is True -- Upload
|
||||
# if fw_latest is not available -- Upload
|
||||
def upload_fw_on_cloud(self, force_upload=False):
|
||||
self.sdk_client.refresh_instance()
|
||||
fw_version = self.fw_version.split("/")[-1]
|
||||
print("Upload fw version :", self.fw_version)
|
||||
fw_id = self.is_fw_available(fw_version=fw_version)
|
||||
if fw_id and not force_upload:
|
||||
print("Firmware Version Already Available, Skipping upload", "Force Upload :", force_upload)
|
||||
print("Skipping upload, Firmware Already Available", "Force Upload :", force_upload)
|
||||
# Don't Upload the fw
|
||||
return fw_id
|
||||
else:
|
||||
if fw_id and force_upload:
|
||||
print("Firmware Version Already Available, Deleting and Uploading Again")
|
||||
print("Firmware Version Already Available, Deleting and Uploading Again",
|
||||
" Force Upload :", force_upload)
|
||||
self.firmware_client.delete_firmware_version(firmware_version_id=fw_id)
|
||||
print("Force Upload :", force_upload, " Deleted current Image")
|
||||
print("Deleted Firmware Image from cloud, uploading again")
|
||||
time.sleep(2)
|
||||
# if force_upload is true and latest image available, then delete the image
|
||||
firmware_data = {
|
||||
"id": 0,
|
||||
"equipmentType": "AP",
|
||||
"modelId": fw_version.split("-")[0],
|
||||
"versionName": fw_version + ".tar.gz",
|
||||
"modelId": self.model,
|
||||
"versionName": fw_version,
|
||||
"description": fw_version + " FW VERSION",
|
||||
"filename": self.jfrog_url + "/" + self.model + "/" + self.branch + "/" + fw_version + ".tar.gz",
|
||||
"filename": self.fw_version,
|
||||
}
|
||||
print(firmware_data["filename"])
|
||||
firmware_id = self.firmware_client.create_firmware_version(body=firmware_data)
|
||||
print("Force Upload :", force_upload, " Uploaded the Image")
|
||||
print("Uploaded the Image: ", fw_version)
|
||||
return firmware_id._id
|
||||
|
||||
def upgrade_fw(self, equipment_id=None, force_upgrade=False, force_upload=False):
|
||||
self.sdk_client.refresh_instance()
|
||||
if equipment_id is None:
|
||||
print("No Equipment Id Given")
|
||||
exit()
|
||||
if (force_upgrade is True) or (self.should_upgrade_ap_fw(equipment_id=equipment_id)):
|
||||
model = self.sdk_client.get_model_name(equipment_id=equipment_id).lower()
|
||||
latest_fw = self.get_fw_version()
|
||||
firmware_id = self.upload_fw_on_cloud(fw_version=latest_fw, force_upload=force_upload)
|
||||
firmware_id = self.upload_fw_on_cloud(force_upload=force_upload)
|
||||
time.sleep(5)
|
||||
try:
|
||||
obj = self.equipment_gateway_client.request_firmware_update(equipment_id=equipment_id,
|
||||
@@ -999,6 +979,7 @@ class FirmwareUtility(JFrogUtility):
|
||||
# Write the upgrade fw logic here
|
||||
|
||||
def should_upgrade_ap_fw(self, equipment_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
current_fw = self.sdk_client.get_ap_firmware_old_method(equipment_id=equipment_id)
|
||||
latest_fw = self.get_fw_version()
|
||||
print(self.model, current_fw, latest_fw)
|
||||
@@ -1008,14 +989,16 @@ class FirmwareUtility(JFrogUtility):
|
||||
return True
|
||||
|
||||
def is_fw_available(self, fw_version=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
if fw_version is None:
|
||||
exit()
|
||||
try:
|
||||
firmware_version = self.firmware_client.get_firmware_version_by_name(
|
||||
firmware_version_name=fw_version + ".tar.gz")
|
||||
firmware_version_name=fw_version)
|
||||
firmware_version = firmware_version._id
|
||||
print("Firmware ID: ", firmware_version)
|
||||
except:
|
||||
except Exception as e:
|
||||
print(e)
|
||||
firmware_version = False
|
||||
print("firmware not available: ", firmware_version)
|
||||
return firmware_version
|
||||
@@ -1023,26 +1006,29 @@ class FirmwareUtility(JFrogUtility):
|
||||
|
||||
if __name__ == '__main__':
|
||||
controller = {
|
||||
'url': "https://wlan-portal-svc-digicert.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'url': "https://wlan-portal-svc-nola-01.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"
|
||||
}
|
||||
api = Controller(controller_data=controller)
|
||||
profile = ProfileUtility(sdk_client=api)
|
||||
profile.get_default_profiles()
|
||||
profile_data = {
|
||||
"profile_name": "ssid_wep_2g",
|
||||
"ssid_name": "ssid_wep_2g",
|
||||
"appliedRadios": ["is2dot4GHz"],
|
||||
"default_key_id" : 1,
|
||||
"wep_key" : 1234567890,
|
||||
"vlan": 1,
|
||||
"mode": "BRIDGE"
|
||||
}
|
||||
|
||||
profile.create_wep_ssid_profile(profile_data=profile_data)
|
||||
# profile = ProfileUtility(sdk_client=api)
|
||||
# profile.get_default_profiles()
|
||||
# profile_data = {
|
||||
# "profile_name": "ssid_wep_2g",
|
||||
# "ssid_name": "ssid_wep_2g",
|
||||
# "appliedRadios": ["is2dot4GHz"],
|
||||
# "default_key_id" : 1,
|
||||
# "wep_key" : 1234567890,
|
||||
# "vlan": 1,
|
||||
# "mode": "BRIDGE"
|
||||
# }
|
||||
fw_obj = FirmwareUtility(sdk_client=api, model="eap101",
|
||||
version_url="https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/dev/ecw5410-2021-05-25-pending-e71df5e.tar.gz")
|
||||
fw_obj.upload_fw_on_cloud(force_upload=True)
|
||||
# fw_obj.upgrade_fw(equipment_id=28)
|
||||
# profile.create_wep_ssid_profile(profile_data=profile_data)
|
||||
# print(profile.get_profile_by_name(profile_name="wpa_wpa2_eap"))
|
||||
profile.get_default_profiles()
|
||||
# profile.get_default_profiles()
|
||||
api.disconnect_Controller()
|
||||
|
||||
@@ -31,10 +31,9 @@ from controller.controller import ProfileUtility
|
||||
from controller.controller import FirmwareUtility
|
||||
import pytest
|
||||
import logging
|
||||
from configuration import CONFIGURATION
|
||||
from configuration import RADIUS_SERVER_DATA
|
||||
from configuration import TEST_CASES
|
||||
from configuration import CONFIGURATION
|
||||
from configuration import FIRMWARE
|
||||
from testrails.testrail_api import APIClient
|
||||
from testrails.reporting import Reporting
|
||||
import sta_connect2
|
||||
@@ -58,6 +57,15 @@ def pytest_addoption(parser):
|
||||
default=False,
|
||||
help="skip updating firmware on the AP (useful for local testing)"
|
||||
)
|
||||
|
||||
# change behaviour
|
||||
parser.addoption(
|
||||
"--exit-on-fail",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="skip updating firmware on the AP (useful for local testing)"
|
||||
)
|
||||
|
||||
# change behaviour
|
||||
parser.addoption(
|
||||
"--force-upgrade",
|
||||
@@ -98,11 +106,6 @@ 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")
|
||||
@@ -121,6 +124,11 @@ def should_upgrade_firmware(request):
|
||||
yield request.config.getoption("--force-upgrade")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def exit_on_fail(request):
|
||||
yield request.config.getoption("--exit-on-fail")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def radius_info():
|
||||
allure.attach(body=str(RADIUS_SERVER_DATA), name="Radius server Info: ")
|
||||
@@ -185,24 +193,25 @@ def setup_controller(request, get_configuration, instantiate_access_point):
|
||||
yield sdk_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def instantiate_firmware(setup_controller, instantiate_jFrog, get_configuration):
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_firmware(setup_controller, 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,
|
||||
firmware_client = FirmwareUtility(sdk_client=setup_controller,
|
||||
model=access_point_info["model"],
|
||||
version=access_point_info["version"])
|
||||
version_url=access_point_info["version"])
|
||||
firmware_client_obj.append(firmware_client)
|
||||
yield firmware_client_obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
@pytest.fixture(scope="session")
|
||||
def get_latest_firmware(instantiate_firmware):
|
||||
fw_version_list = []
|
||||
try:
|
||||
|
||||
for fw_obj in instantiate_firmware:
|
||||
latest_firmware = fw_obj.get_fw_version()
|
||||
latest_firmware = latest_firmware.replace(".tar.gz", "")
|
||||
fw_version_list.append(latest_firmware)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
@@ -211,17 +220,16 @@ def get_latest_firmware(instantiate_firmware):
|
||||
yield fw_version_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def upload_firmware(should_upload_firmware, instantiate_firmware, get_latest_firmware):
|
||||
@pytest.fixture(scope="session")
|
||||
def upload_firmware(should_upload_firmware, instantiate_firmware):
|
||||
firmware_id_list = []
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
firmware_id = instantiate_firmware[i].upload_fw_on_cloud(fw_version=get_latest_firmware[i],
|
||||
force_upload=should_upload_firmware)
|
||||
firmware_id = instantiate_firmware[i].upload_fw_on_cloud(force_upload=should_upload_firmware)
|
||||
firmware_id_list.append(firmware_id)
|
||||
yield firmware_id_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
@pytest.fixture(scope="session")
|
||||
def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware,
|
||||
should_upgrade_firmware):
|
||||
status_list = []
|
||||
@@ -247,7 +255,7 @@ def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_f
|
||||
yield status_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_cloud(setup_controller, get_equipment_id):
|
||||
ap_fw_list = []
|
||||
for i in get_equipment_id:
|
||||
@@ -255,7 +263,7 @@ def check_ap_firmware_cloud(setup_controller, get_equipment_id):
|
||||
yield ap_fw_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_ssh(get_configuration):
|
||||
active_fw_list = []
|
||||
try:
|
||||
@@ -269,6 +277,13 @@ def check_ap_firmware_ssh(get_configuration):
|
||||
yield active_fw_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_test_run(setup_controller, upgrade_firmware, check_ap_firmware_cloud, check_ap_firmware_ssh):
|
||||
if check_ap_firmware_ssh == check_ap_firmware_cloud:
|
||||
yield True
|
||||
else:
|
||||
pytest.exit("AP is not Upgraded tp Target Firmware versions")
|
||||
|
||||
"""
|
||||
Instantiate Reporting
|
||||
"""
|
||||
|
||||
@@ -535,7 +535,9 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def lf_test(get_configuration):
|
||||
# print(get_configuration)
|
||||
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'])
|
||||
# pytest.exit("")
|
||||
yield obj
|
||||
|
||||
|
||||
|
||||
@@ -25,20 +25,20 @@ class TestFirmware(object):
|
||||
PASS = False
|
||||
assert PASS
|
||||
|
||||
# @pytest.mark.firmware_upgrade
|
||||
# def test_firmware_upgrade_request(self, upgrade_firmware, update_report, test_cases):
|
||||
# print()
|
||||
# if not upgrade_firmware:
|
||||
# update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
# status_id=0,
|
||||
# msg='Error requesting upgrade via API')
|
||||
# PASS = False
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
# status_id=1,
|
||||
# msg='Upgrade request using API successful')
|
||||
# PASS = True
|
||||
# assert PASS
|
||||
@pytest.mark.firmware_upgrade
|
||||
def test_firmware_upgrade_request(self, upgrade_firmware, update_report, test_cases):
|
||||
print()
|
||||
if not upgrade_firmware:
|
||||
update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
status_id=0,
|
||||
msg='Error requesting upgrade via API')
|
||||
PASS = False
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
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, update_report, test_cases):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.enterprise, pytest.mark.tls, pytest.mark.sanity]
|
||||
# pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.enterprise, pytest.mark.tls, pytest.mark.sanity]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
|
||||
@@ -22,7 +22,6 @@ setup_params_enterprise = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
@@ -35,7 +34,7 @@ class TestBridgeModeEnterpriseTTLSSuiteOne(object):
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -61,12 +60,14 @@ class TestBridgeModeEnterpriseTTLSSuiteOne(object):
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -92,12 +93,14 @@ class TestBridgeModeEnterpriseTTLSSuiteOne(object):
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
@@ -113,7 +116,7 @@ class TestBridgeModeEnterpriseTTLSSuiteOne(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
@@ -122,12 +125,14 @@ class TestBridgeModeEnterpriseTTLSSuiteOne(object):
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
@@ -152,67 +157,73 @@ class TestBridgeModeEnterpriseTTLSSuiteOne(object):
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
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 passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
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 passes
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info, exit_on_fail):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# 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))
|
||||
# if exit_on_fail:
|
||||
# pytest.exit("Test Case Failed")
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info, exit_on_fail):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "BRIDGE"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# 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))
|
||||
# if exit_on_fail:
|
||||
# pytest.exit("Test Case Failed")
|
||||
# assert passes
|
||||
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
@@ -243,7 +254,7 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -269,13 +280,14 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info):
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -301,13 +313,14 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info):
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
@@ -332,12 +345,14 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
@@ -363,4 +378,6 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@@ -400,81 +400,81 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_wep = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["is2dot4GHz"], "default_key_id": 1,
|
||||
"wep_key": 1234567890},
|
||||
{"ssid_name": "ssid_wep_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"default_key_id": 1, "wep_key": 1234567890}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_wep],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeWEP(object):
|
||||
|
||||
@pytest.mark.wep
|
||||
@pytest.mark.twog
|
||||
def test_wep_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_wep["ssid_modes"]["wep"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
wep_key = "[BLANK]"
|
||||
security = "open"
|
||||
extra_secu = []
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=wep_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
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 passes
|
||||
|
||||
@pytest.mark.wep
|
||||
@pytest.mark.fiveg
|
||||
def test_wep_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_wep["ssid_modes"]["wep"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
wep_key = "[BLANK]"
|
||||
security = "open"
|
||||
extra_secu = []
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=wep_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
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 passes
|
||||
# setup_params_wep = {
|
||||
# "mode": "BRIDGE",
|
||||
# "ssid_modes": {
|
||||
# "wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["is2dot4GHz"], "default_key_id": 1,
|
||||
# "wep_key": 1234567890},
|
||||
# {"ssid_name": "ssid_wep_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
# "default_key_id": 1, "wep_key": 1234567890}]
|
||||
# },
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_wep],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestBridgeModeWEP(object):
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.twog
|
||||
# def test_wep_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# 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 passes
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wep_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# 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 passes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat, pytest.mark.enterprise, pytest.mark.tls, pytest.mark.sanity]
|
||||
# pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat, pytest.mark.enterprise, pytest.mark.tls, pytest.mark.sanity]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
|
||||
@@ -22,7 +22,6 @@ setup_params_enterprise = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
@@ -35,7 +34,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -52,21 +51,23 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -83,21 +84,23 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
@@ -113,21 +116,23 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
@@ -143,76 +148,82 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info, exit_on_fail):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# if exit_on_fail:
|
||||
# pytest.exit("Test Case Failed")
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info, exit_on_fail):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "NAT"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# if exit_on_fail:
|
||||
# pytest.exit("Test Case Failed")
|
||||
# assert passes
|
||||
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
@@ -243,7 +254,7 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -260,22 +271,23 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info):
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -292,22 +304,23 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info):
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
@@ -323,21 +336,23 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
@@ -354,13 +369,15 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@@ -102,12 +102,12 @@ class TestNATModeConnectivitySuiteOne(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -129,12 +129,12 @@ class TestNATModeConnectivitySuiteOne(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -157,12 +157,12 @@ class TestNATModeConnectivitySuiteOne(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA2 Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -185,12 +185,12 @@ class TestNATModeConnectivitySuiteOne(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_nat"],
|
||||
status_id=1,
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_nat"],
|
||||
status_id=5,
|
||||
msg='5G WPA2 Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -245,12 +245,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -272,12 +272,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -301,12 +301,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -329,12 +329,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -359,12 +359,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -388,93 +388,93 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_wep = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["is2dot4GHz"], "default_key_id": 1,
|
||||
"wep_key": 1234567890},
|
||||
{"ssid_name": "ssid_wep_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"default_key_id": 1, "wep_key": 1234567890}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_wep],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestNATModeWEP(object):
|
||||
|
||||
@pytest.mark.wep
|
||||
@pytest.mark.twog
|
||||
def test_wep_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_wep["ssid_modes"]["wep"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
wep_key = "[BLANK]"
|
||||
security = "open"
|
||||
extra_secu = []
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=wep_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wep
|
||||
@pytest.mark.fiveg
|
||||
def test_wep_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_wep["ssid_modes"]["wep"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
wep_key = "[BLANK]"
|
||||
security = "open"
|
||||
extra_secu = []
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=wep_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
# setup_params_wep = {
|
||||
# "mode": "NAT",
|
||||
# "ssid_modes": {
|
||||
# "wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["is2dot4GHz"], "default_key_id": 1,
|
||||
# "wep_key": 1234567890},
|
||||
# {"ssid_name": "ssid_wep_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
# "default_key_id": 1, "wep_key": 1234567890}]
|
||||
# },
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_wep],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestNATModeWEP(object):
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.twog
|
||||
# def test_wep_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wep_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan, pytest.mark.enterprise, pytest.mark.tls, pytest.mark.sanity]
|
||||
# pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan, pytest.mark.enterprise, pytest.mark.tls, pytest.mark.sanity]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "VLAN",
|
||||
|
||||
@@ -22,7 +22,6 @@ setup_params_enterprise = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
@@ -35,7 +34,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -52,21 +51,23 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -83,21 +84,23 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
@@ -113,21 +116,23 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
@@ -143,76 +148,82 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info, exit_on_fail):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# if exit_on_fail:
|
||||
# pytest.exit("Test Case Failed")
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info, exit_on_fail):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "VLAN"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# if exit_on_fail:
|
||||
# pytest.exit("Test Case Failed")
|
||||
# assert passes
|
||||
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
@@ -243,7 +254,7 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -260,22 +271,23 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info):
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
@@ -292,22 +304,23 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info):
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
@@ -323,21 +336,23 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
@@ -354,13 +369,15 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@@ -41,18 +41,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "open"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
# if result:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
@@ -68,18 +68,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "open"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
# if result:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
@@ -96,18 +96,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "wpa"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -123,18 +123,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "wpa"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -151,18 +151,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA2 Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -179,18 +179,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_vlan"],
|
||||
status_id=1,
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_vlan"],
|
||||
status_id=5,
|
||||
msg='5G WPA2 Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -239,18 +239,18 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -266,18 +266,18 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -295,18 +295,18 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -323,18 +323,18 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -353,18 +353,18 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -382,99 +382,99 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_wep = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["is2dot4GHz"], "default_key_id": 1,
|
||||
"wep_key": 1234567890},
|
||||
{"ssid_name": "ssid_wep_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"default_key_id": 1, "wep_key": 1234567890}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_wep],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeWEP(object):
|
||||
|
||||
@pytest.mark.wep
|
||||
@pytest.mark.twog
|
||||
def test_wep_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_wep["ssid_modes"]["wep"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
wep_key = "[BLANK]"
|
||||
security = "open"
|
||||
extra_secu = []
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=wep_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wep
|
||||
@pytest.mark.fiveg
|
||||
def test_wep_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_wep["ssid_modes"]["wep"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
wep_key = "[BLANK]"
|
||||
security = "open"
|
||||
extra_secu = []
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=wep_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
# setup_params_wep = {
|
||||
# "mode": "VLAN",
|
||||
# "ssid_modes": {
|
||||
# "wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["is2dot4GHz"], "default_key_id": 1,
|
||||
# "wep_key": 1234567890},
|
||||
# {"ssid_name": "ssid_wep_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
# "default_key_id": 1, "wep_key": 1234567890}]
|
||||
# },
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_wep],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestVLANModeWEP(object):
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.twog
|
||||
# def test_wep_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 100
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wep_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 100
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
|
||||
@@ -6,10 +6,9 @@ import sys
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.test_resources]
|
||||
pytestmark = [pytest.mark.usefixtures("setup_test_run"), pytest.mark.test_resources, pytest.mark.sanity]
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@allure.testcase(name="Test Resources", url="")
|
||||
class TestResources(object):
|
||||
|
||||
@@ -51,4 +50,3 @@ class TestResources(object):
|
||||
msg='Manager status is Active')
|
||||
|
||||
assert flag
|
||||
|
||||
|
||||
Reference in New Issue
Block a user