mirror of
				https://github.com/Telecominfraproject/wlan-testing.git
				synced 2025-11-04 04:48:01 +00:00 
			
		
		
		
	client_connectivity updates
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
		
							
								
								
									
										1
									
								
								lanforge/lanforge-scripts
									
									
									
									
									
										Submodule
									
								
							
							
								
								
								
								
								
							
						
						
									
										1
									
								
								lanforge/lanforge-scripts
									
									
									
									
									
										Submodule
									
								
							 Submodule lanforge/lanforge-scripts added at de86a454b2
									
								
							@@ -15,6 +15,7 @@ from scp import SCPClient
 | 
				
			|||||||
import os
 | 
					import os
 | 
				
			||||||
import allure
 | 
					import allure
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class APNOS:
 | 
					class APNOS:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self, credentials=None, pwd=os.getcwd()):
 | 
					    def __init__(self, credentials=None, pwd=os.getcwd()):
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@ import swagger_client
 | 
				
			|||||||
from swagger_client import FirmwareManagementApi
 | 
					from swagger_client import FirmwareManagementApi
 | 
				
			||||||
from swagger_client import EquipmentGatewayApi
 | 
					from swagger_client import EquipmentGatewayApi
 | 
				
			||||||
from bs4 import BeautifulSoup
 | 
					from bs4 import BeautifulSoup
 | 
				
			||||||
 | 
					import threading
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ConfigureController:
 | 
					class ConfigureController:
 | 
				
			||||||
@@ -75,17 +76,22 @@ class Controller(ConfigureController):
 | 
				
			|||||||
        if customer_id is None:
 | 
					        if customer_id is None:
 | 
				
			||||||
            self.customer_id = 2
 | 
					            self.customer_id = 2
 | 
				
			||||||
            print("Setting to default Customer ID 2")
 | 
					            print("Setting to default Customer ID 2")
 | 
				
			||||||
 | 
					        #
 | 
				
			||||||
        # Setting the Controller Client Configuration
 | 
					        # Setting the Controller Client Configuration
 | 
				
			||||||
        self.select_controller_data(controller_data=controller_data)
 | 
					        self.select_controller_data(controller_data=controller_data)
 | 
				
			||||||
        self.set_credentials(controller_data=controller_data)
 | 
					        self.set_credentials(controller_data=controller_data)
 | 
				
			||||||
        # self.configuration.refresh_api_key_hook = self.get_bearer_token
 | 
					        self.configuration.refresh_api_key_hook = self.get_bearer_token
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Connecting to Controller
 | 
					        # Connecting to Controller
 | 
				
			||||||
        self.api_client = swagger_client.ApiClient(self.configuration)
 | 
					        self.api_client = swagger_client.ApiClient(self.configuration)
 | 
				
			||||||
        self.login_client = swagger_client.LoginApi(api_client=self.api_client)
 | 
					        self.login_client = swagger_client.LoginApi(api_client=self.api_client)
 | 
				
			||||||
 | 
					        self.bearer = False
 | 
				
			||||||
 | 
					        self.disconnect = False
 | 
				
			||||||
 | 
					        self.semaphore = False
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
            self.bearer = self.get_bearer_token()
 | 
					            self.bearer = self.get_bearer_token()
 | 
				
			||||||
 | 
					            # t1 = threading.Thread(target=self.refresh_instance)
 | 
				
			||||||
 | 
					            # t1.start()
 | 
				
			||||||
            self.api_client.default_headers['Authorization'] = "Bearer " + self.bearer._access_token
 | 
					            self.api_client.default_headers['Authorization'] = "Bearer " + self.bearer._access_token
 | 
				
			||||||
            self.status_client = swagger_client.StatusApi(api_client=self.api_client)
 | 
					            self.status_client = swagger_client.StatusApi(api_client=self.api_client)
 | 
				
			||||||
            self.equipment_client = swagger_client.EquipmentApi(self.api_client)
 | 
					            self.equipment_client = swagger_client.EquipmentApi(self.api_client)
 | 
				
			||||||
@@ -94,12 +100,10 @@ class Controller(ConfigureController):
 | 
				
			|||||||
                "Authorization": "Bearer " + self.bearer._access_token
 | 
					                "Authorization": "Bearer " + self.bearer._access_token
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            self.api_client.configuration.refresh_api_key_hook = self.refresh_instance
 | 
					            self.api_client.configuration.refresh_api_key_hook = self.refresh_instance
 | 
				
			||||||
        self.ping_response = self.portal_ping()
 | 
					        except Exception as e:
 | 
				
			||||||
        self.default_profiles = {}
 | 
					            self.bearer = False
 | 
				
			||||||
        # print(self.bearer)
 | 
					            print(e)
 | 
				
			||||||
        if self.ping_response._application_name != 'PortalServer':
 | 
					
 | 
				
			||||||
            print("Server not Reachable")
 | 
					 | 
				
			||||||
            exit()
 | 
					 | 
				
			||||||
        print("Connected to Controller Server")
 | 
					        print("Connected to Controller Server")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_bearer_token(self):
 | 
					    def get_bearer_token(self):
 | 
				
			||||||
@@ -111,6 +115,15 @@ class Controller(ConfigureController):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def refresh_instance(self):
 | 
					    def refresh_instance(self):
 | 
				
			||||||
        # Connecting to Controller
 | 
					        # 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.api_client = swagger_client.ApiClient(self.configuration)
 | 
				
			||||||
        self.login_client = swagger_client.LoginApi(api_client=self.api_client)
 | 
					        self.login_client = swagger_client.LoginApi(api_client=self.api_client)
 | 
				
			||||||
        self.bearer = self.get_bearer_token()
 | 
					        self.bearer = self.get_bearer_token()
 | 
				
			||||||
@@ -130,11 +143,13 @@ class Controller(ConfigureController):
 | 
				
			|||||||
            print("Server not Reachable")
 | 
					            print("Server not Reachable")
 | 
				
			||||||
            exit()
 | 
					            exit()
 | 
				
			||||||
        print("Connected to Controller Server")
 | 
					        print("Connected to Controller Server")
 | 
				
			||||||
 | 
					            # self.semaphore = False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def portal_ping(self):
 | 
					    def portal_ping(self):
 | 
				
			||||||
        return self.login_client.portal_ping()
 | 
					        return self.login_client.portal_ping()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def disconnect_Controller(self):
 | 
					    def disconnect_Controller(self):
 | 
				
			||||||
 | 
					        self.disconnect = True
 | 
				
			||||||
        self.api_client.__del__()
 | 
					        self.api_client.__del__()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Returns a List of All the Equipments that are available in the cloud instances
 | 
					    # Returns a List of All the Equipments that are available in the cloud instances
 | 
				
			||||||
@@ -837,16 +852,21 @@ class FirmwareUtility(JFrogUtility):
 | 
				
			|||||||
            firmware_version = False
 | 
					            firmware_version = False
 | 
				
			||||||
            print("firmware not available: ", firmware_version)
 | 
					            print("firmware not available: ", firmware_version)
 | 
				
			||||||
        return firmware_version
 | 
					        return firmware_version
 | 
				
			||||||
controller = {
 | 
					
 | 
				
			||||||
    'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build",  # API base url for the controller
 | 
					# controller = {
 | 
				
			||||||
    'username': 'support@example.com',
 | 
					#     'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build",  # API base url for the controller
 | 
				
			||||||
    'password': 'support',
 | 
					#     'username': 'support@example.com',
 | 
				
			||||||
    'version': "1.1.0-SNAPSHOT",
 | 
					#     'password': 'support',
 | 
				
			||||||
    'commit_date': "2021-04-27"
 | 
					#     'version': "1.1.0-SNAPSHOT",
 | 
				
			||||||
}
 | 
					#     'commit_date': "2021-04-27"
 | 
				
			||||||
api = Controller(controller_data=controller)
 | 
					# }
 | 
				
			||||||
for i in range(0, 2500):
 | 
					# api = Controller(controller_data=controller)
 | 
				
			||||||
    print(i)
 | 
					# # profile = ProfileUtility(sdk_client=api)
 | 
				
			||||||
    time.sleep(1)
 | 
					# # profile.cleanup_profiles()
 | 
				
			||||||
print(api.get_equipment_by_customer_id())
 | 
					# # # print(api.get_equipment_by_customer_id())
 | 
				
			||||||
api.disconnect_Controller()
 | 
					# # #
 | 
				
			||||||
 | 
					# for i in range(0, 300):
 | 
				
			||||||
 | 
					#     print(i)
 | 
				
			||||||
 | 
					#     time.sleep(1)
 | 
				
			||||||
 | 
					# print(api.get_equipment_by_customer_id())
 | 
				
			||||||
 | 
					# api.disconnect_Controller()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,34 +4,50 @@
 | 
				
			|||||||
#########################################################################################################
 | 
					#########################################################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from sta_connect2 import StaConnect2
 | 
					from sta_connect2 import StaConnect2
 | 
				
			||||||
 | 
					import time
 | 
				
			||||||
 | 
					from eap_connect import EAPConnect
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class RunTest:
 | 
					class RunTest:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self, lanforge_ip, lanforge_port, lanforge_prefix):
 | 
					    def __init__(self, lanforge_data=None, debug=False):
 | 
				
			||||||
        self.lanforge_ip = lanforge_ip
 | 
					        self.lanforge_ip = lanforge_data["ip"]
 | 
				
			||||||
        self.lanforge_port = lanforge_port
 | 
					        self.lanforge_port = lanforge_data["port"]
 | 
				
			||||||
        self.lanforge_prefix = lanforge_prefix
 | 
					        self.twog_radios = lanforge_data["2.4G-Radio"]
 | 
				
			||||||
 | 
					        self.fiveg_radios = lanforge_data["5G-Radio"]
 | 
				
			||||||
 | 
					        self.ax_radios = lanforge_data["AX-Radio"]
 | 
				
			||||||
 | 
					        self.upstream_port = lanforge_data["upstream"]
 | 
				
			||||||
 | 
					        self.twog_prefix = lanforge_data["2.4G-Station-Name"]
 | 
				
			||||||
 | 
					        self.fiveg_prefix = lanforge_data["5G-Station-Name"]
 | 
				
			||||||
 | 
					        self.ax_prefix = lanforge_data["AX-Station-Name"]
 | 
				
			||||||
 | 
					        self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=debug)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def Single_Client_Connectivity(self, upstream_port="eth1", radio="wiphy0", ssid="TestAP", passkey="ssid_psk",
 | 
					    def Client_Connectivity(self, ssid="[BLANK]", passkey="[BLANK]", security="open", station_name=[],
 | 
				
			||||||
                                   security="open",
 | 
					                                   mode="BRIDGE", vlan_id=1, band="twog"):
 | 
				
			||||||
                                   station_name="sta0000", test_case=None, rid=None, client=None, logger=None):
 | 
					 | 
				
			||||||
        '''SINGLE CLIENT CONNECTIVITY using test_connect2.py'''
 | 
					        '''SINGLE CLIENT CONNECTIVITY using test_connect2.py'''
 | 
				
			||||||
        self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=False)
 | 
					 | 
				
			||||||
        self.staConnect.sta_mode = 0
 | 
					        self.staConnect.sta_mode = 0
 | 
				
			||||||
        self.staConnect.upstream_resource = 1
 | 
					        self.staConnect.upstream_resource = 1
 | 
				
			||||||
        self.staConnect.upstream_port = upstream_port
 | 
					        if mode == "BRIDGE":
 | 
				
			||||||
        self.staConnect.radio = radio
 | 
					            self.staConnect.upstream_port = self.upstream_port
 | 
				
			||||||
 | 
					        elif mode == "NAT":
 | 
				
			||||||
 | 
					            self.staConnect.upstream_port = self.upstream_port
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            self.staConnect.upstream_port = self.upstream_port + "." + str(vlan_id)
 | 
				
			||||||
 | 
					        if band == "twog":
 | 
				
			||||||
 | 
					            self.staConnect.radio = self.twog_radios[0]
 | 
				
			||||||
 | 
					            self.staConnect.sta_prefix = self.twog_prefix
 | 
				
			||||||
 | 
					        if band == "fiveg":
 | 
				
			||||||
 | 
					            self.staConnect.radio = self.fiveg_radios[0]
 | 
				
			||||||
 | 
					            self.staConnect.sta_prefix = self.fiveg_prefix
 | 
				
			||||||
        self.staConnect.resource = 1
 | 
					        self.staConnect.resource = 1
 | 
				
			||||||
        self.staConnect.dut_ssid = ssid
 | 
					        self.staConnect.dut_ssid = ssid
 | 
				
			||||||
        self.staConnect.dut_passwd = passkey
 | 
					        self.staConnect.dut_passwd = passkey
 | 
				
			||||||
        self.staConnect.dut_security = security
 | 
					        self.staConnect.dut_security = security
 | 
				
			||||||
        self.staConnect.station_names = station_name
 | 
					        self.staConnect.station_names = station_name
 | 
				
			||||||
        self.staConnect.sta_prefix = self.lanforge_prefix
 | 
					        self.staConnect.runtime_secs = 40
 | 
				
			||||||
        self.staConnect.runtime_secs = 10
 | 
					 | 
				
			||||||
        self.staConnect.bringup_time_sec = 60
 | 
					        self.staConnect.bringup_time_sec = 60
 | 
				
			||||||
        self.staConnect.cleanup_on_exit = True
 | 
					        self.staConnect.cleanup_on_exit = True
 | 
				
			||||||
        # staConnect.cleanup()
 | 
					        # self.staConnect.cleanup()
 | 
				
			||||||
        self.staConnect.setup()
 | 
					        self.staConnect.setup()
 | 
				
			||||||
        self.staConnect.start()
 | 
					        self.staConnect.start()
 | 
				
			||||||
        print("napping %f sec" % self.staConnect.runtime_secs)
 | 
					        print("napping %f sec" % self.staConnect.runtime_secs)
 | 
				
			||||||
@@ -41,18 +57,15 @@ class RunTest:
 | 
				
			|||||||
        run_results = self.staConnect.get_result_list()
 | 
					        run_results = self.staConnect.get_result_list()
 | 
				
			||||||
        for result in run_results:
 | 
					        for result in run_results:
 | 
				
			||||||
            print("test result: " + result)
 | 
					            print("test result: " + result)
 | 
				
			||||||
        # result = 'pass'
 | 
					        result = True
 | 
				
			||||||
        print("Single Client Connectivity :", self.staConnect.passes)
 | 
					        print("Client Connectivity :", self.staConnect.passes)
 | 
				
			||||||
        if self.staConnect.passes() == True:
 | 
					        if self.staConnect.passes():
 | 
				
			||||||
            print("Single client connection to", self.staConnect.dut_ssid, "successful. Test Passed")
 | 
					            print("client connection to", self.staConnect.dut_ssid, "successful. Test Passed")
 | 
				
			||||||
            client.update_testrail(case_id=test_case, run_id=rid, status_id=1, msg='Client connectivity passed')
 | 
					 | 
				
			||||||
            logger.info("Client connectivity to " + self.staConnect.dut_ssid + " Passed")
 | 
					 | 
				
			||||||
            return ("passed")
 | 
					 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            client.update_testrail(case_id=test_case, run_id=rid, status_id=5, msg='Client connectivity failed')
 | 
					            print("client connection to", self.staConnect.dut_ssid, "unsuccessful. Test Failed")
 | 
				
			||||||
            print("Single client connection to", self.staConnect.dut_ssid, "unsuccessful. Test Failed")
 | 
					            result = False
 | 
				
			||||||
            logger.warning("Client connectivity to " + self.staConnect.dut_ssid + " FAILED")
 | 
					        time.sleep(3)
 | 
				
			||||||
            return ("failed")
 | 
					        return self.staConnect.passes(), result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def Single_Client_EAP(self, port, sta_list, ssid_name, radio, security, eap_type,
 | 
					    def Single_Client_EAP(self, port, sta_list, ssid_name, radio, security, eap_type,
 | 
				
			||||||
                          identity, ttls_password, test_case, rid, client, logger):
 | 
					                          identity, ttls_password, test_case, rid, client, logger):
 | 
				
			||||||
@@ -68,7 +81,7 @@ class RunTest:
 | 
				
			|||||||
        eap_connect.eap = eap_type
 | 
					        eap_connect.eap = eap_type
 | 
				
			||||||
        eap_connect.identity = identity
 | 
					        eap_connect.identity = identity
 | 
				
			||||||
        eap_connect.ttls_passwd = ttls_password
 | 
					        eap_connect.ttls_passwd = ttls_password
 | 
				
			||||||
        eap_connect.runtime_secs = 10
 | 
					        eap_connect.runtime_secs = 40
 | 
				
			||||||
        eap_connect.setup()
 | 
					        eap_connect.setup()
 | 
				
			||||||
        eap_connect.start()
 | 
					        eap_connect.start()
 | 
				
			||||||
        print("napping %f sec" % eap_connect.runtime_secs)
 | 
					        print("napping %f sec" % eap_connect.runtime_secs)
 | 
				
			||||||
@@ -78,21 +91,11 @@ class RunTest:
 | 
				
			|||||||
        run_results = eap_connect.get_result_list()
 | 
					        run_results = eap_connect.get_result_list()
 | 
				
			||||||
        for result in run_results:
 | 
					        for result in run_results:
 | 
				
			||||||
            print("test result: " + result)
 | 
					            print("test result: " + result)
 | 
				
			||||||
        # result = 'pass'
 | 
					        result = True
 | 
				
			||||||
        print("Single Client Connectivity :", eap_connect.passes)
 | 
					        print("Single Client Connectivity :", eap_connect.passes)
 | 
				
			||||||
        if eap_connect.passes() == True:
 | 
					        if eap_connect.passes():
 | 
				
			||||||
            print("Single client connection to", ssid_name, "successful. Test Passed")
 | 
					            print("Single client connection to", ssid_name, "successful. Test Passed")
 | 
				
			||||||
            client.update_testrail(case_id=test_case, run_id=rid, status_id=1, msg='Client connectivity passed')
 | 
					 | 
				
			||||||
            logger.info("Client connectivity to " + ssid_name + " Passed")
 | 
					 | 
				
			||||||
            return ("passed")
 | 
					 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            client.update_testrail(case_id=test_case, run_id=rid, status_id=5, msg='Client connectivity failed')
 | 
					 | 
				
			||||||
            print("Single client connection to", ssid_name, "unsuccessful. Test Failed")
 | 
					            print("Single client connection to", ssid_name, "unsuccessful. Test Failed")
 | 
				
			||||||
            logger.warning("Client connectivity to " + ssid_name + " FAILED")
 | 
					            result = False
 | 
				
			||||||
            return ("failed")
 | 
					        return self.staConnect.passes(), result
 | 
				
			||||||
 | 
					 | 
				
			||||||
    def testrail_retest(self, test_case, rid, ssid_name, client, logger):
 | 
					 | 
				
			||||||
        client.update_testrail(case_id=test_case, run_id=rid, status_id=4,
 | 
					 | 
				
			||||||
                               msg='Error in Client Connectivity Test. Needs to be Re-run')
 | 
					 | 
				
			||||||
        print("Error in test for single client connection to", ssid_name)
 | 
					 | 
				
			||||||
        logger.warning("ERROR testing Client connectivity to " + ssid_name)
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,17 +1,90 @@
 | 
				
			|||||||
 | 
					 | 
				
			||||||
CONFIGURATION = {
 | 
					CONFIGURATION = {
 | 
				
			||||||
    "ext-03":  {
 | 
					    "basic-ext-03-01": {
 | 
				
			||||||
        "controller": {
 | 
					        "controller": {
 | 
				
			||||||
            'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build",  # API base url for the controller
 | 
					            'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build",  # API base url for the controller
 | 
				
			||||||
            'username': 'support@example.com',
 | 
					            'username': 'support@example.com',
 | 
				
			||||||
            'password': 'support',
 | 
					            'password': 'support',
 | 
				
			||||||
            'version': '1.0.0-SNAPSHOT',
 | 
					            'version': "1.1.0-SNAPSHOT",
 | 
				
			||||||
            'commit_date': '2021-03-01'
 | 
					            'commit_date': "2021-04-27"
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        'access_point': [
 | 
					        'access_point': [
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                'model': 'ecw5410',
 | 
					                'model': 'ecw5410',
 | 
				
			||||||
                'mode' : "wifi5",
 | 
					                'mode': "wifi5",
 | 
				
			||||||
 | 
					                'serial': '903cb3944807',
 | 
				
			||||||
 | 
					                'jumphost': True,
 | 
				
			||||||
 | 
					                'ip': "192.168.200.230",
 | 
				
			||||||
 | 
					                'username': "lanforge",
 | 
				
			||||||
 | 
					                'password': "lanforge",
 | 
				
			||||||
 | 
					                'port': 22,
 | 
				
			||||||
 | 
					                'jumphost_tty': '/dev/ttyAP1',
 | 
				
			||||||
 | 
					                'version': "ecw5410-2021-03-30-pending-9cb289b"
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        ],
 | 
				
			||||||
 | 
					        "traffic_generator": {
 | 
				
			||||||
 | 
					            "name": "lanforge",
 | 
				
			||||||
 | 
					            "details": {
 | 
				
			||||||
 | 
					                "ip": "localhost",
 | 
				
			||||||
 | 
					                "port": 8080,
 | 
				
			||||||
 | 
					                "2.4G-Radio": ["wiphy0"],
 | 
				
			||||||
 | 
					                "5G-Radio": ["wiphy1"],
 | 
				
			||||||
 | 
					                "AX-Radio": ["wiphy2"],
 | 
				
			||||||
 | 
					                "upstream": "eth1",
 | 
				
			||||||
 | 
					                "2.4G-Station-Name": "wlan0",
 | 
				
			||||||
 | 
					                "5G-Station-Name": "wlan1",
 | 
				
			||||||
 | 
					                "AX-Station-Name": "ax",
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    "basic-ext-03-02": {
 | 
				
			||||||
 | 
					        "controller": {
 | 
				
			||||||
 | 
					            'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build",  # API base url for the controller
 | 
				
			||||||
 | 
					            'username': 'support@example.com',
 | 
				
			||||||
 | 
					            'password': 'support',
 | 
				
			||||||
 | 
					            'version': "1.1.0-SNAPSHOT",
 | 
				
			||||||
 | 
					            'commit_date': "2021-04-27"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        'access_point': [
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                'model': 'ecw5410',
 | 
				
			||||||
 | 
					                'mode': 'wifi5',
 | 
				
			||||||
 | 
					                'serial': '903cb394486f',
 | 
				
			||||||
 | 
					                'jumphost': True,
 | 
				
			||||||
 | 
					                'ip': "192.168.200.233",
 | 
				
			||||||
 | 
					                'username': "lanforge",
 | 
				
			||||||
 | 
					                'password': "lanforge",
 | 
				
			||||||
 | 
					                'port': 22,
 | 
				
			||||||
 | 
					                'jumphost_tty': '/dev/ttyAP1',
 | 
				
			||||||
 | 
					                'version': "ecw5410-2021-04-26-pending-3fc41fa"
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        ],
 | 
				
			||||||
 | 
					        "traffic_generator": {
 | 
				
			||||||
 | 
					            "name": "lanforge",
 | 
				
			||||||
 | 
					            "details": {
 | 
				
			||||||
 | 
					                "ip": "192.168.200.233",
 | 
				
			||||||
 | 
					                "port": 8080,
 | 
				
			||||||
 | 
					                "2.4G-Radio": ["wiphy0"],
 | 
				
			||||||
 | 
					                "5G-Radio": ["wiphy1"],
 | 
				
			||||||
 | 
					                "AX-Radio": ["wiphy2"],
 | 
				
			||||||
 | 
					                "upstream": "eth1",
 | 
				
			||||||
 | 
					                "2.4G-Station-Name": "wlan0",
 | 
				
			||||||
 | 
					                "5G-Station-Name": "wlan1",
 | 
				
			||||||
 | 
					                "AX-Station-Name": "ax",
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    "basic-ext-03-03": {
 | 
				
			||||||
 | 
					        "controller": {
 | 
				
			||||||
 | 
					            'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build",  # API base url for the controller
 | 
				
			||||||
 | 
					            'username': 'support@example.com',
 | 
				
			||||||
 | 
					            'password': 'support',
 | 
				
			||||||
 | 
					            'version': "1.1.0-SNAPSHOT",
 | 
				
			||||||
 | 
					            'commit_date': "2021-04-27"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        'access_point': [
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                'model': 'ecw5410',
 | 
				
			||||||
 | 
					                'mode': 'wifi5',
 | 
				
			||||||
                'serial': '903cb3944857',
 | 
					                'serial': '903cb3944857',
 | 
				
			||||||
                'jumphost': True,
 | 
					                'jumphost': True,
 | 
				
			||||||
                'ip': "192.168.200.80",
 | 
					                'ip': "192.168.200.80",
 | 
				
			||||||
@@ -32,90 +105,13 @@ CONFIGURATION = {
 | 
				
			|||||||
                "AX-Radio": ["wiphy2"],
 | 
					                "AX-Radio": ["wiphy2"],
 | 
				
			||||||
                "upstream": "eth1",
 | 
					                "upstream": "eth1",
 | 
				
			||||||
                "2.4G-Station-Name": "wlan0",
 | 
					                "2.4G-Station-Name": "wlan0",
 | 
				
			||||||
                "5G-Station-Name": "wlan1",
 | 
					                "5G-Station-Name": "wlan0",
 | 
				
			||||||
                "AX-Station-Name": "ax",
 | 
					                "AX-Station-Name": "ax",
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "ext-04":  {
 | 
					 | 
				
			||||||
        "controller": {
 | 
					 | 
				
			||||||
            'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build",  # API base url for the controller
 | 
					 | 
				
			||||||
            'username': 'support@example.com',
 | 
					 | 
				
			||||||
            'password': 'support',
 | 
					 | 
				
			||||||
            'version': '1.0.0-SNAPSHOT',
 | 
					 | 
				
			||||||
            'commit_date': '2021-03-01'
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        'access_point': [
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                'model': 'ecw5410',
 | 
					 | 
				
			||||||
                'mode': 'wifi5',
 | 
					 | 
				
			||||||
                'serial': '903cb394486f',
 | 
					 | 
				
			||||||
                'jumphost': True,
 | 
					 | 
				
			||||||
                'ip': "192.168.200.81",
 | 
					 | 
				
			||||||
                'username': "lanforge",
 | 
					 | 
				
			||||||
                'password': "lanforge",
 | 
					 | 
				
			||||||
                'port': 22,
 | 
					 | 
				
			||||||
                'jumphost_tty': '/dev/ttyAP1',
 | 
					 | 
				
			||||||
                'version': "ecw5410-2021-04-26-pending-3fc41fa"
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
        "traffic_generator":  {
 | 
					 | 
				
			||||||
            "name": "lanforge",
 | 
					 | 
				
			||||||
            "details": {
 | 
					 | 
				
			||||||
                "ip": "192.168.200.81",
 | 
					 | 
				
			||||||
                "port": 8080,
 | 
					 | 
				
			||||||
                "2.4G-Radio": ["wiphy0"],
 | 
					 | 
				
			||||||
                "5G-Radio": ["wiphy1"],
 | 
					 | 
				
			||||||
                "AX-Radio": ["wiphy2"],
 | 
					 | 
				
			||||||
                "upstream": "eth1",
 | 
					 | 
				
			||||||
                "2.4G-Station-Name": "wlan0",
 | 
					 | 
				
			||||||
                "5G-Station-Name": "wlan1",
 | 
					 | 
				
			||||||
                "AX-Station-Name": "ax",
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "ext-05":  {
 | 
					 | 
				
			||||||
        "controller": {
 | 
					 | 
				
			||||||
            'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build",  # API base url for the controller
 | 
					 | 
				
			||||||
            'username': 'support@example.com',
 | 
					 | 
				
			||||||
            'password': 'support',
 | 
					 | 
				
			||||||
            'version': '1.0.0-SNAPSHOT',
 | 
					 | 
				
			||||||
            'commit_date': '2021-03-01'
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        'access_point': [
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                'model': 'ecw5410',
 | 
					 | 
				
			||||||
                'mode': 'wifi5',
 | 
					 | 
				
			||||||
                'serial': '903cb3944817',
 | 
					 | 
				
			||||||
                'jumphost': True,
 | 
					 | 
				
			||||||
                'ip': "192.168.200.82",
 | 
					 | 
				
			||||||
                'username': "lanforge",
 | 
					 | 
				
			||||||
                'password': "lanforge",
 | 
					 | 
				
			||||||
                'port': 22,
 | 
					 | 
				
			||||||
                'jumphost_tty': '/dev/ttyAP1',
 | 
					 | 
				
			||||||
                'version': "ecw5410-2021-04-26-pending-3fc41fa"
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
        "traffic_generator":  {
 | 
					 | 
				
			||||||
            "name": "lanforge",
 | 
					 | 
				
			||||||
            "details": {
 | 
					 | 
				
			||||||
                "ip": "192.168.200.82",
 | 
					 | 
				
			||||||
                "port": 8080,
 | 
					 | 
				
			||||||
                "2.4G-Radio": ["wiphy0"],
 | 
					 | 
				
			||||||
                "5G-Radio": ["wiphy1"],
 | 
					 | 
				
			||||||
                "AX-Radio": ["wiphy2"],
 | 
					 | 
				
			||||||
                "upstream": "eth1",
 | 
					 | 
				
			||||||
                "2.4G-Station-Name": "wlan0",
 | 
					 | 
				
			||||||
                "5G-Station-Name": "wlan1",
 | 
					 | 
				
			||||||
                "AX-Station-Name": "ax",
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
FIRMWARE = {
 | 
					FIRMWARE = {
 | 
				
			||||||
    # jFrog parameters
 | 
					    # jFrog parameters
 | 
				
			||||||
    "JFROG":
 | 
					    "JFROG":
 | 
				
			||||||
@@ -130,7 +126,7 @@ FIRMWARE = {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RADIUS_SERVER_DATA = {
 | 
					RADIUS_SERVER_DATA = {
 | 
				
			||||||
    "ip": "192.168.200.75",
 | 
					    "ip": "10.28.3.100",
 | 
				
			||||||
    "port": 1812,
 | 
					    "port": 1812,
 | 
				
			||||||
    "secret": "testing123",
 | 
					    "secret": "testing123",
 | 
				
			||||||
    "user": "nolaradius",
 | 
					    "user": "nolaradius",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -92,6 +92,17 @@ Test session base fixture
 | 
				
			|||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# To be depreciated as testrails will go
 | 
				
			||||||
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
 | 
					def test_cases():
 | 
				
			||||||
 | 
					    yield TEST_CASES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
 | 
					def instantiate_jFrog():
 | 
				
			||||||
 | 
					    yield FIRMWARE["JFROG"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
def testbed(request):
 | 
					def testbed(request):
 | 
				
			||||||
    var = request.config.getoption("--testbed")
 | 
					    var = request.config.getoption("--testbed")
 | 
				
			||||||
@@ -129,9 +140,25 @@ def get_apnos():
 | 
				
			|||||||
    yield APNOS
 | 
					    yield APNOS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# APNOS SETUP
 | 
				
			||||||
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
 | 
					def instantiate_access_point(testbed, get_apnos, get_configuration):
 | 
				
			||||||
 | 
					    # Used to add openwrtctl.py in case of serial console mode
 | 
				
			||||||
 | 
					    for access_point_info in get_configuration['access_point']:
 | 
				
			||||||
 | 
					        if access_point_info["jumphost"]:
 | 
				
			||||||
 | 
					            allure.attach(name="added openwrtctl.py to :",
 | 
				
			||||||
 | 
					                          body=access_point_info['ip'] + ":" + str(access_point_info["port"]))
 | 
				
			||||||
 | 
					            get_apnos(access_point_info, pwd="../libs/apnos/")
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            allure.attach(name="Direct AP SSH : ",
 | 
				
			||||||
 | 
					                          body=access_point_info['ip'] + ":" + str(access_point_info["port"]))
 | 
				
			||||||
 | 
					        # Write a code to verify Access Point Connectivity
 | 
				
			||||||
 | 
					    yield True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Controller Fixture
 | 
					# Controller Fixture
 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
def setup_controller(request, get_configuration):
 | 
					def setup_controller(request, get_configuration, instantiate_access_point):
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        sdk_client = Controller(controller_data=get_configuration["controller"])
 | 
					        sdk_client = Controller(controller_data=get_configuration["controller"])
 | 
				
			||||||
        allure.attach(body=str(get_configuration["controller"]), name="Controller Instantiated: ")
 | 
					        allure.attach(body=str(get_configuration["controller"]), name="Controller Instantiated: ")
 | 
				
			||||||
@@ -149,11 +176,11 @@ def setup_controller(request, get_configuration):
 | 
				
			|||||||
    yield sdk_client
 | 
					    yield sdk_client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					@pytest.fixture(scope="class")
 | 
				
			||||||
def instantiate_firmware(controller_instance, instantiate_jFrog, get_configuration):
 | 
					def instantiate_firmware(setup_controller, instantiate_jFrog, get_configuration):
 | 
				
			||||||
    firmware_client_obj = []
 | 
					    firmware_client_obj = []
 | 
				
			||||||
    for access_point_info in get_configuration['access_point']:
 | 
					    for access_point_info in get_configuration['access_point']:
 | 
				
			||||||
        firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=controller_instance,
 | 
					        firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=setup_controller,
 | 
				
			||||||
                                          model=access_point_info["model"],
 | 
					                                          model=access_point_info["model"],
 | 
				
			||||||
                                          version=access_point_info["version"])
 | 
					                                          version=access_point_info["version"])
 | 
				
			||||||
        firmware_client_obj.append(firmware_client)
 | 
					        firmware_client_obj.append(firmware_client)
 | 
				
			||||||
@@ -166,7 +193,7 @@ Instantiate Reporting
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
def instantiate_reporting(request, testbed, get_latest_firmware):
 | 
					def update_report(request, testbed, get_configuration):
 | 
				
			||||||
    if request.config.getoption("--skip-testrail"):
 | 
					    if request.config.getoption("--skip-testrail"):
 | 
				
			||||||
        tr_client = Reporting()
 | 
					        tr_client = Reporting()
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
@@ -177,7 +204,7 @@ def instantiate_reporting(request, testbed, get_latest_firmware):
 | 
				
			|||||||
    else:
 | 
					    else:
 | 
				
			||||||
        projId = tr_client.get_project_id(project_name=request.config.getini("tr_project_id"))
 | 
					        projId = tr_client.get_project_id(project_name=request.config.getini("tr_project_id"))
 | 
				
			||||||
        test_run_name = request.config.getini("tr_prefix") + testbed + "_" + str(
 | 
					        test_run_name = request.config.getini("tr_prefix") + testbed + "_" + str(
 | 
				
			||||||
            datetime.date.today()) + "_" + get_latest_firmware
 | 
					            datetime.date.today()) + "_" + get_configuration['access_point'][0]['version']
 | 
				
			||||||
        tr_client.create_testrun(name=test_run_name, case_ids=list(TEST_CASES.values()), project_id=projId,
 | 
					        tr_client.create_testrun(name=test_run_name, case_ids=list(TEST_CASES.values()), project_id=projId,
 | 
				
			||||||
                                 milestone_id=request.config.getini("milestone"),
 | 
					                                 milestone_id=request.config.getini("milestone"),
 | 
				
			||||||
                                 description="Automated Nightly Sanity test run for new firmware build")
 | 
					                                 description="Automated Nightly Sanity test run for new firmware build")
 | 
				
			||||||
@@ -186,78 +213,15 @@ def instantiate_reporting(request, testbed, get_latest_firmware):
 | 
				
			|||||||
    yield tr_client
 | 
					    yield tr_client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					"""
 | 
				
			||||||
def instantiate_jFrog():
 | 
					FRAMEWORK MARKER LOGIC
 | 
				
			||||||
    yield FIRMWARE["JFROG"]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					 | 
				
			||||||
def check_lanforge_connectivity(testbed):
 | 
					 | 
				
			||||||
    # Check port
 | 
					 | 
				
			||||||
    yield True
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					 | 
				
			||||||
def setup_perfecto_devices(request):
 | 
					 | 
				
			||||||
    yield True
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					 | 
				
			||||||
def test_cases():
 | 
					 | 
				
			||||||
    yield TEST_CASES
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					 | 
				
			||||||
def instantiate_access_point(testbed):
 | 
					 | 
				
			||||||
    APNOS(CONFIGURATION[testbed]['access_point'][0], pwd="../libs/apnos/")
 | 
					 | 
				
			||||||
    yield True
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.fixture(scope="function")
 | 
					 | 
				
			||||||
def test_access_point(testbed, instantiate_access_point):
 | 
					 | 
				
			||||||
    ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0])
 | 
					 | 
				
			||||||
    ap_ssh.reboot()
 | 
					 | 
				
			||||||
    time.sleep(100)
 | 
					 | 
				
			||||||
    status = ap_ssh.get_manager_state()
 | 
					 | 
				
			||||||
    if "ACTIVE" not in status:
 | 
					 | 
				
			||||||
        time.sleep(30)
 | 
					 | 
				
			||||||
        ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0])
 | 
					 | 
				
			||||||
        status = ap_ssh.get_manager_state()
 | 
					 | 
				
			||||||
    yield status
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					 | 
				
			||||||
def setup_profile_data(testbed):
 | 
					 | 
				
			||||||
    model = CONFIGURATION[testbed]["access_point"][0]["model"]
 | 
					 | 
				
			||||||
    profile_data = {}
 | 
					 | 
				
			||||||
    for mode in "BRIDGE", "NAT", "VLAN":
 | 
					 | 
				
			||||||
        profile_data[mode] = {}
 | 
					 | 
				
			||||||
        for security in "OPEN", "WPA", "WPA2_P", "WPA2_E", "WEP":
 | 
					 | 
				
			||||||
            profile_data[mode][security] = {}
 | 
					 | 
				
			||||||
            for radio in "2G", "5G":
 | 
					 | 
				
			||||||
                profile_data[mode][security][radio] = {}
 | 
					 | 
				
			||||||
                name_string = f"{'Sanity'}-{testbed}-{model}-{radio}_{security}_{mode}"
 | 
					 | 
				
			||||||
                ssid_name = f"{'Sanity'}-{model}-{radio}_{security}_{mode}"
 | 
					 | 
				
			||||||
                passkey_string = f"{radio}-{security}_{mode}"
 | 
					 | 
				
			||||||
                profile_data[mode][security][radio]["profile_name"] = name_string
 | 
					 | 
				
			||||||
                profile_data[mode][security][radio]["ssid_name"] = ssid_name
 | 
					 | 
				
			||||||
                if mode == "VLAN":
 | 
					 | 
				
			||||||
                    profile_data[mode][security][radio]["vlan"] = 100
 | 
					 | 
				
			||||||
                else:
 | 
					 | 
				
			||||||
                    profile_data[mode][security][radio]["vlan"] = 1
 | 
					 | 
				
			||||||
                if mode != "NAT":
 | 
					 | 
				
			||||||
                    profile_data[mode][security][radio]["mode"] = "BRIDGE"
 | 
					 | 
				
			||||||
                else:
 | 
					 | 
				
			||||||
                    profile_data[mode][security][radio]["mode"] = "NAT"
 | 
					 | 
				
			||||||
                if security != "OPEN":
 | 
					 | 
				
			||||||
                    profile_data[mode][security][radio]["security_key"] = passkey_string
 | 
					 | 
				
			||||||
                else:
 | 
					 | 
				
			||||||
                    profile_data[mode][security][radio]["security_key"] = "[BLANK]"
 | 
					 | 
				
			||||||
    yield profile_data
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
def get_security_flags():
 | 
					def get_security_flags():
 | 
				
			||||||
 | 
					    # Add more classifications as we go
 | 
				
			||||||
    security = ["open", "wpa", "wpa2_personal", "wpa2_enterprise", "wpa3_enterprise", "twog", "fiveg", "radius"]
 | 
					    security = ["open", "wpa", "wpa2_personal", "wpa2_enterprise", "wpa3_enterprise", "twog", "fiveg", "radius"]
 | 
				
			||||||
    yield security
 | 
					    yield security
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -282,28 +246,43 @@ def get_markers(request, get_security_flags):
 | 
				
			|||||||
    yield security_dict
 | 
					    yield security_dict
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					# Will be availabe as a test case
 | 
				
			||||||
def get_latest_firmware(instantiate_firmware):
 | 
					 | 
				
			||||||
    try:
 | 
					 | 
				
			||||||
        latest_firmware = instantiate_firmware.get_fw_version()
 | 
					 | 
				
			||||||
    except Exception as e:
 | 
					 | 
				
			||||||
        print(e)
 | 
					 | 
				
			||||||
        latest_firmware = False
 | 
					 | 
				
			||||||
    yield latest_firmware
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.fixture(scope="function")
 | 
					@pytest.fixture(scope="function")
 | 
				
			||||||
def check_ap_firmware_ssh(testbed):
 | 
					def test_access_point(testbed, get_apnos, get_configuration):
 | 
				
			||||||
    try:
 | 
					    mgr_status = []
 | 
				
			||||||
        ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0])
 | 
					    for access_point_info in get_configuration['access_point']:
 | 
				
			||||||
        active_fw = ap_ssh.get_active_firmware()
 | 
					        ap_ssh = get_apnos(access_point_info)
 | 
				
			||||||
        print(active_fw)
 | 
					        ap_ssh.reboot()
 | 
				
			||||||
    except Exception as e:
 | 
					        time.sleep(100)
 | 
				
			||||||
        print(e)
 | 
					        status = ap_ssh.get_manager_state()
 | 
				
			||||||
        active_fw = False
 | 
					        if "ACTIVE" not in status:
 | 
				
			||||||
    yield active_fw
 | 
					            time.sleep(30)
 | 
				
			||||||
 | 
					            ap_ssh = APNOS(access_point_info)
 | 
				
			||||||
 | 
					            status = ap_ssh.get_manager_state()
 | 
				
			||||||
 | 
					        mgr_status.append(status)
 | 
				
			||||||
 | 
					    yield mgr_status
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
def client_connectivity():
 | 
					def client_connectivity():
 | 
				
			||||||
    yield StaConnect2
 | 
					    yield StaConnect2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
 | 
					def get_lanforge_data(get_configuration):
 | 
				
			||||||
 | 
					    lanforge_data = {}
 | 
				
			||||||
 | 
					    if get_configuration['traffic_generator']['name'] == 'lanforge':
 | 
				
			||||||
 | 
					        lanforge_data = {
 | 
				
			||||||
 | 
					            "lanforge_ip": get_configuration['traffic_generator']['details']['ip'],
 | 
				
			||||||
 | 
					            "lanforge-port-number": get_configuration['traffic_generator']['details']['port'],
 | 
				
			||||||
 | 
					            "lanforge_2dot4g": get_configuration['traffic_generator']['details']['2.4G-Radio'][0],
 | 
				
			||||||
 | 
					            "lanforge_5g": get_configuration['traffic_generator']['details']['5G-Radio'][0],
 | 
				
			||||||
 | 
					            "lanforge_2dot4g_prefix": get_configuration['traffic_generator']['details']['2.4G-Station-Name'],
 | 
				
			||||||
 | 
					            "lanforge_5g_prefix": get_configuration['traffic_generator']['details']['5G-Station-Name'],
 | 
				
			||||||
 | 
					            "lanforge_2dot4g_station": get_configuration['traffic_generator']['details']['2.4G-Station-Name'],
 | 
				
			||||||
 | 
					            "lanforge_5g_station": get_configuration['traffic_generator']['details']['5G-Station-Name'],
 | 
				
			||||||
 | 
					            "lanforge_bridge_port": get_configuration['traffic_generator']['details']['upstream'],
 | 
				
			||||||
 | 
					            "lanforge_vlan_port": get_configuration['traffic_generator']['details']['upstream'] + ".100",
 | 
				
			||||||
 | 
					            "vlan": 100
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    yield lanforge_data
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,81 +1,81 @@
 | 
				
			|||||||
"""
 | 
					# """
 | 
				
			||||||
    Test Case Module:  setup test cases for basic test cases
 | 
					#     Test Case Module:  setup test cases for basic test cases
 | 
				
			||||||
    Details:    Firmware Upgrade
 | 
					#     Details:    Firmware Upgrade
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
"""
 | 
					# """
 | 
				
			||||||
import pytest
 | 
					# import pytest
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
@pytest.mark.configure_lanforge
 | 
					# @pytest.mark.configure_lanforge
 | 
				
			||||||
def test_configure_lanforge(configure_lanforge):
 | 
					# def test_configure_lanforge(configure_lanforge):
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
    assert True
 | 
					#     assert True
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
@pytest.mark.sanity
 | 
					# @pytest.mark.sanity
 | 
				
			||||||
@pytest.mark.bridge
 | 
					# @pytest.mark.bridge
 | 
				
			||||||
@pytest.mark.nat
 | 
					# @pytest.mark.nat
 | 
				
			||||||
@pytest.mark.vlan
 | 
					# @pytest.mark.vlan
 | 
				
			||||||
@pytest.mark.firmware
 | 
					# @pytest.mark.firmware
 | 
				
			||||||
class TestFirmware(object):
 | 
					# class TestFirmware(object):
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
    @pytest.mark.firmware_create
 | 
					#     @pytest.mark.firmware_create
 | 
				
			||||||
    def test_firmware_create(self, upload_firmware, instantiate_testrail, instantiate_project, test_cases):
 | 
					#     def test_firmware_create(self, upload_firmware, instantiate_testrail, instantiate_project, test_cases):
 | 
				
			||||||
        if upload_firmware != 0:
 | 
					#         if upload_firmware != 0:
 | 
				
			||||||
            instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
 | 
					#             instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
 | 
				
			||||||
                                                 status_id=1,
 | 
					#                                                  status_id=1,
 | 
				
			||||||
                                                 msg='Create new FW version by API successful')
 | 
					#                                                  msg='Create new FW version by API successful')
 | 
				
			||||||
            PASS = True
 | 
					#             PASS = True
 | 
				
			||||||
        else:
 | 
					#         else:
 | 
				
			||||||
            instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
 | 
					#             instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
 | 
				
			||||||
                                                 status_id=5,
 | 
					#                                                  status_id=5,
 | 
				
			||||||
                                                 msg='Error creating new FW version by API')
 | 
					#                                                  msg='Error creating new FW version by API')
 | 
				
			||||||
            PASS = False
 | 
					#             PASS = False
 | 
				
			||||||
        assert PASS
 | 
					#         assert PASS
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
    @pytest.mark.firmware_upgrade
 | 
					#     @pytest.mark.firmware_upgrade
 | 
				
			||||||
    def test_firmware_upgrade_request(self, upgrade_firmware, instantiate_testrail, instantiate_project, test_cases):
 | 
					#     def test_firmware_upgrade_request(self, upgrade_firmware, instantiate_testrail, instantiate_project, test_cases):
 | 
				
			||||||
        print()
 | 
					#         print()
 | 
				
			||||||
        if not upgrade_firmware:
 | 
					#         if not upgrade_firmware:
 | 
				
			||||||
            instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
 | 
					#             instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
 | 
				
			||||||
                                                 status_id=0,
 | 
					#                                                  status_id=0,
 | 
				
			||||||
                                                 msg='Error requesting upgrade via API')
 | 
					#                                                  msg='Error requesting upgrade via API')
 | 
				
			||||||
            PASS = False
 | 
					#             PASS = False
 | 
				
			||||||
        else:
 | 
					#         else:
 | 
				
			||||||
            instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
 | 
					#             instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
 | 
				
			||||||
                                                 status_id=1,
 | 
					#                                                  status_id=1,
 | 
				
			||||||
                                                 msg='Upgrade request using API successful')
 | 
					#                                                  msg='Upgrade request using API successful')
 | 
				
			||||||
            PASS = True
 | 
					#             PASS = True
 | 
				
			||||||
        assert PASS
 | 
					#         assert PASS
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
    @pytest.mark.check_active_firmware_cloud
 | 
					#     @pytest.mark.check_active_firmware_cloud
 | 
				
			||||||
    def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, instantiate_testrail,
 | 
					#     def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, instantiate_testrail,
 | 
				
			||||||
                                  instantiate_project, test_cases):
 | 
					#                                   instantiate_project, test_cases):
 | 
				
			||||||
        if get_latest_firmware != check_ap_firmware_cloud:
 | 
					#         if get_latest_firmware != check_ap_firmware_cloud:
 | 
				
			||||||
            instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
 | 
					#             instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
 | 
				
			||||||
                                                 status_id=5,
 | 
					#                                                  status_id=5,
 | 
				
			||||||
                                                 msg='CLOUDSDK reporting incorrect firmware version.')
 | 
					#                                                  msg='CLOUDSDK reporting incorrect firmware version.')
 | 
				
			||||||
        else:
 | 
					#         else:
 | 
				
			||||||
            instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
 | 
					#             instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
 | 
				
			||||||
                                                 status_id=1,
 | 
					#                                                  status_id=1,
 | 
				
			||||||
                                                 msg='CLOUDSDK reporting correct firmware version.')
 | 
					#                                                  msg='CLOUDSDK reporting correct firmware version.')
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
        assert get_latest_firmware == check_ap_firmware_cloud
 | 
					#         assert get_latest_firmware == check_ap_firmware_cloud
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
@pytest.mark.sanity
 | 
					# @pytest.mark.sanity
 | 
				
			||||||
@pytest.mark.bridge
 | 
					# @pytest.mark.bridge
 | 
				
			||||||
@pytest.mark.nat
 | 
					# @pytest.mark.nat
 | 
				
			||||||
@pytest.mark.vlan
 | 
					# @pytest.mark.vlan
 | 
				
			||||||
@pytest.mark.check_active_firmware_ap
 | 
					# @pytest.mark.check_active_firmware_ap
 | 
				
			||||||
def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_testrail, instantiate_project,
 | 
					# def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_testrail, instantiate_project,
 | 
				
			||||||
                     test_cases):
 | 
					#                      test_cases):
 | 
				
			||||||
    if check_ap_firmware_ssh == get_latest_firmware:
 | 
					#     if check_ap_firmware_ssh == get_latest_firmware:
 | 
				
			||||||
        instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
 | 
					#         instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
 | 
				
			||||||
                                             status_id=1,
 | 
					#                                              status_id=1,
 | 
				
			||||||
                                             msg='Upgrade to ' + get_latest_firmware + ' successful')
 | 
					#                                              msg='Upgrade to ' + get_latest_firmware + ' successful')
 | 
				
			||||||
    else:
 | 
					#     else:
 | 
				
			||||||
        instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
 | 
					#         instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
 | 
				
			||||||
                                             status_id=4,
 | 
					#                                              status_id=4,
 | 
				
			||||||
                                             msg='Cannot reach AP after upgrade to check CLI - re-test required')
 | 
					#                                              msg='Cannot reach AP after upgrade to check CLI - re-test required')
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
    assert check_ap_firmware_ssh == get_latest_firmware
 | 
					#     assert check_ap_firmware_ssh == get_latest_firmware
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,91 +0,0 @@
 | 
				
			|||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.configuration, pytest.mark.basic]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_general = {
 | 
					 | 
				
			||||||
    "mode": "BRIDGE",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
                 {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
 | 
					 | 
				
			||||||
        "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
                {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
                 "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa2_personal": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}]},
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": False
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_general],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestBridgeModeConfiguration(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('open 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_2g_config(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        allure.attach(str(setup_client_connectivity["open_2g"]), 'OPEN SSID 2.4 GHz Creation : ')
 | 
					 | 
				
			||||||
        assert setup_client_connectivity["open_2g"]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('open 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_5g_config(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        allure.attach(str(setup_client_connectivity["open_5g"]), 'OPEN SSID 5 GHz Creation : ')
 | 
					 | 
				
			||||||
        assert setup_client_connectivity["open_5g"]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_2g_config(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        allure.attach(str(setup_client_connectivity["wpa_2g"]), 'WPA SSID 2.4 GHz Creation : ')
 | 
					 | 
				
			||||||
        assert setup_client_connectivity["wpa_2g"]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_5g_config(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        allure.attach(str(setup_client_connectivity["wpa_5g"]), 'WPA SSID 5 GHz Creation : ')
 | 
					 | 
				
			||||||
        assert setup_client_connectivity["wpa_5g"]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_2g_config(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        allure.attach(str(setup_client_connectivity["wpa2_personal_2g"]), 'WPA2 Personal SSID 2.4 GHz Creation : ')
 | 
					 | 
				
			||||||
        assert setup_client_connectivity["wpa2_personal_2g"]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_5g_config(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        allure.attach(str(setup_client_connectivity["wpa2_personal_5g"]), 'WPA2 Personal SSID 5 GHz Creation : ')
 | 
					 | 
				
			||||||
        assert setup_client_connectivity["wpa2_personal_5g"]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @allure.story('equipment AP Configuration')
 | 
					 | 
				
			||||||
    def test_equipment_ap_profile_configuration(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        allure.attach(str(setup_client_connectivity["equipment_ap"]), 'Equipment AP Profile Creation : ')
 | 
					 | 
				
			||||||
        assert setup_client_connectivity["equipment_ap"]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @allure.story('Config push from controller to AP')
 | 
					 | 
				
			||||||
    def test_verify_vif_config(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        allure.attach(str(setup_client_connectivity["vifc"]), 'Profile Push from Controller to AP : ')
 | 
					 | 
				
			||||||
        assert setup_client_connectivity["vifc"]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @allure.story('Config in VIF State')
 | 
					 | 
				
			||||||
    def test_verify_vif_state(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        allure.attach(str(setup_client_connectivity["vifs"]), 'VIF CONFIG AND VIF STATE ARE SAME : ')
 | 
					 | 
				
			||||||
        assert setup_client_connectivity["vifs"]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,124 +0,0 @@
 | 
				
			|||||||
import time
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.basic]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_general = {
 | 
					 | 
				
			||||||
    "mode": "BRIDGE",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
                 {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
 | 
					 | 
				
			||||||
        "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
                {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
                 "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa2_personal": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}]},
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": False
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_general],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestBridgeModeConnectivity(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('open 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_2g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["open"][0]
 | 
					 | 
				
			||||||
        print(ssid_data)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('open 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_5g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["open"][1]
 | 
					 | 
				
			||||||
        print(ssid_data)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_2g(self, request, get_lanforge_data, instantiate_project, instantiate_testrail,
 | 
					 | 
				
			||||||
                         client_connectivity, test_cases):
 | 
					 | 
				
			||||||
        profile_data = setup_params_general["ssid_modes"]["wpa"][0]
 | 
					 | 
				
			||||||
        print(profile_data)
 | 
					 | 
				
			||||||
        station_names = []
 | 
					 | 
				
			||||||
        for i in range(0, int(request.config.getini("num_stations"))):
 | 
					 | 
				
			||||||
            station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
 | 
					 | 
				
			||||||
        print(profile_data, get_lanforge_data)
 | 
					 | 
				
			||||||
        staConnect = client_connectivity(get_lanforge_data["lanforge_ip"],
 | 
					 | 
				
			||||||
                                         int(get_lanforge_data["lanforge-port-number"]),
 | 
					 | 
				
			||||||
                                         debug_=False)
 | 
					 | 
				
			||||||
        staConnect.sta_mode = 0
 | 
					 | 
				
			||||||
        staConnect.upstream_resource = 1
 | 
					 | 
				
			||||||
        staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
 | 
					 | 
				
			||||||
        staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
 | 
					 | 
				
			||||||
        staConnect.resource = 1
 | 
					 | 
				
			||||||
        staConnect.dut_ssid = profile_data["ssid_name"]
 | 
					 | 
				
			||||||
        staConnect.dut_passwd = profile_data["security_key"]
 | 
					 | 
				
			||||||
        staConnect.dut_security = "wpa"
 | 
					 | 
				
			||||||
        staConnect.station_names = station_names
 | 
					 | 
				
			||||||
        staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
 | 
					 | 
				
			||||||
        staConnect.runtime_secs = 10
 | 
					 | 
				
			||||||
        staConnect.bringup_time_sec = 60
 | 
					 | 
				
			||||||
        staConnect.cleanup_on_exit = True
 | 
					 | 
				
			||||||
        # staConnect.cleanup()
 | 
					 | 
				
			||||||
        staConnect.setup()
 | 
					 | 
				
			||||||
        staConnect.start()
 | 
					 | 
				
			||||||
        print("napping %f sec" % staConnect.runtime_secs)
 | 
					 | 
				
			||||||
        time.sleep(staConnect.runtime_secs)
 | 
					 | 
				
			||||||
        staConnect.stop()
 | 
					 | 
				
			||||||
        staConnect.cleanup()
 | 
					 | 
				
			||||||
        run_results = staConnect.get_result_list()
 | 
					 | 
				
			||||||
        for result in run_results:
 | 
					 | 
				
			||||||
            print("test result: " + result)
 | 
					 | 
				
			||||||
        # result = 'pass'
 | 
					 | 
				
			||||||
        print("Single Client Connectivity :", staConnect.passes)
 | 
					 | 
				
			||||||
        if staConnect.passes():
 | 
					 | 
				
			||||||
            instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_bridge"], run_id=instantiate_project,
 | 
					 | 
				
			||||||
                                                 status_id=1,
 | 
					 | 
				
			||||||
                                                 msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
					 | 
				
			||||||
                                                     run_results))
 | 
					 | 
				
			||||||
        else:
 | 
					 | 
				
			||||||
            instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_bridge"], run_id=instantiate_project,
 | 
					 | 
				
			||||||
                                                 status_id=5,
 | 
					 | 
				
			||||||
                                                 msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
					 | 
				
			||||||
                                                     run_results))
 | 
					 | 
				
			||||||
        assert staConnect.passes()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_5g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa"][1]
 | 
					 | 
				
			||||||
        print(ssid_data)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_2g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
 | 
					 | 
				
			||||||
        print(ssid_data)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_5g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
 | 
					 | 
				
			||||||
        print(ssid_data)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
@@ -1,55 +0,0 @@
 | 
				
			|||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.enterprise, pytest.mark.bridge, pytest.mark.configuration]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_enterprise = {
 | 
					 | 
				
			||||||
    "mode": "BRIDGE",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "wpa2_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa3_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": True
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_enterprise],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestBridgeModeEnterprise(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_2g(self):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_2g(self):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,55 +0,0 @@
 | 
				
			|||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.enterprise, pytest.mark.bridge]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_enterprise = {
 | 
					 | 
				
			||||||
    "mode": "BRIDGE",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "wpa2_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa3_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": True
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_enterprise],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestBridgeModeEnterprise(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_2g(self,):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_2g(self):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,344 +0,0 @@
 | 
				
			|||||||
import time
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					 | 
				
			||||||
def setup_vlan():
 | 
					 | 
				
			||||||
    vlan_id = [100]
 | 
					 | 
				
			||||||
    allure.attach(body=str(vlan_id), name="VLAN Created: ")
 | 
					 | 
				
			||||||
    yield vlan_id[0]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@allure.feature("CLIENT CONNECTIVITY SETUP")
 | 
					 | 
				
			||||||
@pytest.fixture(scope="package")
 | 
					 | 
				
			||||||
def setup_client_connectivity(request, instantiate_controller, testbed, setup_vlan, get_equipment_id,
 | 
					 | 
				
			||||||
                              instantiate_profile, get_markers,
 | 
					 | 
				
			||||||
                              get_security_flags, get_configuration, radius_info, get_apnos):
 | 
					 | 
				
			||||||
    instantiate_profile = instantiate_profile(sdk_client=instantiate_controller)
 | 
					 | 
				
			||||||
    vlan_id, mode = 0, 0
 | 
					 | 
				
			||||||
    instantiate_profile.cleanup_objects()
 | 
					 | 
				
			||||||
    parameter = dict(request.param)
 | 
					 | 
				
			||||||
    test_cases = {}
 | 
					 | 
				
			||||||
    profile_data = {}
 | 
					 | 
				
			||||||
    if parameter['mode'] not in ["BRIDGE", "NAT", "VLAN"]:
 | 
					 | 
				
			||||||
        print("Invalid Mode: ", parameter['mode'])
 | 
					 | 
				
			||||||
        allure.attach(body=parameter['mode'], name="Invalid Mode: ")
 | 
					 | 
				
			||||||
        yield test_cases
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if parameter['mode'] == "NAT":
 | 
					 | 
				
			||||||
        mode = "NAT"
 | 
					 | 
				
			||||||
        vlan_id = 1
 | 
					 | 
				
			||||||
    if parameter['mode'] == "BRIDGE":
 | 
					 | 
				
			||||||
        mode = "BRIDGE"
 | 
					 | 
				
			||||||
        vlan_id = 1
 | 
					 | 
				
			||||||
    if parameter['mode'] == "VLAN":
 | 
					 | 
				
			||||||
        mode = "BRIDGE"
 | 
					 | 
				
			||||||
        vlan_id = setup_vlan
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Equipment-AP-" + parameter['mode'])
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    profile_data["equipment_ap"] = {"profile_name": testbed + "-Equipment-AP-" + parameter['mode']}
 | 
					 | 
				
			||||||
    profile_data["ssid"] = {}
 | 
					 | 
				
			||||||
    for i in parameter["ssid_modes"]:
 | 
					 | 
				
			||||||
        profile_data["ssid"][i] = []
 | 
					 | 
				
			||||||
        for j in range(len(parameter["ssid_modes"][i])):
 | 
					 | 
				
			||||||
            profile_name = testbed + "-SSID-" + i + "-" + str(j) + "-" + parameter['mode']
 | 
					 | 
				
			||||||
            data = parameter["ssid_modes"][i][j]
 | 
					 | 
				
			||||||
            data["profile_name"] = profile_name
 | 
					 | 
				
			||||||
            if "mode" not in dict(data).keys():
 | 
					 | 
				
			||||||
                data["mode"] = mode
 | 
					 | 
				
			||||||
            if "vlan" not in dict(data).keys():
 | 
					 | 
				
			||||||
                data["vlan"] = vlan_id
 | 
					 | 
				
			||||||
            instantiate_profile.delete_profile_by_name(profile_name=profile_name)
 | 
					 | 
				
			||||||
            profile_data["ssid"][i].append(data)
 | 
					 | 
				
			||||||
    #         print(profile_name)
 | 
					 | 
				
			||||||
    # print(profile_data)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + mode)
 | 
					 | 
				
			||||||
    time.sleep(10)
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
      Setting up rf profile
 | 
					 | 
				
			||||||
    """
 | 
					 | 
				
			||||||
    rf_profile_data = {
 | 
					 | 
				
			||||||
        "name": "RF-Profile-" + testbed + "-" + parameter['mode'] + "-" +
 | 
					 | 
				
			||||||
                get_configuration[testbed]['access_point'][0]['mode']
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    for i in parameter["rf"]:
 | 
					 | 
				
			||||||
        rf_profile_data[i] = parameter['rf'][i]
 | 
					 | 
				
			||||||
    # print(rf_profile_data)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    try:
 | 
					 | 
				
			||||||
        instantiate_profile.delete_profile_by_name(profile_name=rf_profile_data['name'])
 | 
					 | 
				
			||||||
        instantiate_profile.set_rf_profile(profile_data=rf_profile_data,
 | 
					 | 
				
			||||||
                                           mode=get_configuration[testbed]['access_point'][0]['mode'])
 | 
					 | 
				
			||||||
        allure.attach(body=str(rf_profile_data),
 | 
					 | 
				
			||||||
                      name="RF Profile Created : " + get_configuration[testbed]['access_point'][0]['mode'])
 | 
					 | 
				
			||||||
    except Exception as e:
 | 
					 | 
				
			||||||
        print(e)
 | 
					 | 
				
			||||||
        allure.attach(body=str(e), name="Exception ")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Radius Profile Creation
 | 
					 | 
				
			||||||
    if parameter["radius"]:
 | 
					 | 
				
			||||||
        radius_info = radius_info
 | 
					 | 
				
			||||||
        radius_info["name"] = testbed + "-Automation-Radius-Profile-" + testbed
 | 
					 | 
				
			||||||
        instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + testbed)
 | 
					 | 
				
			||||||
        try:
 | 
					 | 
				
			||||||
            # pass
 | 
					 | 
				
			||||||
            instantiate_profile.create_radius_profile(radius_info=radius_info)
 | 
					 | 
				
			||||||
            allure.attach(body=str(radius_info),
 | 
					 | 
				
			||||||
                          name="Radius Profile Created")
 | 
					 | 
				
			||||||
            test_cases['radius_profile'] = True
 | 
					 | 
				
			||||||
        except Exception as e:
 | 
					 | 
				
			||||||
            print(e)
 | 
					 | 
				
			||||||
            test_cases['radius_profile'] = False
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # SSID Profile Creation
 | 
					 | 
				
			||||||
    print(get_markers)
 | 
					 | 
				
			||||||
    for mode in profile_data['ssid']:
 | 
					 | 
				
			||||||
        if mode == "open":
 | 
					 | 
				
			||||||
            for j in profile_data["ssid"][mode]:
 | 
					 | 
				
			||||||
                # print(j)
 | 
					 | 
				
			||||||
                if mode in get_markers.keys() and get_markers[mode]:
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["open_2g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["open_2g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["open_5g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["open_5g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if mode == "wpa":
 | 
					 | 
				
			||||||
            for j in profile_data["ssid"][mode]:
 | 
					 | 
				
			||||||
                # print(j)
 | 
					 | 
				
			||||||
                if mode in get_markers.keys() and get_markers[mode]:
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_wpa_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["wpa_2g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["wpa_2g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_wpa_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["wpa_5g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["wpa_5g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
        if mode == "wpa2_personal":
 | 
					 | 
				
			||||||
            for j in profile_data["ssid"][mode]:
 | 
					 | 
				
			||||||
                # print(j)
 | 
					 | 
				
			||||||
                if mode in get_markers.keys() and get_markers[mode]:
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["wpa2_personal_2g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["wpa2_personal_2g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["wpa2_personal_5g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["wpa2_personal_5g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if mode == "wpa3_personal":
 | 
					 | 
				
			||||||
            for j in profile_data["ssid"][mode]:
 | 
					 | 
				
			||||||
                # print(j)
 | 
					 | 
				
			||||||
                if mode in get_markers.keys() and get_markers[mode]:
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_wpa3_personal_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["wpa3_personal_2g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["wpa3_personal_2g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_wpa3_personal_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["wpa3_personal_5g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["wpa3_personal_5g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if mode == "wpa2_enterprise":
 | 
					 | 
				
			||||||
            for j in profile_data["ssid"][mode]:
 | 
					 | 
				
			||||||
                # print(j)
 | 
					 | 
				
			||||||
                if mode in get_markers.keys() and get_markers[mode]:
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["wpa2_enterprise_2g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["wpa2_enterprise_2g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["wpa2_enterprise_5g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["wpa2_enterprise_5g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if mode == "wpa3_enterprise":
 | 
					 | 
				
			||||||
            for j in profile_data["ssid"][mode]:
 | 
					 | 
				
			||||||
                # print(j)
 | 
					 | 
				
			||||||
                if mode in get_markers.keys() and get_markers[mode]:
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_wpa3_enterprise_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["wpa3_enterprise_2g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["wpa3_enterprise_2g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
                    try:
 | 
					 | 
				
			||||||
                        if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
 | 
					 | 
				
			||||||
                                j["appliedRadios"]):
 | 
					 | 
				
			||||||
                            creates_profile = instantiate_profile.create_wpa3_enterprise_ssid_profile(profile_data=j)
 | 
					 | 
				
			||||||
                            test_cases["wpa3_enterprise_5g"] = True
 | 
					 | 
				
			||||||
                            allure.attach(body=str(creates_profile),
 | 
					 | 
				
			||||||
                                          name="SSID Profile Created")
 | 
					 | 
				
			||||||
                    except Exception as e:
 | 
					 | 
				
			||||||
                        print(e)
 | 
					 | 
				
			||||||
                        test_cases["wpa3_enterprise_5g"] = False
 | 
					 | 
				
			||||||
                        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                                      name="SSID Profile Creation Failed")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Equipment AP Profile Creation
 | 
					 | 
				
			||||||
    try:
 | 
					 | 
				
			||||||
        instantiate_profile.set_ap_profile(profile_data=profile_data['equipment_ap'])
 | 
					 | 
				
			||||||
        test_cases["equipment_ap"] = True
 | 
					 | 
				
			||||||
        allure.attach(body=str(profile_data['equipment_ap']),
 | 
					 | 
				
			||||||
                      name="Equipment AP Profile Created")
 | 
					 | 
				
			||||||
    except Exception as e:
 | 
					 | 
				
			||||||
        print(e)
 | 
					 | 
				
			||||||
        test_cases["equipment_ap"] = False
 | 
					 | 
				
			||||||
        allure.attach(body=str(e),
 | 
					 | 
				
			||||||
                      name="Equipment AP Profile Creation Failed")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Push the Equipment AP Profile to AP
 | 
					 | 
				
			||||||
    try:
 | 
					 | 
				
			||||||
        instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
 | 
					 | 
				
			||||||
    except Exception as e:
 | 
					 | 
				
			||||||
        print(e)
 | 
					 | 
				
			||||||
        print("failed to create AP Profile")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ap_ssh = get_apnos(get_configuration[testbed]['access_point'][0], pwd="../libs/apnos/")
 | 
					 | 
				
			||||||
    ssid_names = []
 | 
					 | 
				
			||||||
    for i in instantiate_profile.profile_creation_ids["ssid"]:
 | 
					 | 
				
			||||||
        ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i))
 | 
					 | 
				
			||||||
    ssid_names.sort()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # This loop will check the VIF Config with cloud profile
 | 
					 | 
				
			||||||
    vif_config = []
 | 
					 | 
				
			||||||
    test_cases['vifc'] = False
 | 
					 | 
				
			||||||
    for i in range(0, 18):
 | 
					 | 
				
			||||||
        vif_config = list(ap_ssh.get_vif_config_ssids())
 | 
					 | 
				
			||||||
        vif_config.sort()
 | 
					 | 
				
			||||||
        print(vif_config)
 | 
					 | 
				
			||||||
        print(ssid_names)
 | 
					 | 
				
			||||||
        if ssid_names == vif_config:
 | 
					 | 
				
			||||||
            test_cases['vifc'] = True
 | 
					 | 
				
			||||||
            break
 | 
					 | 
				
			||||||
        time.sleep(10)
 | 
					 | 
				
			||||||
    allure.attach(body=str("VIF Config: " + str(vif_config) + "\n" + "SSID Pushed from Controller: " + str(ssid_names)),
 | 
					 | 
				
			||||||
                  name="SSID Profiles in VIF Config and Controller: ")
 | 
					 | 
				
			||||||
    ap_ssh = get_apnos(get_configuration[testbed]['access_point'][0], pwd="../libs/apnos/")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # This loop will check the VIF Config with VIF State
 | 
					 | 
				
			||||||
    test_cases['vifs'] = False
 | 
					 | 
				
			||||||
    for i in range(0, 18):
 | 
					 | 
				
			||||||
        vif_state = list(ap_ssh.get_vif_state_ssids())
 | 
					 | 
				
			||||||
        vif_state.sort()
 | 
					 | 
				
			||||||
        vif_config = list(ap_ssh.get_vif_config_ssids())
 | 
					 | 
				
			||||||
        vif_config.sort()
 | 
					 | 
				
			||||||
        print(vif_config)
 | 
					 | 
				
			||||||
        print(vif_state)
 | 
					 | 
				
			||||||
        if vif_state == vif_config:
 | 
					 | 
				
			||||||
            test_cases['vifs'] = True
 | 
					 | 
				
			||||||
            break
 | 
					 | 
				
			||||||
        time.sleep(10)
 | 
					 | 
				
			||||||
    allure.attach(body=str("VIF Config: " + str(vif_config) + "\n" + "VIF State: " + str(vif_state)),
 | 
					 | 
				
			||||||
                  name="SSID Profiles in VIF Config and VIF State: ")
 | 
					 | 
				
			||||||
    print(test_cases)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def teardown_session():
 | 
					 | 
				
			||||||
        print("\nRemoving Profiles")
 | 
					 | 
				
			||||||
        instantiate_profile.delete_profile_by_name(profile_name=profile_data['equipment_ap']['profile_name'])
 | 
					 | 
				
			||||||
        instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["ssid"])
 | 
					 | 
				
			||||||
        instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["radius"])
 | 
					 | 
				
			||||||
        instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["rf"])
 | 
					 | 
				
			||||||
        allure.attach(body=str(profile_data['equipment_ap']['profile_name'] + "\n"),
 | 
					 | 
				
			||||||
                      name="Tear Down in Profiles ")
 | 
					 | 
				
			||||||
        time.sleep(20)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    request.addfinalizer(teardown_session)
 | 
					 | 
				
			||||||
    yield test_cases
 | 
					 | 
				
			||||||
@@ -1,78 +0,0 @@
 | 
				
			|||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_general = {
 | 
					 | 
				
			||||||
    "mode": "NAT",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
                 {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
 | 
					 | 
				
			||||||
        "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
                {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
                 "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa2_personal": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}]},
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": False
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_general],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestNATModeConnectivity(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('open 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_2g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["open"][0]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('open 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_5g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["open"][1]
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_2g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa"][0]
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_5g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa"][1]
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_2g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_5g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,78 +0,0 @@
 | 
				
			|||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat, pytest.mark.configuration]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_general = {
 | 
					 | 
				
			||||||
    "mode": "NAT",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
                 {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
 | 
					 | 
				
			||||||
        "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
                {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
                 "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa2_personal": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}]},
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": False
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_general],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestNATModeConnectivity(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('open 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_2g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["open"][0]
 | 
					 | 
				
			||||||
        allure.attach(str(setup_client_connectivity), 'Hello, World')
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('open 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_5g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["open"][1]
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_2g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa"][0]
 | 
					 | 
				
			||||||
        print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_5g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa"][1]
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_2g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
 | 
					 | 
				
			||||||
        print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_5g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,55 +0,0 @@
 | 
				
			|||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.enterprise, pytest.mark.nat, pytest.mark.configuration]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_enterprise = {
 | 
					 | 
				
			||||||
    "mode": "NAT",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "wpa2_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa3_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": True
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_enterprise],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestNATModeEnterprise(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_2g(self):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_2g(self):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,55 +0,0 @@
 | 
				
			|||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.enterprise, pytest.mark.nat]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_enterprise = {
 | 
					 | 
				
			||||||
    "mode": "NAT",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "wpa2_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa3_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": True
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_enterprise],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestNATModeEnterprise(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_2g(self,):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_2g(self):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,78 +0,0 @@
 | 
				
			|||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_general = {
 | 
					 | 
				
			||||||
    "mode": "VLAN",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
                 {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
 | 
					 | 
				
			||||||
        "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
                {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
                 "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa2_personal": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}]},
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": False
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@allure.feature("VLAN MODE CLIENT CONNECTIVITY")
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_general],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestVLANModeConnectivity(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('open 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_2g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["open"][0]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('open 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_5g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["open"][1]
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_2g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa"][0]
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_5g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa"][1]
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_2g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_5g(self):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,78 +0,0 @@
 | 
				
			|||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan, pytest.mark.configuration]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_general = {
 | 
					 | 
				
			||||||
    "mode": "VLAN",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
                 {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
 | 
					 | 
				
			||||||
        "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
                {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
                 "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa2_personal": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}]},
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": False
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@allure.feature("VLAN MODE CLIENT CONNECTIVITY")
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_general],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestVLANModeConnectivity(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('open 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_2g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["open"][0]
 | 
					 | 
				
			||||||
        allure.attach(str(setup_client_connectivity), 'Hello, World')
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.open
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('open 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_open_ssid_5g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["open"][1]
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_2g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa"][0]
 | 
					 | 
				
			||||||
        print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa_ssid_5g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa"][1]
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 2.4 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_2g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
 | 
					 | 
				
			||||||
        print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_personal
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    @allure.story('wpa2_personal 5 GHZ Band')
 | 
					 | 
				
			||||||
    def test_wpa2_personal_ssid_5g(self, setup_client_connectivity):
 | 
					 | 
				
			||||||
        ssid_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
 | 
					 | 
				
			||||||
        assert setup_client_connectivity
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,55 +0,0 @@
 | 
				
			|||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.enterprise, pytest.mark.bridge, pytest.mark.configuration]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_enterprise = {
 | 
					 | 
				
			||||||
    "mode": "BRIDGE",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "wpa2_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa3_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": True
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_enterprise],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestBridgeModeEnterprise(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_2g(self):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_2g(self):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,55 +0,0 @@
 | 
				
			|||||||
import pytest
 | 
					 | 
				
			||||||
import allure
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.enterprise, pytest.mark.bridge]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
setup_params_enterprise = {
 | 
					 | 
				
			||||||
    "mode": "BRIDGE",
 | 
					 | 
				
			||||||
    "ssid_modes": {
 | 
					 | 
				
			||||||
        "wpa2_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
					 | 
				
			||||||
             "security_key": "something"}],
 | 
					 | 
				
			||||||
        "wpa3_enterprise": [
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
					 | 
				
			||||||
            {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    "rf": {},
 | 
					 | 
				
			||||||
    "radius": True
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.mark.parametrize(
 | 
					 | 
				
			||||||
    'setup_client_connectivity',
 | 
					 | 
				
			||||||
    [setup_params_enterprise],
 | 
					 | 
				
			||||||
    indirect=True,
 | 
					 | 
				
			||||||
    scope="package"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
@pytest.mark.usefixtures("setup_client_connectivity")
 | 
					 | 
				
			||||||
class TestBridgeModeEnterprise(object):
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_2g(self,):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa2_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa2_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.twog
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_2g(self):
 | 
					 | 
				
			||||||
        # print(setup_client_connectivity)
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @pytest.mark.wpa3_enterprise
 | 
					 | 
				
			||||||
    @pytest.mark.fiveg
 | 
					 | 
				
			||||||
    def test_wpa3_enterprise_5g(self):
 | 
					 | 
				
			||||||
        assert "setup_client_connectivity"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -1,39 +1,49 @@
 | 
				
			|||||||
import time
 | 
					import os
 | 
				
			||||||
 | 
					import sys
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sys.path.append(
 | 
				
			||||||
 | 
					    os.path.dirname(
 | 
				
			||||||
 | 
					        os.path.realpath(__file__)
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					if "libs" not in sys.path:
 | 
				
			||||||
 | 
					    sys.path.append(f'../libs')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from controller.controller import ProfileUtility
 | 
				
			||||||
 | 
					import time
 | 
				
			||||||
 | 
					from lanforge.lf_tests import RunTest
 | 
				
			||||||
import pytest
 | 
					import pytest
 | 
				
			||||||
import allure
 | 
					import allure
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
 | 
					def get_equipment_id(setup_controller, testbed, get_configuration):
 | 
				
			||||||
 | 
					    equipment_id = 0
 | 
				
			||||||
 | 
					    if len(get_configuration['access_point']) == 1:
 | 
				
			||||||
 | 
					        equipment_id = setup_controller.get_equipment_id(
 | 
				
			||||||
 | 
					            serial_number=get_configuration['access_point'][0]['serial'])
 | 
				
			||||||
 | 
					    print(equipment_id)
 | 
				
			||||||
 | 
					    yield equipment_id
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
 | 
					def instantiate_profile():
 | 
				
			||||||
 | 
					    yield ProfileUtility
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
def setup_vlan():
 | 
					def setup_vlan():
 | 
				
			||||||
    vlan_id = [100]
 | 
					    vlan_id = [100]
 | 
				
			||||||
    allure.attach(body=str(vlan_id), name="VLAN Created: ")
 | 
					    allure.attach(body=str(vlan_id), name="VLAN Created: ")
 | 
				
			||||||
    yield vlan_id[0]
 | 
					    yield vlan_id[0]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.fixture(scope="session")
 | 
					 | 
				
			||||||
def get_equipment_id(instantiate_controller, testbed):
 | 
					 | 
				
			||||||
    equipment_id = 0
 | 
					 | 
				
			||||||
    if len(CONFIGURATION[testbed]['access_point']) == 1:
 | 
					 | 
				
			||||||
        equipment_id = instantiate_controller.get_equipment_id(
 | 
					 | 
				
			||||||
            serial_number=CONFIGURATION[testbed]['access_point'][0]['serial'])
 | 
					 | 
				
			||||||
    print(equipment_id)
 | 
					 | 
				
			||||||
    yield equipment_id
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.fixture(scope="module")
 | 
					 | 
				
			||||||
def instantiate_profile(instantiate_controller):
 | 
					 | 
				
			||||||
    try:
 | 
					 | 
				
			||||||
        profile_object = ProfileUtility(sdk_client=instantiate_controller)
 | 
					 | 
				
			||||||
    except Exception as e:
 | 
					 | 
				
			||||||
        profile_object = False
 | 
					 | 
				
			||||||
    yield profile_object
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
@allure.feature("CLIENT CONNECTIVITY SETUP")
 | 
					@allure.feature("CLIENT CONNECTIVITY SETUP")
 | 
				
			||||||
@pytest.fixture(scope="package")
 | 
					@pytest.fixture(scope="class")
 | 
				
			||||||
def setup_client_connectivity(request, instantiate_controller, testbed, setup_vlan, get_equipment_id,
 | 
					def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment_id,
 | 
				
			||||||
                              instantiate_profile, get_markers,
 | 
					                              instantiate_profile, get_markers,
 | 
				
			||||||
                              get_security_flags, get_configuration, radius_info, get_apnos):
 | 
					                              get_security_flags, get_configuration, radius_info, get_apnos):
 | 
				
			||||||
    instantiate_profile = instantiate_profile(sdk_client=instantiate_controller)
 | 
					    instantiate_profile = instantiate_profile(sdk_client=setup_controller)
 | 
				
			||||||
    vlan_id, mode = 0, 0
 | 
					    vlan_id, mode = 0, 0
 | 
				
			||||||
    instantiate_profile.cleanup_objects()
 | 
					    instantiate_profile.cleanup_objects()
 | 
				
			||||||
    parameter = dict(request.param)
 | 
					    parameter = dict(request.param)
 | 
				
			||||||
@@ -80,7 +90,7 @@ def setup_client_connectivity(request, instantiate_controller, testbed, setup_vl
 | 
				
			|||||||
    """
 | 
					    """
 | 
				
			||||||
    rf_profile_data = {
 | 
					    rf_profile_data = {
 | 
				
			||||||
        "name": "RF-Profile-" + testbed + "-" + parameter['mode'] + "-" +
 | 
					        "name": "RF-Profile-" + testbed + "-" + parameter['mode'] + "-" +
 | 
				
			||||||
                get_configuration[testbed]['access_point'][0]['mode']
 | 
					                get_configuration['access_point'][0]['mode']
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for i in parameter["rf"]:
 | 
					    for i in parameter["rf"]:
 | 
				
			||||||
@@ -90,9 +100,9 @@ def setup_client_connectivity(request, instantiate_controller, testbed, setup_vl
 | 
				
			|||||||
    try:
 | 
					    try:
 | 
				
			||||||
        instantiate_profile.delete_profile_by_name(profile_name=rf_profile_data['name'])
 | 
					        instantiate_profile.delete_profile_by_name(profile_name=rf_profile_data['name'])
 | 
				
			||||||
        instantiate_profile.set_rf_profile(profile_data=rf_profile_data,
 | 
					        instantiate_profile.set_rf_profile(profile_data=rf_profile_data,
 | 
				
			||||||
                                           mode=get_configuration[testbed]['access_point'][0]['mode'])
 | 
					                                           mode=get_configuration['access_point'][0]['mode'])
 | 
				
			||||||
        allure.attach(body=str(rf_profile_data),
 | 
					        allure.attach(body=str(rf_profile_data),
 | 
				
			||||||
                      name="RF Profile Created : " + get_configuration[testbed]['access_point'][0]['mode'])
 | 
					                      name="RF Profile Created : " + get_configuration['access_point'][0]['mode'])
 | 
				
			||||||
    except Exception as e:
 | 
					    except Exception as e:
 | 
				
			||||||
        print(e)
 | 
					        print(e)
 | 
				
			||||||
        allure.attach(body=str(e), name="Exception ")
 | 
					        allure.attach(body=str(e), name="Exception ")
 | 
				
			||||||
@@ -308,7 +318,7 @@ def setup_client_connectivity(request, instantiate_controller, testbed, setup_vl
 | 
				
			|||||||
        print(e)
 | 
					        print(e)
 | 
				
			||||||
        print("failed to create AP Profile")
 | 
					        print("failed to create AP Profile")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ap_ssh = get_apnos(get_configuration[testbed]['access_point'][0], pwd="../libs/apnos/")
 | 
					    ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
 | 
				
			||||||
    ssid_names = []
 | 
					    ssid_names = []
 | 
				
			||||||
    for i in instantiate_profile.profile_creation_ids["ssid"]:
 | 
					    for i in instantiate_profile.profile_creation_ids["ssid"]:
 | 
				
			||||||
        ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i))
 | 
					        ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i))
 | 
				
			||||||
@@ -328,7 +338,7 @@ def setup_client_connectivity(request, instantiate_controller, testbed, setup_vl
 | 
				
			|||||||
        time.sleep(10)
 | 
					        time.sleep(10)
 | 
				
			||||||
    allure.attach(body=str("VIF Config: " + str(vif_config) + "\n" + "SSID Pushed from Controller: " + str(ssid_names)),
 | 
					    allure.attach(body=str("VIF Config: " + str(vif_config) + "\n" + "SSID Pushed from Controller: " + str(ssid_names)),
 | 
				
			||||||
                  name="SSID Profiles in VIF Config and Controller: ")
 | 
					                  name="SSID Profiles in VIF Config and Controller: ")
 | 
				
			||||||
    ap_ssh = get_apnos(get_configuration[testbed]['access_point'][0], pwd="../libs/apnos/")
 | 
					    ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # This loop will check the VIF Config with VIF State
 | 
					    # This loop will check the VIF Config with VIF State
 | 
				
			||||||
    test_cases['vifs'] = False
 | 
					    test_cases['vifs'] = False
 | 
				
			||||||
@@ -359,3 +369,9 @@ def setup_client_connectivity(request, instantiate_controller, testbed, setup_vl
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    request.addfinalizer(teardown_session)
 | 
					    request.addfinalizer(teardown_session)
 | 
				
			||||||
    yield test_cases
 | 
					    yield test_cases
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.fixture(scope="session")
 | 
				
			||||||
 | 
					def lf_test(get_configuration):
 | 
				
			||||||
 | 
					    obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'])
 | 
				
			||||||
 | 
					    yield obj
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										81
									
								
								tests/e2e/basic/test_firmware.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								tests/e2e/basic/test_firmware.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,81 @@
 | 
				
			|||||||
 | 
					"""
 | 
				
			||||||
 | 
					    Test Case Module:  setup test cases for basic test cases
 | 
				
			||||||
 | 
					    Details:    Firmware Upgrade
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
 | 
					import pytest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.mark.configure_lanforge
 | 
				
			||||||
 | 
					def test_configure_lanforge(configure_lanforge):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    assert True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.mark.sanity
 | 
				
			||||||
 | 
					@pytest.mark.bridge
 | 
				
			||||||
 | 
					@pytest.mark.nat
 | 
				
			||||||
 | 
					@pytest.mark.vlan
 | 
				
			||||||
 | 
					@pytest.mark.firmware
 | 
				
			||||||
 | 
					class TestFirmware(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.firmware_create
 | 
				
			||||||
 | 
					    def test_firmware_create(self, upload_firmware, instantiate_testrail, instantiate_project, test_cases):
 | 
				
			||||||
 | 
					        if upload_firmware != 0:
 | 
				
			||||||
 | 
					            instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
 | 
				
			||||||
 | 
					                                                 status_id=1,
 | 
				
			||||||
 | 
					                                                 msg='Create new FW version by API successful')
 | 
				
			||||||
 | 
					            PASS = True
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
 | 
				
			||||||
 | 
					                                                 status_id=5,
 | 
				
			||||||
 | 
					                                                 msg='Error creating new FW version by API')
 | 
				
			||||||
 | 
					            PASS = False
 | 
				
			||||||
 | 
					        assert PASS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.firmware_upgrade
 | 
				
			||||||
 | 
					    def test_firmware_upgrade_request(self, upgrade_firmware, instantiate_testrail, instantiate_project, test_cases):
 | 
				
			||||||
 | 
					        print()
 | 
				
			||||||
 | 
					        if not upgrade_firmware:
 | 
				
			||||||
 | 
					            instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
 | 
				
			||||||
 | 
					                                                 status_id=0,
 | 
				
			||||||
 | 
					                                                 msg='Error requesting upgrade via API')
 | 
				
			||||||
 | 
					            PASS = False
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
 | 
				
			||||||
 | 
					                                                 status_id=1,
 | 
				
			||||||
 | 
					                                                 msg='Upgrade request using API successful')
 | 
				
			||||||
 | 
					            PASS = True
 | 
				
			||||||
 | 
					        assert PASS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.check_active_firmware_cloud
 | 
				
			||||||
 | 
					    def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, instantiate_testrail,
 | 
				
			||||||
 | 
					                                  instantiate_project, test_cases):
 | 
				
			||||||
 | 
					        if get_latest_firmware != check_ap_firmware_cloud:
 | 
				
			||||||
 | 
					            instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
 | 
				
			||||||
 | 
					                                                 status_id=5,
 | 
				
			||||||
 | 
					                                                 msg='CLOUDSDK reporting incorrect firmware version.')
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
 | 
				
			||||||
 | 
					                                                 status_id=1,
 | 
				
			||||||
 | 
					                                                 msg='CLOUDSDK reporting correct firmware version.')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        assert get_latest_firmware == check_ap_firmware_cloud
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.mark.sanity
 | 
				
			||||||
 | 
					@pytest.mark.bridge
 | 
				
			||||||
 | 
					@pytest.mark.nat
 | 
				
			||||||
 | 
					@pytest.mark.vlan
 | 
				
			||||||
 | 
					@pytest.mark.check_active_firmware_ap
 | 
				
			||||||
 | 
					def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_testrail, instantiate_project,
 | 
				
			||||||
 | 
					                     test_cases):
 | 
				
			||||||
 | 
					    if check_ap_firmware_ssh == get_latest_firmware:
 | 
				
			||||||
 | 
					        instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
 | 
				
			||||||
 | 
					                                             status_id=1,
 | 
				
			||||||
 | 
					                                             msg='Upgrade to ' + get_latest_firmware + ' successful')
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
 | 
				
			||||||
 | 
					                                             status_id=4,
 | 
				
			||||||
 | 
					                                             msg='Cannot reach AP after upgrade to check CLI - re-test required')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    assert check_ap_firmware_ssh == get_latest_firmware
 | 
				
			||||||
@@ -0,0 +1,266 @@
 | 
				
			|||||||
 | 
					import allure
 | 
				
			||||||
 | 
					import pytest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					setup_params_general = {
 | 
				
			||||||
 | 
					    "mode": "BRIDGE",
 | 
				
			||||||
 | 
					    "ssid_modes": {
 | 
				
			||||||
 | 
					        "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
				
			||||||
 | 
					                 {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
 | 
				
			||||||
 | 
					        "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
				
			||||||
 | 
					                {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
				
			||||||
 | 
					                 "security_key": "something"}],
 | 
				
			||||||
 | 
					        "wpa2_personal": [
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
				
			||||||
 | 
					             "security_key": "something"}]},
 | 
				
			||||||
 | 
					    "rf": {},
 | 
				
			||||||
 | 
					    "radius": False
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.mark.basic
 | 
				
			||||||
 | 
					@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
 | 
				
			||||||
 | 
					@pytest.mark.parametrize(
 | 
				
			||||||
 | 
					    'setup_profiles',
 | 
				
			||||||
 | 
					    [setup_params_general],
 | 
				
			||||||
 | 
					    indirect=True,
 | 
				
			||||||
 | 
					    scope="class"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					@pytest.mark.usefixtures("setup_profiles")
 | 
				
			||||||
 | 
					class TestBridgeModeConnectivity(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.configuration
 | 
				
			||||||
 | 
					    def test_basic_configuration(self):
 | 
				
			||||||
 | 
					        assert True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.open
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    @allure.story('open 2.4 GHZ Band')
 | 
				
			||||||
 | 
					    def test_open_ssid_2g(self, request, setup_profiles, get_lanforge_data, lf_test, update_report, test_cases):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["open"][0]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = "[BLANK]"
 | 
				
			||||||
 | 
					        security = "open"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "BRIDGE"
 | 
				
			||||||
 | 
					        band = "twog"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.open
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    @allure.story('open 5 GHZ Band')
 | 
				
			||||||
 | 
					    def test_open_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["open"][1]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = "[BLANK]"
 | 
				
			||||||
 | 
					        security = "open"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "BRIDGE"
 | 
				
			||||||
 | 
					        band = "fiveg"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    @allure.story('wpa 2.4 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa_ssid_2g(self, request, get_lanforge_data, update_report,
 | 
				
			||||||
 | 
					                         lf_test, test_cases):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa"][0]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "BRIDGE"
 | 
				
			||||||
 | 
					        band = "twog"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    @allure.story('wpa 5 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa_ssid_5g(self, request, lf_test, update_report, test_cases, get_lanforge_data):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa"][1]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "BRIDGE"
 | 
				
			||||||
 | 
					        band = "fiveg"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa2_personal
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    @allure.story('wpa2_personal 2.4 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa2_personal_ssid_2g(self, request, get_lanforge_data, lf_test, update_report, test_cases):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa2"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "BRIDGE"
 | 
				
			||||||
 | 
					        band = "twog"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa2_personal
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    @allure.story('wpa2_personal 5 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa2_personal_ssid_5g(self, request, get_lanforge_data, update_report, test_cases, lf_test):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa2"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "BRIDGE"
 | 
				
			||||||
 | 
					        band = "fiveg"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					setup_params_enterprise = {
 | 
				
			||||||
 | 
					    "mode": "BRIDGE",
 | 
				
			||||||
 | 
					    "ssid_modes": {
 | 
				
			||||||
 | 
					        "wpa2_enterprise": [
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
				
			||||||
 | 
					             "security_key": "something"}],
 | 
				
			||||||
 | 
					        "wpa3_enterprise": [
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    "rf": {},
 | 
				
			||||||
 | 
					    "radius": True
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.mark.enterprise
 | 
				
			||||||
 | 
					@pytest.mark.parametrize(
 | 
				
			||||||
 | 
					    'setup_profiles',
 | 
				
			||||||
 | 
					    [setup_params_enterprise],
 | 
				
			||||||
 | 
					    indirect=True,
 | 
				
			||||||
 | 
					    scope="package"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					@pytest.mark.usefixtures("setup_profiles")
 | 
				
			||||||
 | 
					class TestBridgeModeEnterprise(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa2_enterprise
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    def test_wpa2_enterprise_2g(self, ):
 | 
				
			||||||
 | 
					        # print(setup_client_connectivity)
 | 
				
			||||||
 | 
					        assert "setup_client_connectivity"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa2_enterprise
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    def test_wpa2_enterprise_5g(self):
 | 
				
			||||||
 | 
					        assert "setup_client_connectivity"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa3_enterprise
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    def test_wpa3_enterprise_2g(self):
 | 
				
			||||||
 | 
					        # print(setup_client_connectivity)
 | 
				
			||||||
 | 
					        assert "setup_client_connectivity"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa3_enterprise
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    def test_wpa3_enterprise_5g(self):
 | 
				
			||||||
 | 
					        assert "setup_client_connectivity"
 | 
				
			||||||
@@ -0,0 +1,260 @@
 | 
				
			|||||||
 | 
					import pytest
 | 
				
			||||||
 | 
					import allure
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					setup_params_general = {
 | 
				
			||||||
 | 
					    "mode": "NAT",
 | 
				
			||||||
 | 
					    "ssid_modes": {
 | 
				
			||||||
 | 
					        "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
				
			||||||
 | 
					                 {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
 | 
				
			||||||
 | 
					        "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
				
			||||||
 | 
					                {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
				
			||||||
 | 
					                 "security_key": "something"}],
 | 
				
			||||||
 | 
					        "wpa2_personal": [
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
				
			||||||
 | 
					             "security_key": "something"}]},
 | 
				
			||||||
 | 
					    "rf": {},
 | 
				
			||||||
 | 
					    "radius": False
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@allure.feature("NAT MODE CLIENT CONNECTIVITY")
 | 
				
			||||||
 | 
					@pytest.mark.parametrize(
 | 
				
			||||||
 | 
					    'setup_profiles',
 | 
				
			||||||
 | 
					    [setup_params_general],
 | 
				
			||||||
 | 
					    indirect=True,
 | 
				
			||||||
 | 
					    scope="class"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					@pytest.mark.usefixtures("setup_profiles")
 | 
				
			||||||
 | 
					class TestNATModeConnectivity(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.open
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    @allure.story('open 2.4 GHZ Band')
 | 
				
			||||||
 | 
					    def test_open_ssid_2g(self, request, setup_profiles, get_lanforge_data, lf_test, update_report, test_cases):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["open"][0]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = "[BLANK]"
 | 
				
			||||||
 | 
					        security = "open"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "NAT"
 | 
				
			||||||
 | 
					        band = "twog"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.open
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    @allure.story('open 5 GHZ Band')
 | 
				
			||||||
 | 
					    def test_open_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["open"][1]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = "[BLANK]"
 | 
				
			||||||
 | 
					        security = "open"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "NAT"
 | 
				
			||||||
 | 
					        band = "fiveg"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    @allure.story('wpa 2.4 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa_ssid_2g(self, request, get_lanforge_data, update_report,
 | 
				
			||||||
 | 
					                         lf_test, test_cases):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa"][0]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "NAT"
 | 
				
			||||||
 | 
					        band = "twog"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    @allure.story('wpa 5 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa_ssid_5g(self, request, lf_test, update_report, test_cases, get_lanforge_data):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa"][1]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "NAT"
 | 
				
			||||||
 | 
					        band = "fiveg"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa2_personal
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    @allure.story('wpa2_personal 2.4 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa2_personal_ssid_2g(self, request, get_lanforge_data, lf_test, update_report, test_cases):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa2"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "NAT"
 | 
				
			||||||
 | 
					        band = "twog"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa2_personal
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    @allure.story('wpa2_personal 5 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa2_personal_ssid_5g(self, request, get_lanforge_data, update_report, test_cases, lf_test):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa2"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "NAT"
 | 
				
			||||||
 | 
					        band = "fiveg"
 | 
				
			||||||
 | 
					        vlan = 1
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					setup_params_enterprise = {
 | 
				
			||||||
 | 
					    "mode": "NAT",
 | 
				
			||||||
 | 
					    "ssid_modes": {
 | 
				
			||||||
 | 
					        "wpa2_enterprise": [
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
				
			||||||
 | 
					             "security_key": "something"}],
 | 
				
			||||||
 | 
					        "wpa3_enterprise": [
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    "rf": {},
 | 
				
			||||||
 | 
					    "radius": True
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@pytest.mark.parametrize(
 | 
				
			||||||
 | 
					    'setup_profiles',
 | 
				
			||||||
 | 
					    [setup_params_enterprise],
 | 
				
			||||||
 | 
					    indirect=True,
 | 
				
			||||||
 | 
					    scope="package"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					@pytest.mark.usefixtures("setup_profiles")
 | 
				
			||||||
 | 
					class TestNATModeEnterprise(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa2_enterprise
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    def test_wpa2_enterprise_2g(self):
 | 
				
			||||||
 | 
					        # print(setup_client_connectivity)
 | 
				
			||||||
 | 
					        assert "setup_client_connectivity"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa2_enterprise
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    def test_wpa2_enterprise_5g(self):
 | 
				
			||||||
 | 
					        assert "setup_client_connectivity"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa3_enterprise
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    def test_wpa3_enterprise_2g(self):
 | 
				
			||||||
 | 
					        # print(setup_client_connectivity)
 | 
				
			||||||
 | 
					        assert "setup_client_connectivity"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa3_enterprise
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    def test_wpa3_enterprise_5g(self):
 | 
				
			||||||
 | 
					        assert "setup_client_connectivity"
 | 
				
			||||||
@@ -0,0 +1,261 @@
 | 
				
			|||||||
 | 
					import pytest
 | 
				
			||||||
 | 
					import allure
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					setup_params_general = {
 | 
				
			||||||
 | 
					    "mode": "VLAN",
 | 
				
			||||||
 | 
					    "ssid_modes": {
 | 
				
			||||||
 | 
					        "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
				
			||||||
 | 
					                 {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
 | 
				
			||||||
 | 
					        "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
				
			||||||
 | 
					                {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
				
			||||||
 | 
					                 "security_key": "something"}],
 | 
				
			||||||
 | 
					        "wpa2_personal": [
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
				
			||||||
 | 
					            {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
				
			||||||
 | 
					             "security_key": "something"}]},
 | 
				
			||||||
 | 
					    "rf": {},
 | 
				
			||||||
 | 
					    "radius": False
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@allure.feature("VLAN MODE CLIENT CONNECTIVITY")
 | 
				
			||||||
 | 
					@pytest.mark.parametrize(
 | 
				
			||||||
 | 
					    'setup_profiles',
 | 
				
			||||||
 | 
					    [setup_params_general],
 | 
				
			||||||
 | 
					    indirect=True,
 | 
				
			||||||
 | 
					    scope="class"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					@pytest.mark.usefixtures("setup_profiles")
 | 
				
			||||||
 | 
					class TestVLANModeConnectivity(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.open
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    @allure.story('open 2.4 GHZ Band')
 | 
				
			||||||
 | 
					    def test_open_ssid_2g(self, request, get_lanforge_data, lf_test, update_report, test_cases):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["open"][0]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = "[BLANK]"
 | 
				
			||||||
 | 
					        security = "open"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "VLAN"
 | 
				
			||||||
 | 
					        band = "twog"
 | 
				
			||||||
 | 
					        vlan = 100
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.open
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    @allure.story('open 5 GHZ Band')
 | 
				
			||||||
 | 
					    def test_open_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["open"][1]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = "[BLANK]"
 | 
				
			||||||
 | 
					        security = "open"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "VLAN"
 | 
				
			||||||
 | 
					        band = "fiveg"
 | 
				
			||||||
 | 
					        vlan = 100
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    @allure.story('wpa 2.4 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa_ssid_2g(self, request, get_lanforge_data, update_report,
 | 
				
			||||||
 | 
					                         lf_test, test_cases):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa"][0]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "VLAN"
 | 
				
			||||||
 | 
					        band = "twog"
 | 
				
			||||||
 | 
					        vlan = 100
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    @allure.story('wpa 5 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa_ssid_5g(self, request, lf_test, update_report, test_cases, get_lanforge_data):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa"][1]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "VLAN"
 | 
				
			||||||
 | 
					        band = "fiveg"
 | 
				
			||||||
 | 
					        vlan = 100
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa2_personal
 | 
				
			||||||
 | 
					    @pytest.mark.twog
 | 
				
			||||||
 | 
					    @allure.story('wpa2_personal 2.4 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa2_personal_ssid_2g(self, request, get_lanforge_data, lf_test, update_report, test_cases):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa2"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "VLAN"
 | 
				
			||||||
 | 
					        band = "twog"
 | 
				
			||||||
 | 
					        vlan = 100
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @pytest.mark.wpa2_personal
 | 
				
			||||||
 | 
					    @pytest.mark.fiveg
 | 
				
			||||||
 | 
					    @allure.story('wpa2_personal 5 GHZ Band')
 | 
				
			||||||
 | 
					    def test_wpa2_personal_ssid_5g(self, request, get_lanforge_data, update_report, test_cases, lf_test):
 | 
				
			||||||
 | 
					        profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
 | 
				
			||||||
 | 
					        ssid_name = profile_data["ssid_name"]
 | 
				
			||||||
 | 
					        security_key = profile_data["security_key"]
 | 
				
			||||||
 | 
					        security = "wpa2"
 | 
				
			||||||
 | 
					        station_names = []
 | 
				
			||||||
 | 
					        for i in range(0, int(request.config.getini("num_stations"))):
 | 
				
			||||||
 | 
					            station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
 | 
				
			||||||
 | 
					        mode = "VLAN"
 | 
				
			||||||
 | 
					        band = "fiveg"
 | 
				
			||||||
 | 
					        vlan = 100
 | 
				
			||||||
 | 
					        passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
 | 
				
			||||||
 | 
					                                                     passkey=security_key, mode=mode, band=band,
 | 
				
			||||||
 | 
					                                                     station_name=station_names, vlan_id=vlan)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if result:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=1,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
 | 
				
			||||||
 | 
					                                          status_id=5,
 | 
				
			||||||
 | 
					                                          msg='2G WPA Client Connectivity Failed - bridge mode' + str(
 | 
				
			||||||
 | 
					                                              passes))
 | 
				
			||||||
 | 
					        assert result
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# setup_params_enterprise = {
 | 
				
			||||||
 | 
					#     "mode": "BRIDGE",
 | 
				
			||||||
 | 
					#     "ssid_modes": {
 | 
				
			||||||
 | 
					#         "wpa2_enterprise": [
 | 
				
			||||||
 | 
					#             {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
 | 
				
			||||||
 | 
					#             {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
 | 
				
			||||||
 | 
					#              "security_key": "something"}],
 | 
				
			||||||
 | 
					#         "wpa3_enterprise": [
 | 
				
			||||||
 | 
					#             {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
 | 
				
			||||||
 | 
					#             {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#     "rf": {},
 | 
				
			||||||
 | 
					#     "radius": True
 | 
				
			||||||
 | 
					# }
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# @pytest.mark.parametrize(
 | 
				
			||||||
 | 
					#     'setup_profiles',
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#     [setup_params_enterprise],
 | 
				
			||||||
 | 
					#     indirect=True,
 | 
				
			||||||
 | 
					#     scope="package"
 | 
				
			||||||
 | 
					# )
 | 
				
			||||||
 | 
					# @pytest.mark.usefixtures("setup_profiles")
 | 
				
			||||||
 | 
					# class TestBridgeModeEnterprise(object):
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#     @pytest.mark.wpa2_enterprise
 | 
				
			||||||
 | 
					#     @pytest.mark.twog
 | 
				
			||||||
 | 
					#     def test_wpa2_enterprise_2g(self, ):
 | 
				
			||||||
 | 
					#         # print(setup_client_connectivity)
 | 
				
			||||||
 | 
					#         assert "setup_client_connectivity"
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#     @pytest.mark.wpa2_enterprise
 | 
				
			||||||
 | 
					#     @pytest.mark.fiveg
 | 
				
			||||||
 | 
					#     def test_wpa2_enterprise_5g(self):
 | 
				
			||||||
 | 
					#         assert "setup_client_connectivity"
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#     @pytest.mark.wpa3_enterprise
 | 
				
			||||||
 | 
					#     @pytest.mark.twog
 | 
				
			||||||
 | 
					#     def test_wpa3_enterprise_2g(self):
 | 
				
			||||||
 | 
					#         # print(setup_client_connectivity)
 | 
				
			||||||
 | 
					#         assert "setup_client_connectivity"
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#     @pytest.mark.wpa3_enterprise
 | 
				
			||||||
 | 
					#     @pytest.mark.fiveg
 | 
				
			||||||
 | 
					#     def test_wpa3_enterprise_5g(self):
 | 
				
			||||||
 | 
					#         assert "setup_client_connectivity"
 | 
				
			||||||
@@ -1,65 +1,49 @@
 | 
				
			|||||||
"""
 | 
					"""
 | 
				
			||||||
    Test Case Module:  Testing Basic Connectivity with Resources
 | 
					    Test Case Module:  Testing Basic Connectivity with Resources
 | 
				
			||||||
    Mode:       BRIDGE
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
import pytest
 | 
					 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pytestmark = [pytest.mark.test_connectivity]
 | 
					import allure
 | 
				
			||||||
 | 
					import pytest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pytestmark = [pytest.mark.test_resources]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.mark.sanity
 | 
					@pytest.mark.sanity
 | 
				
			||||||
@pytest.mark.bridge
 | 
					@allure.testcase(name="Test Resources", url="")
 | 
				
			||||||
@pytest.mark.nat
 | 
					class TestResources(object):
 | 
				
			||||||
@pytest.mark.vlan
 | 
					
 | 
				
			||||||
@pytest.mark.test_controller_connectivity
 | 
					    @pytest.mark.test_cloud_controller
 | 
				
			||||||
def test_controller_connectivity(instantiate_controller, instantiate_testrail, instantiate_project, test_cases):
 | 
					    @allure.testcase(name="test_controller_connectivity", url="")
 | 
				
			||||||
    try:
 | 
					    def test_controller_connectivity(self, setup_controller, update_report, test_cases):
 | 
				
			||||||
        instantiate_testrail.update_testrail(case_id=test_cases["cloud_ver"], run_id=instantiate_project,
 | 
					        if setup_controller.bearer:
 | 
				
			||||||
 | 
					            allure.attach(name="Controller Connectivity Success", body="")
 | 
				
			||||||
 | 
					            update_report.update_testrail(case_id=test_cases["cloud_ver"],
 | 
				
			||||||
                                          status_id=1, msg='Read CloudSDK version from API successfully')
 | 
					                                          status_id=1, msg='Read CloudSDK version from API successfully')
 | 
				
			||||||
        PASS = True
 | 
					 | 
				
			||||||
    except:
 | 
					 | 
				
			||||||
        instantiate_testrail.update_testrail(case_id=test_cases["cloud_ver"], run_id=instantiate_project,
 | 
					 | 
				
			||||||
                                             status_id=0, msg='Could not read CloudSDK version from API')
 | 
					 | 
				
			||||||
        PASS = False
 | 
					 | 
				
			||||||
    assert instantiate_controller
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@pytest.mark.sanity
 | 
					 | 
				
			||||||
@pytest.mark.bridge
 | 
					 | 
				
			||||||
@pytest.mark.nat
 | 
					 | 
				
			||||||
@pytest.mark.vlan
 | 
					 | 
				
			||||||
@pytest.mark.test_access_points_connectivity
 | 
					 | 
				
			||||||
def test_access_points_connectivity(test_access_point, instantiate_testrail, instantiate_project, test_cases):
 | 
					 | 
				
			||||||
    if "ACTIVE" not in test_access_point:
 | 
					 | 
				
			||||||
        instantiate_testrail.update_testrail(case_id=test_cases["cloud_connection"], run_id=instantiate_project,
 | 
					 | 
				
			||||||
                                             status_id=5,
 | 
					 | 
				
			||||||
                                             msg='CloudSDK connectivity failed')
 | 
					 | 
				
			||||||
        status = False
 | 
					 | 
				
			||||||
        sys.exit()
 | 
					 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
        instantiate_testrail.update_testrail(case_id=test_cases["cloud_connection"], run_id=instantiate_project,
 | 
					            allure.attach(name="Controller Connectivity Failed", body="")
 | 
				
			||||||
                                             status_id=1,
 | 
					            update_report.update_testrail(case_id=test_cases["cloud_ver"],
 | 
				
			||||||
                                             msg='Manager status is Active')
 | 
					                                          status_id=0, msg='Could not read CloudSDK version from API')
 | 
				
			||||||
        status = True
 | 
					            pytest.exit("Resource Not Available")
 | 
				
			||||||
 | 
					        print(setup_controller.bearer)
 | 
				
			||||||
 | 
					        assert setup_controller.bearer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert status
 | 
					    @pytest.mark.test_access_points_connectivity
 | 
				
			||||||
 | 
					    @allure.testcase(name="test_access_points_connectivity", url="")
 | 
				
			||||||
 | 
					    def test_access_points_connectivity(self, test_access_point, update_report, test_cases):
 | 
				
			||||||
@pytest.mark.sanity
 | 
					        print(test_access_point)
 | 
				
			||||||
@pytest.mark.bridge
 | 
					        # if "ACTIVE" not in test_access_point:
 | 
				
			||||||
@pytest.mark.nat
 | 
					        #     allure.attach(name="Access Point Connectivity Success", body=str(test_access_point))
 | 
				
			||||||
@pytest.mark.vlan
 | 
					        #     update_report.update_testrail(case_id=test_cases["cloud_connection"],
 | 
				
			||||||
@pytest.mark.test_lanforge_connectivity
 | 
					        #                                   status_id=5,
 | 
				
			||||||
def test_lanforge_connectivity(check_lanforge_connectivity):
 | 
					        #                                   msg='CloudSDK connectivity failed')
 | 
				
			||||||
    assert "instantiate_cloudsdk"
 | 
					        #
 | 
				
			||||||
 | 
					        #     sys.exit()
 | 
				
			||||||
 | 
					        # else:
 | 
				
			||||||
@pytest.mark.shivam
 | 
					        #     allure.attach(name="Access Point Connectivity Failed", body=str(test_access_point))
 | 
				
			||||||
@pytest.mark.bridge
 | 
					        #     update_report.update_testrail(case_id=test_cases["cloud_connection"],
 | 
				
			||||||
@pytest.mark.nat
 | 
					        #                                   status_id=1,
 | 
				
			||||||
@pytest.mark.vlan
 | 
					        #                                   msg='Manager status is Active')
 | 
				
			||||||
@pytest.mark.test_perfecto_connectivity
 | 
					        #
 | 
				
			||||||
def test_perfecto_connectivity(setup_controller):
 | 
					        # assert "ACTIVE" in test_access_point
 | 
				
			||||||
    assert "instantiate_cloudsdk"
 | 
					        assert True
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user