From 3a779404ad5d6dcfb6bdc75bb6da60979f8555eb Mon Sep 17 00:00:00 2001 From: saurabh Date: Fri, 8 Oct 2021 14:16:06 +0530 Subject: [PATCH] Added testcasses for Client Connectivity-ios Signed-off-by: saurabh --- .../iOS/test_enterprise_ttls.py | 70 +++++++++++-------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/client_connectivity_test/iOS/test_enterprise_ttls.py b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/client_connectivity_test/iOS/test_enterprise_ttls.py index 5772a7499..2c5534660 100644 --- a/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/client_connectivity_test/iOS/test_enterprise_ttls.py +++ b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/client_connectivity_test/iOS/test_enterprise_ttls.py @@ -19,7 +19,7 @@ if 'perfecto_libs' not in sys.path: 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 + 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_connect ,pytest.mark.interop_uc_sanity, pytest.mark.bridge, pytest.mark.enterprise] @@ -54,10 +54,10 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object): 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") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4711", name="WIFI-4711") @pytest.mark.wpa2_enterprise @pytest.mark.fiveg - def test_ClientConnect_5g_WPA2_Eap(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnectivity_5g_WPA2_Eap(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" @@ -82,22 +82,25 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object): ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData) - if ip: - if is_internet: + if is_internet: + if ip: text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") else: - text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address") print(text_body) allure.attach(name="Connection Status: ", body=str(text_body)) - assert True + + wifi_connect_eap(request, ssidName, ttls_passwd, setup_perfectoMobile_iOS, connData) + assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + wifi_disconnect_and_forget(request, ssidName, setup_perfectoMobile_iOS, connData) else: - allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4690", name="WIFI-4690") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4710", name="WIFI-4710") @pytest.mark.twog @pytest.mark.wpa2_enterprise - def test_ClientConnect_2g_WPA2_Eap(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnectivity_2g_WPA2_Eap(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] @@ -119,22 +122,25 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object): # 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: + if is_internet: + if ip: text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") else: - text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address") print(text_body) allure.attach(name="Connection Status: ", body=str(text_body)) - assert True + + wifi_connect_eap(request, ssidName, ttls_passwd, setup_perfectoMobile_iOS, connData) + assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + wifi_disconnect_and_forget(request, ssidName, setup_perfectoMobile_iOS, connData) else: - allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4695", name="WIFI-4695") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4715", name="WIFI-4715") @pytest.mark.wpa3_enterprise @pytest.mark.fiveg - def test_ClientConnect_5g_WPA3_Eap(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnectivity_5g_WPA3_Eap(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" @@ -159,22 +165,25 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object): ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData) - if ip: - if is_internet: + if is_internet: + if ip: text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") else: - text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address") print(text_body) allure.attach(name="Connection Status: ", body=str(text_body)) - assert True + + wifi_connect_eap(request, ssidName, ttls_passwd, setup_perfectoMobile_iOS, connData) + assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + wifi_disconnect_and_forget(request, ssidName, setup_perfectoMobile_iOS, connData) else: - allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4694", name="WIFI-4694") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4714", name="WIFI-4714") @pytest.mark.twog @pytest.mark.wpa3_enterprise - def test_ClientConnect_2g_WPA3_Eap(self, request, get_vif_state, get_ToggleAirplaneMode_data + def test_ClientConnectivity_2g_WPA3_Eap(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] @@ -196,14 +205,17 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object): # 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: + if is_internet: + if ip: text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet") else: - text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet") + text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address") print(text_body) allure.attach(name="Connection Status: ", body=str(text_body)) - assert True + + wifi_connect_eap(request, ssidName, ttls_passwd, setup_perfectoMobile_iOS, connData) + assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + wifi_disconnect_and_forget(request, ssidName, setup_perfectoMobile_iOS, connData) else: - allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) + allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False