From 40059635da94d9f393a8bf66eb981fefbd1212aa Mon Sep 17 00:00:00 2001 From: saurabh Date: Mon, 11 Oct 2021 20:53:11 +0530 Subject: [PATCH 1/8] Added mixed mode testcasses Signed-off-by: saurabh --- .../iOS/test_general_security_mode.py | 247 ++++++++++++++++++ 1 file changed, 247 insertions(+) diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_general_security_mode.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_general_security_mode.py index 6f1b7efed..c37576e3f 100644 --- a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_general_security_mode.py +++ b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_general_security_mode.py @@ -260,3 +260,250 @@ class TestVlanModeConnectSuiteOneVlan(object): else: allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) assert False + +setup_params_general_two = { + "mode": "VLAN", + "ssid_modes": { + "wpa3_personal": [ + {"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100}, + {"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["5G"], + "security_key": "something", "vlan": 100}], + "wpa3_personal_mixed": [ + {"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100}, + {"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["5G"], + "security_key": "something", "vlan": 100}], + "wpa_wpa2_personal_mixed": [ + {"ssid_name": "ssid_wpa_wpa2_p_m_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100}, + {"ssid_name": "ssid_wpa_wpa2_p_m_5g", "appliedRadios": ["5G"], + "security_key": "something", "vlan": 100}] + }, + "rf": {}, + "radius": False +} + + +@allure.suite(suite_name="interop sanity") +@allure.sub_suite(sub_suite_name="Vlan Mode Client Connect : Suite-B") +@pytest.mark.InteropsuiteB +@allure.feature("VLAN MODE CLIENT CONNECT") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestVlanModeConnectSuiteTwo(object): + """ Client Connect SuiteB + pytest -m "client_connect and nat and InteropsuiteB" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4596", name="WIFI-4596") + @pytest.mark.fiveg + @pytest.mark.wpa3_personal + def test_ClientConnect_5g_wpa3_personal_Vlan(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4595", name="WIFI-4595") + @pytest.mark.twog + @pytest.mark.wpa3_personal + def test_ClientConnect_2g_wpa3_personal_Vlan(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4598", name="WIFI-4598") + @pytest.mark.fiveg + @pytest.mark.wpa3_personal_mixed + def test_ClientConnect_5g_wpa3_personal_mixed_Vlan(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4597", name="WIFI-4597") + @pytest.mark.twog + @pytest.mark.wpa3_personal_mixed + def test_ClientConnect_2g_wpa3_personal_mixed_Vlan(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4600", name="WIFI-4600") + @pytest.mark.fiveg + @pytest.mark.wpa_wpa2_personal_mixed + def test_ClientConnect_5g_wpa_wpa2_personal_mixed_Vlan(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + #Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4599", name="WIFI-4599") + @pytest.mark.twog + @pytest.mark.wpa_wpa2_personal_mixed + def test_ClientConnect_2g_wpa_wpa2_personal_mixed_Vlan(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False \ No newline at end of file From 1abba4f56e982c8937c3d78bb0473ce43e49743a Mon Sep 17 00:00:00 2001 From: saurabh Date: Mon, 11 Oct 2021 20:55:31 +0530 Subject: [PATCH 2/8] Added mixed mode testcasses Signed-off-by: saurabh --- .../client_connect_test/iOS/test_general_security_mode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_general_security_mode.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_general_security_mode.py index c37576e3f..a90453ce2 100644 --- a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_general_security_mode.py +++ b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_general_security_mode.py @@ -295,7 +295,7 @@ setup_params_general_two = { @pytest.mark.usefixtures("setup_profiles") class TestVlanModeConnectSuiteTwo(object): """ Client Connect SuiteB - pytest -m "client_connect and nat and InteropsuiteB" + pytest -m "client_connect and vlan and InteropsuiteB" """ @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4596", name="WIFI-4596") From 943b844c92743d093d0761a66f960facea86335e Mon Sep 17 00:00:00 2001 From: saurabh Date: Tue, 12 Oct 2021 15:53:00 +0530 Subject: [PATCH 3/8] Added jira links Signed-off-by: saurabh --- .../iOS/test_general_security_modes.py | 13 +- .../iOS/test_enterprise_ttls.py | 209 ++++++++++++++++ .../iOS/test_enterprise_ttls.py | 223 ++++++++++++++++++ 3 files changed, 444 insertions(+), 1 deletion(-) create mode 100644 tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_enterprise_ttls.py create mode 100644 tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py diff --git a/tests/e2e/interOp/validation_of_operating_modes/nat_mode/client_connectivity_test/iOS/test_general_security_modes.py b/tests/e2e/interOp/validation_of_operating_modes/nat_mode/client_connectivity_test/iOS/test_general_security_modes.py index 9658fe02a..437036abe 100644 --- a/tests/e2e/interOp/validation_of_operating_modes/nat_mode/client_connectivity_test/iOS/test_general_security_modes.py +++ b/tests/e2e/interOp/validation_of_operating_modes/nat_mode/client_connectivity_test/iOS/test_general_security_modes.py @@ -57,6 +57,7 @@ class TestNatModeConnectivitySuiteNatOne(object): pytest -m "client_connectivity and nat and InteropsuiteA" """ + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4526", name="WIFI-4526") @pytest.mark.fiveg @pytest.mark.wpa2_personal def test_ClientConnectivity_5g_WPA2_Personal_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, @@ -93,6 +94,7 @@ class TestNatModeConnectivitySuiteNatOne(object): allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4525", name="WIFI-4525") @pytest.mark.twog @pytest.mark.wpa2_personal def test_ClientConnectivity_2g_WPA2_Personal_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): @@ -128,6 +130,7 @@ class TestNatModeConnectivitySuiteNatOne(object): allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4522", name="WIFI-4522") @pytest.mark.fiveg @pytest.mark.wpa def test_ClientConnectivity_5g_WPA_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): @@ -163,6 +166,7 @@ class TestNatModeConnectivitySuiteNatOne(object): allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4520", name="WIFI-4520") @pytest.mark.twog @pytest.mark.wpa def test_ClientConnectivity_2g_WPA_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): @@ -198,6 +202,7 @@ class TestNatModeConnectivitySuiteNatOne(object): allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4518", name="WIFI-4518") @pytest.mark.fiveg @pytest.mark.open def test_ClientConnectivity_5g_Open_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): @@ -233,6 +238,7 @@ class TestNatModeConnectivitySuiteNatOne(object): allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4517", name="WIFI-4517") @pytest.mark.twog @pytest.mark.open def test_ClientConnectivity_2g_Open_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): @@ -309,6 +315,7 @@ class TestNatModeConnectivitySuiteNatTwo(object): pytest -m "client_connectivity and nat and InteropsuiteB" """ + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4528", name="WIFI-4528") @pytest.mark.fiveg @pytest.mark.wpa3_personal def test_ClientConnectivity_5g_wpa3_personal_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): @@ -343,6 +350,7 @@ class TestNatModeConnectivitySuiteNatTwo(object): allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) assert False + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4527", name="WIFI-4527") @pytest.mark.twog @pytest.mark.wpa3_personal def test_ClientConnectivity_2g_wpa3_personal_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): @@ -377,6 +385,7 @@ class TestNatModeConnectivitySuiteNatTwo(object): allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) assert False + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4532", name="WIFI-4532") @pytest.mark.fiveg @pytest.mark.wpa3_personal_mixed def test_ClientConnectivity_5g_wpa3_personal_mixed_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): @@ -411,6 +420,7 @@ class TestNatModeConnectivitySuiteNatTwo(object): allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) assert False + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4529", name="WIFI-4529") @pytest.mark.twog @pytest.mark.wpa3_personal_mixed def test_ClientConnectivity_2g_wpa3_personal_mixed_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): @@ -445,6 +455,7 @@ class TestNatModeConnectivitySuiteNatTwo(object): allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) assert False + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4538", name="WIFI-4538") @pytest.mark.fiveg @pytest.mark.wpa_wpa2_personal_mixed def test_ClientConnectivity_5g_wpa_wpa2_personal_mixed_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): @@ -479,7 +490,7 @@ class TestNatModeConnectivitySuiteNatTwo(object): allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) assert False - + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4537", name="WIFI-4537") @pytest.mark.twog @pytest.mark.wpa_wpa2_personal_mixed def test_ClientConnectivity_2g_wpa_wpa2_personal_mixed_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_enterprise_ttls.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_enterprise_ttls.py new file mode 100644 index 000000000..5247b85f1 --- /dev/null +++ b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_enterprise_ttls.py @@ -0,0 +1,209 @@ +from logging import exception +import io +import unittest +import warnings +from perfecto.test import TestResultFactory +import pytest +import sys +import time +from selenium.common.exceptions import NoSuchElementException +from selenium.webdriver.common.by import By +from appium import webdriver +from selenium.common.exceptions import NoSuchElementException + +import sys +import allure + +if 'perfecto_libs' not in sys.path: + sys.path.append(f'../libs/perfecto_libs') + +from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ForgetWifiConnection, ping_deftapps_iOS, \ + Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown,\ + verifyUploadDownloadSpeediOS, get_ip_address_eap_ios + +pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.client_connect + ,pytest.mark.interop_uc_sanity, pytest.mark.bridge, pytest.mark.enterprise] + +setup_params_enterprise = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_enterprise": [ + {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"]}, + {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}], + "wpa3_enterprise": [ + {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"]}, + {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}]}, + + "rf": {}, + "radius": True +} + + +@allure.suite(suite_name="interop sanity") +@allure.sub_suite(sub_suite_name="Bridge Mode EAP Client Connect : Suite-A") +@pytest.mark.suiteA +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_enterprise], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeEnterpriseTTLSSuiteA(object): + """ SuiteA Enterprise Test Cases + pytest -m "client_connect and bridge and enterprise and ttls and interop and suiteA" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4691", name="WIFI-4691") + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_ClientConnect_5g_WPA2_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + """ wpa2 enterprise 5g + pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg" + """ + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1] + ssidName = profile_data["ssid_name"] + # ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + ttls_passwd = radius_info["password"] + identity = radius_info['user'] + get_vif_state.append(ssidName) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_ToggleAirplaneMode_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, + connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4690", name="WIFI-4690") + @pytest.mark.twog + @pytest.mark.wpa2_enterprise + def test_ClientConnect_2g_WPA2_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0] + ssidName = profile_data["ssid_name"] + # ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + ttls_passwd = radius_info["password"] + identity = radius_info['user'] + get_vif_state.append(ssidName) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_ToggleAirplaneMode_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4695", name="WIFI-4695") + @pytest.mark.wpa3_enterprise + @pytest.mark.fiveg + def test_ClientConnect_5g_WPA3_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + """ wpa2 enterprise 5g + pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg" + """ + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1] + ssidName = profile_data["ssid_name"] + # ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + ttls_passwd = radius_info["password"] + identity = radius_info['user'] + get_vif_state.append(ssidName) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_ToggleAirplaneMode_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, + connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4694", name="WIFI-4694") + @pytest.mark.twog + @pytest.mark.wpa3_enterprise + def test_ClientConnect_2g_WPA3_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0] + ssidName = profile_data["ssid_name"] + # ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + ttls_passwd = radius_info["password"] + identity = radius_info['user'] + get_vif_state.append(ssidName) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_ToggleAirplaneMode_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py new file mode 100644 index 000000000..65a6980ea --- /dev/null +++ b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py @@ -0,0 +1,223 @@ +from logging import exception +import io +import unittest +import warnings +from perfecto.test import TestResultFactory +import pytest +import sys +import time +from selenium.common.exceptions import NoSuchElementException +from selenium.webdriver.common.by import By +from appium import webdriver +from selenium.common.exceptions import NoSuchElementException + +import sys +import allure + +if 'perfecto_libs' not in sys.path: + sys.path.append(f'../libs/perfecto_libs') + +from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ForgetWifiConnection, ping_deftapps_iOS, \ + Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown,\ + verifyUploadDownloadSpeediOS, get_ip_address_eap_ios, wifi_connect_eap, wifi_disconnect_and_forget + +pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.client_connectivity + ,pytest.mark.interop_uc_sanity, pytest.mark.bridge, pytest.mark.enterprise] + +setup_params_enterprise = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_enterprise": [ + {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"]}, + {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}], + "wpa3_enterprise": [ + {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"]}, + {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}]}, + + "rf": {}, + "radius": True +} + + +@allure.suite(suite_name="interop sanity") +@allure.sub_suite(sub_suite_name="Bridge Mode EAP Client Connectivity : Suite-A") +@pytest.mark.suiteA +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_enterprise], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeEnterpriseTTLSSuiteA(object): + """ SuiteA Enterprise Test Cases + pytest -m "client_connect and bridge and enterprise and ttls and interop and suiteA" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4711", name="WIFI-4711") + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_ClientConnectivity_5g_WPA2_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + """ wpa2 enterprise 5g + pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg" + """ + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = ["BLANK"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + ttls_passwd = radius_info["password"] + identity = radius_info['user'] + get_vif_state.append(ssidName) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_ToggleAirplaneMode_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData) + + if is_internet: + if ip: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + + wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData) + assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + wifi_disconnect_and_forget(request, ssidName, ssidPassword,setup_perfectoMobile_iOS, connData) + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4710", name="WIFI-4710") + @pytest.mark.twog + @pytest.mark.wpa2_enterprise + def test_ClientConnectivity_2g_WPA2_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + + profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = ["BLANK"] + # ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + ttls_passwd = radius_info["password"] + identity = radius_info['user'] + get_vif_state.append(ssidName) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_ToggleAirplaneMode_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData) + + if is_internet: + if ip: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + + wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData) + assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4715", name="WIFI-4715") + @pytest.mark.wpa3_enterprise + @pytest.mark.fiveg + def test_ClientConnectivity_5g_WPA3_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + """ wpa2 enterprise 5g + pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg" + """ + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = ["BLANK"] + # ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + ttls_passwd = radius_info["password"] + identity = radius_info['user'] + get_vif_state.append(ssidName) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_ToggleAirplaneMode_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, + connData) + + if is_internet: + if ip: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + + wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData) + assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4714", name="WIFI-4714") + @pytest.mark.twog + @pytest.mark.wpa3_enterprise + def test_ClientConnectivity_2g_WPA3_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = ["BLANK"] + # ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + ttls_passwd = radius_info["password"] + identity = radius_info['user'] + get_vif_state.append(ssidName) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_ToggleAirplaneMode_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData) + + if is_internet: + if ip: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + + wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData) + assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False From 22311e2dc23f6dd6951b96a390c984e2a2e2f98a Mon Sep 17 00:00:00 2001 From: saurabh Date: Tue, 12 Oct 2021 15:53:33 +0530 Subject: [PATCH 4/8] Added enterprise testcasses for ios Signed-off-by: saurabh --- .../iOS/test_enterprise_ttls.py | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_enterprise_ttls.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_enterprise_ttls.py index 5247b85f1..bc3037bb3 100644 --- a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_enterprise_ttls.py +++ b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connect_test/iOS/test_enterprise_ttls.py @@ -22,17 +22,17 @@ from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ForgetWifiConnecti verifyUploadDownloadSpeediOS, get_ip_address_eap_ios pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.client_connect - ,pytest.mark.interop_uc_sanity, pytest.mark.bridge, pytest.mark.enterprise] + ,pytest.mark.interop_uc_sanity, pytest.mark.vlan, pytest.mark.enterprise] setup_params_enterprise = { - "mode": "BRIDGE", + "mode": "VLAN", "ssid_modes": { "wpa2_enterprise": [ - {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"]}, - {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}], + {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"], "vlan": 100}, + {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"], "vlan": 100}], "wpa3_enterprise": [ - {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"]}, - {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}]}, + {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"], "vlan": 100}, + {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"], "vlan": 100}]}, "rf": {}, "radius": True @@ -40,7 +40,7 @@ setup_params_enterprise = { @allure.suite(suite_name="interop sanity") -@allure.sub_suite(sub_suite_name="Bridge Mode EAP Client Connect : Suite-A") +@allure.sub_suite(sub_suite_name="Vlan Mode EAP Client Connect : Suite-A") @pytest.mark.suiteA @pytest.mark.parametrize( 'setup_profiles', @@ -51,16 +51,16 @@ setup_params_enterprise = { @pytest.mark.usefixtures("setup_profiles") class TestBridgeModeEnterpriseTTLSSuiteA(object): """ SuiteA Enterprise Test Cases - pytest -m "client_connect and bridge and enterprise and ttls and interop and suiteA" + pytest -m "client_connect and vlan and enterprise and ttls and interop and suiteA" """ - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4691", name="WIFI-4691") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4703", name="WIFI-4703") @pytest.mark.wpa2_enterprise @pytest.mark.fiveg - def test_ClientConnect_5g_WPA2_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnect_5g_WPA2_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data , setup_perfectoMobile_iOS, radius_info, get_ap_logs): """ wpa2 enterprise 5g - pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg" + pytest -m "client_connect and vlan and enterprise and ttls and wpa_enterprise and fiveg" """ profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1] ssidName = profile_data["ssid_name"] @@ -94,10 +94,10 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object): allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) assert False - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4690", name="WIFI-4690") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4702", name="WIFI-4702") @pytest.mark.twog @pytest.mark.wpa2_enterprise - def test_ClientConnect_2g_WPA2_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnect_2g_WPA2_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data , setup_perfectoMobile_iOS, radius_info, get_ap_logs): profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0] @@ -131,13 +131,13 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object): allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) assert False - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4695", name="WIFI-4695") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4707", name="WIFI-4707") @pytest.mark.wpa3_enterprise @pytest.mark.fiveg - def test_ClientConnect_5g_WPA3_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnect_5g_WPA3_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data , setup_perfectoMobile_iOS, radius_info, get_ap_logs): """ wpa2 enterprise 5g - pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg" + pytest -m "client_connect and vlan and enterprise and ttls and wpa_enterprise and fiveg" """ profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1] ssidName = profile_data["ssid_name"] @@ -171,10 +171,10 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object): allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) assert False - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4694", name="WIFI-4694") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4706", name="WIFI-4706") @pytest.mark.twog @pytest.mark.wpa3_enterprise - def test_ClientConnect_2g_WPA3_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnect_2g_WPA3_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data , setup_perfectoMobile_iOS, radius_info, get_ap_logs): profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0] From 6e90148db73a70612c52e3472c6c607591d3536f Mon Sep 17 00:00:00 2001 From: saurabh Date: Tue, 12 Oct 2021 15:53:49 +0530 Subject: [PATCH 5/8] Added enterprise testcasses for ios Signed-off-by: saurabh --- .../iOS/test_enterprise_ttls.py | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py index 65a6980ea..1678ea844 100644 --- a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py +++ b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py @@ -22,17 +22,17 @@ from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ForgetWifiConnecti verifyUploadDownloadSpeediOS, get_ip_address_eap_ios, wifi_connect_eap, wifi_disconnect_and_forget pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.client_connectivity - ,pytest.mark.interop_uc_sanity, pytest.mark.bridge, pytest.mark.enterprise] + ,pytest.mark.interop_uc_sanity, pytest.mark.vlan, pytest.mark.enterprise] setup_params_enterprise = { - "mode": "BRIDGE", + "mode": "VLAN", "ssid_modes": { "wpa2_enterprise": [ - {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"]}, - {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}], + {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"], "vlan": 100}, + {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"], "vlan": 100}], "wpa3_enterprise": [ - {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"]}, - {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}]}, + {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"], "vlan": 100}, + {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"], "vlan": 100}]}, "rf": {}, "radius": True @@ -40,7 +40,7 @@ setup_params_enterprise = { @allure.suite(suite_name="interop sanity") -@allure.sub_suite(sub_suite_name="Bridge Mode EAP Client Connectivity : Suite-A") +@allure.sub_suite(sub_suite_name="Vlan Mode EAP Client Connectivity : Suite-A") @pytest.mark.suiteA @pytest.mark.parametrize( 'setup_profiles', @@ -49,18 +49,18 @@ setup_params_enterprise = { scope="class" ) @pytest.mark.usefixtures("setup_profiles") -class TestBridgeModeEnterpriseTTLSSuiteA(object): +class TestVlanModeEnterpriseTTLSSuiteA(object): """ SuiteA Enterprise Test Cases - pytest -m "client_connect and bridge and enterprise and ttls and interop and suiteA" + pytest -m "client_connect and vlan and enterprise and ttls and interop and suiteA" """ - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4711", name="WIFI-4711") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4829", name="WIFI-4829") @pytest.mark.wpa2_enterprise @pytest.mark.fiveg - def test_ClientConnectivity_5g_WPA2_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnectivity_5g_WPA2_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data , setup_perfectoMobile_iOS, radius_info, get_ap_logs): """ wpa2 enterprise 5g - pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg" + pytest -m "client_connect and vlan and enterprise and ttls and wpa_enterprise and fiveg" """ profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1] ssidName = profile_data["ssid_name"] @@ -96,10 +96,10 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object): allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4710", name="WIFI-4710") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4828", name="WIFI-4828") @pytest.mark.twog @pytest.mark.wpa2_enterprise - def test_ClientConnectivity_2g_WPA2_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnectivity_2g_WPA2_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data , setup_perfectoMobile_iOS, radius_info, get_ap_logs): profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0] @@ -137,13 +137,14 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object): allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4715", name="WIFI-4715") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4833", name="WIFI-4833") + @pytest.mark.sg123 @pytest.mark.wpa3_enterprise @pytest.mark.fiveg - def test_ClientConnectivity_5g_WPA3_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnectivity_5g_WPA3_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data , setup_perfectoMobile_iOS, radius_info, get_ap_logs): """ wpa2 enterprise 5g - pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg" + pytest -m "client_connect and vlan and enterprise and ttls and wpa_enterprise and fiveg" """ profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1] ssidName = profile_data["ssid_name"] @@ -181,10 +182,11 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object): allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4714", name="WIFI-4714") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4832", name="WIFI-4832") + @pytest.mark.sg123 @pytest.mark.twog @pytest.mark.wpa3_enterprise - def test_ClientConnectivity_2g_WPA3_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnectivity_2g_WPA3_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data , setup_perfectoMobile_iOS, radius_info, get_ap_logs): profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0] From 1aefd0ef738d578aeb1439dd0c3c74b25b86f6b5 Mon Sep 17 00:00:00 2001 From: saurabh Date: Tue, 12 Oct 2021 15:55:16 +0530 Subject: [PATCH 6/8] Added general testcasses for vlan ios Signed-off-by: saurabh --- .../iOS/test_general_security_modes.py | 250 ++++++++++++++++++ 1 file changed, 250 insertions(+) diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_general_security_modes.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_general_security_modes.py index 11f43cb36..ee50b1790 100644 --- a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_general_security_modes.py +++ b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_general_security_modes.py @@ -271,3 +271,253 @@ class TestVlanModeConnectSuiteOneVlan(object): else: allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False + +setup_params_general_two = { + "mode": "VLAN", + "ssid_modes": { + "wpa3_personal": [ + {"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100}, + {"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["5G"], + "security_key": "something", "vlan": 100}], + "wpa3_personal_mixed": [ + {"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100}, + {"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["5G"], + "security_key": "something", "vlan": 100}], + "wpa_wpa2_personal_mixed": [ + {"ssid_name": "ssid_wpa_wpa2_p_m_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100}, + {"ssid_name": "ssid_wpa_wpa2_p_m_5g", "appliedRadios": ["5G"], + "security_key": "something", "vlan": 100}] + }, + "rf": {}, + "radius": False +} + + +@allure.suite(suite_name="interop sanity") +@allure.sub_suite(sub_suite_name="Vlan Mode Client Connectivity : Suite-B") +@pytest.mark.InteropsuiteB +@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 TestVlanModeConnectivitySuiteBridgeTwo(object): + """ Client Connectivity SuiteA + pytest -m "client_connectivity and vlan and InteropsuiteB" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4615", name="WIFI-4615") + @pytest.mark.fiveg + @pytest.mark.wpa3_personal + def test_ClientConnectivity_5g_wpa3_personal_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4614", name="WIFI-4614") + @pytest.mark.twog + @pytest.mark.wpa3_personal + def test_ClientConnectivity_2g_wpa3_personal_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4619", name="WIFI-4619") + @pytest.mark.fiveg + @pytest.mark.wpa3_personal_mixed + def test_ClientConnectivity_5g_wpa3_personal_mixed_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4618", name="WIFI-4618") + @pytest.mark.twog + @pytest.mark.wpa3_personal_mixed + def test_ClientConnectivity_2g_wpa3_personal_mixed_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4622", name="WIFI-4622") + @pytest.mark.fiveg + @pytest.mark.wpa_wpa2_personal_mixed + def test_ClientConnectivity_5g_wpa_wpa2_personal_mixed_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + #Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4620", name="WIFI-4620") + @pytest.mark.twog + @pytest.mark.wpa_wpa2_personal_mixed + def test_ClientConnectivity_2g_wpa_wpa2_personal_mixed_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + # ssidPassword = "[BLANK]" + print ("SSID_NAME: " + ssidName) + print ("SSID_PASS: " + ssidPassword) + get_vif_state.append(ssidName) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + if ip: + if is_internet: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") + else: + text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + print(text_body) + allure.attach(name="Connection Status: ", body=str(text_body)) + assert True + else: + allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + assert False + From dd48abe0f444865d25f71684258bb8859d5cb11d Mon Sep 17 00:00:00 2001 From: saurabh Date: Tue, 12 Oct 2021 15:57:10 +0530 Subject: [PATCH 7/8] Added general testcasses for vlan ios Signed-off-by: saurabh --- .../client_connectivity_test/iOS/test_general_security_modes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_general_security_modes.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_general_security_modes.py index ee50b1790..f62799172 100644 --- a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_general_security_modes.py +++ b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_general_security_modes.py @@ -304,7 +304,7 @@ setup_params_general_two = { scope="class" ) @pytest.mark.usefixtures("setup_profiles") -class TestVlanModeConnectivitySuiteBridgeTwo(object): +class TestVlanModeConnectivitySuiteTwo(object): """ Client Connectivity SuiteA pytest -m "client_connectivity and vlan and InteropsuiteB" """ From 8d7f0e2814dc04d97ede4c7398e9abec82578a5e Mon Sep 17 00:00:00 2001 From: saurabh Date: Tue, 12 Oct 2021 16:02:35 +0530 Subject: [PATCH 8/8] removed unused markers Signed-off-by: saurabh --- .../client_connectivity_test/iOS/test_enterprise_ttls.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py index 1678ea844..288f2d4b4 100644 --- a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py +++ b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/client_connectivity_test/iOS/test_enterprise_ttls.py @@ -138,7 +138,6 @@ class TestVlanModeEnterpriseTTLSSuiteA(object): assert False @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4833", name="WIFI-4833") - @pytest.mark.sg123 @pytest.mark.wpa3_enterprise @pytest.mark.fiveg def test_ClientConnectivity_5g_WPA3_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data @@ -183,7 +182,6 @@ class TestVlanModeEnterpriseTTLSSuiteA(object): assert False @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4832", name="WIFI-4832") - @pytest.mark.sg123 @pytest.mark.twog @pytest.mark.wpa3_enterprise def test_ClientConnectivity_2g_WPA3_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data