diff --git a/libs/controller/controller.py b/libs/controller/controller.py index 394ea4c47..a8ccc1126 100644 --- a/libs/controller/controller.py +++ b/libs/controller/controller.py @@ -179,7 +179,7 @@ class Controller(ConfigureController): # Get the equipment id, of a equipment with a serial number def get_equipment_id(self, serial_number=None): equipment_data = self.get_equipment_by_customer_id(max_items=100) - # print(equipment_data) + for equipment in equipment_data: print(equipment._id) if equipment._serial == serial_number: @@ -212,7 +212,7 @@ class Controller(ConfigureController): # print(status_data) try: current_ap_fw = status_data[2]['details']['reportedSwVersion'] - print(current_ap_fw) + # print(current_ap_fw) return current_ap_fw except Exception as e: current_ap_fw = "error" @@ -343,6 +343,7 @@ class ProfileUtility: self.default_profiles['radius'] = i if i._name == "TipWlan-rf": self.default_profiles['rf'] = i + # print(i) # This will delete the Profiles associated with an equipment of givwn equipment_id, and associate it to default # equipment_ap profile @@ -385,7 +386,7 @@ class ProfileUtility: for i in self.default_profiles: skip_delete_id.append(self.default_profiles[i]._id) delete_ids = list(set(delete_ids) - set(delete_ids).intersection(set(skip_delete_id))) - print(delete_ids) + # print(delete_ids) for i in delete_ids: self.set_equipment_to_profile(profile_id=i) self.delete_profile(profile_id=delete_ids) @@ -419,8 +420,9 @@ class ProfileUtility: "model_type": "PaginationContext", "maxItemsPerPage": 5000 }""" - equipment_data = self.sdk_client.equipment_client.get_equipment_by_customer_id(customer_id=2, - pagination_context=pagination_context) + equipment_data = self.sdk_client.equipment_client. \ + get_equipment_by_customer_id(customer_id=2, + pagination_context=pagination_context) self.get_default_profiles() for i in equipment_data._items: if i._profile_id == profile_id: @@ -443,6 +445,9 @@ class ProfileUtility: default_profile._details["rfConfigMap"]["is5GHz"]["rf"] = profile_data["name"] default_profile._details["rfConfigMap"]["is5GHzL"]["rf"] = profile_data["name"] default_profile._details["rfConfigMap"]["is5GHzU"]["rf"] = profile_data["name"] + # for i in profile_data['rfConfigMap']: + # for j in profile_data['rfConfigMap'][i]: + # default_profile._details["rfConfigMap"][i][j] = profile_data['rfConfigMap'][i][j] profile = self.profile_client.create_profile(body=default_profile) self.profile_creation_ids['rf'].append(profile._id) return profile @@ -468,6 +473,7 @@ class ProfileUtility: method call: used to create a ssid profile with the given parameters """ + # Open def create_open_ssid_profile(self, profile_data=None): try: if profile_data is None: @@ -490,6 +496,7 @@ class ProfileUtility: return profile + # wpa personal def create_wpa_ssid_profile(self, profile_data=None): try: if profile_data is None: @@ -511,6 +518,7 @@ class ProfileUtility: profile = False return profile + # wpa2 personal def create_wpa2_personal_ssid_profile(self, profile_data=None): try: if profile_data is None: @@ -533,6 +541,7 @@ class ProfileUtility: profile = False return profile + # wpa3 personal def create_wpa3_personal_ssid_profile(self, profile_data=None): try: if profile_data is None: @@ -545,7 +554,7 @@ class ProfileUtility: default_profile._details['ssid'] = profile_data['ssid_name'] default_profile._details['keyStr'] = profile_data['security_key'] default_profile._details['forwardMode'] = profile_data['mode'] - default_profile._details['secureMode'] = 'wpa3OnlyPSK' + default_profile._details['secureMode'] = 'wpa3OnlySAE' profile = self.profile_client.create_profile(body=default_profile) profile_id = profile._id self.profile_creation_ids['ssid'].append(profile_id) @@ -555,6 +564,101 @@ class ProfileUtility: profile = False return profile + # wpa3 personal mixed mode + def create_wpa3_personal_mixed_ssid_profile(self, profile_data=None): + try: + if profile_data is None: + return False + default_profile = self.default_profiles['ssid'] + default_profile._details['appliedRadios'] = profile_data["appliedRadios"] + + default_profile._name = profile_data['profile_name'] + default_profile._details['vlanId'] = profile_data['vlan'] + default_profile._details['ssid'] = profile_data['ssid_name'] + default_profile._details['keyStr'] = profile_data['security_key'] + default_profile._details['forwardMode'] = profile_data['mode'] + default_profile._details['secureMode'] = 'wpa3MixedSAE' + profile = self.profile_client.create_profile(body=default_profile) + profile_id = profile._id + self.profile_creation_ids['ssid'].append(profile_id) + self.profile_ids.append(profile_id) + except Exception as e: + print(e) + profile = False + return profile + + # wpa wpa2 personal mixed mode + def create_wpa_wpa2_personal_mixed_ssid_profile(self, profile_data=None): + try: + if profile_data is None: + return False + default_profile = self.default_profiles['ssid'] + default_profile._details['appliedRadios'] = profile_data["appliedRadios"] + + default_profile._name = profile_data['profile_name'] + default_profile._details['vlanId'] = profile_data['vlan'] + default_profile._details['ssid'] = profile_data['ssid_name'] + default_profile._details['keyStr'] = profile_data['security_key'] + default_profile._details['forwardMode'] = profile_data['mode'] + default_profile._details['secureMode'] = 'wpa2PSK' + profile = self.profile_client.create_profile(body=default_profile) + profile_id = profile._id + self.profile_creation_ids['ssid'].append(profile_id) + self.profile_ids.append(profile_id) + except Exception as e: + print(e) + profile = False + return profile + + # wpa enterprise + def create_wpa_enterprise_ssid_profile(self, profile_data=None): + try: + if profile_data is None: + return False + default_profile = self.default_profiles['ssid'] + default_profile._details['appliedRadios'] = profile_data["appliedRadios"] + + default_profile._name = profile_data['profile_name'] + default_profile._details['vlanId'] = profile_data['vlan'] + default_profile._details['ssid'] = profile_data['ssid_name'] + default_profile._details['forwardMode'] = profile_data['mode'] + default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0] + default_profile._child_profile_ids = self.profile_creation_ids["radius"] + default_profile._details['secureMode'] = 'wpaRadius' + profile = self.profile_client.create_profile(body=default_profile) + profile_id = profile._id + self.profile_creation_ids['ssid'].append(profile_id) + self.profile_ids.append(profile_id) + except Exception as e: + print(e) + profile = False + return profile + + # wpa wpa2 enterprise mixed mode + def create_wpa_wpa2_enterprise_mixed_ssid_profile(self, profile_data=None): + try: + if profile_data is None: + return False + default_profile = self.default_profiles['ssid'] + default_profile._details['appliedRadios'] = profile_data["appliedRadios"] + + default_profile._name = profile_data['profile_name'] + default_profile._details['vlanId'] = profile_data['vlan'] + default_profile._details['ssid'] = profile_data['ssid_name'] + default_profile._details['forwardMode'] = profile_data['mode'] + default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0] + default_profile._child_profile_ids = self.profile_creation_ids["radius"] + default_profile._details['secureMode'] = 'wpa2OnlyRadius' + profile = self.profile_client.create_profile(body=default_profile) + profile_id = profile._id + self.profile_creation_ids['ssid'].append(profile_id) + self.profile_ids.append(profile_id) + except Exception as e: + print(e) + profile = False + return profile + + # wpa2 enterprise mode ssid profile def create_wpa2_enterprise_ssid_profile(self, profile_data=None): try: if profile_data is None: @@ -578,6 +682,7 @@ class ProfileUtility: profile = False return profile + # wpa3 enterprise mode def create_wpa3_enterprise_ssid_profile(self, profile_data=None): try: if profile_data is None: @@ -600,6 +705,29 @@ class ProfileUtility: profile = False return profile + # wpa3 enterprise mixed mode + def create_wpa3_enterprise_mixed_ssid_profile(self, profile_data=None): + try: + if profile_data is None: + return False + default_profile = self.default_profiles['ssid'] + default_profile._details['appliedRadios'] = profile_data["appliedRadios"] + default_profile._name = profile_data['profile_name'] + default_profile._details['vlanId'] = profile_data['vlan'] + default_profile._details['ssid'] = profile_data['ssid_name'] + default_profile._details['forwardMode'] = profile_data['mode'] + default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0] + default_profile._child_profile_ids = self.profile_creation_ids["radius"] + default_profile._details['secureMode'] = 'wpa3MixedEAP' + profile = self.profile_client.create_profile(body=default_profile) + profile_id = profile._id + self.profile_creation_ids['ssid'].append(profile_id) + self.profile_ids.append(profile_id) + except Exception as e: + print(e) + profile = False + return profile + """ method call: used to create a ap profile that contains the given ssid profiles """ @@ -777,6 +905,7 @@ class FirmwareUtility(JFrogUtility): def get_fw_version(self): # Get The equipment model self.latest_fw = self.get_build(model=self.model, version=self.fw_version) + # print("shivam", self.latest_fw) return self.latest_fw def upload_fw_on_cloud(self, fw_version=None, force_upload=False): @@ -869,3 +998,9 @@ if __name__ == '__main__': sdk_client = Controller(controller_data=controller) # Use Library/ Method Here sdk_client.disconnect_Controller() + api = Controller(controller_data=controller) + profile = ProfileUtility(sdk_client=api) + # print(profile.get_profile_by_name(profile_name="basic-ext-03-03-SSID-open-0-VLAN")) + profile.get_default_profiles() + api.disconnect_Controller() + diff --git a/libs/lanforge/lf_tests.py b/libs/lanforge/lf_tests.py index 1286c747e..af67837fd 100644 --- a/libs/lanforge/lf_tests.py +++ b/libs/lanforge/lf_tests.py @@ -2,10 +2,28 @@ # Used by Nightly_Sanity # This has different types of old_pytest like Single client connectivity, Single_Client_EAP, testrail_retest ######################################################################################################### +import sys +import os +sys.path.append( + os.path.dirname( + os.path.realpath(__file__) + ) +) +if "libs" not in sys.path: + sys.path.append(f'../libs') +for folder in 'py-json', 'py-scripts': + if folder not in sys.path: + sys.path.append(f'../../lanforge/lanforge-scripts/{folder}') + +sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity") + +sys.path.append(f'../libs') +sys.path.append(f'../libs/lanforge/') from sta_connect2 import StaConnect2 import time -from eap_connect import EAPConnect +# from eap_connect import EAPConnect +from test_ipv4_ttls import TTLSTest class RunTest: @@ -20,10 +38,11 @@ class RunTest: 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.debug = debug self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=debug) def Client_Connectivity(self, ssid="[BLANK]", passkey="[BLANK]", security="open", station_name=[], - mode="BRIDGE", vlan_id=1, band="twog"): + mode="BRIDGE", vlan_id=1, band="twog"): '''SINGLE CLIENT CONNECTIVITY using test_connect2.py''' self.staConnect.sta_mode = 0 self.staConnect.upstream_resource = 1 @@ -67,35 +86,65 @@ class RunTest: time.sleep(3) return self.staConnect.passes(), result - def Single_Client_EAP(self, port, sta_list, ssid_name, radio, security, eap_type, - identity, ttls_password, test_case, rid, client, logger): - eap_connect = EAPConnect(self.lanforge_ip, self.lanforge_port, _debug_on=False) - eap_connect.upstream_resource = 1 - eap_connect.upstream_port = port - eap_connect.security = security - eap_connect.sta_list = sta_list - eap_connect.station_names = sta_list - eap_connect.sta_prefix = self.lanforge_prefix - eap_connect.ssid = ssid_name - eap_connect.radio = radio - eap_connect.eap = eap_type - eap_connect.identity = identity - eap_connect.ttls_passwd = ttls_password - eap_connect.runtime_secs = 40 - eap_connect.setup() - eap_connect.start() - print("napping %f sec" % eap_connect.runtime_secs) - time.sleep(eap_connect.runtime_secs) - eap_connect.stop() - eap_connect.cleanup() - run_results = eap_connect.get_result_list() - for result in run_results: - print("test result: " + result) - result = True - print("Single Client Connectivity :", eap_connect.passes) - if eap_connect.passes(): - print("Single client connection to", ssid_name, "successful. Test Passed") + def EAP_Connect(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", mode="BRIDGE", band="twog", vlan_id=100, + station_name=[], key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="nolastart", + wep_key="NA", ca_cert="NA", eap="TTLS", identity="nolaradius"): + self.eap_connect = TTLSTest(host=self.lanforge_ip, port=self.lanforge_port, + sta_list=station_name, vap=False, _debug_on=self.debug) + + self.eap_connect.station_profile.sta_mode = 0 + self.eap_connect.upstream_resource = 1 + if mode == "BRIDGE": + self.eap_connect.upstream_port = self.upstream_port + elif mode == "NAT": + self.eap_connect.upstream_port = self.upstream_port else: - print("Single client connection to", ssid_name, "unsuccessful. Test Failed") - result = False - return self.staConnect.passes(), result + self.eap_connect.upstream_port = self.upstream_port + "." + str(vlan_id) + if band == "twog": + self.eap_connect.radio = self.twog_radios[0] + # self.eap_connect.sta_prefix = self.twog_prefix + if band == "fiveg": + self.eap_connect.radio = self.fiveg_radios[0] + # self.eap_connect.sta_prefix = self.fiveg_prefix + # self.eap_connect.resource = 1 + if eap == "TTLS": + self.eap_connect.ieee80211w = 0 + self.eap_connect.station_profile.set_command_flag("add_sta", "80211u_enable", 0) + self.eap_connect.identity = identity + self.eap_connect.ttls_passwd = ttls_passwd + if eap == "TLS": + self.eap_connect.key_mgmt = "WPA-EAP-SUITE-B" + self.eap_connect.station_profile.set_command_flag("add_sta", "80211u_enable", 0) + self.eap_connect.pairwise = "TKIP" + self.eap_connect.group = "TKIP" + self.eap_connect.eap = "EAP-TLS" + + # self.eap_connect.hs20_enable = False + self.eap_connect.ssid = ssid + self.eap_connect.password = passkey + self.eap_connect.security = security + self.eap_connect.sta_list = station_name + self.eap_connect.build() + self.eap_connect.start(station_name, True, True) + self.eap_connect.stop() + self.eap_connect.cleanup(station_name) + return self.eap_connect.passes() + + +if __name__ == '__main__': + lanforge_data = { + "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": "wlan0", + "AX-Station-Name": "ax", + } + obj = RunTest(lanforge_data=lanforge_data, debug=False) + # print(obj.eap_connect.json_get("port/1/1/sta0000?fields=ap,ip")) + obj.EAP_Connect(station_name=["sta0000", "sta0001"], eap="TTLS", ssid="testing_radius") diff --git a/tests/conftest.py b/tests/conftest.py index 3a7845ceb..6dd589c36 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -194,6 +194,15 @@ def get_apnos(): yield APNOS +@pytest.fixture(scope="session") +def get_equipment_id(setup_controller, testbed, get_configuration): + equipment_id_list = [] + for i in get_configuration['access_point']: + equipment_id_list.append(setup_controller.get_equipment_id( + serial_number=i['serial'])) + yield equipment_id_list + + # APNOS SETUP @pytest.fixture(scope="session") def instantiate_access_point(testbed, get_apnos, get_configuration): @@ -241,6 +250,79 @@ def instantiate_firmware(setup_controller, instantiate_jFrog, get_configuration) yield firmware_client_obj +@pytest.fixture(scope="class") +def get_latest_firmware(instantiate_firmware): + fw_version_list = [] + try: + + for fw_obj in instantiate_firmware: + latest_firmware = fw_obj.get_fw_version() + fw_version_list.append(latest_firmware) + except Exception as e: + print(e) + fw_version_list = [] + + yield fw_version_list + + +@pytest.fixture(scope="class") +def upload_firmware(should_upload_firmware, instantiate_firmware, get_latest_firmware): + firmware_id_list = [] + for i in range(0, len(instantiate_firmware)): + firmware_id = instantiate_firmware[i].upload_fw_on_cloud(fw_version=get_latest_firmware[i], + force_upload=should_upload_firmware) + firmware_id_list.append(firmware_id) + yield firmware_id_list + + +@pytest.fixture(scope="class") +def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware, + should_upgrade_firmware): + status_list = [] + if get_latest_firmware != check_ap_firmware_cloud: + if request.config.getoption("--skip-upgrade"): + status = "skip-upgrade" + status_list.append(status) + else: + + for i in range(0, len(instantiate_firmware)): + status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id, force_upload=False, + force_upgrade=should_upgrade_firmware) + status_list.append(status) + else: + if should_upgrade_firmware: + for i in range(0, len(instantiate_firmware)): + status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id, force_upload=False, + force_upgrade=should_upgrade_firmware) + status_list.append(status) + else: + status = "skip-upgrade Version Already Available" + status_list.append(status) + yield status_list + + +@pytest.fixture(scope="class") +def check_ap_firmware_cloud(setup_controller, get_equipment_id): + ap_fw_list = [] + for i in get_equipment_id: + ap_fw_list.append(setup_controller.get_ap_firmware_old_method(equipment_id=i)) + yield ap_fw_list + + +@pytest.fixture(scope="class") +def check_ap_firmware_ssh(get_configuration): + active_fw_list = [] + try: + for access_point in get_configuration['access_point']: + ap_ssh = APNOS(access_point) + active_fw = ap_ssh.get_active_firmware() + active_fw_list.append(active_fw) + except Exception as e: + print(e) + active_fw_list = [] + yield active_fw_list + + """ Instantiate Reporting """ @@ -358,7 +440,8 @@ FRAMEWORK MARKER LOGIC @pytest.fixture(scope="session") 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", "wpa3_personal", "wpa3_personal_mixed", + "wpa2_enterprise", "wpa3_enterprise", "twog", "fiveg", "radius"] yield security diff --git a/tests/e2e/basic/_basic_test_setup/setup__e2e_resources.py b/tests/e2e/basic/_basic_test_setup/setup__e2e_resources.py index 1526dd80d..a2a932def 100644 --- a/tests/e2e/basic/_basic_test_setup/setup__e2e_resources.py +++ b/tests/e2e/basic/_basic_test_setup/setup__e2e_resources.py @@ -1,4 +1,4 @@ -<<<<<<< HEAD + """ Test Case Module: setup test cases for basic test cases Details: Firmware Upgrade @@ -110,7 +110,7 @@ def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_tes assert check_ap_firmware_ssh == get_latest_firmware -======= + # """ # Test Case Module: setup test cases for basic test cases # Details: Firmware Upgrade @@ -192,4 +192,4 @@ def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_tes # msg='Cannot reach AP after upgrade to check CLI - re-test required') # # assert check_ap_firmware_ssh == get_latest_firmware ->>>>>>> staging-wifi-1960 + diff --git a/tests/e2e/basic/_basic_test_setup/setup_e2e_bridge.py b/tests/e2e/basic/_basic_test_setup/setup_e2e_bridge.py deleted file mode 100644 index 044e72cb5..000000000 --- a/tests/e2e/basic/_basic_test_setup/setup_e2e_bridge.py +++ /dev/null @@ -1,174 +0,0 @@ -""" - Test Case Module: setup test cases for bridge mode sanity - Details: bridge mode setup - -""" -import time - -import pytest - - -@pytest.mark.sanity -@pytest.mark.setup_bridge -@pytest.mark.bridge -@pytest.mark.parametrize( - 'setup_profiles, create_profiles', - [(["BRIDGE"], ["BRIDGE"])], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") -@pytest.mark.usefixtures("create_profiles") -class TestSetupBridge: - - @pytest.mark.wpa - @pytest.mark.twog - def test_setup_wpa_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases): - if create_profiles['ssid_2g_wpa_bridge']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_bridge"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_2g_wpa_bridge'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_bridge"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa - @pytest.mark.fiveg - def test_setup_wpa_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases): - - if create_profiles['ssid_5g_wpa_bridge']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_bridge"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_5g_wpa_bridge'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_bridge"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.twog - def test_setup_wpa2_personal_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_2g_wpa2_bridge']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_bridge"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_2g_wpa2_bridge'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_bridge"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - def test_setup_wpa2_personal_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_5g_wpa2_bridge']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_bridge"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_5g_wpa2_bridge'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_bridge"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.radius - def test_setup_radius_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases): - - if create_profiles['radius_profile']: - instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['radius_profile'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_enterprise - @pytest.mark.twog - @pytest.mark.radius - def test_setup_wpa2_enterprise_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_2g_eap_bridge']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_bridge"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_2g_eap_bridge'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_bridge"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_enterprise - @pytest.mark.fiveg - @pytest.mark.radius - def test_setup_wpa2_enterprise_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_5g_eap_bridge']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_bridge"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_5g_eap_bridge'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_bridge"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - def test_setup_equipment_ap_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ap_bridge']: - instantiate_testrail.update_testrail(case_id=test_cases["ap_bridge"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ap_bridge'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ap_bridge"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - def test_verify_vif_config(self, setup_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if setup_profiles['bridge_vifc']: - instantiate_testrail.update_testrail(case_id=test_cases["bridge_vifc"], run_id=instantiate_project, - status_id=1, - msg='profile pushed successfully') - assert setup_profiles['bridge_vifc'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["bridge_vifc"], run_id=instantiate_project, - status_id=5, - msg='Failed to push profile') - assert False - - def test_verify_vif_state(self, setup_profiles, instantiate_testrail, instantiate_project, - test_cases): - if setup_profiles['bridge_vifs']: - instantiate_testrail.update_testrail(case_id=test_cases["bridge_vifs"], run_id=instantiate_project, - status_id=1, - msg='profile pushed successfully') - time.sleep(100) - assert setup_profiles['bridge_vifs'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["bridge_vifs"], run_id=instantiate_project, - status_id=5, - msg='Failed to push profile') - time.sleep(100) - assert False diff --git a/tests/e2e/basic/_basic_test_setup/setup_e2e_nat.py b/tests/e2e/basic/_basic_test_setup/setup_e2e_nat.py deleted file mode 100644 index 9f60ca2f4..000000000 --- a/tests/e2e/basic/_basic_test_setup/setup_e2e_nat.py +++ /dev/null @@ -1,174 +0,0 @@ -""" - Test Case Module: setup test cases for nat mode sanity - Details: nat mode setup - -""" -import time - -import pytest - - -@pytest.mark.sanity -@pytest.mark.setup_nat -@pytest.mark.nat -@pytest.mark.parametrize( - 'setup_profiles, create_profiles', - [(["NAT"], ["NAT"])], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") -@pytest.mark.usefixtures("create_profiles") -class TestSetupnat: - - @pytest.mark.wpa - @pytest.mark.twog - def test_setup_wpa_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases): - if create_profiles['ssid_2g_wpa_nat']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_nat"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_2g_wpa_nat'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_nat"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa - @pytest.mark.fiveg - def test_setup_wpa_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases): - - if create_profiles['ssid_5g_wpa_nat']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_nat"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_5g_wpa_nat'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_nat"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.twog - def test_setup_wpa2_personal_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_2g_wpa2_nat']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_nat"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_2g_wpa2_nat'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_nat"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - def test_setup_wpa2_personal_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_5g_wpa2_nat']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_nat"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_5g_wpa2_nat'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_nat"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.radius - def test_setup_radius_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases): - - if create_profiles['radius_profile']: - instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['radius_profile'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_enterprise - @pytest.mark.twog - @pytest.mark.radius - def test_setup_wpa2_enterprise_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_2g_eap_nat']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_nat"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_2g_eap_nat'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_nat"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_enterprise - @pytest.mark.fiveg - @pytest.mark.radius - def test_setup_wpa2_enterprise_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_5g_eap_nat']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_nat"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_5g_eap_nat'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_nat"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - def test_setup_equipment_ap_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ap_nat']: - instantiate_testrail.update_testrail(case_id=test_cases["ap_nat"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ap_nat'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ap_nat"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - def test_verify_vif_config(self, setup_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if setup_profiles['nat_vifc']: - instantiate_testrail.update_testrail(case_id=test_cases["nat_vifc"], run_id=instantiate_project, - status_id=1, - msg='profile pushed successfully') - assert setup_profiles['nat_vifc'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["nat_vifc"], run_id=instantiate_project, - status_id=5, - msg='Failed to push profile') - assert False - - def test_verify_vif_state(self, setup_profiles, instantiate_testrail, instantiate_project, - test_cases): - if setup_profiles['nat_vifs']: - instantiate_testrail.update_testrail(case_id=test_cases["nat_vifs"], run_id=instantiate_project, - status_id=1, - msg='profile pushed successfully') - time.sleep(100) - assert setup_profiles['nat_vifs'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["nat_vifs"], run_id=instantiate_project, - status_id=5, - msg='Failed to push profile') - time.sleep(100) - assert False diff --git a/tests/e2e/basic/_basic_test_setup/setup_e2e_vlan.py b/tests/e2e/basic/_basic_test_setup/setup_e2e_vlan.py deleted file mode 100644 index e3a814b28..000000000 --- a/tests/e2e/basic/_basic_test_setup/setup_e2e_vlan.py +++ /dev/null @@ -1,177 +0,0 @@ -""" - Test Case Module: setup test cases for vlan mode sanity - Details: vlan mode setup - -""" -import time - -import pytest - - -@pytest.mark.sanity -@pytest.mark.setup_vlan -@pytest.mark.vlan -@pytest.mark.parametrize( - 'setup_profiles, create_profiles', - [(["VLAN"], ["VLAN"])], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") -@pytest.mark.usefixtures("create_profiles") -class TestSetupvlan: - - - @pytest.mark.wpa - @pytest.mark.twog - def test_setup_wpa_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases): - if create_profiles['ssid_2g_wpa_vlan']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_vlan"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_2g_wpa_vlan'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_vlan"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa - @pytest.mark.fiveg - def test_setup_wpa_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases): - - if create_profiles['ssid_5g_wpa_vlan']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_vlan"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_5g_wpa_vlan'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_vlan"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.twog - def test_setup_wpa2_personal_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_2g_wpa2_vlan']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_vlan"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_2g_wpa2_vlan'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_vlan"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - def test_setup_wpa2_personal_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_5g_wpa2_vlan']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_vlan"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_5g_wpa2_vlan'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_vlan"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.radius - def test_setup_radius_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases): - - if create_profiles['radius_profile']: - instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['radius_profile'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_enterprise - @pytest.mark.twog - @pytest.mark.radius - def test_setup_wpa2_enterprise_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_2g_eap_vlan']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_vlan"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_2g_eap_vlan'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_vlan"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - @pytest.mark.wpa2_enterprise - @pytest.mark.fiveg - @pytest.mark.radius - def test_setup_wpa2_enterprise_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ssid_5g_eap_vlan']: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_vlan"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ssid_5g_eap_vlan'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_vlan"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - def test_setup_equipment_ap_profile(self, create_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if create_profiles['ap_vlan']: - instantiate_testrail.update_testrail(case_id=test_cases["ap_vlan"], run_id=instantiate_project, - status_id=1, - msg='profile created successfully') - assert create_profiles['ap_vlan'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["ap_vlan"], run_id=instantiate_project, - status_id=5, - msg='Failed to create profile') - assert False - - def test_verify_vif_config(self, setup_profiles, instantiate_testrail, instantiate_project, - test_cases): - - if setup_profiles['vlan_vifc']: - instantiate_testrail.update_testrail(case_id=test_cases["vlan_vifc"], run_id=instantiate_project, - status_id=1, - msg='profile pushed successfully') - assert setup_profiles['vlan_vifc'] - else: - instantiate_testrail.update_testrail(case_id=test_cases["vlan_vifc"], run_id=instantiate_project, - status_id=5, - msg='Failed to push profile') - assert False - - def test_verify_vif_state(self, setup_profiles, instantiate_testrail, instantiate_project, - test_cases): - if setup_profiles['vlan_vifs']: - instantiate_testrail.update_testrail(case_id=test_cases["vlan_vifs"], run_id=instantiate_project, - status_id=1, - msg='profile pushed successfully') - time.sleep(100) - - assert setup_profiles['vlan_vifs'] - - else: - instantiate_testrail.update_testrail(case_id=test_cases["vlan_vifs"], run_id=instantiate_project, - status_id=5, - msg='Failed to push profile') - time.sleep(100) - assert False diff --git a/tests/e2e/basic/_basic_test_setup/__init__.py b/tests/e2e/basic/configuration_tests/bridge_mode/__init__.py similarity index 100% rename from tests/e2e/basic/_basic_test_setup/__init__.py rename to tests/e2e/basic/configuration_tests/bridge_mode/__init__.py diff --git a/tests/e2e/basic/configuration_tests/bridge_mode/test_bridge_mode_configuration.py b/tests/e2e/basic/configuration_tests/bridge_mode/test_bridge_mode_configuration.py new file mode 100644 index 000000000..0ea6e63ff --- /dev/null +++ b/tests/e2e/basic/configuration_tests/bridge_mode/test_bridge_mode_configuration.py @@ -0,0 +1,496 @@ +import allure +import pytest +import time + +pytestmark = [pytest.mark.setup, pytest.mark.bridge, pytest.mark.sanity] + +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 SETUP") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestSetupBridge(object): + + @pytest.mark.open + @pytest.mark.twog + def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['open_2g']: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_2g'] + else: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.open + @pytest.mark.fiveg + def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['open_5g']: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_5g'] + else: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa + @pytest.mark.twog + def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa_2g']: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa + @pytest.mark.fiveg + def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa_5g']: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_personal + @pytest.mark.twog + def test_setup_wpa2_personal_2g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + def test_setup_wpa2_personal_5g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_setup_equipment_ap_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['equipment_ap']: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['equipment_ap'] + else: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_verify_vif_config(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['vifc']: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifc'] + else: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=5, + msg='Failed to push profile') + assert False + + def test_verify_vif_state(self, setup_profiles, update_report, + test_cases): + if setup_profiles['vifs']: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=1, + msg='profile pushed successfully') + time.sleep(100) + assert setup_profiles['vifs'] + else: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=5, + msg='Failed to push profile') + time.sleep(100) + assert False + + +setup_params_general_two = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa3_personal": [ + {"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa3_personal_mixed": [ + {"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa_wpa2_personal_mixed": [ + {"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}] + }, + "rf": {}, + "radius": False +} + + +@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectivitySuiteTwo(object): + + @pytest.mark.wpa3_personal + @pytest.mark.twog + def test_setup_wpa3_personal_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['open_2g']: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_2g'] + else: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_personal + @pytest.mark.fiveg + def test_setup_wpa3_personal_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['open_5g']: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_5g'] + else: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_personal_mixed + @pytest.mark.twog + def test_setup_wpa3_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa_2g']: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_personal_mixed + @pytest.mark.fiveg + def test_setup_wpa3_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa_5g']: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa_wpa2_personal_mixed + @pytest.mark.twog + def test_setup_wpa_wpa2_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa_wpa2_personal_mixed + @pytest.mark.fiveg + def test_setup_wpa_wpa2_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_setup_equipment_ap_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['equipment_ap']: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['equipment_ap'] + else: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_verify_vif_config(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['vifc']: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifc'] + else: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=5, + msg='Failed to push profile') + assert False + + def test_verify_vif_state(self, setup_profiles, update_report, + test_cases): + if setup_profiles['vifs']: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=1, + msg='profile pushed successfully') + time.sleep(100) + assert setup_profiles['vifs'] + else: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=5, + msg='Failed to push profile') + time.sleep(100) + assert False + + +setup_params_enterprise = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa_enterprise": [ + {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "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 +@allure.feature("BRIDGE MODE ENTERPRISE SETUP") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_enterprise], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestSetupBridgeEnterprise(object): + + @pytest.mark.wpa_enterprise + @pytest.mark.twog + def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa_enterprise_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa_enterprise_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa2_enterprise_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa2_enterprise_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_enterprise + @pytest.mark.twog + def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa3_enterprise_2g']: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa3_enterprise_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_enterprise + @pytest.mark.fiveg + def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa3_enterprise_5g']: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa3_enterprise_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_setup_equipment_ap_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['equipment_ap']: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['equipment_ap'] + else: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_verify_vif_config(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['vifc']: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifc'] + else: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=5, + msg='Failed to push profile') + assert False + + def test_verify_vif_state(self, setup_profiles, update_report, + test_cases): + if setup_profiles['vifs']: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=1, + msg='profile pushed successfully') + time.sleep(100) + assert setup_profiles['vifs'] + else: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=5, + msg='Failed to push profile') + time.sleep(100) + assert False diff --git a/tests/e2e/basic/configuration_tests/nat_mode/__init__.py b/tests/e2e/basic/configuration_tests/nat_mode/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/basic/configuration_tests/nat_mode/test_nat_mode_configuration.py b/tests/e2e/basic/configuration_tests/nat_mode/test_nat_mode_configuration.py new file mode 100644 index 000000000..4112ff575 --- /dev/null +++ b/tests/e2e/basic/configuration_tests/nat_mode/test_nat_mode_configuration.py @@ -0,0 +1,495 @@ +import allure +import pytest +import time + +pytestmark = [pytest.mark.setup, pytest.mark.NAT, pytest.mark.sanity] + +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 +} + + +@pytest.mark.basic +@allure.feature("NAT MODE SETUP") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestSetupNAT(object): + + @pytest.mark.open + @pytest.mark.twog + def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['open_2g']: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_2g'] + else: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.open + @pytest.mark.fiveg + def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['open_5g']: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_5g'] + else: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa + @pytest.mark.twog + def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa_2g']: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa + @pytest.mark.fiveg + def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa_5g']: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_personal + @pytest.mark.twog + def test_setup_wpa2_personal_2g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + def test_setup_wpa2_personal_5g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_setup_equipment_ap_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['equipment_ap']: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['equipment_ap'] + else: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_verify_vif_config(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['vifc']: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifc'] + else: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=5, + msg='Failed to push profile') + assert False + + def test_verify_vif_state(self, setup_profiles, update_report, + test_cases): + if setup_profiles['vifs']: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=1, + msg='profile pushed successfully') + time.sleep(100) + assert setup_profiles['vifs'] + else: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=5, + msg='Failed to push profile') + time.sleep(100) + assert False + + +setup_params_general_two = { + "mode": "NAT", + "ssid_modes": { + "wpa3_personal": [ + {"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa3_personal_mixed": [ + {"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa_wpa2_personal_mixed": [ + {"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_wpa3_p_m_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_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestNATModeConnectivitySuiteTwo(object): + + @pytest.mark.wpa3_personal + @pytest.mark.twog + def test_setup_wpa3_personal_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['open_2g']: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_2g'] + else: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_personal + @pytest.mark.fiveg + def test_setup_wpa3_personal_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['open_5g']: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_5g'] + else: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_personal_mixed + @pytest.mark.twog + def test_setup_wpa3_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa_2g']: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_personal_mixed + @pytest.mark.fiveg + def test_setup_wpa3_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa_5g']: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa_wpa2_personal_mixed + @pytest.mark.twog + def test_setup_wpa_wpa2_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa_wpa2_personal_mixed + @pytest.mark.fiveg + def test_setup_wpa_wpa2_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_setup_equipment_ap_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['equipment_ap']: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['equipment_ap'] + else: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_verify_vif_config(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['vifc']: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifc'] + else: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=5, + msg='Failed to push profile') + assert False + + def test_verify_vif_state(self, setup_profiles, update_report, + test_cases): + if setup_profiles['vifs']: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=1, + msg='profile pushed successfully') + time.sleep(100) + assert setup_profiles['vifs'] + else: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=5, + msg='Failed to push profile') + time.sleep(100) + assert False + + +setup_params_enterprise = { + "mode": "NAT", + "ssid_modes": { + "wpa_enterprise": [ + {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "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 +@allure.feature("NAT MODE ENTERPRISE SETUP") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_enterprise], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestSetupNATEnterprise(object): + + @pytest.mark.wpa_enterprise + @pytest.mark.twog + def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa_enterprise_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa_enterprise_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa2_enterprise_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa2_enterprise_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_enterprise + @pytest.mark.twog + def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa3_enterprise_2g']: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa3_enterprise_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_enterprise + @pytest.mark.fiveg + def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa3_enterprise_5g']: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa3_enterprise_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_setup_equipment_ap_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['equipment_ap']: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['equipment_ap'] + else: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_verify_vif_config(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['vifc']: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifc'] + else: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=5, + msg='Failed to push profile') + assert False + + def test_verify_vif_state(self, setup_profiles, update_report, + test_cases): + if setup_profiles['vifs']: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=1, + msg='profile pushed successfully') + time.sleep(100) + assert setup_profiles['vifs'] + else: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=5, + msg='Failed to push profile') + time.sleep(100) + assert False diff --git a/tests/e2e/basic/configuration_tests/vlan_mode/__init__.py b/tests/e2e/basic/configuration_tests/vlan_mode/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/basic/configuration_tests/vlan_mode/test_vlan_mode_configuration.py b/tests/e2e/basic/configuration_tests/vlan_mode/test_vlan_mode_configuration.py new file mode 100644 index 000000000..58e07d16e --- /dev/null +++ b/tests/e2e/basic/configuration_tests/vlan_mode/test_vlan_mode_configuration.py @@ -0,0 +1,495 @@ +import allure +import pytest +import time + +pytestmark = [pytest.mark.setup, pytest.mark.VLAN, pytest.mark.sanity] + +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 +} + + +@pytest.mark.basic +@allure.feature("VLAN MODE SETUP") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestSetupVLAN(object): + + @pytest.mark.open + @pytest.mark.twog + def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['open_2g']: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_2g'] + else: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.open + @pytest.mark.fiveg + def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['open_5g']: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_5g'] + else: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa + @pytest.mark.twog + def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa_2g']: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa + @pytest.mark.fiveg + def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa_5g']: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_personal + @pytest.mark.twog + def test_setup_wpa2_personal_2g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + def test_setup_wpa2_personal_5g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_setup_equipment_ap_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['equipment_ap']: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['equipment_ap'] + else: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_verify_vif_config(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['vifc']: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifc'] + else: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=5, + msg='Failed to push profile') + assert False + + def test_verify_vif_state(self, setup_profiles, update_report, + test_cases): + if setup_profiles['vifs']: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=1, + msg='profile pushed successfully') + time.sleep(100) + assert setup_profiles['vifs'] + else: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=5, + msg='Failed to push profile') + time.sleep(100) + assert False + + +setup_params_general_two = { + "mode": "VLAN", + "ssid_modes": { + "wpa3_personal": [ + {"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa3_personal_mixed": [ + {"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa_wpa2_personal_mixed": [ + {"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_wpa3_p_m_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_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestVLANModeConnectivitySuiteTwo(object): + + @pytest.mark.wpa3_personal + @pytest.mark.twog + def test_setup_wpa3_personal_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['open_2g']: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_2g'] + else: + update_report.update_testrail(case_id=test_cases["open_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_personal + @pytest.mark.fiveg + def test_setup_wpa3_personal_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['open_5g']: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['open_5g'] + else: + update_report.update_testrail(case_id=test_cases["open_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_personal_mixed + @pytest.mark.twog + def test_setup_wpa3_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa_2g']: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_personal_mixed + @pytest.mark.fiveg + def test_setup_wpa3_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa_5g']: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa_wpa2_personal_mixed + @pytest.mark.twog + def test_setup_wpa_wpa2_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa_wpa2_personal_mixed + @pytest.mark.fiveg + def test_setup_wpa_wpa2_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa2_personal_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_personal_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_setup_equipment_ap_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['equipment_ap']: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['equipment_ap'] + else: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_verify_vif_config(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['vifc']: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifc'] + else: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=5, + msg='Failed to push profile') + assert False + + def test_verify_vif_state(self, setup_profiles, update_report, + test_cases): + if setup_profiles['vifs']: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=1, + msg='profile pushed successfully') + time.sleep(100) + assert setup_profiles['vifs'] + else: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=5, + msg='Failed to push profile') + time.sleep(100) + assert False + + +setup_params_enterprise = { + "mode": "VLAN", + "ssid_modes": { + "wpa_enterprise": [ + {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "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 +@allure.feature("VLAN MODE ENTERPRISE SETUP") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_enterprise], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestSetupVLANEnterprise(object): + + @pytest.mark.wpa_enterprise + @pytest.mark.twog + def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa_enterprise_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa_enterprise_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases): + if setup_profiles['wpa2_enterprise_2g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases): + + if setup_profiles['wpa2_enterprise_5g']: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_enterprise + @pytest.mark.twog + def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa3_enterprise_2g']: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa3_enterprise_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa3_enterprise + @pytest.mark.fiveg + def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['wpa3_enterprise_5g']: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa3_enterprise_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_setup_equipment_ap_profile(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['equipment_ap']: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['equipment_ap'] + else: + update_report.update_testrail(case_id=test_cases["equipment_ap"], + status_id=5, + msg='Failed to create profile') + assert False + + def test_verify_vif_config(self, setup_profiles, update_report, + test_cases): + + if setup_profiles['vifc']: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifc'] + else: + update_report.update_testrail(case_id=test_cases["vifc"], + status_id=5, + msg='Failed to push profile') + assert False + + def test_verify_vif_state(self, setup_profiles, update_report, + test_cases): + if setup_profiles['vifs']: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=1, + msg='profile pushed successfully') + time.sleep(100) + assert setup_profiles['vifs'] + else: + update_report.update_testrail(case_id=test_cases["vifs"], + status_id=5, + msg='Failed to push profile') + time.sleep(100) + assert False diff --git a/tests/e2e/basic/conftest.py b/tests/e2e/basic/conftest.py index b1a3a5579..874f286b5 100644 --- a/tests/e2e/basic/conftest.py +++ b/tests/e2e/basic/conftest.py @@ -74,16 +74,6 @@ def instantiate_profile(instantiate_controller): yield profile_object -@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 @@ -99,12 +89,13 @@ def setup_vlan(): @allure.feature("CLIENT CONNECTIVITY SETUP") @pytest.fixture(scope="class") def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment_id, - instantiate_profile, get_markers, - get_security_flags, get_configuration, radius_info, get_apnos): + instantiate_profile, get_markers, + get_security_flags, get_configuration, radius_info, get_apnos): instantiate_profile = instantiate_profile(sdk_client=setup_controller) vlan_id, mode = 0, 0 instantiate_profile.cleanup_objects() parameter = dict(request.param) + print(parameter) test_cases = {} profile_data = {} if parameter['mode'] not in ["BRIDGE", "NAT", "VLAN"]: @@ -272,7 +263,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment if mode == "wpa3_personal": for j in profile_data["ssid"][mode]: - # print(j) + 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( @@ -298,6 +289,36 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment test_cases["wpa3_personal_5g"] = False allure.attach(body=str(e), name="SSID Profile Creation Failed") + if mode == "wpa3_personal_mixed": + 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_mixed_ssid_profile( + profile_data=j) + test_cases["wpa3_personal_mixed_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_mixed_ssid_profile( + profile_data=j) + test_cases["wpa3_personal_mixed_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]: @@ -371,7 +392,8 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment # Push the Equipment AP Profile to AP try: - instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id) + for i in get_equipment_id: + instantiate_profile.push_profile_old_method(equipment_id=i) except Exception as e: print(e) print("failed to create AP Profile") @@ -383,7 +405,6 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment ssid_names.sort() - @pytest.fixture(scope="function") def update_ssid(request, instantiate_profile, setup_profile_data): requested_profile = str(request.param).replace(" ", "").split(",") @@ -450,8 +471,30 @@ def create_lanforge_chamberview_dut(get_configuration, testbed): dut.setup() yield dut + @pytest.fixture(scope="session") def lf_test(get_configuration): obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details']) yield obj + +@pytest.fixture(scope="session") +def station_names_twog(request, get_configuration): + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_configuration["traffic_generator"]["details"]["2.4G-Station-Name"] + "0" + str(i)) + yield station_names + + +@pytest.fixture(scope="session") +def station_names_fiveg(request, get_configuration): + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_configuration["traffic_generator"]["details"]["5G-Station-Name"] + "0" + str(i)) + yield station_names + + +@pytest.fixture(scope="session") +def num_stations(request): + num_sta = int(request.config.getini("num_stations")) + yield num_sta diff --git a/tests/e2e/basic/test_firmware.py b/tests/e2e/basic/test_firmware.py index 8af8183d6..559e9e478 100644 --- a/tests/e2e/basic/test_firmware.py +++ b/tests/e2e/basic/test_firmware.py @@ -5,77 +5,65 @@ """ import pytest -@pytest.mark.configure_lanforge -def test_configure_lanforge(configure_lanforge): - - assert True +pytestmark = [pytest.mark.firmware, pytest.mark.sanity] -@pytest.mark.sanity -@pytest.mark.bridge -@pytest.mark.nat -@pytest.mark.vlan -@pytest.mark.firmware +@pytest.mark.firmware_cloud class TestFirmware(object): @pytest.mark.firmware_create - def test_firmware_create(self, upload_firmware, instantiate_testrail, instantiate_project, test_cases): + def test_firmware_create(self, upload_firmware, update_report, 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') + update_report.update_testrail(case_id=test_cases["create_fw"], + 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') + update_report.update_testrail(case_id=test_cases["create_fw"], + 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.firmware_upgrade + # def test_firmware_upgrade_request(self, upgrade_firmware, update_report, test_cases): + # print() + # if not upgrade_firmware: + # update_report.update_testrail(case_id=test_cases["upgrade_api"], + # status_id=0, + # msg='Error requesting upgrade via API') + # PASS = False + # else: + # update_report.update_testrail(case_id=test_cases["upgrade_api"], + # status_id=1, + # msg='Upgrade request using API successful') + # PASS = True + # assert PASS @pytest.mark.check_active_firmware_cloud - def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, instantiate_testrail, - instantiate_project, test_cases): + def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, update_report, 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.') + update_report.update_testrail(case_id=test_cases["cloud_fw"], + 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.') + update_report.update_testrail(case_id=test_cases["cloud_fw"], + 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, +@pytest.mark.firmware_ap +def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, update_report, 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') + update_report.update_testrail(case_id=test_cases["ap_upgrade"], + status_id=1, + msg='Upgrade to ' + str(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') + update_report.update_testrail(case_id=test_cases["ap_upgrade"], + status_id=4, + msg='Cannot reach AP after upgrade to check CLI - re-test required') assert check_ap_firmware_ssh == get_latest_firmware diff --git a/tests/e2e/basic/validation_of_operating_modes/bridge_mode/client_connectivity/test_security_modes.py b/tests/e2e/basic/validation_of_operating_modes/bridge_mode/client_connectivity/test_security_modes.py index 15a5ce5bd..74a7db1cd 100644 --- a/tests/e2e/basic/validation_of_operating_modes/bridge_mode/client_connectivity/test_security_modes.py +++ b/tests/e2e/basic/validation_of_operating_modes/bridge_mode/client_connectivity/test_security_modes.py @@ -1,7 +1,7 @@ import allure import pytest -pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge] +pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.sanity] setup_params_general = { "mode": "BRIDGE", @@ -29,90 +29,78 @@ setup_params_general = { scope="class" ) @pytest.mark.usefixtures("setup_profiles") -class TestBridgeModeConnectivity(object): - - @pytest.mark.configuration - def test_basic_configuration(self): - assert True +class TestBridgeModeConnectivitySuiteOne(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): + def test_open_ssid_2g(self, setup_profiles, get_lanforge_data, lf_test, update_report, station_names_twog, + 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) + station_name=station_names_twog, 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)) + # 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): + def test_open_ssid_5g(self, get_lanforge_data, lf_test, test_cases, station_names_fiveg, 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) + station_name=station_names_fiveg, 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)) + # 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): + lf_test, test_cases, station_names_twog): 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) + station_name=station_names_twog, vlan_id=vlan) if result: update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], @@ -129,50 +117,133 @@ class TestBridgeModeConnectivity(object): @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): + def test_wpa_ssid_5g(self, lf_test, update_report, test_cases, station_names_fiveg, 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) + station_name=station_names_fiveg, vlan_id=vlan) if result: - update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + update_report.update_testrail(case_id=test_cases["5g_wpa_bridge"], status_id=1, - msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str( + msg='5G WPA Client Connectivity Passed successfully - bridge mode' + str( passes)) else: - update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + update_report.update_testrail(case_id=test_cases["5g_wpa_bridge"], status_id=5, - msg='2G WPA Client Connectivity Failed - bridge mode' + str( + msg='5G 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): + def test_wpa2_personal_ssid_2g(self, get_lanforge_data, lf_test, update_report, test_cases, + station_names_twog): 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) + station_name=station_names_twog, vlan_id=vlan) + + if result: + update_report.update_testrail(case_id=test_cases["2g_wpa2_bridge"], + status_id=1, + msg='2G WPA2 Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa2_bridge"], + status_id=5, + msg='2G WPA2 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, get_lanforge_data, update_report, test_cases, station_names_fiveg, + 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" + 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_fiveg, vlan_id=vlan) + + if result: + update_report.update_testrail(case_id=test_cases["5g_wpa2_bridge"], + status_id=1, + msg='5G WPA2 Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["5g_wpa2_bridge"], + status_id=5, + msg='5G WPA2 Client Connectivity Failed - bridge mode' + str( + passes)) + assert result + + +setup_params_general_two = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa3_personal": [ + {"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa3_personal_mixed": [ + {"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa_wpa2_personal_mixed": [ + {"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}] + }, + "rf": {}, + "radius": False +} + + +@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectivitySuiteTwo(object): + + @pytest.mark.wpa3_personal + @pytest.mark.twog + @allure.story('open 2.4 GHZ Band') + def test_wpa3_personal_ssid_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = ["wpa3"] + 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_twog, vlan_id=vlan) if result: update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], @@ -186,23 +257,132 @@ class TestBridgeModeConnectivity(object): passes)) assert result - @pytest.mark.wpa2_personal + @pytest.mark.wpa3_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] + @allure.story('open 5 GHZ Band') + def test_wpa3_personal_ssid_5g(self, station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_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)) + security = ["wpa3"] 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) + station_name=station_names_fiveg, 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.wpa3_personal_mixed + @pytest.mark.twog + @allure.story('open 2.4 GHZ Band') + def test_wpa3_personal_mixed_ssid_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, + update_report, + test_cases): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa3" + 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_twog, 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.wpa3_personal_mixed + @pytest.mark.fiveg + @allure.story('open 5 GHZ Band') + def test_wpa3_personal_mixed_ssid_5g(self, station_names_fiveg, get_lanforge_data, lf_test, test_cases, + update_report): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa3" + 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_fiveg, 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_wpa2_personal_mixed + @pytest.mark.twog + @allure.story('wpa wpa2 personal mixed 2.4 GHZ Band') + def test_wpa_wpa2_personal_ssid_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases): + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = ["wpa3"] + 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_twog, 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_wpa2_personal_mixed + @pytest.mark.fiveg + @allure.story('wpa wpa2 personal mixed 5 GHZ Band') + def test_wpa_wpa2_personal_ssid_5g(self, station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report): + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = ["wpa3"] + 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_fiveg, vlan_id=vlan) if result: update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], @@ -220,6 +400,10 @@ class TestBridgeModeConnectivity(object): setup_params_enterprise = { "mode": "BRIDGE", "ssid_modes": { + "wpa_enterprise": [ + {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], "wpa2_enterprise": [ {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], @@ -238,29 +422,193 @@ setup_params_enterprise = { 'setup_profiles', [setup_params_enterprise], indirect=True, - scope="package" + scope="class" ) @pytest.mark.usefixtures("setup_profiles") class TestBridgeModeEnterprise(object): + @pytest.mark.wpa_enterprise + @pytest.mark.twog + def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_twog, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=5, + msg='2G WPA Client Connectivity Failed - bridge mode' + str( + passes)) + assert passes + + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_fiveg, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=5, + msg='2G WPA Client Connectivity Failed - bridge mode' + str( + passes)) + assert passes + @pytest.mark.wpa2_enterprise @pytest.mark.twog - def test_wpa2_enterprise_2g(self, ): - # print(setup_client_connectivity) - assert "setup_client_connectivity" + def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_twog, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=5, + msg='2G WPA Client Connectivity Failed - bridge mode' + str( + passes)) + assert passes @pytest.mark.wpa2_enterprise @pytest.mark.fiveg - def test_wpa2_enterprise_5g(self): - assert "setup_client_connectivity" + def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_fiveg, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=5, + msg='2G WPA Client Connectivity Failed - bridge mode' + str( + passes)) + assert passes @pytest.mark.wpa3_enterprise @pytest.mark.twog - def test_wpa3_enterprise_2g(self): - # print(setup_client_connectivity) - assert "setup_client_connectivity" + def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_twog, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=5, + msg='2G WPA Client Connectivity Failed - bridge mode' + str( + passes)) + assert passes @pytest.mark.wpa3_enterprise @pytest.mark.fiveg - def test_wpa3_enterprise_5g(self): - assert "setup_client_connectivity" + def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_fiveg, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=5, + msg='2G WPA Client Connectivity Failed - bridge mode' + str( + passes)) + assert passes diff --git a/tests/e2e/basic/validation_of_operating_modes/nat_mode/client_connectivity/test_basic_security.py b/tests/e2e/basic/validation_of_operating_modes/nat_mode/client_connectivity/test_basic_security.py deleted file mode 100644 index 2434b2d3a..000000000 --- a/tests/e2e/basic/validation_of_operating_modes/nat_mode/client_connectivity/test_basic_security.py +++ /dev/null @@ -1,260 +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_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" diff --git a/tests/e2e/basic/validation_of_operating_modes/nat_mode/client_connectivity/test_security_modes.py b/tests/e2e/basic/validation_of_operating_modes/nat_mode/client_connectivity/test_security_modes.py new file mode 100644 index 000000000..0296a284a --- /dev/null +++ b/tests/e2e/basic/validation_of_operating_modes/nat_mode/client_connectivity/test_security_modes.py @@ -0,0 +1,639 @@ +import pytest +import allure + +pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat, pytest.mark.sanity] + +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 TestNATModeConnectivitySuiteOne(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_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert 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_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert 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_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert 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_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert 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_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert 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_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert result + + +setup_params_general_two = { + "mode": "NAT", + "ssid_modes": { + "wpa3_personal": [ + {"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa3_personal_mixed": [ + {"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa_wpa2_personal_mixed": [ + {"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}] + }, + "rf": {}, + "radius": False +} + + +@pytest.mark.shivam +@allure.feature("NAT MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestNATModeConnectivitySuiteTwo(object): + + @pytest.mark.wpa3_personal + @pytest.mark.twog + @allure.story('open 2.4 GHZ Band') + def test_wpa3_personal_ssid_2g(self, request, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = ["wpa3"] + 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_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert result + + @pytest.mark.wpa3_personal + @pytest.mark.fiveg + @allure.story('open 5 GHZ Band') + def test_wpa3_personal_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = ["wpa3"] + 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_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert result + + @pytest.mark.wpa3_personal_mixed + @pytest.mark.twog + @allure.story('open 2.4 GHZ Band') + def test_wpa3_personal_mixed_ssid_2g(self, request, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa3" + 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_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert result + + @pytest.mark.wpa3_personal_mixed + @pytest.mark.fiveg + @allure.story('open 5 GHZ Band') + def test_wpa3_personal_mixed_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa3" + 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_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert result + + @pytest.mark.wpa_wpa2_personal_mixed + @pytest.mark.twog + @allure.story('wpa wpa2 personal mixed 2.4 GHZ Band') + def test_wpa_wpa2_personal_ssid_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases): + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = ["wpa3"] + 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_twog, 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_wpa2_personal_mixed + @pytest.mark.fiveg + @allure.story('wpa wpa2 personal mixed 5 GHZ Band') + def test_wpa_wpa2_personal_ssid_5g(self, station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report): + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = ["wpa3"] + 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_fiveg, 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": { + "wpa_enterprise": [ + {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "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="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestNATModeEnterprise(object): + + @pytest.mark.wpa_enterprise + @pytest.mark.twog + def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_twog, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=5, + msg='2G WPA Client Connectivity Failed - bridge mode' + str( + passes)) + assert passes + + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_fiveg, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=5, + msg='2G WPA Client Connectivity Failed - bridge mode' + str( + passes)) + assert passes + + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "NAT" + band = "twog" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_twog, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert passes + + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "NAT" + band = "fiveg" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_fiveg, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert passes + + @pytest.mark.wpa3_enterprise + @pytest.mark.twog + def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "NAT" + band = "twog" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_twog, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert passes + + @pytest.mark.wpa3_enterprise + @pytest.mark.fiveg + def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "NAT" + band = "fiveg" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_fiveg, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"], + status_id=5, + msg='2G WPA Client Connectivity Failed - NAT mode' + str( + passes)) + assert passes diff --git a/tests/e2e/basic/validation_of_operating_modes/vlan_mode/client_connectivity/test_basic_security.py b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/client_connectivity/test_basic_security.py deleted file mode 100644 index 189d008b8..000000000 --- a/tests/e2e/basic/validation_of_operating_modes/vlan_mode/client_connectivity/test_basic_security.py +++ /dev/null @@ -1,261 +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_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" diff --git a/tests/e2e/basic/validation_of_operating_modes/vlan_mode/client_connectivity/test_security_modes.py b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/client_connectivity/test_security_modes.py new file mode 100644 index 000000000..9b885dc79 --- /dev/null +++ b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/client_connectivity/test_security_modes.py @@ -0,0 +1,634 @@ +import pytest +import allure + +pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan, pytest.mark.sanity] + +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, setup_profiles, 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_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert 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_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert 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_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert 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_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert 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_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert 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_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert result + + +setup_params_general_two = { + "mode": "VLAN", + "ssid_modes": { + "wpa3_personal": [ + {"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa3_personal_mixed": [ + {"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "wpa_wpa2_personal_mixed": [ + {"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}] + }, + "rf": {}, + "radius": False +} + + +@pytest.mark.shivam +@allure.feature("VLAN MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestVLANModeConnectivitySuiteTwo(object): + + @pytest.mark.wpa3_personal + @pytest.mark.twog + @allure.story('open 2.4 GHZ Band') + def test_wpa3_personal_ssid_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = ["wpa3"] + mode = "VLAN" + 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_twog, vlan_id=vlan) + + if result: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert result + + @pytest.mark.wpa3_personal + @pytest.mark.fiveg + @allure.story('open 5 GHZ Band') + def test_wpa3_personal_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = ["wpa3"] + 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 = 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_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert result + + @pytest.mark.wpa3_personal_mixed + @pytest.mark.twog + @allure.story('open 2.4 GHZ Band') + def test_wpa3_personal_mixed_ssid_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, + update_report, + test_cases): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa3" + mode = "VLAN" + 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_twog, vlan_id=vlan) + + if result: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert result + + @pytest.mark.wpa3_personal_mixed + @pytest.mark.fiveg + @allure.story('open 5 GHZ Band') + def test_wpa3_personal_mixed_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report): + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa3" + 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 = 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_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert result + + @pytest.mark.wpa_wpa2_personal_mixed + @pytest.mark.twog + @allure.story('wpa wpa2 personal mixed 2.4 GHZ Band') + def test_wpa_wpa2_personal_ssid_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases): + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = ["wpa3"] + 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_twog, 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_wpa2_personal_mixed + @pytest.mark.fiveg + @allure.story('wpa wpa2 personal mixed 5 GHZ Band') + def test_wpa_wpa2_personal_ssid_5g(self, station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report): + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = ["wpa3"] + 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_fiveg, 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": "VLAN", + "ssid_modes": { + "wpa_enterprise": [ + {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "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="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestVLANModeEnterprise(object): + + @pytest.mark.wpa_enterprise + @pytest.mark.twog + def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_twog, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=5, + msg='2G WPA Client Connectivity Failed - bridge mode' + str( + passes)) + assert passes + + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_fiveg, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"], + status_id=5, + msg='2G WPA Client Connectivity Failed - bridge mode' + str( + passes)) + assert passes + + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "VLAN" + band = "twog" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_twog, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert passes + + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "VLAN" + band = "fiveg" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_fiveg, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert passes + + @pytest.mark.wpa3_enterprise + @pytest.mark.twog + def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "VLAN" + band = "twog" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_twog, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert passes + + @pytest.mark.wpa3_enterprise + @pytest.mark.fiveg + def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report, + test_cases, radius_info): + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "VLAN" + band = "fiveg" + vlan = 1 + ttls_passwd = radius_info["password"] + eap = "TTLS" + identity = radius_info['user'] + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_fiveg, vlan_id=vlan) + + if passes: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str( + passes)) + else: + update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"], + status_id=5, + msg='2G WPA Client Connectivity Failed - VLAN mode' + str( + passes)) + assert passes diff --git a/tests/test_connectivity.py b/tests/test_connectivity.py index d6d9f5175..42073ffe2 100644 --- a/tests/test_connectivity.py +++ b/tests/test_connectivity.py @@ -3,53 +3,7 @@ """ import sys -<<<<<<< HEAD -pytestmark = [pytest.mark.test_connectivity] - -@pytest.mark.sanity -@pytest.mark.bridge -@pytest.mark.nat -@pytest.mark.vlan -@pytest.mark.test_controller_connectivity -def test_controller_connectivity(instantiate_controller, instantiate_testrail, instantiate_project, test_cases): - try: - instantiate_testrail.update_testrail(case_id=test_cases["cloud_ver"], run_id=instantiate_project, - 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(access_point_connectivity, instantiate_testrail, instantiate_project, test_cases, - exit_on_fail): - if not access_point_connectivity["serial"] and not access_point_connectivity["mgr"]: - instantiate_testrail.update_testrail(case_id=test_cases["cloud_connection"], run_id=instantiate_project, - status_id=5, - msg='CloudSDK connectivity failed') - status = False - pytest.exit("Access Point is not Properly Connected: Sanity Failed") - else: - instantiate_testrail.update_testrail(case_id=test_cases["cloud_connection"], run_id=instantiate_project, - status_id=1, - msg='Manager status is Active') - status = True - - assert status - - -@pytest.mark.test_lanforge_connectivity -def test_lanforge_connectiity(check_lanforge_connectivity): - assert True -======= import allure import pytest @@ -72,26 +26,28 @@ class TestResources(object): update_report.update_testrail(case_id=test_cases["cloud_ver"], status_id=0, msg='Could not read CloudSDK version from API') pytest.exit("Resource Not Available") - print(setup_controller.bearer) + # print(setup_controller.bearer) assert setup_controller.bearer @pytest.mark.test_access_points_connectivity @allure.testcase(name="test_access_points_connectivity", url="") def test_access_points_connectivity(self, test_access_point, update_report, test_cases): - print(test_access_point) - # if "ACTIVE" not in test_access_point: - # allure.attach(name="Access Point Connectivity Success", body=str(test_access_point)) - # update_report.update_testrail(case_id=test_cases["cloud_connection"], - # status_id=5, - # msg='CloudSDK connectivity failed') - # - # sys.exit() - # else: - # allure.attach(name="Access Point Connectivity Failed", body=str(test_access_point)) - # update_report.update_testrail(case_id=test_cases["cloud_connection"], - # status_id=1, - # msg='Manager status is Active') - # - # assert "ACTIVE" in test_access_point - assert True ->>>>>>> staging-wifi-1960 + for i in test_access_point: + if "ACTIVE" not in i: + flag = False + + if flag is False: + allure.attach(name="Access Point Connectivity Success", body=str(test_access_point)) + update_report.update_testrail(case_id=test_cases["cloud_connection"], + status_id=5, + msg='CloudSDK connectivity failed') + + pytest.exit("Access Point Manafer state is not ACtive") + else: + allure.attach(name="Access Point Connectivity Failed", body=str(test_access_point)) + update_report.update_testrail(case_id=test_cases["cloud_connection"], + status_id=1, + msg='Manager status is Active') + + assert flag +