From 23f38362272565de8dac61d689f182c7b781752c Mon Sep 17 00:00:00 2001 From: haricharan-jaka Date: Tue, 27 Jul 2021 17:09:52 +0530 Subject: [PATCH 1/8] Client connectivty Bridge mode --- .../client_connectivity/test_BridgeMode.py | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py 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..92c18a737 --- /dev/null +++ b/tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py @@ -0,0 +1,156 @@ +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"}], + "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(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(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(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(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) \ No newline at end of file From e00aeadc92d95b30c7b25b2681d22f9128a33ea9 Mon Sep 17 00:00:00 2001 From: haricharan-jaka Date: Tue, 27 Jul 2021 20:38:52 +0530 Subject: [PATCH 2/8] Added open security to client_connectivity test_NatMode --- .../client_connectivity/test_NatMode.py | 58 +++++++++++++++++++ .../iOS/client_connectivity/test_NatMode.py | 57 ++++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/tests/e2e/interOp/android/client_connectivity/test_NatMode.py b/tests/e2e/interOp/android/client_connectivity/test_NatMode.py index a903be39f..b68b61cef 100644 --- a/tests/e2e/interOp/android/client_connectivity/test_NatMode.py +++ b/tests/e2e/interOp/android/client_connectivity/test_NatMode.py @@ -25,6 +25,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"], "security_key": ""}, + {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": ""}], "wpa2_personal": [ {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}]}, @@ -97,6 +99,7 @@ class TestNatMode(object): #ForgetWifi ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) + @pytest.mark.twog @pytest.mark.wpa def test_ClientConnectivity_2g_WPA(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android): @@ -149,4 +152,59 @@ class TestNatMode(object): 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(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 = 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.and_cliconn + @pytest.mark.fiveg + @pytest.mark.open + def test_ClientConnectivity_5g_OPEN(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 = 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) \ No newline at end of file diff --git a/tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py b/tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py index 406764b19..69c680f58 100644 --- a/tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py +++ b/tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py @@ -25,9 +25,12 @@ 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"], "security_key": ""}, + {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": ""}], "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 } @@ -148,4 +151,58 @@ class TestNatMode(object): 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(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 = 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.open + def test_ClientConnectivity_5g_OPEN(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 = 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) \ No newline at end of file From 7a986b82c1a91b09102cd4be92f12b1d4bfbe02c Mon Sep 17 00:00:00 2001 From: haricharan-jaka <87761091+haricharan-jaka@users.noreply.github.com> Date: Tue, 27 Jul 2021 20:46:56 +0530 Subject: [PATCH 3/8] Delete test_BridgeMode.py --- .../client_connectivity/test_BridgeMode.py | 156 ------------------ 1 file changed, 156 deletions(-) delete mode 100644 tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py diff --git a/tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py b/tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py deleted file mode 100644 index 92c18a737..000000000 --- a/tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py +++ /dev/null @@ -1,156 +0,0 @@ -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"}], - "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(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(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(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(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) \ No newline at end of file From ee7c9fb6f65f15ea40041495f7acb376d29328f5 Mon Sep 17 00:00:00 2001 From: haricharan-jaka Date: Tue, 27 Jul 2021 17:09:52 +0530 Subject: [PATCH 4/8] Client connectivty Bridge mode --- .../client_connectivity/test_BridgeMode.py | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py 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..92c18a737 --- /dev/null +++ b/tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py @@ -0,0 +1,156 @@ +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"}], + "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(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(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(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(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) \ No newline at end of file From f297dddb078892af5d433267cd59fdc20f1220df Mon Sep 17 00:00:00 2001 From: haricharan-jaka Date: Tue, 27 Jul 2021 20:38:52 +0530 Subject: [PATCH 5/8] Added open security to client_connectivity test_NatMode --- .../iOS/client_connectivity/test_NatMode.py | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py b/tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py index 406764b19..69c680f58 100644 --- a/tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py +++ b/tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py @@ -25,9 +25,12 @@ 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"], "security_key": ""}, + {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": ""}], "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 } @@ -148,4 +151,58 @@ class TestNatMode(object): 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(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 = 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.open + def test_ClientConnectivity_5g_OPEN(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 = 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) \ No newline at end of file From 9a119a959e4297ef4ccc88c97727d01f3347d1ea Mon Sep 17 00:00:00 2001 From: haricharan-jaka <87761091+haricharan-jaka@users.noreply.github.com> Date: Tue, 27 Jul 2021 20:46:56 +0530 Subject: [PATCH 6/8] Delete test_BridgeMode.py --- .../client_connectivity/test_BridgeMode.py | 156 ------------------ 1 file changed, 156 deletions(-) delete mode 100644 tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py diff --git a/tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py b/tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py deleted file mode 100644 index 92c18a737..000000000 --- a/tests/e2e/interOp/iOS/client_connectivity/test_BridgeMode.py +++ /dev/null @@ -1,156 +0,0 @@ -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"}], - "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(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(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(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(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) \ No newline at end of file From b176b696b359911cbf5131ac4fe42d48f3649f6c Mon Sep 17 00:00:00 2001 From: haricharan-jaka Date: Thu, 29 Jul 2021 12:23:33 +0530 Subject: [PATCH 7/8] Added open security to clentconnectivity --- tests/e2e/interOp/android/client_connectivity/test_NatMode.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/interOp/android/client_connectivity/test_NatMode.py b/tests/e2e/interOp/android/client_connectivity/test_NatMode.py index 8900554ff..afa6dd7e7 100644 --- a/tests/e2e/interOp/android/client_connectivity/test_NatMode.py +++ b/tests/e2e/interOp/android/client_connectivity/test_NatMode.py @@ -178,7 +178,6 @@ class TestNatMode(object): # ForgetWifi ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData) - @pytest.mark.and_cliconn @pytest.mark.fiveg @pytest.mark.open def test_ClientConnectivity_5g_OPEN(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android): From 8ae4c281147b5a32a75befcbea357a711a2d8420 Mon Sep 17 00:00:00 2001 From: haricharan-jaka <87761091+haricharan-jaka@users.noreply.github.com> Date: Thu, 29 Jul 2021 12:34:21 +0530 Subject: [PATCH 8/8] Delete uc-sanity.yml --- .github/workflows/uc-sanity.yml | 295 -------------------------------- 1 file changed, 295 deletions(-) delete mode 100644 .github/workflows/uc-sanity.yml diff --git a/.github/workflows/uc-sanity.yml b/.github/workflows/uc-sanity.yml deleted file mode 100644 index 1ba5fa59b..000000000 --- a/.github/workflows/uc-sanity.yml +++ /dev/null @@ -1,295 +0,0 @@ -name: uCentral sanity testing -env: - # thirdparties - DOCKER_SERVER: tip-tip-wlan-cloud-docker-repo.jfrog.io - DOCKER_USER_NAME: wlan-testing-cicd - DOCKER_USER_PASSWORD: ${{ secrets.DOCKER_USER_PASSWORD }} - # AWS credentials - AWS_EKS_NAME: tip-wlan-main - AWS_DEFAULT_OUTPUT: json - AWS_DEFAULT_REGION: us-east-2 - AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }} - # Cloud SDK certs - CACERT: ${{ secrets.CACERT }} - CAKEY: ${{ secrets.CAKEY }} - ALLURE_CLI_VERSION: 2.14.0 - -on: - workflow_dispatch: - inputs: - testbeds: - default: 'basic-03,basic-04,basic-05,basic-06,basic-07,basic-08' - description: 'Testbed(s) to test' - required: false - marker_expression: - default: 'uc_sanity' - description: 'Markers expression that will be passed to the pytest command.' - required: false - schedule: - - cron: '15 0 * * *' - -defaults: - run: - shell: bash - -jobs: - build: - runs-on: ubuntu-latest - steps: - # checkout needed repositories - - name: Checkout Testing repo - uses: actions/checkout@v2 - with: - path: wlan-testing - ref: feature-ucentral-wifi-2526 - - - name: Checkout LANforge scripts - uses: actions/checkout@v2 - with: - path: wlan-lanforge-scripts - repository: Telecominfraproject/wlan-lanforge-scripts - - - name: import LANforge scripts - working-directory: wlan-testing - run: ./sync_repos.bash - - # build and push docker image - - name: docker login - run: docker login ${{ env.DOCKER_SERVER }} -u ${{ env.DOCKER_USER_NAME }} -p ${{ env.DOCKER_USER_PASSWORD }} - - name: build docker image - working-directory: wlan-testing - run: docker build -t ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} -f docker/Dockerfile . - - name: push docker image - run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} - - generate-matrix: - name: generate testbed matrix - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: generate-matrix - id: set-matrix - run: | - TESTBEDS="${{ github.event.inputs.testbeds || 'basic-03,basic-04,basic-05,basic-06,basic-07,basic-08' }}" - TESTBEDS=$(echo $TESTBEDS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') - TESTBEDS=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})') - echo "::set-output name=matrix::{\"include\":${TESTBEDS}}" - - test: - runs-on: ubuntu-latest - needs: [ build, generate-matrix ] - strategy: - fail-fast: false - matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }} - steps: - - name: get EKS access credentials - run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} - - - name: install Allure CLI tool - run: | - wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz - tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz - - - name: set job name - id: job - run: echo "::set-output name=name::testing-${{ github.run_number }}" - - - name: prepare namespace - id: namespace - run: | - NAMESPACE="testing-${{ github.run_id }}-${{ matrix.testbed }}" - kubectl create ns $NAMESPACE - kubectl config set-context --current --namespace=$NAMESPACE - echo "::set-output name=name::${NAMESPACE}" - - - name: create configuration.py secret - run: | - cat << EOF > configuration.py - ${{ secrets.LAB_CONFIGURATION }} - EOF - - kubectl create secret generic configuration --from-file=configuration=./configuration.py - - - name: run sanity tests - run: | - cat </dev/null 2>&1 - done - echo "tests completed" - - echo "downloading allure results..." - kubectl cp $podname:/tmp/allure-results allure-results >/dev/null 2>&1 - - echo "waiting for pod to exit" - kubectl logs -f $podname >/dev/null 2>&1 - - exit $(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}") - - - name: print logs - if: always() - run: | - podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///") - kubectl logs $podname - - - name: upload Allure results as artifact - if: always() - uses: actions/upload-artifact@v2 - with: - name: allure-results-${{ matrix.testbed }} - path: allure-results - - - name: cleanup - if: always() - run: | - kubectl delete ns "${{ steps.namespace.outputs.name }}" --wait=true - - report: - runs-on: ubuntu-latest - needs: [ test, generate-matrix ] - if: always() - strategy: - max-parallel: 1 - fail-fast: false - matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }} - steps: - - name: install Allure CLI tool - run: | - wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz - tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz - - - uses: actions/download-artifact@v2 - with: - name: allure-results-${{ matrix.testbed }} - path: allure-results - - - name: checkout testing repo - uses: actions/checkout@v2 - with: - path: wlan-testing - - - name: get reports branch - uses: actions/checkout@v2 - continue-on-error: true - with: - ref: gh-pages - path: reports - - - name: copy history into results - run: | - if [ -e "reports/sanity/${{ matrix.testbed }}/latest" ] ; then - cp -r reports/sanity/${{ matrix.testbed }}/latest/history/ allure-results/history - fi - - - name: add report metadata - run: | - cat << EOF >> allure-results/environment.properties - Testbed=${{ matrix.testbed }} - Tests.CommitId=$(cd wlan-testing && git rev-parse --short HEAD) - CiRun.Id=${{ github.run_id }} - CiRun.Number=${{ github.run_number }} - CiRun.Url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} - EOF - - - name: generate Allure report - run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate - - - name: upload Allure report as artifact - uses: actions/upload-artifact@v2 - with: - name: allure-report-${{ matrix.testbed }} - path: allure-report - - # doing this to be able to aggregate multiple reports together later on - - name: copy results into report - run: cp -r allure-results allure-report/results - - - name: copy new report - if: ${{ (github.event.inputs.marker_expression || 'uc_sanity') == 'uc_sanity' }} - run: | - mkdir -p reports/sanity/${{ matrix.testbed }} - cp -Tr allure-report reports/sanity/${{ matrix.testbed }}/${{ github.run_number }} - - - name: update latest symlink - if: ${{ (github.event.inputs.marker_expression || 'uc_sanity') == 'uc_sanity' }} - working-directory: reports/sanity/${{ matrix.testbed }} - run: ln -fns ${{ github.run_number }} latest - - - name: generate new index.html - run: python wlan-testing/.github/tools/generate_directory_index.py -r reports - - - name: commit reports update - working-directory: reports - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - git add . - git commit -m "Automated deployment: $(date -u)" - - - name: push - if: github.ref == 'refs/heads/master' - uses: ad-m/github-push-action@v0.6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: gh-pages - directory: reports - - cleanup: - needs: [ test ] - runs-on: ubuntu-latest - if: always() - steps: - - name: cleanup Docker image - run: curl -u${{ env.DOCKER_USER_NAME }}:${{ env.DOCKER_USER_PASSWORD }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-docker-repo/cloud-sdk-nightly/${{ github.run_id }}"