From 941d1b047ecc9356de5a246bb0c63af3e1e047fd Mon Sep 17 00:00:00 2001 From: shivamcandela Date: Mon, 31 May 2021 23:48:44 +0530 Subject: [PATCH] missing security modes EAP Configuration added nat and vlan Signed-off-by: shivamcandela --- ...enterprise_security_modes_configuration.py | 164 +++++++++++++++++- ...enterprise_security_modes_configuration.py | 164 +++++++++++++++++- 2 files changed, 326 insertions(+), 2 deletions(-) diff --git a/tests/e2e/basic/configuration_tests/nat_mode/test_enterprise_security_modes_configuration.py b/tests/e2e/basic/configuration_tests/nat_mode/test_enterprise_security_modes_configuration.py index a7bb573ab..e46b1bb1b 100644 --- a/tests/e2e/basic/configuration_tests/nat_mode/test_enterprise_security_modes_configuration.py +++ b/tests/e2e/basic/configuration_tests/nat_mode/test_enterprise_security_modes_configuration.py @@ -1,7 +1,8 @@ import pytest import allure -pytestmark = [pytest.mark.setup, pytest.mark.nat, pytest.mark.sanity, pytest.mark.enterprise, pytest.mark.usefixtures("setup_test_run")] +pytestmark = [pytest.mark.setup, pytest.mark.nat, pytest.mark.sanity, pytest.mark.enterprise, + pytest.mark.usefixtures("setup_test_run")] setup_params_enterprise = { "mode": "NAT", @@ -162,3 +163,164 @@ class TestSetupNATEnterprise(object): status_id=5, msg='Failed to push profile') assert False + + +setup_params_enterprise_two = { + "mode": "NAT", + "ssid_modes": { + "wpa_enterprise": [ + {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]}, + {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}], + "wpa2_enterprise": [ + {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]}, + {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}], + "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_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestSetupNATEnterpriseSuiteB(object): + + @pytest.mark.wpa_enterprise + @pytest.mark.twog + def test_setup_wpa_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["wpa_enterprise_2g_na"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_na"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_setup_wpa_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["wpa_enterprise_5g_na"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_na"], + 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_na"], + 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_na"], + 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_na"], + 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_na"], + 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_na"], + 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_na"], + 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_na"], + 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_na"], + 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_na"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['equipment_ap'] + else: + update_report.update_testrail(case_id=test_cases["equipment_ap_na"], + 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["nat_vifc"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifc'] + else: + update_report.update_testrail(case_id=test_cases["nat_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["nat_vifs"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifs'] + else: + update_report.update_testrail(case_id=test_cases["nat_vifs"], + status_id=5, + msg='Failed to push profile') + assert False diff --git a/tests/e2e/basic/configuration_tests/vlan_mode/test_enterprise_security_modes_configuration.py b/tests/e2e/basic/configuration_tests/vlan_mode/test_enterprise_security_modes_configuration.py index 5fa76179c..973487656 100644 --- a/tests/e2e/basic/configuration_tests/vlan_mode/test_enterprise_security_modes_configuration.py +++ b/tests/e2e/basic/configuration_tests/vlan_mode/test_enterprise_security_modes_configuration.py @@ -1,7 +1,8 @@ import pytest import allure -pytestmark = [pytest.mark.setup, pytest.mark.vlan, pytest.mark.sanity, pytest.mark.enterprise, pytest.mark.usefixtures("setup_test_run")] +pytestmark = [pytest.mark.setup, pytest.mark.vlan, pytest.mark.sanity, pytest.mark.enterprise, + pytest.mark.usefixtures("setup_test_run")] setup_params_enterprise = { "mode": "VLAN", @@ -162,3 +163,164 @@ class TestSetupvlanEnterprise(object): status_id=5, msg='Failed to push profile') assert False + + +setup_params_enterprise_two = { + "mode": "VLAN", + "ssid_modes": { + "wpa_enterprise": [ + {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]}, + {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}], + "wpa2_enterprise": [ + {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]}, + {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}], + "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_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestSetupVLANEnterpriseSuiteB(object): + + @pytest.mark.wpa_enterprise + @pytest.mark.twog + def test_setup_wpa_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["wpa_enterprise_2g_vlan"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_2g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_vlan"], + status_id=5, + msg='Failed to create profile') + assert False + + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_setup_wpa_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["wpa_enterprise_5g_vlan"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['wpa2_enterprise_5g'] + else: + update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_vlan"], + 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_vlan"], + 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_vlan"], + 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_vlan"], + 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_vlan"], + 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_vlan"], + 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_vlan"], + 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_vlan"], + 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_vlan"], + 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_vlan"], + status_id=1, + msg='profile created successfully') + assert setup_profiles['equipment_ap'] + else: + update_report.update_testrail(case_id=test_cases["equipment_ap_vlan"], + 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["vlan_vifc"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifc'] + else: + update_report.update_testrail(case_id=test_cases["vlan_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["vlan_vifs"], + status_id=1, + msg='profile pushed successfully') + assert setup_profiles['vifs'] + else: + update_report.update_testrail(case_id=test_cases["vlan_vifs"], + status_id=5, + msg='Failed to push profile') + assert False