From a50f30bd2bb30ca200eae945101cf10c6a7a80ae Mon Sep 17 00:00:00 2001 From: saurabh Date: Tue, 12 Oct 2021 16:33:21 +0530 Subject: [PATCH] Added Wpa Enterprise mode in NAT ios Signed-off-by: saurabh --- .../iOS/test_enterprise_ttls.py | 82 ++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/tests/e2e/interOp/validation_of_operating_modes/nat_mode/client_connect_test/iOS/test_enterprise_ttls.py b/tests/e2e/interOp/validation_of_operating_modes/nat_mode/client_connect_test/iOS/test_enterprise_ttls.py index 1126f2b95..7a8c8c904 100644 --- a/tests/e2e/interOp/validation_of_operating_modes/nat_mode/client_connect_test/iOS/test_enterprise_ttls.py +++ b/tests/e2e/interOp/validation_of_operating_modes/nat_mode/client_connect_test/iOS/test_enterprise_ttls.py @@ -32,7 +32,10 @@ setup_params_enterprise = { {"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"]}]}, + {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}], + "wpa_enterprise": [ + {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]}, + {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"]}]}, "rf": {}, "radius": True @@ -207,3 +210,80 @@ class TestNatModeEnterpriseTTLSSuiteA(object): else: allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4699", name="WIFI-4699") + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_ClientConnect_5g_WPA_Eap_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + """ wpa enterprise 5g + pytest -m "client_connect and nat and enterprise and ttls and wpa_enterprise and fiveg" + """ + profile_data = setup_params_enterprise["ssid_modes"]["wpa_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-4698", name="WIFI-4698") + @pytest.mark.twog + @pytest.mark.wpa_enterprise + def test_ClientConnect_2g_WPA_Eap_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + + profile_data = setup_params_enterprise["ssid_modes"]["wpa_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