diff --git a/.github/workflows/cloud-controller-build.yaml b/.github/workflows/cloud-controller-build.yaml index 7990e4a5c..c1e21a699 100644 --- a/.github/workflows/cloud-controller-build.yaml +++ b/.github/workflows/cloud-controller-build.yaml @@ -19,11 +19,11 @@ env: testbeds: '[ { "number": "01", - "version": "1.2.0-rc2" + "version": "1.2.0" }, { "number": "02", - "version": "1.2.0-rc2" + "version": "1.2.0" } ]' diff --git a/config/ratelimit_2.4_noteffect_otherSSID.json b/config/ratelimit_2.4_noteffect_otherSSID.json new file mode 100644 index 000000000..b22f03737 --- /dev/null +++ b/config/ratelimit_2.4_noteffect_otherSSID.json @@ -0,0 +1,107 @@ +{ + "uuid": 2, + "radios": [ + + { + "band": "2G", + "channel": 6, + "channel-mode": "HE", + "channel-width": 20, + "country": "CA" + } + ], + + "interfaces": [ + { + "name": "WAN", + "role": "upstream", + "services": [ "lldp" ], + "ethernet": [ + { + "select-ports": [ + "WAN*" + ] + } + ], + "ipv4": { + "addressing": "dynamic" + }, + "ssids": [ + { + "name": "SSID1", + "wifi-bands": [ + "2G" + ], + "bss-mode": "ap", + "encryption": { + "proto": "psk2", + "key": "OpenWifi", + "ieee80211w": "optional" + }, + "rate-limit": { + "ingress-rate": 30, + "egress-rate": 30 + } + }, + { + "name": "SSID2", + "wifi-bands": [ + "2G" + ], + "bss-mode": "ap", + "encryption": { + "proto": "psk2", + "key": "OpenWifi", + "ieee80211w": "optional" + }, + "rate-limit": { + "ingress-rate": 0, + "egress-rate": 0 + } + } + ] + }, + { + "name": "LAN", + "role": "downstream", + "services": [ "ssh", "lldp" ], + "ethernet": [ + { + "select-ports": [ + "LAN*" + ] + } + ], + "ipv4": { + "addressing": "static", + "subnet": "192.168.1.1/24", + "dhcp": { + "lease-first": 10, + "lease-count": 100, + "lease-time": "6h" + } + } + } + ], + "metrics": { + "statistics": { + "interval": 120, + "types": [ "ssids", "lldp", "clients" ] + }, + "health": { + "interval": 120 + }, + "wifi-frames": { + "filters": [ "probe", "auth" ] + } + }, + "services": { + "lldp": { + "describe": "uCentral", + "location": "universe" + }, + "ssh": { + "port": 22 + } + } +} \ No newline at end of file diff --git a/config/ratelimit_2.4disabled_case.json b/config/ratelimit_2.4disabled_case.json new file mode 100644 index 000000000..fd28e0c49 --- /dev/null +++ b/config/ratelimit_2.4disabled_case.json @@ -0,0 +1,91 @@ +{ + "uuid": 2, + "radios": [ + + { + "band": "2G", + "channel": 11, + "channel-mode": "HE", + "channel-width": 20, + "country": "CA" + } + ], + + "interfaces": [ + { + "name": "WAN", + "role": "upstream", + "services": [ "lldp" ], + "ethernet": [ + { + "select-ports": [ + "WAN*" + ] + } + ], + "ipv4": { + "addressing": "dynamic" + }, + "ssids": [ + { + "name": "SSID1", + "wifi-bands": [ + "2G" + ], + "bss-mode": "ap", + "encryption": { + "proto": "psk2", + "key": "OpenWifi", + "ieee80211w": "optional" + }, + "rate-limit": { + "ingress-rate": 0, + "egress-rate": 0 + } + } + ] + }, + { + "name": "LAN", + "role": "downstream", + "services": [ "ssh", "lldp" ], + "ethernet": [ + { + "select-ports": [ + "LAN*" + ] + } + ], + "ipv4": { + "addressing": "static", + "subnet": "192.168.1.1/24", + "dhcp": { + "lease-first": 10, + "lease-count": 100, + "lease-time": "6h" + } + } + } + ], + "metrics": { + "statistics": { + "interval": 120, + "types": [ "ssids", "lldp", "clients" ] + }, + "health": { + "interval": 120 + }, + "wifi-frames": { + "filters": [ "probe", "auth" ] + } + }, + "services": { + "lldp": { + "describe": "uCentral", + "location": "universe" + }, + "ssh": { + "port": 22 + } + } +} \ No newline at end of file diff --git a/config/ratelimit_2.4enable_cases.json b/config/ratelimit_2.4enable_cases.json new file mode 100644 index 000000000..e231bc508 --- /dev/null +++ b/config/ratelimit_2.4enable_cases.json @@ -0,0 +1,91 @@ +{ + "uuid": 2, + "radios": [ + + { + "band": "2G", + "channel": 11, + "channel-mode": "HE", + "channel-width": 20, + "country": "CA" + } + ], + + "interfaces": [ + { + "name": "WAN", + "role": "upstream", + "services": [ "lldp" ], + "ethernet": [ + { + "select-ports": [ + "WAN*" + ] + } + ], + "ipv4": { + "addressing": "dynamic" + }, + "ssids": [ + { + "name": "SSID1", + "wifi-bands": [ + "2G" + ], + "bss-mode": "ap", + "encryption": { + "proto": "psk2", + "key": "OpenWifi", + "ieee80211w": "optional" + }, + "rate-limit": { + "ingress-rate": 50, + "egress-rate": 50 + } + } + ] + }, + { + "name": "LAN", + "role": "downstream", + "services": [ "ssh", "lldp" ], + "ethernet": [ + { + "select-ports": [ + "LAN*" + ] + } + ], + "ipv4": { + "addressing": "static", + "subnet": "192.168.1.1/24", + "dhcp": { + "lease-first": 10, + "lease-count": 100, + "lease-time": "6h" + } + } + } + ], + "metrics": { + "statistics": { + "interval": 120, + "types": [ "ssids", "lldp", "clients" ] + }, + "health": { + "interval": 120 + }, + "wifi-frames": { + "filters": [ "probe", "auth" ] + } + }, + "services": { + "lldp": { + "describe": "uCentral", + "location": "universe" + }, + "ssh": { + "port": 22 + } + } +} \ No newline at end of file diff --git a/config/ratelimit_5_noteffect_otherSSID.json b/config/ratelimit_5_noteffect_otherSSID.json new file mode 100644 index 000000000..95b08b864 --- /dev/null +++ b/config/ratelimit_5_noteffect_otherSSID.json @@ -0,0 +1,106 @@ +{ + "uuid": 2, + "radios": [ + { + "band": "5G", + "channel": 149, + "channel-mode": "HE", + "channel-width": 80, + "country": "CA" + } + ], + + "interfaces": [ + { + "name": "WAN", + "role": "upstream", + "services": [ "lldp" ], + "ethernet": [ + { + "select-ports": [ + "WAN*" + ] + } + ], + "ipv4": { + "addressing": "dynamic" + }, + "ssids": [ + { + "name": "SSID1", + "wifi-bands": [ + "5G" + ], + "bss-mode": "ap", + "encryption": { + "proto": "psk2", + "key": "OpenWifi", + "ieee80211w": "optional" + }, + "rate-limit": { + "ingress-rate": 20, + "egress-rate": 20 + } + }, + { + "name": "SSID2", + "wifi-bands": [ + "5G" + ], + "bss-mode": "ap", + "encryption": { + "proto": "psk2", + "key": "OpenWifi", + "ieee80211w": "optional" + }, + "rate-limit": { + "ingress-rate": 0, + "egress-rate": 0 + } + } + ] + }, + { + "name": "LAN", + "role": "downstream", + "services": [ "ssh", "lldp" ], + "ethernet": [ + { + "select-ports": [ + "LAN*" + ] + } + ], + "ipv4": { + "addressing": "static", + "subnet": "192.168.1.1/24", + "dhcp": { + "lease-first": 10, + "lease-count": 100, + "lease-time": "6h" + } + } + } + ], + "metrics": { + "statistics": { + "interval": 120, + "types": [ "ssids", "lldp", "clients" ] + }, + "health": { + "interval": 120 + }, + "wifi-frames": { + "filters": [ "probe", "auth" ] + } + }, + "services": { + "lldp": { + "describe": "uCentral", + "location": "universe" + }, + "ssh": { + "port": 22 + } + } +} \ No newline at end of file diff --git a/config/ratelimit_5disable_cases.json b/config/ratelimit_5disable_cases.json new file mode 100644 index 000000000..481d7c9a0 --- /dev/null +++ b/config/ratelimit_5disable_cases.json @@ -0,0 +1,91 @@ +{ + "uuid": 2, + "radios": [ + { + "band": "5G", + "channel": 149, + "channel-mode": "HE", + "channel-width": 80, + "country": "CA" + } + ], + + "interfaces": [ + { + "name": "WAN", + "role": "upstream", + "services": [ "lldp" ], + "ethernet": [ + { + "select-ports": [ + "WAN*" + ] + } + ], + "ipv4": { + "addressing": "dynamic" + }, + "ssids": [ + + { + "name": "SSID1", + "wifi-bands": [ + "5G" + ], + "bss-mode": "ap", + "encryption": { + "proto": "psk2", + "key": "OpenWifi", + "ieee80211w": "optional" + }, + "rate-limit": { + "ingress-rate": 0, + "egress-rate": 0 + } + } + ] + }, + { + "name": "LAN", + "role": "downstream", + "services": [ "ssh", "lldp" ], + "ethernet": [ + { + "select-ports": [ + "LAN*" + ] + } + ], + "ipv4": { + "addressing": "static", + "subnet": "192.168.1.1/24", + "dhcp": { + "lease-first": 10, + "lease-count": 100, + "lease-time": "6h" + } + } + } + ], + "metrics": { + "statistics": { + "interval": 120, + "types": [ "ssids", "lldp", "clients" ] + }, + "health": { + "interval": 120 + }, + "wifi-frames": { + "filters": [ "probe", "auth" ] + } + }, + "services": { + "lldp": { + "describe": "uCentral", + "location": "universe" + }, + "ssh": { + "port": 22 + } + } +} \ No newline at end of file diff --git a/config/ratelimit_5enable_cases.json b/config/ratelimit_5enable_cases.json new file mode 100644 index 000000000..4c9ef2444 --- /dev/null +++ b/config/ratelimit_5enable_cases.json @@ -0,0 +1,91 @@ +{ + "uuid": 2, + "radios": [ + { + "band": "5G", + "channel": 149, + "channel-mode": "HE", + "channel-width": 80, + "country": "CA" + } + ], + + "interfaces": [ + { + "name": "WAN", + "role": "upstream", + "services": [ "lldp" ], + "ethernet": [ + { + "select-ports": [ + "WAN*" + ] + } + ], + "ipv4": { + "addressing": "dynamic" + }, + "ssids": [ + + { + "name": "SSID1", + "wifi-bands": [ + "5G" + ], + "bss-mode": "ap", + "encryption": { + "proto": "psk2", + "key": "OpenWifi", + "ieee80211w": "optional" + }, + "rate-limit": { + "ingress-rate": 50, + "egress-rate": 50 + } + } + ] + }, + { + "name": "LAN", + "role": "downstream", + "services": [ "ssh", "lldp" ], + "ethernet": [ + { + "select-ports": [ + "LAN*" + ] + } + ], + "ipv4": { + "addressing": "static", + "subnet": "192.168.1.1/24", + "dhcp": { + "lease-first": 10, + "lease-count": 100, + "lease-time": "6h" + } + } + } + ], + "metrics": { + "statistics": { + "interval": 120, + "types": [ "ssids", "lldp", "clients" ] + }, + "health": { + "interval": 120 + }, + "wifi-frames": { + "filters": [ "probe", "auth" ] + } + }, + "services": { + "lldp": { + "describe": "uCentral", + "location": "universe" + }, + "ssh": { + "port": 22 + } + } +} \ No newline at end of file diff --git a/lanforge/lanforge-scripts b/lanforge/lanforge-scripts index 16276e080..82a756834 160000 --- a/lanforge/lanforge-scripts +++ b/lanforge/lanforge-scripts @@ -1 +1 @@ -Subproject commit 16276e080cce82cac7d6d27737893f872d4c7a96 +Subproject commit 82a756834b9108d81f10b8cdd3a4ce72741e9940 diff --git a/libs/controller/controller_2x/controller.py b/libs/controller/controller_2x/controller.py index fe912b089..9e50d719f 100644 --- a/libs/controller/controller_2x/controller.py +++ b/libs/controller/controller_2x/controller.py @@ -34,7 +34,7 @@ class ConfigureController: self.access_token = "" # self.session = requests.Session() self.login_resp = self.login() - self.gw_host = self.get_endpoint() + self.gw_host = self.get_gw_endpoint() def build_uri_sec(self, path): new_uri = 'https://%s:%d/api/v1/%s' % (self.host.hostname, self.host.port, path) @@ -47,6 +47,31 @@ class ConfigureController: print(new_uri) return new_uri + def request(self, service, command, method, params, payload): + if service == "sec": + uri = self.build_uri_sec(command) + elif service == "gw": + uri = self.build_uri(command) + elif service == "fms": + uri = self.build_url_fms(command) + else: + raise NameError("Invalid service code for request.") + + print(uri) + params = params + if method == "GET": + resp = requests.get(uri, headers=self.make_headers(), params=params, verify=False, timeout=100) + elif method == "POST": + resp = requests.post(uri, data=payload, verify=False, timeout=100) + elif method == "PUT": + resp = requests.put(uri, data=payload, verify=False, timeout=100) + elif method == "DELETE": + resp = requests.delete(uri, headers=self.make_headers(), params=params, verify=False, timeout=100) + + self.check_response(method, resp, self.make_headers(), payload, uri) + print (resp) + return resp + def login(self): uri = self.build_uri_sec("oauth2") # self.session.mount(uri, HTTPAdapter(max_retries=15)) @@ -60,17 +85,18 @@ class ConfigureController: # self.session.headers.update({'Authorization': self.access_token}) return resp - def get_endpoint(self): + def get_gw_endpoint(self): uri = self.build_uri_sec("systemEndpoints") print(uri) resp = requests.get(uri, headers=self.make_headers(), verify=False, timeout=100) print(resp) self.check_response("GET", resp, self.make_headers(), "", uri) - devices = resp.json() - print(devices["endpoints"][0]["uri"]) - gw_host = urlparse(devices["endpoints"][0]["uri"]) + services = resp.json() + print(services["endpoints"][0]["uri"]) + gw_host = urlparse(services["endpoints"][0]["uri"]) return gw_host + def logout(self): uri = self.build_uri_sec('oauth2/%s' % self.access_token) resp = requests.delete(uri, headers=self.make_headers(), verify=False, timeout=100) diff --git a/tests/configuration.py b/tests/configuration.py index 9e6abe815..4c538b050 100644 --- a/tests/configuration.py +++ b/tests/configuration.py @@ -126,10 +126,10 @@ CONFIGURATION = { 'mode': 'wifi5', 'serial': '001122090801', 'jumphost': True, - 'ip': "10.28.3.100", + 'ip': "127.0.0.1", 'username': "lanforge", 'password': "pumpkin77", - 'port': 22, + 'port': 8833, 'jumphost_tty': '/dev/ttyAP3', 'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/tplink_ec420/20210728-tplink_ec420-uCentral-trunk-12ad0d5-upgrade.bin" } diff --git a/tests/controller_tests/ucentral_gateway/test_authentication.py b/tests/controller_tests/ucentral_gateway/test_authentication.py deleted file mode 100644 index f13427c54..000000000 --- a/tests/controller_tests/ucentral_gateway/test_authentication.py +++ /dev/null @@ -1,29 +0,0 @@ -""" - - UCI Rest API Tests: Test Login, Logout API's - -""" -import pytest - - -class TestUCIAUTHDEAUTH(object): - """ - pytest -m "uci_login or uci_logout" --ucentral - """ - - @pytest.mark.uci_login - def test_uci_auth(self, setup_controller): - """ - pytest -m "uci_login" --ucentral - """ - print(setup_controller.login_resp) - assert setup_controller.login_resp.status_code == 200 - - @pytest.mark.uci_logout - def test_uci_deauth(self, setup_controller): - """ - pytest -m "uci_logout" --ucentral - """ - resp = setup_controller.logout() - print(resp) - assert resp.status_code == 200 diff --git a/tests/controller_tests/ucentral_gateway/test_gatewayservice.py b/tests/controller_tests/ucentral_gateway/test_gatewayservice.py new file mode 100644 index 000000000..b54c4bf96 --- /dev/null +++ b/tests/controller_tests/ucentral_gateway/test_gatewayservice.py @@ -0,0 +1,141 @@ +""" + + UCentral Gateway Services Rest API Tests + +""" +import pytest +import json +import allure + +@allure.feature("SDK REST API") + +class TestUcentralGatewayService(object): + """ + """ + @pytest.mark.sdk_restapi + def test_gwservice_listdevices(self, setup_controller): + """ + Test the list devices endpoint + WIFI-3452 + """ + resp = setup_controller.request("gw", "devices", "GET", None, None) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="gw list devices", body=body) + if resp.status_code != 200: + assert False + devices = json.loads(resp.text) + print (devices) + + @pytest.mark.sdk_restapi + def test_gwservice_createdevice(self, setup_controller): + """ + Test the create device endpoint + WIFI-3453 + """ + configuration = {'uuid': '1'} + payload = {'serialNumber': 'DEADBEEF0011', + 'UUID': '123456', + 'configuration': configuration, + 'deviceType': 'AP', + 'location': '', + 'macAddress': 'DE:AD:BE:EF:00:11', + 'manufacturer': 'Testing', + 'owner': ''} + print(json.dumps(payload)) + resp = setup_controller.request("gw", "device/DEADBEEF0011", "POST", None, json.dumps(payload)) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="gw create devices", body=body) + if resp.status_code != 200: + assert False + devices = json.loads(resp.text) + print (devices) + + resp = setup_controller.request("gw", "device/DEADBEEF0011", "GET", None, None) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="gw create device verify", body=body) + if resp.status_code != 200: + assert False + + resp = setup_controller.request("gw", "device/DEADBEEF0011", "DELETE", None, None) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="gw create device delete", body=body) + if resp.status_code != 200: + assert False + + @pytest.mark.sdk_restapi + def test_gwservice_updatedevice(self, setup_controller): + """ + Test the update device endpoint + WIFI-3454 + """ + configuration = {'uuid': '1'} + payload = {'serialNumber': 'DEADBEEF0011', + 'UUID': '123456', + 'configuration': configuration, + 'deviceType': 'AP', + 'location': '', + 'macAddress': 'DE:AD:BE:EF:00:11', + 'manufacturer': 'Testing', + 'owner': ''} + resp = setup_controller.request("gw", "device/DEADBEEF0011", "POST", None, json.dumps(payload)) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="gw create devices", body=body) + if resp.status_code != 200: + assert False + devices = json.loads(resp.text) + print (devices) + + payload = {'serialNumber': 'DEADBEEF0011', + 'owner': 'pytest'} + resp = setup_controller.request("gw", "device/DEADBEEF0011", "PUT", None, json.dumps(payload)) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="gw get device", body=body) + if resp.status_code != 200: + assert False + + resp = setup_controller.request("gw", "device/DEADBEEF0011", "GET", None, None) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="gw create device verify", body=body) + if resp.status_code != 200: + assert False + + device = json.loads(resp.text) + print (device) + + + resp = setup_controller.request("gw", "device/DEADBEEF0011", "DELETE", None, None) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="gw get device", body=body) + if resp.status_code != 200: + assert False + + @pytest.mark.sdk_restapi + def test_gwservice_deletedevice(self, setup_controller): + """ + Test the delete device endpoint + WIFI-3455 + """ + configuration = {'uuid': '1'} + payload = {'serialNumber': 'DEADBEEF0011', + 'UUID': '123456', + 'configuration': configuration, + 'deviceType': 'AP', + 'location': '', + 'macAddress': 'DE:AD:BE:EF:00:11', + 'manufacturer': 'Testing', + 'owner': ''} + resp = setup_controller.request("gw", "device/DEADBEEF0011", "POST", None, json.dumps(payload)) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="gw create devices", body=body) + if resp.status_code != 200: + assert False + devices = json.loads(resp.text) + print (devices) + + + resp = setup_controller.request("gw", "device/DEADBEEF0011", "DELETE", None, None) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="gw get device", body=body) + if resp.status_code != 200: + assert False + diff --git a/tests/controller_tests/ucentral_gateway/test_securityservice.py b/tests/controller_tests/ucentral_gateway/test_securityservice.py new file mode 100644 index 000000000..ce9a3500f --- /dev/null +++ b/tests/controller_tests/ucentral_gateway/test_securityservice.py @@ -0,0 +1,129 @@ +""" + + UCentral Security Services Rest API Tests: Test Login, Logout API's + +""" +import pytest +import json +import allure + +@allure.feature("SDK REST API") + +class TestUcentralSecService(object): + """ + Test the oauth endpoint + WIFI-3447 + """ + @pytest.mark.sdk_restapi + def test_secservice_oauth(self, setup_controller): + """ + pytest -m "uci_login" + """ + resp = setup_controller.login_resp + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="login", body=body) + assert setup_controller.login_resp.status_code == 200 + + @pytest.mark.sdk_restapi + def test_secservice_oauth_revoke(self, setup_controller): + """ + Test the oauth revoke endpoint + WIFI-3448 + """ + resp = setup_controller.logout() + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="oauth revoke", body=body) + assert resp.status_code == 204 + setup_controller.login() + + @pytest.mark.sdk_restapi + def test_secservice_system_endpoints(self, setup_controller): + """ + Test the system endpoints to verify list of services present + WIFI-3449 + """ + resp = setup_controller.request("sec", "systemEndpoints", "GET", None, None) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="security systemEndpoints", body=body) + + if resp.status_code != 200: + assert False + services = json.loads(resp.text) + print (services) + + if 'endpoints' not in services: + assert False + + num_services = 0 + uri_present = 0 + authtype_present = 0 + for item in services['endpoints']: + if item['type'] == 'ucentralgw': + num_services += 1 + if item['uri'] is not None: + uri_present += 1 + if item['authenticationType'] is not None: + authtype_present += 1 + elif item['type'] == 'ucentralfms': + num_services += 1 + if item['uri'] is not None: + uri_present += 1 + if item['authenticationType'] is not None: + authtype_present += 1 + + assert (num_services == 2) and (uri_present == 2) and (authtype_present == 2) + + @pytest.mark.sdk_restapi + def test_secservice_get_version(self, setup_controller): + """ + Test the system endpoint to verify the version of the service + WIFI-3450 + """ + + params = {'command': 'version'} + resp = setup_controller.request("sec", "system", "GET", params, None) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="security get version result", body=body) + + if resp.status_code != 200: + assert False + system = json.loads(resp.text) + print (system) + if 'tag' not in system: + assert False + if system['tag'] != 'version': + assert False + if not system['value']: + assert False + + @pytest.mark.sdk_restapi + def test_secservice_get_uptime(self, setup_controller): + """ + Test the system endpoint to verify the uptime of the service + WIFI-3451 + """ + + params = {'command': 'times'} + resp = setup_controller.request("sec", "system", "GET", params, None) + body = resp.url + "," + str(resp.status_code) + ',' + resp.text + allure.attach(name="security get uptime", body=body) + if resp.status_code != 200: + assert False + system = json.loads(resp.text) + print (system) + if 'times' not in system: + assert False + + valid_entities = 0 + for item in system['times']: + if item['tag'] == 'uptime': + valid_entities += 1 + if item['tag'] == 'start': + valid_entities += 1 + if item['value'] is not None: + valid_entities += 1 + + assert (valid_entities == 4) + + + diff --git a/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting/test_rate_limiting.py b/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting/test_rate_limiting.py index b6e2d313d..17d7100b8 100644 --- a/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting/test_rate_limiting.py +++ b/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting/test_rate_limiting.py @@ -45,10 +45,13 @@ class TestRateLimitingBridge(object): @pytest.mark.wpa2_personal @pytest.mark.twog + @pytest.mark.up + @pytest.mark.batch_size_125 @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') - def test_wpa2_personal_ssid_2g(self, lf_test, get_vif_state, lf_tools): + def test_wpa2_personal_ssid_up_batch_size_125_2g(self, lf_test, get_vif_state, lf_tools): """ Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and twog and up and batch_size_125" """ # run wifi capacity test here profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] @@ -63,11 +66,363 @@ class TestRateLimitingBridge(object): lf_tools.add_stations(band="2G", num_stations=5, dut=lf_tools.dut_name, ssid_name=ssid_name) lf_tools.Chamber_View() wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, - download_rate="1Gbps", batch_size="1,5", - upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000") + download_rate="0Gbps", batch_size="1,2,5", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] lf_tools.attach_report_graphs(report_name=report_name) print("Test Completed... Cleaning up Stations") - assert True \ No newline at end of file + assert True + + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.dw + @pytest.mark.batch_size_125 + @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') + def test_wpa2_personal_ssid_dw_batch_size_125_2g(self, lf_test, get_vif_state, lf_tools): + """ + Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and twog and dw and batch_size_125" + """ + # run wifi capacity test here + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) + get_vif_state.append(ssid_name) + if ssid_name 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") + lf_tools.add_stations(band="2G", num_stations=5, dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", batch_size="1,2,5", + upload_rate="0Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True + + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.up_dw + @pytest.mark.batch_size_125 + @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') + def test_wpa2_personal_ssid_up_dw_batch_size_125_2g(self, lf_test, get_vif_state, lf_tools): + """ + Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and twog and up_dw and batch_size_125" + """ + # run wifi capacity test here + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) + get_vif_state.append(ssid_name) + if ssid_name 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") + lf_tools.add_stations(band="2G", num_stations=5, dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", batch_size="1,2,5", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.up + @pytest.mark.batch_size_125 + @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') + def test_wpa2_personal_ssid_up_batch_size_125_5g(self, lf_test, get_vif_state, lf_tools): + """ + Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and fiveg and up and batch_size_125" + """ + # run wifi capacity test here + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) + get_vif_state.append(ssid_name) + if ssid_name 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") + lf_tools.add_stations(band="5G", num_stations=5, dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="0Gbps", batch_size="1,2,5", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dw + @pytest.mark.batch_size_125 + @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') + def test_wpa2_personal_ssid_dw_batch_size_125_5g(self, lf_test, get_vif_state, lf_tools): + """ + Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and fiveg and dw and batch_size_125" + """ + # run wifi capacity test here + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) + get_vif_state.append(ssid_name) + if ssid_name 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") + lf_tools.add_stations(band="5G", num_stations=5, dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", batch_size="1,2,5", + upload_rate="0Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.up_dw + @pytest.mark.batch_size_125 + @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') + def test_wpa2_personal_ssid_up_dw_batch_size_125_5g(self, lf_test, get_vif_state, lf_tools): + """ + Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and fiveg and up_dw and batch_size_125" + """ + # run wifi capacity test here + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) + get_vif_state.append(ssid_name) + if ssid_name 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") + lf_tools.add_stations(band="5G", num_stations=5, dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", batch_size="1,2,5", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True + + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.up + @pytest.mark.batch_size_1 + @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') + def test_wpa2_personal_ssid_up_batch_size_1_2g(self, lf_test, get_vif_state, lf_tools): + """ + Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and twog and up and batch_size_1" + """ + # run wifi capacity test here + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) + get_vif_state.append(ssid_name) + if ssid_name 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") + lf_tools.add_stations(band="2G", num_stations=1, dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="0Gbps", batch_size="1", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True + + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.dw + @pytest.mark.batch_size_1 + @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') + def test_wpa2_personal_ssid_dw_batch_size_1_2g(self, lf_test, get_vif_state, lf_tools): + """ + Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and twog and dw and batch_size_1" + """ + # run wifi capacity test here + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) + get_vif_state.append(ssid_name) + if ssid_name 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") + lf_tools.add_stations(band="2G", num_stations=1, dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", batch_size="1", + upload_rate="0Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True + + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.up_dw + @pytest.mark.batch_size_1 + @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') + def test_wpa2_personal_ssid_up_dw_batch_size_1_2g(self, lf_test, get_vif_state, lf_tools): + """ + Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and twog and up_dw and batch_size_1" + """ + # run wifi capacity test here + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) + get_vif_state.append(ssid_name) + if ssid_name 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") + lf_tools.add_stations(band="2G", num_stations=1, dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", batch_size="1", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.up + @pytest.mark.batch_size_1 + @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') + def test_wpa2_personal_ssid_up_batch_size_1_5g(self, lf_test, get_vif_state, lf_tools): + """ + Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and fiveg and up and batch_size_1" + """ + # run wifi capacity test here + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) + get_vif_state.append(ssid_name) + if ssid_name 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") + lf_tools.add_stations(band="5G", num_stations=1, dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="0Gbps", batch_size="1", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dw + @pytest.mark.batch_size_1 + @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') + def test_wpa2_personal_ssid_dw_batch_size_1_5g(self, lf_test, get_vif_state, lf_tools): + """ + Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and fiveg and dw and batch_size_1" + """ + # run wifi capacity test here + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) + get_vif_state.append(ssid_name) + if ssid_name 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") + lf_tools.add_stations(band="5G", num_stations=1, dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", batch_size="1", + upload_rate="0Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.up_dw + @pytest.mark.batch_size_1 + @allure.story('Rate Limiting Open SSID 2.4 GHZ Band') + def test_wpa2_personal_ssid_up_dw_batch_size_1_5g(self, lf_test, get_vif_state, lf_tools): + """ + Test Rate Limiting Scenario + pytest -m "rate_limiting and bridge and wpa2_personal and fiveg and up_dw and batch_size_1" + """ + # run wifi capacity test here + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) + get_vif_state.append(ssid_name) + if ssid_name 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") + lf_tools.add_stations(band="5G", num_stations=1, dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", batch_size="1", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True diff --git a/tests/e2e/interOp/android/AccessPointConnection/test_AccessPointConnection_BridgeMode.py b/tests/e2e/interOp/android/AccessPointConnection/test_AccessPointConnection_BridgeMode.py new file mode 100644 index 000000000..e3c348ec1 --- /dev/null +++ b/tests/e2e/interOp/android/AccessPointConnection/test_AccessPointConnection_BridgeMode.py @@ -0,0 +1,221 @@ +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 sys +import allure + +pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_and, pytest.mark.android, pytest.mark.AccessPointConnection] + +if 'perfecto_libs' not in sys.path: + sys.path.append(f'../libs/perfecto_libs') + +from android_lib import closeApp, verifyUploadDownloadSpeed_android, set_APconnMobileDevice_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp + +setup_params_general = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}], + "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]}, + {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}], + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}]}, + "rf": {}, + "radius": False +} + +@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) + +@pytest.mark.usefixtures("setup_profiles") +class TestAcessPointConnectionBridge(object): + + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + def test_AccessPointConnection_5g_WPA2_Personal_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + #print ("SSID_PASS: " + ssidPassword) + + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_APToMobileDevice_data + + #Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + #Toggle AirplaneMode + assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData) + + #Verify Upload download Speed from device Selection + assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData) + + #ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.wpa2_personal + def test_AccessPointConnection_2g_WPA2_Personal_Bridge(self,request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + #print ("SSID_PASS: " + ssidPassword) + + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_ToggleAirplaneMode_data + + #Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + #Toggle AirplaneMode + assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData) + + #Verify Upload download Speed from device Selection + assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData) + + #ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + + @pytest.mark.fiveg + @pytest.mark.wpa + def test_AccessPointConnection_5g_WPA_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android): + profile_data = setup_params_general["ssid_modes"]["wpa"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + #print ("SSID_PASS: " + ssidPassword) + + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_ToggleAirplaneMode_data + + #Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + #Toggle AirplaneMode + assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData) + + #Verify Upload download Speed from device Selection + assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData) + + #ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.wpa + def test_AccessPointConnection_2g_WPA_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android): + profile_data = setup_params_general["ssid_modes"]["wpa"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print ("SSID_NAME: " + ssidName) + #print ("SSID_PASS: " + ssidPassword) + + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_ToggleAirplaneMode_data + + #Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + #Toggle AirplaneMode + assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData) + + #Verify Upload download Speed from device Selection + assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData) + + #ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.open + def test_AccessPointConnection_2g_OPEN_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android): + + profile_data = setup_params_general["ssid_modes"]["open"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = "[BLANK]" + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + # Toggle AirplaneMode + assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData) + + # Verify Upload download Speed from device Selection + assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + + @pytest.mark.fiveg + @pytest.mark.open + def test_AccessPointConnection_5g_OPEN_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android): + + profile_data = setup_params_general["ssid_modes"]["open"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = "[BLANK]" + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + # Toggle AirplaneMode + assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData) + + # Verify Upload download Speed from device Selection + assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) diff --git a/tests/e2e/interOp/android/client_connectivity/test_BridgeMode.py b/tests/e2e/interOp/android/client_connectivity/test_BridgeMode.py new file mode 100644 index 000000000..c8ce6b6fb --- /dev/null +++ b/tests/e2e/interOp/android/client_connectivity/test_BridgeMode.py @@ -0,0 +1,214 @@ +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 sys +import allure + +if 'perfecto_libs' not in sys.path: + sys.path.append(f'../libs/perfecto_libs') + +pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, + pytest.mark.ClientConnectivity] + +from android_lib import closeApp, set_APconnMobileDevice_android, verifyUploadDownloadSpeed_android, \ + Toggle_AirplaneMode_android, ForgetWifiConnection, openApp + +setup_params_general = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]}, + {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}], + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}]}, + "rf": {}, + "radius": False +} + + +@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeMode(object): + + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + def test_ClientConnectivity_5g_WPA2_Personal_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_android): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + # Verify Upload download Speed from device Selection + assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.wpa2_personal + def test_ClientConnectivity_2g_WPA2_Personal_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_android): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + # Toggle AirplaneMode + assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.wpa + def test_ClientConnectivity_2g_WPA_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_android): + profile_data = setup_params_general["ssid_modes"]["wpa"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + # Toggle AirplaneMode + assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + + @pytest.mark.fiveg + @pytest.mark.wpa + def test_ClientConnectivity_5g_WPA_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_android): + profile_data = setup_params_general["ssid_modes"]["wpa"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + # Toggle AirplaneMode + assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.open + def test_ClientConnectivity_2g_OPEN_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_android): + + profile_data = setup_params_general["ssid_modes"]["open"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = "[BLANK]" + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + # Toggle AirplaneMode + assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + + @pytest.mark.fiveg + @pytest.mark.open + def test_ClientConnectivity_5g_OPEN_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_android): + + profile_data = setup_params_general["ssid_modes"]["open"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = "[BLANK]" + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + + 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_android[1] + driver = setup_perfectoMobile_android[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + + # Toggle AirplaneMode + assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + diff --git a/tests/e2e/interOp/iOS/AccessPointConnection/test_AccessPointConnection.py b/tests/e2e/interOp/iOS/AccessPointConnection/test_AccessPointConnection.py index 2db65a185..52da14e1b 100644 --- a/tests/e2e/interOp/iOS/AccessPointConnection/test_AccessPointConnection.py +++ b/tests/e2e/interOp/iOS/AccessPointConnection/test_AccessPointConnection.py @@ -26,6 +26,8 @@ setup_params_general = { "ssid_modes": { "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}], + "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]}, + {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}], "wpa2_personal": [ {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}]}, @@ -106,7 +108,6 @@ class TestAccessPointConnectivety(object): #ForgetWifi ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) - @pytest.mark.fiveg @pytest.mark.wpa def test_AccessPointConnection_5g_WPA(self, request, get_vif_state, get_AccessPointConn_data, setup_perfectoMobile_iOS): @@ -168,4 +169,69 @@ class TestAccessPointConnectivety(object): ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip) #ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.fiveg + @pytest.mark.open + def test_AccessPointConnection_5g_OPEN(self, request, get_vif_state, get_AccessPointConn_data, + setup_perfectoMobile_iOS): + + profile_data = setup_params_general["ssid_modes"]["open"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = "[BLANK]" + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + + 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_AccessPointConn_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Need An ip To ping + wifi_ip = get_WifiIPAddress_iOS(request, setup_perfectoMobile_iOS, connData, ssidName) + + # Open Ping Application + openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS) + + ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.open + def test_AccessPointConnection_2g_OPEN(self, request, get_vif_state, get_AccessPointConn_data, + setup_perfectoMobile_iOS): + profile_data = setup_params_general["ssid_modes"]["open"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = "[BLANK]" + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + + 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_AccessPointConn_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Need An ip To ping + wifi_ip = get_WifiIPAddress_iOS(request, setup_perfectoMobile_iOS, connData, ssidName) + + # Open Ping Application + openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS) + + ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip) + + # ForgetWifi ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) \ No newline at end of file diff --git a/tests/e2e/interOp/iOS/AccessPointConnection/test_AccessPointConnection_BridgeMode.py b/tests/e2e/interOp/iOS/AccessPointConnection/test_AccessPointConnection_BridgeMode.py new file mode 100644 index 000000000..dd97ef960 --- /dev/null +++ b/tests/e2e/interOp/iOS/AccessPointConnection/test_AccessPointConnection_BridgeMode.py @@ -0,0 +1,245 @@ +from logging import exception +import io +import unittest +import warnings +from perfecto.test import TestResultFactory +import pytest +import sys +import time +from selenium.common.exceptions import NoSuchElementException +from selenium.webdriver.common.by import By +from appium import webdriver +from selenium.common.exceptions import NoSuchElementException + +import sys +import allure + +if 'perfecto_libs' not in sys.path: + sys.path.append(f'../libs/perfecto_libs') + +from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ForgetWifiConnection, ping_deftapps_iOS, \ + Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown + +pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, + pytest.mark.AccessPointConnection] + +setup_params_general = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]}, + {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}], + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}]}, + "rf": {}, + "radius": False +} + + +@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestAccessPointConnectivetyBridge(object): + + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + def test_AccessPointConnection_5g_WPA2_Personal_Bridge(self, request, get_vif_state, get_AccessPointConn_data, + setup_perfectoMobile_iOS): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + + 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_AccessPointConn_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Need An ip To ping + wifi_ip = get_WifiIPAddress_iOS(request, setup_perfectoMobile_iOS, connData, ssidName) + + # Open Ping Application + openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS) + + ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.wpa2_personal + def test_AccessPointConnection_2g_WPA2_Personal_Bridge(self, request, get_vif_state, get_AccessPointConn_data, + setup_perfectoMobile_iOS): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + + 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_AccessPointConn_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Need An ip To ping + wifi_ip = get_WifiIPAddress_iOS(request, setup_perfectoMobile_iOS, connData, ssidName) + + # Open Ping Application + openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS) + + ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.fiveg + @pytest.mark.wpa + def test_AccessPointConnection_5g_WPA_Bridge(self, request, get_vif_state, get_AccessPointConn_data, + setup_perfectoMobile_iOS): + + profile_data = setup_params_general["ssid_modes"]["wpa"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + + 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_AccessPointConn_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Need An ip To ping + wifi_ip = get_WifiIPAddress_iOS(request, setup_perfectoMobile_iOS, connData, ssidName) + + # Open Ping Application + openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS) + + ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.wpa + def test_AccessPointConnection_2g_WPA_Bridge(self, request, get_vif_state, get_AccessPointConn_data, + setup_perfectoMobile_iOS): + profile_data = setup_params_general["ssid_modes"]["wpa"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + + 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_AccessPointConn_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Need An ip To ping + wifi_ip = get_WifiIPAddress_iOS(request, setup_perfectoMobile_iOS, connData, ssidName) + + # Open Ping Application + openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS) + + ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.fiveg + @pytest.mark.open + def test_AccessPointConnection_5g_OPEN_Bridge(self, request, get_vif_state, get_AccessPointConn_data, + setup_perfectoMobile_iOS): + + profile_data = setup_params_general["ssid_modes"]["open"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = "[BLANK]" + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + + 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_AccessPointConn_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Need An ip To ping + wifi_ip = get_WifiIPAddress_iOS(request, setup_perfectoMobile_iOS, connData, ssidName) + + # Open Ping Application + openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS) + + ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.open + def test_AccessPointConnection_2g_OPEN_Bridge(self, request, get_vif_state, get_AccessPointConn_data, + setup_perfectoMobile_iOS): + profile_data = setup_params_general["ssid_modes"]["open"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = "[BLANK]" + print("SSID_NAME: " + ssidName) + # print ("SSID_PASS: " + ssidPassword) + + 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_AccessPointConn_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Need An ip To ping + wifi_ip = get_WifiIPAddress_iOS(request, setup_perfectoMobile_iOS, connData, ssidName) + + # Open Ping Application + openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS) + + ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) \ No newline at end of file diff --git a/tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py b/tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py new file mode 100644 index 000000000..6fe5e3925 --- /dev/null +++ b/tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py @@ -0,0 +1,212 @@ +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 sys +import allure + +if 'perfecto_libs' not in sys.path: + sys.path.append(f'../libs/perfecto_libs') + +pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ClientConnectivity] + +from iOS_lib import closeApp, openApp, verifyUploadDownloadSpeediOS, ForgetWifiConnection, Toggle_AirplaneMode_iOS, \ + set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown + +setup_params_general = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}], + "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]}, + {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}], + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}]}, + "rf": {}, + "radius": False +} + + +@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestBridgeMode(object): + + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + def test_ClientConnectivity_5g_WPA2_Personal_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_iOS): + + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Verify Upload download Speed from device Selection + verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.wpa2_personal + def test_ClientConnectivity_2g_WPA2_Personal_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_iOS): + + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Verify Upload download Speed from device Selection + verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.wpa + def test_ClientConnectivity_2g_WPA_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_iOS): + + profile_data = setup_params_general["ssid_modes"]["wpa"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Verify Upload download Speed from device Selection + verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.fiveg + @pytest.mark.wpa + def test_ClientConnectivity_5g_WPA_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_iOS): + + profile_data = setup_params_general["ssid_modes"]["wpa"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Verify Upload download Speed from device Selection + verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.twog + @pytest.mark.open + def test_ClientConnectivity_2g_OPEN_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_iOS): + + profile_data = setup_params_general["ssid_modes"]["open"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = "[BLANK]" + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Verify Upload download Speed from device Selection + verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) + + @pytest.mark.fiveg + @pytest.mark.open + def test_ClientConnectivity_5g_OPEN_Bridge(self, request, get_vif_state, get_APToMobileDevice_data, + setup_perfectoMobile_iOS): + + profile_data = setup_params_general["ssid_modes"]["open"][1] + ssidName = profile_data["ssid_name"] + ssidPassword = "[BLANK]" + print("SSID_NAME: " + ssidName) + print("SSID_PASS: " + ssidPassword) + if ssidName not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + + report = setup_perfectoMobile_iOS[1] + driver = setup_perfectoMobile_iOS[0] + connData = get_APToMobileDevice_data + + # Set Wifi/AP Mode + set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData) + + # Verify Upload download Speed from device Selection + verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData) + + # ForgetWifi + ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData) \ No newline at end of file