From 80f7a834d88b530bb9026032322f998b099d24a9 Mon Sep 17 00:00:00 2001 From: Jyothsna-setti <100190428+Jyothsna-setti@users.noreply.github.com> Date: Wed, 27 Apr 2022 10:14:17 +0530 Subject: [PATCH] Wifi 7306 (#490) * fixed the channels Signed-off-by: Jyothsna-setti * channels fixed Signed-off-by: Jyothsna-setti * Removed unwanted code Signed-off-by: Jyothsna-setti * Removed unwanted markers and made some changes in country code SG(android) Signed-off-by: Jyothsna-setti * Removed unwanted files Signed-off-by: Jyothsna-setti * Removed unnecessary spaces in test_general_security_modes Signed-off-by: Jyothsna-setti * Added a new marker in country code JP(IOS) Signed-off-by: Jyothsna-setti * removed unnecessary files Signed-off-by: Jyothsna-setti * added a new marker in country US(IOS) Signed-off-by: Jyothsna-setti * Added new marker to country code IN(IOS) Signed-off-by: Jyothsna-setti * Added init.py file in country code IN(IOS) Signed-off-by: Jyothsna-setti --- .../iOS/test_general_security_modes.py | 2 +- .../country_code_IN/iOS/__init__.py | 0 .../country_code_IN/iOS/test_IN_20mhz.py | 1729 +++++++++++++++++ .../country_code_IN/iOS/test_IN_40mhz.py | 1166 +++++++++++ .../country_code_IN/iOS/test_IN_80mhz.py | 1028 ++++++++++ 5 files changed, 3924 insertions(+), 1 deletion(-) create mode 100644 tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/__init__.py create mode 100644 tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_20mhz.py create mode 100644 tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_40mhz.py create mode 100644 tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_80mhz.py diff --git a/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/client_connect_test/iOS/test_general_security_modes.py b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/client_connect_test/iOS/test_general_security_modes.py index 5af4d603a..479037832 100644 --- a/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/client_connect_test/iOS/test_general_security_modes.py +++ b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/client_connect_test/iOS/test_general_security_modes.py @@ -555,4 +555,4 @@ class TestBridgeModeConnectSuiteTwo(object): assert True else: allure.attach(name="Connection Status: ", body=str("Device is Unable to connect")) - assert False + assert False \ No newline at end of file diff --git a/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/__init__.py b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_20mhz.py b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_20mhz.py new file mode 100644 index 000000000..6e48a9f69 --- /dev/null +++ b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_20mhz.py @@ -0,0 +1,1729 @@ +from logging import exception +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 random +import string +import sys +import allure + +if 'perfecto_libs' not in sys.path: + sys.path.append(f'../libs/perfecto_libs') + +pytestmark = [pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.interop_country_code_IN, pytest.mark.interop_country_code, + pytest.mark.bridge] + + +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_ios + + +setup_params_general1 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 36}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 1} + }, + "radius": False +} + +for sec_modes in setup_params_general1['ssid_modes'].keys(): + for i in range(len(setup_params_general1['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general1['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general1['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general1], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteOne(object): + """ Client Connect SuiteOne + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn36_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general1["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7647", name="WIFI-7647") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn1_20Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general1["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general2 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 40}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 2} + }, + "radius": False +} + +for sec_modes in setup_params_general2['ssid_modes'].keys(): + for i in range(len(setup_params_general2['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general2['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general2['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general2], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteTwo(object): + """ Client Connect SuiteTwo + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn40_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general2["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7647", name="WIFI-7647") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn2_20Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general2["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general3 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 44}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 3} + }, + "radius": False +} + +for sec_modes in setup_params_general3['ssid_modes'].keys(): + for i in range(len(setup_params_general3['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general3['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general3['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general3], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteThree(object): + """ Client Connect SuiteThree """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn44_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general3["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7647", name="WIFI-7647") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn3_20Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general3["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general4 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 48}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 4} + }, + "radius": False +} + +for sec_modes in setup_params_general4['ssid_modes'].keys(): + for i in range(len(setup_params_general4['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general4['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general4['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general4], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteFour(object): + """ Client Connect SuiteFour """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn48_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general4["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7647", name="WIFI-7647") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn4_20Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general4["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general5 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 52}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 5} + }, + "radius": False +} + +for sec_modes in setup_params_general5['ssid_modes'].keys(): + for i in range(len(setup_params_general5['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general5['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general5['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general5], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteFive(object): + """ Client Connect SuiteFive """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn52_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general5["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7647", name="WIFI-7647") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn5_20Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general5["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general6 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 56}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 6} + }, + "radius": False +} + +for sec_modes in setup_params_general6['ssid_modes'].keys(): + for i in range(len(setup_params_general6['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general6['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general6['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general6], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteSix(object): + """ Client Connect SuiteSix """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn56_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general6["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7647", name="WIFI-7647") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn6_20Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general6["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general7 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 60}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 7} + }, + "radius": False +} + +for sec_modes in setup_params_general7['ssid_modes'].keys(): + for i in range(len(setup_params_general7['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general7['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general7['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general7], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteSeven(object): + """ Client Connect SuiteSeven """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn60_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general7["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7647", name="WIFI-7647") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn7_20Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general7["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general8 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 64}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 8} + }, + "radius": False +} + +for sec_modes in setup_params_general8['ssid_modes'].keys(): + for i in range(len(setup_params_general8['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general8['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general8['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general8], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteEight(object): + """ Client Connect SuiteEight """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn64_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general8["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7647", name="WIFI-7647") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn8_20Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general8["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general9 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 100}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 9} + }, + "radius": False +} + +for sec_modes in setup_params_general9['ssid_modes'].keys(): + for i in range(len(setup_params_general9['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general9['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general9['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general9], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteNine(object): + """ Client Connect SuiteNine """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn100_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general9["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7647", name="WIFI-7647") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn9_20Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general9["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general10 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 104}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 10} + }, + "radius": False +} + +for sec_modes in setup_params_general10['ssid_modes'].keys(): + for i in range(len(setup_params_general10['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general10['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general10['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general10], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteTen(object): + """ Client Connect SuiteTen """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn104_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general10["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7647", name="WIFI-7647") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn10_20Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general10["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general11 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 108}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 11} + }, + "radius": False +} + +for sec_modes in setup_params_general11['ssid_modes'].keys(): + for i in range(len(setup_params_general11['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general11['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general11['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general11], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteEleven(object): + """ Client Connect SuiteEleven """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn108_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general11["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7647", name="WIFI-7647") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn11_20Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general11["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general12 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 112}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 12} + }, + "radius": False +} + +for sec_modes in setup_params_general12['ssid_modes'].keys(): + for i in range(len(setup_params_general12['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general12['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general12['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general12], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteTwelve(object): + """ Client Connect SuiteTwelve """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn112_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general12["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general13 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 116}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 12} + }, + "radius": False +} + +for sec_modes in setup_params_general13['ssid_modes'].keys(): + for i in range(len(setup_params_general13['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general13['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general13['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general13], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteThirteen(object): + """ Client Connect SuiteThirteen """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn116_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general13["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general14 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 132}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 12} + }, + "radius": False +} + +for sec_modes in setup_params_general14['ssid_modes'].keys(): + for i in range(len(setup_params_general14['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general14['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general14['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general14], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteFourteen(object): + """ Client Connect SuiteFourteen """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn132_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general14["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general15 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 136}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 12} + }, + "radius": False +} + +for sec_modes in setup_params_general15['ssid_modes'].keys(): + for i in range(len(setup_params_general15['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general15['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general15['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general15], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteFifteen(object): + """ Client Connect SuiteFifteen """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn136_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general15["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general16 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 140}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 12} + }, + "radius": False +} + +for sec_modes in setup_params_general16['ssid_modes'].keys(): + for i in range(len(setup_params_general16['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general16['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general16['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general16], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteSixteen(object): + """ Client Connect SuiteSixteen """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn140_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general16["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general17 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 144}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 20, + "channel": 12} + }, + "radius": False +} + +for sec_modes in setup_params_general17['ssid_modes'].keys(): + for i in range(len(setup_params_general17['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general17['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general17['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general17], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteSeventeen(object): + """ Client Connect SuiteSeventeen """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7658", name="WIFI-7658") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.twentyMhz + def test_ClientConnect_bridge_wpa2_chn144_20Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general17["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 diff --git a/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_40mhz.py b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_40mhz.py new file mode 100644 index 000000000..e01b83b34 --- /dev/null +++ b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_40mhz.py @@ -0,0 +1,1166 @@ +from logging import exception +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 random +import string +import sys +import allure + +if 'perfecto_libs' not in sys.path: + sys.path.append(f'../libs/perfecto_libs') + +pytestmark = [pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.interop_country_code_IN, pytest.mark.interop_country_code, + pytest.mark.bridge] + + +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_ios + + +setup_params_general1 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 36}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 1} + }, + "radius": False +} + +for sec_modes in setup_params_general1['ssid_modes'].keys(): + for i in range(len(setup_params_general1['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general1['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general1['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general1], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteOne(object): + """ Client Connect SuiteOne """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI--7663", name="WIFI--7663") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn36_40Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general1["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7651", name="WIFI-7651") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn1_40Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general1["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general2 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 44}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 2} + }, + "radius": False +} + +for sec_modes in setup_params_general2['ssid_modes'].keys(): + for i in range(len(setup_params_general2['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general2['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general2['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general2], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteTwo(object): + """ Client Connect SuiteTwo """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI--7663", name="WIFI--7663") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn44_40Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general2["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7651", name="WIFI-7651") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn2_40Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general2["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general3 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 52}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 3} + }, + "radius": False +} + +for sec_modes in setup_params_general3['ssid_modes'].keys(): + for i in range(len(setup_params_general3['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general3['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general3['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general3], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteThree(object): + """ Client Connect SuiteThree """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI--7663", name="WIFI--7663") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn52_40Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general3["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7651", name="WIFI-7651") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn3_40Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general3["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general4 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 60}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 4} + }, + "radius": False +} + +for sec_modes in setup_params_general4['ssid_modes'].keys(): + for i in range(len(setup_params_general4['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general4['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general4['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general4], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteFour(object): + """ Client Connect SuiteFour """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI--7663", name="WIFI--7663") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn60_40Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general4["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7651", name="WIFI-7651") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn4_40Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general4["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general5 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 100}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 5} + }, + "radius": False +} + +for sec_modes in setup_params_general5['ssid_modes'].keys(): + for i in range(len(setup_params_general5['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general5['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general5['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general5], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteFive(object): + """ Client Connect SuiteFuve """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI--7663", name="WIFI--7663") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn100_40Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general5["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7651", name="WIFI-7651") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn5_40Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general5["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general6 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 108}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 6} + }, + "radius": False +} + +for sec_modes in setup_params_general6['ssid_modes'].keys(): + for i in range(len(setup_params_general6['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general6['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general6['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general6], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteSix(object): + """ Client Connect SuiteSix """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI--7663", name="WIFI--7663") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn108_40Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general6["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7651", name="WIFI-7651") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn6_40Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general6["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general7 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 132}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 7} + }, + "radius": False +} + +for sec_modes in setup_params_general7['ssid_modes'].keys(): + for i in range(len(setup_params_general7['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general7['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general7['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general7], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteSeven(object): + """ Client Connect SuiteSeven """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI--7663", name="WIFI--7663") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn132_40Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general7["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7651", name="WIFI-7651") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn7_40Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general7["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general8 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 140}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 8} + }, + "radius": False +} + +for sec_modes in setup_params_general8['ssid_modes'].keys(): + for i in range(len(setup_params_general8['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general8['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general8['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general8], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteEight(object): + """ Client Connect SuiteEight """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI--7663", name="WIFI--7663") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn140_40Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general8["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7651", name="WIFI-7651") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn8_40Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general8["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general9 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 100}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 9} + }, + "radius": False +} + +for sec_modes in setup_params_general9['ssid_modes'].keys(): + for i in range(len(setup_params_general9['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general9['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general9['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general9], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteNine(object): + """ Client Connect SuiteNine """ + + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7651", name="WIFI-7651") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn9_40Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general9["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general10 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 104}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 10} + }, + "radius": False +} + +for sec_modes in setup_params_general10['ssid_modes'].keys(): + for i in range(len(setup_params_general10['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general10['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general10['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general10], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteTen(object): + """ Client Connect SuiteTen """ + + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7651", name="WIFI-7651") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.fourtyMhz + def test_ClientConnect_bridge_wpa2_chn10_40Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general10["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general11 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 108}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 40, + "channel": 11} + }, + "radius": False +} + +for sec_modes in setup_params_general11['ssid_modes'].keys(): + for i in range(len(setup_params_general11['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general11['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general11['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general11], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteEleven(object): + """ Client Connect SuiteEleven """ + + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7651", name="WIFI-7651") + @pytest.mark.twog + @pytest.mark.wpa2_personal + def test_ClientConnect_bridge_wpa2_chn11_40Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general11["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + diff --git a/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_80mhz.py b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_80mhz.py new file mode 100644 index 000000000..9f56ccfda --- /dev/null +++ b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/country_code_channel_division/country_code_IN/iOS/test_IN_80mhz.py @@ -0,0 +1,1028 @@ +from logging import exception +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 random +import string +import sys +import allure + +if 'perfecto_libs' not in sys.path: + sys.path.append(f'../libs/perfecto_libs') + +pytestmark = [pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.interop_country_code_IN, pytest.mark.interop_country_code, + pytest.mark.bridge] + + +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_ios + + +setup_params_general1 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 36}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 1} + }, + "radius": False +} + +for sec_modes in setup_params_general1['ssid_modes'].keys(): + for i in range(len(setup_params_general1['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general1['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general1['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general1], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteOne(object): + """ Client Connect SuiteOne """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7669", name="WIFI-7669") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn36_80Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general1["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7652", name="WIFI-7652") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn1_80Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general1["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general2 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 52}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 2} + }, + "radius": False +} + +for sec_modes in setup_params_general2['ssid_modes'].keys(): + for i in range(len(setup_params_general2['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general2['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general2['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general2], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteTwo(object): + """ Client Connect SuiteTwo """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7669", name="WIFI-7669") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn52_80Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general2["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7652", name="WIFI-7652") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn2_80Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general2["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general3 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 100}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 3} + }, + "radius": False +} + +for sec_modes in setup_params_general3['ssid_modes'].keys(): + for i in range(len(setup_params_general3['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general3['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general3['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general3], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteThree(object): + """ Client Connect SuiteThree """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7669", name="WIFI-7669") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn100_80Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general3["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7652", name="WIFI-7652") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn3_80Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general3["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general4 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 132}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 4} + }, + "radius": False +} + +for sec_modes in setup_params_general4['ssid_modes'].keys(): + for i in range(len(setup_params_general4['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general4['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general4['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general4], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteFour(object): + """ Client Connect SuiteFour """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7669", name="WIFI-7669") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn132_80Mhz_IN_5g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general4["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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-7652", name="WIFI-7652") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn4_80Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general4["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general5 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 52}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 5} + }, + "radius": False +} + +for sec_modes in setup_params_general5['ssid_modes'].keys(): + for i in range(len(setup_params_general5['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general5['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general5['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general5], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteFive(object): + + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7652", name="WIFI-7652") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn5_80Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general5["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general6 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 56}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 6} + }, + "radius": False +} + +for sec_modes in setup_params_general6['ssid_modes'].keys(): + for i in range(len(setup_params_general6['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general6['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general6['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general6], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteSix(object): + + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7652", name="WIFI-7652") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn6_80Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general6["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general7 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 60}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 7} + }, + "radius": False +} + +for sec_modes in setup_params_general7['ssid_modes'].keys(): + for i in range(len(setup_params_general7['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general7['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general7['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general7], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteSeven(object): + + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7652", name="WIFI-7652") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn7_80Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general7["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general8 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 64}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 8} + }, + "radius": False +} + +for sec_modes in setup_params_general8['ssid_modes'].keys(): + for i in range(len(setup_params_general8['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general8['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general8['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general8], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteEight(object): + + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7652", name="WIFI-7652") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn8_80Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general8["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general9 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 100}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 9} + }, + "radius": False +} + +for sec_modes in setup_params_general9['ssid_modes'].keys(): + for i in range(len(setup_params_general9['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general9['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general9['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general9], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteNine(object): + + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7652", name="WIFI-7652") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn9_80Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general9["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + + +setup_params_general10 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 104}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 10} + }, + "radius": False +} + +for sec_modes in setup_params_general10['ssid_modes'].keys(): + for i in range(len(setup_params_general10['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general10['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general10['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general10], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteTen(object): + + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7652", name="WIFI-7652") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn10_80Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general10["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +setup_params_general11 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ]}, + "rf": {"5G": + {'band': '5G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 108}, + "2G": + {'band': '2G', + 'country': 'IN', + "channel-mode": "VHT", + 'channel-width': 80, + "channel": 11} + }, + "radius": False +} + +for sec_modes in setup_params_general11['ssid_modes'].keys(): + for i in range(len(setup_params_general11['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general11['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general11['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + + +@allure.suite(suite_name="interop country code") +@allure.sub_suite(sub_suite_name="Bridge Mode country code(IN)") +@allure.feature("BRIDGE MODE CLIENT CONNECT WITH COUNTRY CODE IN") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general11], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeModeConnectSuiteEleven(object): + + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7652", name="WIFI-7652") + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.eightyMhz + def test_ClientConnect_bridge_wpa2_chn11_80Mhz_IN_2g(self, request, get_vif_state, get_ap_logs, + get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS): + profile_data = setup_params_general11["ssid_modes"]["wpa2_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_ToggleAirplaneMode_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 + +