mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2026-01-07 21:01:37 +00:00
Merge branch 'WIFI-5978' of https://github.com/Telecominfraproject/wlan-testing into WIFI-5978
This commit is contained in:
2
.github/workflows/quali-basic-manual.yml
vendored
2
.github/workflows/quali-basic-manual.yml
vendored
@@ -40,7 +40,7 @@ on:
|
||||
default: 'main'
|
||||
description: 'revision of the Open Wifi UI'
|
||||
ap_model:
|
||||
description: 'AP model to test, one of ECW5410,EAP101,EC420,ECW5211,WF188N,EAP102,CIG194C'
|
||||
description: 'AP model to test, one of edgecore_ecw5410,edgecore_eap101,tp-link_ec420-g1,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c,hfcl_ion4'
|
||||
required: true
|
||||
firmware:
|
||||
default: 'next-latest'
|
||||
|
||||
8
.github/workflows/quali.yml
vendored
8
.github/workflows/quali.yml
vendored
@@ -41,7 +41,7 @@ on:
|
||||
description: 'revision of the Open Wifi UI'
|
||||
ap_models:
|
||||
required: true
|
||||
default: 'ECW5410,EAP101,EC420,ECW5211,WF188N,EAP102,CIG194C'
|
||||
default: 'edgecore_ecw5410,edgecore_eap101,tp-link_ec420-g1,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c,hfcl_ion4'
|
||||
description: 'the AP models to test'
|
||||
ap_version:
|
||||
required: true
|
||||
@@ -71,12 +71,12 @@ jobs:
|
||||
- name: set variables
|
||||
id: vars
|
||||
run: |
|
||||
echo ::set-output name=openwifi::$(echo "${{ github.event.inputs.openwifi_revision || 'v2.4.0-RC2' }}")
|
||||
echo ::set-output name=gw::$(echo "${{ github.event.inputs.openwifi_gw_revision || 'v2.4.0-RC2' }}")
|
||||
echo ::set-output name=openwifi::$(echo "${{ github.event.inputs.openwifi_revision || 'v2.4.0-RC3' }}")
|
||||
echo ::set-output name=gw::$(echo "${{ github.event.inputs.openwifi_gw_revision || 'v2.4.0-RC3' }}")
|
||||
echo ::set-output name=sec::$(echo "${{ github.event.inputs.openwifi_sec_revision || 'v2.4.0-RC2' }}")
|
||||
echo ::set-output name=fms::$(echo "${{ github.event.inputs.openwifi_fms_revision || 'v2.4.0-RC2' }}")
|
||||
echo ::set-output name=ui::$(echo "${{ github.event.inputs.openwifi_ui_revision || 'v2.4.0-RC2' }}")
|
||||
echo ::set-output name=ap_models::$(echo "${{ github.event.inputs.ap_models || 'ECW5410,EAP101,EC420,ECW5211,WF188N,EAP102,CIG194C' }}")
|
||||
echo ::set-output name=ap_models::$(echo "${{ github.event.inputs.ap_models || 'edgecore_ecw5410,edgecore_eap101,tp-link_ec420-g1,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c,hfcl_ion4' }}")
|
||||
echo ::set-output name=ap_version::$(echo "${{ github.event.inputs.ap_version || 'next-latest' }}")
|
||||
echo ::set-output name=marker_expression::$(echo "${{ github.event.inputs.marker_expression || 'uc_sanity' }}")
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ env:
|
||||
{
|
||||
"namespace": "dev01",
|
||||
"deploy_method": "git",
|
||||
"chart_version": "v2.4.0-RC2",
|
||||
"owgw_version": "v2.4.0-RC2",
|
||||
"chart_version": "v2.4.0-RC3",
|
||||
"owgw_version": "v2.4.0-RC3",
|
||||
"owsec_version": "v2.4.0-RC2",
|
||||
"owfms_version": "v2.4.0-RC2",
|
||||
"owprov_version": "main",
|
||||
|
||||
@@ -31,8 +31,8 @@ env:
|
||||
{
|
||||
"namespace": "qa01",
|
||||
"deploy_method": "git",
|
||||
"chart_version": "v2.4.0-RC2",
|
||||
"owgw_version": "v2.4.0-RC2",
|
||||
"chart_version": "v2.4.0-RC3",
|
||||
"owgw_version": "v2.4.0-RC3",
|
||||
"owsec_version": "v2.4.0-RC2",
|
||||
"owfms_version": "v2.4.0-RC2",
|
||||
"owprov_version": "main",
|
||||
|
||||
@@ -582,6 +582,24 @@ class APNOS:
|
||||
pass
|
||||
return vlan_list
|
||||
|
||||
def get_ap_uci_show_ucentral(self):
|
||||
try:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = "uci show ucentral"
|
||||
if self.mode:
|
||||
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
|
||||
f"cmd --value \"{cmd}\" "
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
output = stdout.read()
|
||||
status = output.decode('utf-8').splitlines()
|
||||
for i in status:
|
||||
if i.startswith("ucentral.config.server="):
|
||||
status = i.split("=")[1]
|
||||
client.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
status = "Error"
|
||||
return status
|
||||
|
||||
if __name__ == '__main__':
|
||||
obj = {
|
||||
|
||||
@@ -22,12 +22,13 @@ for folder in 'py-json', 'py-scripts':
|
||||
sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../tools')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
from sta_connect2 import StaConnect2
|
||||
import time
|
||||
import string
|
||||
import random
|
||||
|
||||
from scp_util import SCP_File
|
||||
S = 12
|
||||
# from eap_connect import EAPConnect
|
||||
from test_ipv4_ttls import TTLSTest
|
||||
@@ -50,6 +51,7 @@ class RunTest:
|
||||
def __init__(self, lanforge_data=None, local_report_path="../reports/", influx_params=None, debug=False):
|
||||
self.lanforge_ip = lanforge_data["ip"]
|
||||
self.lanforge_port = lanforge_data["port"]
|
||||
self.lanforge_ssh_port = lanforge_data["ssh_port"]
|
||||
self.twog_radios = lanforge_data["2.4G-Radio"]
|
||||
self.fiveg_radios = lanforge_data["5G-Radio"]
|
||||
self.ax_radios = lanforge_data["AX-Radio"]
|
||||
@@ -129,6 +131,13 @@ class RunTest:
|
||||
print("test result: " + result)
|
||||
pytest.exit("Test Failed: Debug True")
|
||||
self.staConnect.cleanup()
|
||||
supplicqant = "/home/lanforge/wifi/wpa_supplicant_log_" + self.staConnect.radio.split(".")[2] + ".txt"
|
||||
obj = SCP_File(ip=self.lanforge_ip, port=self.lanforge_ssh_port, username="root", password="lanforge",
|
||||
remote_path=supplicqant,
|
||||
local_path=".")
|
||||
obj.pull_file()
|
||||
allure.attach.file(source="wpa_supplicant_log_" + self.staConnect.radio.split(".")[2] + ".txt",
|
||||
name="supplicant_log")
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
result = True
|
||||
@@ -215,6 +224,13 @@ class RunTest:
|
||||
# print(e)
|
||||
|
||||
self.eap_connect.stop()
|
||||
supplicqant = "/home/lanforge/wifi/wpa_supplicant_log_" + self.eap_connect.radio.split(".")[2] + ".txt"
|
||||
obj = SCP_File(ip=self.lanforge_ip, port=self.lanforge_ssh_port, username="root", password="lanforge",
|
||||
remote_path=supplicqant,
|
||||
local_path=".")
|
||||
obj.pull_file()
|
||||
allure.attach.file(source="wpa_supplicant_log_" + self.eap_connect.radio.split(".")[2] + ".txt",
|
||||
name="supplicant_log")
|
||||
if not self.eap_connect.passes():
|
||||
if self.debug:
|
||||
print("test result: " + self.eap_connect.passes())
|
||||
|
||||
55
libs/lanforge/scp_util.py
Executable file
55
libs/lanforge/scp_util.py
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
|
||||
import paramiko
|
||||
from scp import SCPClient
|
||||
|
||||
|
||||
class SCP_File:
|
||||
def __init__(self, ip="localhost", port=22, username="lanforge", password="lanforge", remote_path="/home/lanforge/",
|
||||
local_path="."):
|
||||
self.ip = ip
|
||||
self.port = port
|
||||
self.remote_path = remote_path
|
||||
self.local_path = local_path
|
||||
self.username = username
|
||||
self.password = password
|
||||
|
||||
def pull_file(self):
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.load_system_host_keys()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect(hostname=self.ip, username=self.username, password=self.password, port=self.port, allow_agent=False,
|
||||
look_for_keys=False)
|
||||
# ssh.close()
|
||||
|
||||
with SCPClient(ssh.get_transport()) as scp:
|
||||
scp.get(remote_path=self.remote_path, local_path=self.local_path, recursive=True)
|
||||
scp.close()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog="lf_utils",
|
||||
formatter_class=argparse.RawTextHelpFormatter,
|
||||
allow_abbrev=True,
|
||||
epilog="About lf_tools.py",
|
||||
description="Tools for LANforge System")
|
||||
parser.add_argument('--host', type=str, help=' --host : IP Address f LANforge System', default="localhost")
|
||||
parser.add_argument('--port', type=int, help='--passwd of dut', default=22)
|
||||
parser.add_argument('--username', type=str, help='--username to use on LANforge', default="lanforge")
|
||||
parser.add_argument('--password', type=str, help='--password to use on LANforge', default="lanforge")
|
||||
parser.add_argument('--remote_path', type=str, help='--password to the given username',
|
||||
default="/home/lanforge/lf_kinstall.pl")
|
||||
parser.add_argument('--local_path', type=str, help='--action to perform'
|
||||
'reboot | run_cmd', default=".")
|
||||
args = parser.parse_args()
|
||||
lf_tools = SCP_File(ip=args.host, port=args.port,
|
||||
username=args.username, password=args.password,
|
||||
remote_path=args.remote_path, local_path=args.local_path)
|
||||
lf_tools.pull_file()
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -51,6 +51,7 @@ def closeApp(appName, setup_perfectoMobile):
|
||||
setup_perfectoMobile[1].step_start("Closing App: " + appName)
|
||||
params = {'identifier': appName}
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:close', params)
|
||||
print("Closed App")
|
||||
|
||||
def scrollDown(setup_perfectoMobile):
|
||||
print("Scroll Down")
|
||||
@@ -581,7 +582,7 @@ def verifyUploadDownloadSpeed_android(request, setup_perfectoMobile, get_APToMob
|
||||
driver.switch_to.context('WEBVIEW_1')
|
||||
|
||||
try:
|
||||
print("Launching Safari")
|
||||
print("Launching Chrome")
|
||||
report.step_start("Google Home Page")
|
||||
driver.get(connData["webURL"])
|
||||
print("Enter Search Text")
|
||||
@@ -2678,6 +2679,639 @@ def wifi_connect_eap(request, WifiName, User, ttls_passwd, setup_perfectoMobile,
|
||||
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
#--------------------CAPTIVE PORTAL Android-----------------------------------------
|
||||
def captive_portal_and(request, WifiName, WifiPass, setup_perfectoMobile, connData):
|
||||
print("\n-------------------------------------")
|
||||
print("Select Wifi/AccessPoint Connection")
|
||||
print("-------------------------------------")
|
||||
print("Verifying Wifi Connection Details....")
|
||||
#allure.attach(name= body=str("\n-------------------------------------"))
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
ssid_with_internet = False
|
||||
|
||||
report.step_start("Switching Driver Context")
|
||||
print("Switching Context to Native")
|
||||
contexts = driver.contexts
|
||||
driver.switch_to.context(contexts[0])
|
||||
|
||||
# Open Settings Application
|
||||
openApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
deviceModelName = getDeviceModelName(setup_perfectoMobile)
|
||||
print("Selected Device Model: " + deviceModelName)
|
||||
#allure.attach(name= body=str("\Selected Device Model: " + deviceModelName))
|
||||
if deviceModelName != ("Pixel 4"):
|
||||
report.step_start("Set Wifi Network to " + WifiName)
|
||||
|
||||
|
||||
# -----------------To Open Connections page-----------------------
|
||||
try:
|
||||
print("Verifying Connected Wifi Connection")
|
||||
report.step_start("Click Connections")
|
||||
connElement = driver.find_element_by_xpath("//*[@text='Connections']")
|
||||
connElement.click()
|
||||
|
||||
|
||||
# ---------------------Open WIFI page-------------------------------
|
||||
try:
|
||||
report.step_start("Clicking Wi-Fi")
|
||||
print("Clicking WIFI")
|
||||
wifiElement = driver.find_element_by_xpath("//*[@text='Wi-Fi']")
|
||||
wifiElement.click()
|
||||
|
||||
|
||||
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
|
||||
try:
|
||||
driver.implicitly_wait(1)
|
||||
get_switch_text_element = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/switch_text']")
|
||||
get_switch_text = get_switch_text_element.text
|
||||
print("get_switch_text: ",get_switch_text)
|
||||
print("Find wifi switch")
|
||||
try: #To Turn on Wi-Fi Switch
|
||||
if get_switch_text == "Off":
|
||||
# driver.implicitly_wait(3)
|
||||
get_switch_element = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/switch_widget']")
|
||||
driver.implicitly_wait(1)
|
||||
get_switch_element.click()
|
||||
driver.implicitly_wait(1)
|
||||
i = 0
|
||||
for i in range(5):
|
||||
if get_switch_text == "On":
|
||||
print("WIFI Switch is ON")
|
||||
break
|
||||
else:
|
||||
try:
|
||||
get_switch_text_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/switch_text']")
|
||||
get_switch_text = get_switch_text_element.text
|
||||
except:
|
||||
pass
|
||||
print("Sleeping for: ", i)
|
||||
time.sleep(i)
|
||||
pass
|
||||
if get_switch_text == "Off":
|
||||
print("Switch is Still OFF")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
else:
|
||||
print("Switch is already On")
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
print("Couldn't turn on WIFI switch")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
|
||||
#---------------------This is to Forget current connected SSID-------------------------------
|
||||
try: #To deal with already connected SSID
|
||||
check_if_no_internet_popup(driver)
|
||||
network_category = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/connected_network_category']")
|
||||
try: #To forget exhisting ssid
|
||||
print("To forget ssid")
|
||||
check_if_no_internet_popup(driver)
|
||||
additional_details_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/layout_details']")
|
||||
additional_details_element.click()
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
forget_ssid = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/forget_button']//*[@resource-id='com.android.settings:id/icon']")
|
||||
forget_ssid.click()
|
||||
print("Forget old ssid")
|
||||
except:
|
||||
print("Couldn't forget ssid")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
except:
|
||||
print("Couldn't get into additional details")
|
||||
except:
|
||||
print("No Connected SSIDS")
|
||||
#----------------------This is to Forget current connected SSID--------------------------------
|
||||
|
||||
|
||||
print("Searching for Wifi: " + WifiName)
|
||||
#allure.attach(name= body=str("Searching for Wifi: " + WifiName))
|
||||
time.sleep(2)
|
||||
print("Selecting Wifi: " + WifiName)
|
||||
ssid_found = False
|
||||
available_ssids = False
|
||||
# This is To get all available ssids
|
||||
# ------------------------------------------------------
|
||||
try:
|
||||
for check_for_all_ssids in range(2):
|
||||
available_ssids = get_all_available_ssids(driver)
|
||||
try:
|
||||
if WifiName not in available_ssids:
|
||||
scrollDown(setup_perfectoMobile)
|
||||
time.sleep(2)
|
||||
else:
|
||||
ssid_found = True
|
||||
print(WifiName + " : Found in Device")
|
||||
#allure.attach(name= body=str(WifiName + " : Found in Device"))
|
||||
break
|
||||
except:
|
||||
print("1538")
|
||||
pass
|
||||
if not ssid_found:
|
||||
print("could not found" + WifiName + " in device")
|
||||
#allure.attach(name= body=str("could not found" + WifiName + " in device"))
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
except:
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
#Selecting WIFI
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Selecting Wifi: " + WifiName)
|
||||
print("Click wifi")
|
||||
wifi_selection_element = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@text='" + WifiName + "']")))
|
||||
wifi_selection_element.click()
|
||||
check_if_no_internet_popup(driver)
|
||||
#allure.attach(name= body=str("Selecting Wifi: " + WifiName))
|
||||
except Exception as e:
|
||||
print("Exception on Selecting Wifi Network. Please check wifi Name or signal")
|
||||
#allure.attach(name= body=str("Exception on Selecting Wifi Network. Please check wifi Name or signal"))
|
||||
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
|
||||
|
||||
#Set password if Needed
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
time.sleep(2)
|
||||
check_if_no_internet_popup(driver)
|
||||
report.step_start("Set Wifi Password")
|
||||
print("Enter Wifi password")
|
||||
wifi_password_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/edittext']")
|
||||
wifi_password_element.send_keys(WifiPass)
|
||||
except NoSuchElementException:
|
||||
print("Password Page Not Loaded, password May be cached in the System")
|
||||
check_if_no_internet_popup(driver)
|
||||
# -------------------------------------------------------
|
||||
|
||||
#Click on connect button
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Connect Button")
|
||||
print("Click Connect Button")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Connect']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print("Connect Button Not Enabled...Verify if Password is set properly ")
|
||||
check_if_no_internet_popup(driver)
|
||||
#---------------------Clicking on ssid for captive portal login--------
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Selecting Wifi: " + WifiName)
|
||||
wifi_selection_element = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@text='" + WifiName + "']")))
|
||||
wifi_selection_element.click()
|
||||
except NoSuchElementException:
|
||||
print("Not connected to Captive portal Ssid.. ")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Accept Terms Button")
|
||||
print("Click Accept Terms Button")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Accept Terms of Service']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't press Accept terms button")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Continue Button")
|
||||
print("Click Continue Button")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Continue']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't press Continue button")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Last Terms if needed")
|
||||
print("Click Last Terms if needed")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Done']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't find the last terms page")
|
||||
|
||||
#Verify if WiFi is connected
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Verify if Wifi is Connected")
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,
|
||||
"//*[@resource-id='android:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
ssid_with_internet = True
|
||||
print("Wifi Successfully Connected")
|
||||
#allure.attach(name= body=str("Wifi Successfully Connected"))
|
||||
# time.sleep(5)
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,
|
||||
"//*[@resource-id='com.android.settings:id/summary' and @text='Connected without internet']/parent::*/android.widget.TextView[@text='"
|
||||
+ WifiName + "']")))
|
||||
print("Wifi Successfully Connected without internet")
|
||||
#allure.attach(name= body=str("Wifi Successfully Connected without internet"))
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
try:
|
||||
report.step_start("Verify if Wifi is Connected")
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 60).until(EC.presence_of_element_located((
|
||||
MobileBy.XPATH,
|
||||
"//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
ssid_with_internet = True
|
||||
print("Wifi Successfully Connected")
|
||||
#allure.attach(name=body=str("Wifi Successfully Connected"))
|
||||
except NoSuchElementException:
|
||||
print("Wifi Connection Error: " + WifiName)
|
||||
#allure.attach(name=body=str("Wifi Connection Error: " + WifiName))
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
# Get into Additional Details
|
||||
# To Get an IP Address
|
||||
# To Forget connection
|
||||
# To turn off auto. connect
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
print("Into additional details")
|
||||
time.sleep(2)
|
||||
additional_details_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/layout_details']")
|
||||
additional_details_element.click()
|
||||
try:
|
||||
time.sleep(2)
|
||||
ip_address_element = driver.find_element_by_xpath(
|
||||
"//*[@text='IP address']/parent::*/android.widget.TextView[@resource-id='com.android.settings:id/summary']")
|
||||
ip_address_element_text = ip_address_element.text
|
||||
print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
try:
|
||||
time.sleep(2)
|
||||
ip_address_element = driver.find_element_by_xpath(
|
||||
"//*[@text='IP address']/parent::*/android.widget.TextView[@resource-id='android:id/summary']")
|
||||
ip_address_element_text = ip_address_element.text
|
||||
print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
print("IP address element not found")
|
||||
# allure.attach(name= body=str("IP address element not found"))
|
||||
|
||||
# closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
# return ip_address_element_text, ssid_with_internet
|
||||
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
driver.implicitly_wait(3)
|
||||
time.sleep(2)
|
||||
auto_reconnect_off = driver.find("//*[@resource-id='android:id/switch_widget']")
|
||||
auto_reconnect_off_text = auto_reconnect_off.text
|
||||
if auto_reconnect_off_text != "Off":
|
||||
auto_reconnect_off.click()
|
||||
print("Auto reconnect turning off")
|
||||
else:
|
||||
print("Auto reconnect is already off")
|
||||
except:
|
||||
print("Couldn't find auto reconnect element")
|
||||
except:
|
||||
print("Couldn't get into Additional settings")
|
||||
except NoSuchElementException:
|
||||
print("No Switch element found")
|
||||
#allure.attach(name= body=str("No Switch element found"))
|
||||
# ---------------------To Turn on WIFi Switch if already OFF-------------------------------
|
||||
|
||||
except NoSuchElementException:
|
||||
print("Couldn't find wifi Button")
|
||||
#allure.attach(name= body=str("Couldn't find wifi Button"))
|
||||
# ------------------Open WIFI page----------------------------------
|
||||
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath - Update/check Xpath for Click Connections")
|
||||
#allure.attach(name= body=str("Exception: Verify Xpath - Update/check Xpath for Click Connections"))
|
||||
# -----------------To Open Connections page---------------------------
|
||||
# --------------------Pixel 4 code---------------------------
|
||||
else:
|
||||
report.step_start("Set Wifi Network to " + WifiName)
|
||||
|
||||
# -----------------To Open Connections page-----------------------
|
||||
try:
|
||||
print("Verifying Connected Wifi Connection")
|
||||
report.step_start("Click Network & internet in pixel4")
|
||||
connElement = driver.find_element_by_xpath("//*[@text='Network & internet']")
|
||||
connElement.click()
|
||||
|
||||
# ---------------------Open WIFI page-------------------------------
|
||||
try:
|
||||
report.step_start("Clicking Wi-Fi")
|
||||
print("Clicking WIFI")
|
||||
time.sleep(3)
|
||||
wifiElement = WebDriverWait(driver, 10).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@text='Wi‑Fi']")))
|
||||
wifiElement.click()
|
||||
|
||||
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
|
||||
try:
|
||||
driver.implicitly_wait(1)
|
||||
report.step_start("Turn on WIFi Switch if already OFF")
|
||||
get_switch_text_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='android:id/icon']")
|
||||
get_switch_text = get_switch_text_element.click()
|
||||
if get_switch_text is not None:
|
||||
switch_text = "Off"
|
||||
else:
|
||||
switch_text = "On"
|
||||
|
||||
print("get_switch_text: ", switch_text)
|
||||
print("Find wifi switch")
|
||||
try: # To Turn on Wi-Fi Switch
|
||||
if switch_text == "Off":
|
||||
# driver.implicitly_wait(3)
|
||||
get_switch_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/switch_widget']")
|
||||
driver.implicitly_wait(1)
|
||||
get_switch_element.click()
|
||||
driver.implicitly_wait(1)
|
||||
i = 0
|
||||
for i in range(5):
|
||||
if switch_text == "On":
|
||||
print("WIFI Switch is ON")
|
||||
break
|
||||
else:
|
||||
try:
|
||||
get_switch_text_element = driver.find_element_by_xpath(
|
||||
"//*[@text='Add network']")
|
||||
get_switch_text = get_switch_text_element.text
|
||||
if get_switch_text == "Add network":
|
||||
switch_text = "On"
|
||||
else:
|
||||
switch_text = "Off"
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath")
|
||||
# Scroll Down
|
||||
scrollDown(setup_perfectoMobile)
|
||||
print("Sleeping for: ", i)
|
||||
time.sleep(i)
|
||||
pass
|
||||
if switch_text == "Off":
|
||||
print("Switch is Still OFF")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
else:
|
||||
print("Switch is already On")
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
print("Couldn't turn on WIFI switch")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
|
||||
# ---------------------This is to Forget current connected SSID-------------------------------
|
||||
try: # To deal with already connected SSID
|
||||
check_if_no_internet_popup(driver)
|
||||
network_category = driver.find_element_by_xpath("//*[@text='Connected']")
|
||||
try: # To forget existing ssid
|
||||
print("To forget ssid")
|
||||
report.step_start("To forget ssid")
|
||||
check_if_no_internet_popup(driver)
|
||||
additional_details_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/settings_button_no_background']")
|
||||
additional_details_element.click()
|
||||
except:
|
||||
print("Couldn't get into additional details")
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
forget_ssid = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/button1']")
|
||||
forget_ssid.click()
|
||||
print("Forget old ssid")
|
||||
except:
|
||||
print("Couldn't forget ssid")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
except:
|
||||
print("No Connected SSIDS")
|
||||
# ----------------------This is to Forget current connected SSID--------------------------------
|
||||
|
||||
# time.sleep(2)
|
||||
# print("Selecting Wifi: " + WifiName)
|
||||
# ssid_found = False
|
||||
# available_ssids = False
|
||||
# This is To get all available ssids
|
||||
# ------------------------------------------------------
|
||||
# try:
|
||||
# for check_for_all_ssids in range(2):
|
||||
# available_ssids = WifiName
|
||||
# try:
|
||||
# if WifiName not in available_ssids:
|
||||
# scrollDown(setup_perfectoMobile)
|
||||
# time.sleep(2)
|
||||
# else:
|
||||
# ssid_found = True
|
||||
# print(WifiName + " : Found in Device")
|
||||
# # allure.attach(name= body=str(WifiName + " : Found in Device"))
|
||||
# break
|
||||
# except:
|
||||
# print("1538")
|
||||
# pass
|
||||
# if not ssid_found:
|
||||
# print("could not found" + WifiName + " in device")
|
||||
# # allure.attach(name= body=str("could not found" + WifiName + " in device"))
|
||||
# closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
# return ssid_with_internet
|
||||
# except:
|
||||
# closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
# return ssid_with_internet
|
||||
# # -------------------------------------------------------
|
||||
|
||||
# Selecting WIFI
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Selecting Wifi: " + WifiName)
|
||||
print("Click wifi")
|
||||
wifi_selection_element = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@text='" + WifiName + "']")))
|
||||
wifi_selection_element.click()
|
||||
check_if_no_internet_popup(driver)
|
||||
# allure.attach(name= body=str("Selecting Wifi: " + WifiName))
|
||||
except Exception as e:
|
||||
print("Exception on Selecting Wifi Network")
|
||||
# allure.attach(name= body=str("Exception on Selecting Wifi Network. Please check wifi Name or signal"))
|
||||
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
# Set password if Needed
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
report.step_start("Set Wifi Password")
|
||||
print("Entering password")
|
||||
wifiPasswordElement = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/password']")
|
||||
wifiPasswordElement.send_keys(WifiPass)
|
||||
except NoSuchElementException:
|
||||
print("Password Page Not Loaded, password May be cached in the System")
|
||||
check_if_no_internet_popup(driver)
|
||||
# -------------------------------------------------------
|
||||
|
||||
# Click on connect button
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Click Connect Button")
|
||||
joinBTNElement = driver.find_element_by_xpath("//*[@text='Connect']")
|
||||
joinBTNElement.click()
|
||||
except NoSuchElementException:
|
||||
print("Connect Button Not Enabled...Verify if Password is set properly ")
|
||||
check_if_no_internet_popup(driver)
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Selecting Wifi: " + WifiName)
|
||||
wifiSelectionElement = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@text='" + WifiName + "']")))
|
||||
wifiSelectionElement.click()
|
||||
check_if_no_internet_popup(driver)
|
||||
except Exception as e:
|
||||
print("Exception on Selecting Wifi Network. Please check wifi Name or signal")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Accept Terms Button")
|
||||
print("Click Accept Terms Button")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Accept Terms of Service']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't press Accept terms button")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Continue Button")
|
||||
print("Click Continue Button")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Continue']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't press Continue button")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Last Terms if needed")
|
||||
print("Click Last Terms if needed")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Done']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't find the last terms page")
|
||||
|
||||
# Verify if WiFi is connected
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Verify if Wifi is Connected")
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,
|
||||
"//*[@resource-id='android:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
ssid_with_internet = True
|
||||
print("Wifi Successfully Connected")
|
||||
# time.sleep(5)
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,
|
||||
"//*[@resource-id='com.android.settings:id/summary' and @text='Connected without internet']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
print("Wifi Successfully Connected without internet")
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
try:
|
||||
report.step_start("Verify if Wifi is Connected")
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 60).until(
|
||||
EC.presence_of_element_located((
|
||||
MobileBy.XPATH,
|
||||
"//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
ssid_with_internet = True
|
||||
print("Wifi Successfully Connected")
|
||||
except NoSuchElementException:
|
||||
print("Wifi Connection Error: " + WifiName)
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
|
||||
# Get into Additional Details
|
||||
# To Get an IP Address
|
||||
# To Forget connection
|
||||
# To turn off auto. connect
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
print("Into additional details")
|
||||
time.sleep(5)
|
||||
report.step_start("Going for ip address")
|
||||
additional_details_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/settings_button_no_background']")
|
||||
additional_details_element.click()
|
||||
print("Entered ssid")
|
||||
try:
|
||||
time.sleep(10)
|
||||
print("clicking Advanced")
|
||||
report.step_start("clicking Advanced")
|
||||
advanced_element = driver.find_element_by_xpath("//*[@text='Advanced']")
|
||||
advanced_element.click()
|
||||
print("clicked Advanced")
|
||||
# print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
try:
|
||||
time.sleep(5)
|
||||
print("clicking Advanced2")
|
||||
advanced_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/recycler_view']/android.widget.FrameLayout[2]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]")
|
||||
advanced_element.click()
|
||||
# print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
try:
|
||||
time.sleep(5)
|
||||
print("clicking Advanced2")
|
||||
advanced_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/recycler_view']/android.widget.LinearLayout[5]/android.widget.LinearLayout[1]/android.widget.ImageView[1]")
|
||||
advanced_element.click()
|
||||
except:
|
||||
print("No advanced options")
|
||||
# allure.attach(name= body=str("IP address element not found"))
|
||||
|
||||
# closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
# return ip_address_element_text, ssid_with_internet
|
||||
# Scroll Down
|
||||
scrollDown(setup_perfectoMobile)
|
||||
try:
|
||||
time.sleep(2)
|
||||
ip_address_element = driver.find_element_by_xpath(
|
||||
"//*[@text='IP address']/parent::*/android.widget.TextView[@resource-id='android:id/summary']")
|
||||
ip_address_element_text = ip_address_element.text
|
||||
print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
print("IP address element not found")
|
||||
except:
|
||||
print("Couldn't get into Additional settings")
|
||||
# -------------------------------------------------------
|
||||
except:
|
||||
print("No Switch element found")
|
||||
# ---------------------To Turn on WIFi Switch if already OFF-------------------------------
|
||||
|
||||
except:
|
||||
print("Couldn't find wifi Button")
|
||||
# ------------------Open WIFI page----------------------------------
|
||||
|
||||
except:
|
||||
print("Exception: Verify Xpath - Update/check Xpath for Click Connections")
|
||||
# -----------------To Open Connections page---------------------------
|
||||
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ip_address_element_text, ssid_with_internet
|
||||
|
||||
|
||||
def close_driver(driver):
|
||||
driver.close()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -42,7 +42,6 @@ from LANforge.LFUtils import *
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
from apnos.apnos import APNOS
|
||||
from controller.controller_1x.controller import Controller
|
||||
from controller.controller_1x.controller import FirmwareUtility
|
||||
import pytest
|
||||
from lanforge.lf_tests import RunTest
|
||||
@@ -50,11 +49,10 @@ from cv_test_manager import cv_test
|
||||
from configuration import CONFIGURATION
|
||||
from configuration import RADIUS_SERVER_DATA
|
||||
from configuration import RADIUS_ACCOUNTING_DATA
|
||||
|
||||
from lanforge.scp_util import SCP_File
|
||||
from testrails.testrail_api import APIClient
|
||||
from testrails.reporting import Reporting
|
||||
from lf_tools import ChamberView
|
||||
from sta_connect2 import StaConnect2
|
||||
from os import path
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
@@ -266,6 +264,11 @@ def get_sdk_version(fixtures_ver):
|
||||
version = fixtures_ver.get_sdk_version()
|
||||
yield version
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_uci_show(fixtures_ver, get_apnos, get_configuration):
|
||||
uci_show = fixtures_ver.get_uci_show(get_apnos, get_configuration)
|
||||
yield uci_show
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def skip_lf(request):
|
||||
@@ -524,6 +527,12 @@ def test_access_point(fixtures_ver, request, get_configuration, get_apnos):
|
||||
yield status
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def test_ap_connection_status(fixtures_ver, request, get_configuration, get_apnos):
|
||||
"""used to check the manager status of AP, should be used as a setup to verify if ap can reach cloud"""
|
||||
connection, redirector_value = fixtures_ver.get_ap_status_logs(get_configuration, get_apnos)
|
||||
yield connection, redirector_value
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def traffic_generator_connectivity(testbed, get_configuration):
|
||||
"""Verify if traffic generator is reachable"""
|
||||
@@ -679,3 +688,25 @@ def get_ap_logs(request, get_apnos, get_configuration):
|
||||
pass
|
||||
|
||||
request.addfinalizer(collect_logs)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_lf_logs(request, get_apnos, get_configuration):
|
||||
ip = get_configuration["traffic_generator"]["details"]["ip"]
|
||||
port = get_configuration["traffic_generator"]["details"]["ssh_port"]
|
||||
|
||||
def collect_logs_lf():
|
||||
log_0 = "/home/lanforge/lanforge_log_0.txt"
|
||||
log_1 = "/home/lanforge/lanforge_log_1.txt"
|
||||
obj = SCP_File(ip=ip, port=port, username="root", password="lanforge", remote_path=log_0,
|
||||
local_path=".")
|
||||
obj.pull_file()
|
||||
allure.attach.file(source="lanforge_log_0.txt",
|
||||
name="lanforge_log_0")
|
||||
obj = SCP_File(ip=ip, port=port, username="root", password="lanforge", remote_path=log_1,
|
||||
local_path=".")
|
||||
obj.pull_file()
|
||||
allure.attach.file(source="lanforge_log_1.txt",
|
||||
name="lanforge_log_1")
|
||||
|
||||
request.addfinalizer(collect_logs_lf)
|
||||
|
||||
@@ -71,6 +71,7 @@ def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtur
|
||||
if vlan_list[i] > 4095 or vlan_list[i] < 1:
|
||||
vlan_list.pop(i)
|
||||
if request.param["mode"] == "VLAN":
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan_list)
|
||||
|
||||
# call this, if 1.x
|
||||
|
||||
@@ -46,7 +46,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -73,7 +73,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, get_ap_logs,
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, get_ap_logs, get_lf_logs,
|
||||
setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 5g
|
||||
@@ -98,7 +98,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -126,7 +126,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -154,7 +154,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -181,7 +181,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -239,7 +239,7 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -267,7 +267,7 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -295,7 +295,7 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -322,7 +322,7 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
|
||||
@@ -50,7 +50,8 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2809", name="JIRA LINK")
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs, setup_profiles, lf_test, update_report,
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs, setup_profiles, lf_test,
|
||||
update_report,
|
||||
station_names_twog,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -76,7 +77,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2801", name="JIRA LINK")
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs, lf_test, test_cases, station_names_fiveg,
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs, lf_test, test_cases, station_names_fiveg, get_lf_logs,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 5G
|
||||
pytest -m "client_connectivity and bridge and general and open and fiveg"
|
||||
@@ -103,7 +104,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2801", name="JIRA LINK")
|
||||
def test_wpa_ssid_2g(self, get_vif_state, get_ap_logs, update_report,
|
||||
def test_wpa_ssid_2g(self, get_vif_state, get_ap_logs, update_report, get_lf_logs,
|
||||
lf_test, test_cases, station_names_twog):
|
||||
"""Client Connectivity wpa ssid 2.4G
|
||||
pytest -m "client_connectivity and bridge and general and wpa and twog"
|
||||
@@ -129,7 +130,8 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs, lf_test, update_report, test_cases, station_names_fiveg):
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs, lf_test, update_report, get_lf_logs,
|
||||
test_cases, station_names_fiveg):
|
||||
"""Client Connectivity wpa ssid 5G
|
||||
pytest -m "client_connectivity and bridge and general and wpa and fiveg"
|
||||
"""
|
||||
@@ -154,7 +156,8 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, lf_test, update_report, test_cases,
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, update_report, test_cases,
|
||||
station_names_twog):
|
||||
"""Client Connectivity wpa2_personal ssid 2.4G
|
||||
pytest -m "client_connectivity and bridge and general and wpa2_personal and twog"
|
||||
@@ -181,7 +184,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, update_report, test_cases,
|
||||
station_names_fiveg,
|
||||
station_names_fiveg, get_lf_logs,
|
||||
lf_test):
|
||||
"""Client Connectivity wpa2_personal ssid 5G
|
||||
pytest -m "client_connectivity and bridge and general and wpa2_personal and fiveg"
|
||||
@@ -270,7 +273,8 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs, station_names_fiveg, lf_test, test_cases,
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs, station_names_fiveg,
|
||||
lf_test, test_cases, get_lf_logs,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and bridge and general and wpa3_personal and fiveg"
|
||||
@@ -296,7 +300,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state, get_ap_logs, station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
lf_test, get_lf_logs,
|
||||
update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -323,7 +327,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state, get_ap_logs, station_names_fiveg, lf_test,
|
||||
test_cases,
|
||||
test_cases, get_lf_logs,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and bridge and general and wpa3_personal_mixed and fiveg"
|
||||
@@ -349,7 +353,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
lf_test, get_lf_logs,
|
||||
update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -376,7 +380,8 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, station_names_fiveg, lf_test, test_cases,
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, station_names_fiveg, get_lf_logs,
|
||||
lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and bridge and general and wpa_wpa2_personal_mixed and fiveg"
|
||||
|
||||
@@ -34,7 +34,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
@@ -59,7 +59,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
@@ -85,7 +85,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
@@ -111,7 +111,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
@@ -136,7 +136,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
@@ -160,7 +160,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state,station_names_fiveg, get_ap_logs,
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state,station_names_fiveg, get_ap_logs, get_lf_logs,
|
||||
setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
@@ -210,7 +210,7 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][0]
|
||||
@@ -235,7 +235,7 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
@@ -260,7 +260,7 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][0]
|
||||
@@ -284,8 +284,8 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][1]
|
||||
|
||||
@@ -48,7 +48,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
setup_profiles, lf_test, update_report,
|
||||
station_names_twog,
|
||||
test_cases):
|
||||
@@ -77,7 +77,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, test_cases, station_names_fiveg,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 5G
|
||||
@@ -104,7 +104,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
def test_wpa_ssid_2g(self, get_vif_state, get_ap_logs, update_report,
|
||||
def test_wpa_ssid_2g(self, get_vif_state, get_ap_logs, update_report, get_lf_logs,
|
||||
lf_test, test_cases, station_names_twog):
|
||||
"""Client Connectivity wpa ssid 2.4G
|
||||
pytest -m "client_connectivity and NAT and general and wpa and twog"
|
||||
@@ -129,7 +129,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, update_report, test_cases, station_names_fiveg):
|
||||
"""Client Connectivity wpa ssid 5G
|
||||
pytest -m "client_connectivity and NAT and general and wpa and fiveg"
|
||||
@@ -155,7 +155,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, update_report, test_cases,
|
||||
station_names_twog):
|
||||
"""Client Connectivity wpa2_personal ssid 2.4G
|
||||
@@ -182,7 +182,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
update_report, test_cases,
|
||||
station_names_fiveg,
|
||||
lf_test):
|
||||
@@ -245,7 +245,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
@@ -272,7 +272,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -300,7 +300,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
lf_test, get_lf_logs,
|
||||
update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -326,7 +326,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, lf_test,
|
||||
test_cases,
|
||||
update_report):
|
||||
@@ -353,7 +353,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
update_report,
|
||||
@@ -382,7 +382,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
|
||||
@@ -34,7 +34,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -60,7 +60,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -87,7 +87,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -114,7 +114,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -140,7 +140,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -165,7 +165,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -216,7 +216,7 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -244,7 +244,7 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
station_names_fiveg, setup_profiles,
|
||||
lf_test,
|
||||
lf_test, get_lf_logs,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
@@ -268,7 +268,7 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
@@ -293,7 +293,7 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles,
|
||||
lf_test,
|
||||
update_report, exit_on_fail,
|
||||
|
||||
@@ -46,8 +46,8 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
setup_profiles, lf_test, update_report,
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
setup_profiles, lf_test, update_report,
|
||||
station_names_twog,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -72,8 +72,8 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
lf_test, test_cases, station_names_fiveg,
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, test_cases, station_names_fiveg,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 5G
|
||||
pytest -m "client_connectivity and vlan and general and open and fiveg"
|
||||
@@ -100,7 +100,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
def test_wpa_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
update_report,
|
||||
update_report, get_lf_logs,
|
||||
lf_test, test_cases, station_names_twog):
|
||||
"""Client Connectivity wpa ssid 2.4G
|
||||
pytest -m "client_connectivity and vlan and general and wpa and twog"
|
||||
@@ -126,7 +126,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, update_report, test_cases, station_names_fiveg):
|
||||
"""Client Connectivity wpa ssid 5G
|
||||
pytest -m "client_connectivity and vlan and general and wpa and fiveg"
|
||||
@@ -152,8 +152,8 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
lf_test, update_report, test_cases,
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, update_report, test_cases,
|
||||
station_names_twog):
|
||||
"""Client Connectivity wpa2_personal ssid 2.4G
|
||||
pytest -m "client_connectivity and vlan and general and wpa2_personal and twog"
|
||||
@@ -179,8 +179,8 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
update_report, test_cases,
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
update_report, test_cases,
|
||||
station_names_fiveg,
|
||||
lf_test):
|
||||
"""Client Connectivity wpa2_personal ssid 5G
|
||||
@@ -243,8 +243,8 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
def test_wpa3_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -271,8 +271,8 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
station_names_fiveg, lf_test, test_cases,
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and vlan and general and wpa3_personal and fiveg"
|
||||
@@ -298,8 +298,8 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test, get_lf_logs,
|
||||
update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -326,8 +326,8 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
station_names_fiveg, lf_test,
|
||||
test_cases,
|
||||
station_names_fiveg, lf_test,
|
||||
test_cases, get_lf_logs,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and vlan and general and wpa3_personal_mixed and fiveg"
|
||||
@@ -353,8 +353,8 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test, get_lf_logs,
|
||||
update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -381,8 +381,8 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
station_names_fiveg, lf_test, test_cases,
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and vlan and general and wpa_wpa2_personal_mixed and fiveg"
|
||||
|
||||
0
tests/e2e/interOp/captive_portal/__init__.py
Normal file
0
tests/e2e/interOp/captive_portal/__init__.py
Normal file
@@ -0,0 +1,276 @@
|
||||
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 android_lib import closeApp, set_APconnMobileDevice_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, \
|
||||
get_ip_address_and, verifyUploadDownloadSpeed_android, wifi_connect, wifi_disconnect_and_forget, captive_portal_and
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.captive_portal
|
||||
,pytest.mark.interop_uc_sanity, pytest.mark.bridge]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "captive_open_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "captive_open_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa": [{"ssid_name": "captive_wpa_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive_wpa_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}],
|
||||
"wpa2_personal": [{"ssid_name": "captive_wpa2_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive_wpa2_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}],
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "captive_wpa3_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive_wpa3_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.suite(suite_name="interop sanity")
|
||||
@allure.sub_suite(sub_suite_name="Bridge Mode Captive Portal : Suite-A")
|
||||
@pytest.mark.InteropsuiteA
|
||||
@allure.feature("BRIDGE MODE CAPTIVE PORTAL")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeCaptivePortalSuiteOneBridge(object):
|
||||
""" Captive Portal SuiteA
|
||||
pytest -m "captive portal and bridge and InteropsuiteA"
|
||||
"""
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5178", name="WIFI-5178")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.open
|
||||
def test_Captive_Portal_Open_2g_BRIDGE(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5141", name="WIFI-5141")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.open
|
||||
def test_Captive_Portal_Open_5g_BRIDGE(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5180", name="WIFI-5180")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_Captive_Portal_WPA_2g_Bridge(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5144", name="WIFI-5144")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_Captive_Portal_WPA_5g_Bridge(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5184", name="WIFI-5184")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_Captive_Portal_WPA2_2g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5147", name="WIFI-5147")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_Captive_Portal_WPA2_5g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@@ -0,0 +1,350 @@
|
||||
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,\
|
||||
verifyUploadDownloadSpeediOS, get_ip_address_ios, captive_portal_ios, wifi_connect, wifi_disconnect_and_forget
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios,
|
||||
pytest.mark.captive_portal, pytest.mark.interop_uc_sanity, pytest.mark.bridge]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "captive_open_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "captive_open_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa": [{"ssid_name": "captive_wpa_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive_wpa_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}],
|
||||
"wpa2": [{"ssid_name": "captive_wpa2_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive2_wpa_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}],
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "captive_wpa3_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive_wpa3_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.suite(suite_name="interop sanity")
|
||||
@allure.sub_suite(sub_suite_name="Bridge Mode Captive Portal : Suite-A")
|
||||
@pytest.mark.InteropsuiteA
|
||||
@allure.feature("BRIDGE MODE CAPTIVE PORTAL")
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_general],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
#@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeCaptivePortalSuiteOneBridge(object):
|
||||
""" Captive Portal SuiteA
|
||||
pytest -m "captive portal and bridge and InteropsuiteA"
|
||||
"""
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5179", name="WIFI-5179")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.open
|
||||
def test_Captive_Portal_Open_2g_BRIDGE(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5146", name="WIFI-5146")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.open
|
||||
def test_Captive_Portal_Open_5g_BRIDGE(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5182", name="WIFI-5182")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_Captive_Portal_WPA_2g_Bridge(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5149", name="WIFI-5149")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_Captive_Portal_WPA_5g_Bridge(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5186", name="WIFI-5186")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_Captive_Portal_WPA2_2g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5153", name="WIFI-5153")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_Captive_Portal_WPA2_5g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
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)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5130", name="WIFI-5130")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa3_personal
|
||||
def test_Captive_Portal_WPA3_2g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5140", name="WIFI-5140")
|
||||
@pytest.mark.sg123
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa3_personal
|
||||
def test_Captive_Portal_WPA3_5g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_iOS[1]
|
||||
driver = setup_perfectoMobile_iOS[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@@ -318,6 +318,39 @@ class Fixtures_2x:
|
||||
version_list.append(version)
|
||||
return version_list
|
||||
|
||||
def get_uci_show(self, get_apnos, get_configuration):
|
||||
version_list = []
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(access_point_info)
|
||||
connectivity_data = ap_ssh.run_generic_command(cmd="uci show ucentral.config.server")
|
||||
# connectivity_data.pop(0)
|
||||
# connectivity_data.pop(1)
|
||||
break
|
||||
# version_list.append(connectivity_data)
|
||||
return connectivity_data[1]
|
||||
|
||||
def get_ap_status_logs(self, get_configuration, get_apnos):
|
||||
connected = 0
|
||||
redirector_data = None
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(access_point_info, sdk="2.x")
|
||||
# for i in range(15):
|
||||
connectivity_data = ap_ssh.run_generic_command(cmd="ubus call ucentral status")
|
||||
if "disconnected" in str(connectivity_data):
|
||||
print("AP in disconnected state, sleeping for 30 sec")
|
||||
# time.sleep(30)
|
||||
connected = 0
|
||||
# # if i == 10:
|
||||
# print("rebooting AP")
|
||||
# ap_ssh.reboot()
|
||||
# print("sleep for 300 sec")
|
||||
# time.sleep(300)
|
||||
else:
|
||||
connected = 1
|
||||
|
||||
redirector_data = ap_ssh.run_generic_command(cmd="cat /etc/ucentral/redirector.json")
|
||||
return connected, redirector_data
|
||||
|
||||
def get_sdk_version(self):
|
||||
version = self.controller_obj.get_sdk_version()
|
||||
return version
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
"""
|
||||
Test Case Module: Testing Basic Connectivity with Resources
|
||||
"""
|
||||
import time
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
import requests
|
||||
import json
|
||||
|
||||
pytestmark = [pytest.mark.test_resources, pytest.mark.sanity, pytest.mark.uc_sanity,
|
||||
pytest.mark.sanity_55]
|
||||
@@ -17,26 +19,133 @@ class TestResources(object):
|
||||
@pytest.mark.test_cloud_controller
|
||||
@pytest.mark.uc_sanity
|
||||
@allure.testcase(name="test_controller_connectivity", url="")
|
||||
def test_controller_connectivity(self, setup_controller):
|
||||
def test_controller_connectivity(self, setup_controller, get_configuration):
|
||||
"""Test case to verify cloud Controller Connectivity"""
|
||||
|
||||
login_response_json = setup_controller.login_resp.json()
|
||||
response_code = setup_controller.login_resp.status_code
|
||||
allure.attach(name="Login Response Code", body=str(response_code))
|
||||
allure.attach(name="Login Response JSON",
|
||||
body=str(login_response_json),
|
||||
attachment_type=allure.attachment_type.JSON)
|
||||
version = setup_controller.get_sdk_version()
|
||||
print(version)
|
||||
assert response_code == 200
|
||||
request_url = setup_controller.login_resp.request.url
|
||||
print("Login_Request_URL: ", str(request_url))
|
||||
allure.attach(name="Login_Request_URL: ", body=str(request_url))
|
||||
print("response_code: ", response_code)
|
||||
allure.attach(name="Login Response Code: ", body=str(response_code))
|
||||
print("login_response_json: ", login_response_json)
|
||||
allure.attach(name="Login Response JSON: ", body=str(setup_controller.login_resp.json()))
|
||||
if response_code != 200:
|
||||
pytest.exit(
|
||||
"exiting from pytest, login response is no 200: " + str(setup_controller.login_resp.status_code))
|
||||
|
||||
gw_system_info = setup_controller.get_system_gw()
|
||||
request_url = gw_system_info.request.url
|
||||
allure.attach(name="get_system_gw_request: ", body=str(request_url))
|
||||
gw_system_status = gw_system_info.status_code
|
||||
gw_system_status_json = gw_system_info.json()
|
||||
print("gw_status_check response from gateway: ", gw_system_status)
|
||||
allure.attach(name="gw_status_check response from gateway: ", body=str(gw_system_status) +
|
||||
str(gw_system_status_json))
|
||||
if gw_system_status != 200:
|
||||
allure.attach(name="Login_Request_URL: ", body=str(request_url))
|
||||
pytest.exit("gw_status_check response from gateway: " + str(gw_system_status))
|
||||
|
||||
fms_system_info = setup_controller.get_system_fms()
|
||||
request_url = fms_system_info.request.url
|
||||
allure.attach(name="get_system_fms_request: ", body=str(request_url))
|
||||
fms_system_status = fms_system_info.status_code
|
||||
fms_system_status_json = fms_system_info.json()
|
||||
print("fms_status_check response from fms: ", fms_system_status)
|
||||
allure.attach(name="fms_status_check response from fms:", body=str(fms_system_status) +
|
||||
str(fms_system_status_json))
|
||||
if fms_system_status != 200:
|
||||
pytest.exit("fms_status_check response from fms: " + str(fms_system_status))
|
||||
|
||||
# if gw_status_check != 200:
|
||||
# for i in range(10):
|
||||
# if setup_controller.get_system_gw().status_code != 200 and i < 9:
|
||||
# print("sleeping for 30 sec, gw service is down with response not equals to 200")
|
||||
# time.sleep(30)
|
||||
# elif setup_controller.get_system_gw().status_code != 200 and i == 9:
|
||||
# pytest.exit("GW service is not up yet, exiting from pytest")
|
||||
# else:
|
||||
# break
|
||||
#
|
||||
# if fms_status_check != 200:
|
||||
# for i in range(10):
|
||||
# if setup_controller.get_system_fms().status_code != 200 and i < 9:
|
||||
# print("sleeping for 30 sec, fms service is down with response not equals to 200")
|
||||
# time.sleep(30)
|
||||
# elif setup_controller.get_system_fms().status_code != 200 and i == 9:
|
||||
# pytest.exit("fms service is not up yet, exiting from pytest")
|
||||
# else:
|
||||
# break
|
||||
#
|
||||
# available_device_list = []
|
||||
# devices = setup_controller.get_devices()
|
||||
# number_devices = len(devices["devices"])
|
||||
# for i in range(number_devices):
|
||||
# available_device_list.append(devices["devices"][i]["serialNumber"])
|
||||
# print("available_device_list: ", available_device_list)
|
||||
#
|
||||
# if get_configuration["access_point"][0]["serial"] not in available_device_list:
|
||||
# for i in range(10):
|
||||
# available_device_list = []
|
||||
# devices = setup_controller.get_devices()
|
||||
# number_devices = len(devices["devices"])
|
||||
# for i in range(number_devices):
|
||||
# available_device_list.append(devices["devices"][i]["serialNumber"])
|
||||
# print(available_device_list)
|
||||
#
|
||||
# if get_configuration["access_point"][0]["serial"] not in available_device_list and i < 9:
|
||||
# print("unable to find device on UI, Sleeping for 30 sec")
|
||||
# time.sleep(30)
|
||||
# elif get_configuration["access_point"][0]["serial"] not in available_device_list and i == 9:
|
||||
# pytest.exit("Device" + get_configuration["access_point"][0]["serial"] + "not found on UI")
|
||||
# else:
|
||||
# break
|
||||
#
|
||||
# for ap in get_configuration['access_point']:
|
||||
#
|
||||
# ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")
|
||||
# uci_show_ucentral = ap_ssh.run_generic_command("uci show ucentral")
|
||||
# print(uci_show_ucentral)
|
||||
# print("AP is pointing to: ", ap_ssh.get_ap_uci_show_ucentral())
|
||||
# expected_sdk = str(get_configuration["controller"]['url'].replace("https://sec", "\'gw").replace(":16001","\'"))
|
||||
# if ap_ssh.get_ap_uci_show_ucentral() != expected_sdk:
|
||||
# for i in range(10):
|
||||
# ucentral_show = str(ap_ssh.get_ap_uci_show_ucentral().strip())
|
||||
# print("AP pointing to: ", ucentral_show)
|
||||
# print("AP should point to: ", expected_sdk)
|
||||
#
|
||||
# if ucentral_show != expected_sdk and i < 9:
|
||||
# print("AP is not pointing to right SDK, retry after 30 sec")
|
||||
# time.sleep(30)
|
||||
# elif ucentral_show != expected_sdk and i == 9:
|
||||
# assert False
|
||||
# pytest.exit("AP is not pointing to right SDK")
|
||||
# else:
|
||||
# break
|
||||
|
||||
assert True
|
||||
|
||||
@pytest.mark.test_access_points_connectivity
|
||||
@allure.testcase(name="test_access_points_connectivity", url="")
|
||||
def test_access_points_connectivity(self, test_access_point, fixtures_ver):
|
||||
def test_access_points_connectivity(self, setup_controller, get_uci_show, test_access_point, get_configuration,
|
||||
test_ap_connection_status, fixtures_ver):
|
||||
"""Test case to verify Access Points Connectivity"""
|
||||
data = []
|
||||
for status in test_access_point:
|
||||
data.append(status[0])
|
||||
connection, redirector = test_ap_connection_status
|
||||
allure.attach(name="AP - Cloud connectivity info", body=str(fixtures_ver.ubus_connection))
|
||||
print("test_ap_connection_status: ", connection, redirector)
|
||||
expected_sdk = str(get_configuration["controller"]['url'].replace("https://sec", "\'gw").replace(":16001", "\'"))
|
||||
print("Expected SDK: ", expected_sdk)
|
||||
allure.attach(name="Exoected SDK: ", body=str(expected_sdk))
|
||||
print("SDK On AP: ", str(get_uci_show.split("=")[1]))
|
||||
allure.attach(name="SDK Pointed by AP: ", body=str(get_uci_show.split("=")[1]))
|
||||
if expected_sdk not in get_uci_show:
|
||||
pytest.exit("AP has invalid Redirector")
|
||||
if test_ap_connection_status[0] == 0:
|
||||
pytest.exit("AP in Disconnected State")
|
||||
assert False not in data
|
||||
|
||||
@pytest.mark.traffic_generator_connectivity
|
||||
@@ -135,9 +244,12 @@ class TestFMS(object):
|
||||
assert False not in PASS
|
||||
|
||||
@pytest.mark.firmware_upgrade
|
||||
def test_firmware_upgrade_request(self, firmware_upgrade, get_ap_logs):
|
||||
def test_firmware_upgrade_request(self, firmware_upgrade, get_ap_logs, test_ap_connection_status):
|
||||
for update in firmware_upgrade:
|
||||
allure.attach(name='serial: ' + update[0], body="")
|
||||
if test_ap_connection_status[0] == 0:
|
||||
assert False
|
||||
pytest.exit("AP in Disconnected State")
|
||||
assert True
|
||||
|
||||
@pytest.mark.test_firmware_ap
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/python3.9
|
||||
"""
|
||||
|
||||
lf_tools : Tools for LANforge
|
||||
reboot, run_cmd, etc
|
||||
./lf_tools --host 10.28.3.8 --port 22 --username root --password lanforge --action reboot
|
||||
./lf_tools --host 10.28.3.8 --port 22 --username root --password lanforge --action run_cmd --cmd ls
|
||||
|
||||
"""
|
||||
import argparse
|
||||
import paramiko
|
||||
|
||||
|
||||
class LFTools:
|
||||
|
||||
def __init__(self, host="", port=22, username="root", password="lanforge"):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.username = username
|
||||
self.password = password
|
||||
|
||||
def ssh_cli_connect(self):
|
||||
client = paramiko.SSHClient()
|
||||
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
print("Connecting to LANforge: %s@%s:%s" % (
|
||||
self.username, self.host, self.port))
|
||||
client.connect(self.host, username=self.username, password=self.password,
|
||||
port=self.port, timeout=10, allow_agent=False, banner_timeout=200)
|
||||
|
||||
return client
|
||||
|
||||
def run_cmd(self, cmd):
|
||||
client = self.ssh_cli_connect()
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
output = "Output: " + str(stdout.read())
|
||||
error = "Error: " + str(stderr.read())
|
||||
client.close()
|
||||
return output, error
|
||||
|
||||
def run_action(self, action, cmd):
|
||||
if action == "reboot":
|
||||
output, error = self.run_cmd("reboot")
|
||||
print(output, error)
|
||||
elif action == "run_cmd":
|
||||
output, error = self.run_cmd(cmd)
|
||||
print(output, error)
|
||||
else:
|
||||
print("Invalid Action")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog="lf_utils",
|
||||
formatter_class=argparse.RawTextHelpFormatter,
|
||||
allow_abbrev=True,
|
||||
epilog="About lf_tools.py",
|
||||
description="Tools for LANforge System")
|
||||
parser.add_argument('--host', type=str, help=' --host : IP Address f LANforge System', default="localhost")
|
||||
parser.add_argument('--port', type=int, help='--passwd of dut', default=22)
|
||||
parser.add_argument('--username', type=str, help='--username to use on LANforge', default="root")
|
||||
parser.add_argument('--password', type=str, help='--password to the given username', default="lanforge")
|
||||
parser.add_argument('--action', type=str, help='--action to perform'
|
||||
'reboot | run_cmd', default="run_cmd")
|
||||
parser.add_argument('--cmd', type=str, help='--cmd : used when action is "run_cmd"', default="pwd")
|
||||
args = parser.parse_args()
|
||||
lf_tools = LFTools(host=args.host, port=args.port, username=args.username, password=args.password)
|
||||
lf_tools.run_action(args.action, args.cmd)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
55
tools/scp_util.py
Executable file
55
tools/scp_util.py
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
|
||||
import paramiko
|
||||
from scp import SCPClient
|
||||
|
||||
|
||||
class SCP_File:
|
||||
def __init__(self, ip="localhost", port=22, username="lanforge", password="lanforge", remote_path="/home/lanforge/",
|
||||
local_path="."):
|
||||
self.ip = ip
|
||||
self.port = port
|
||||
self.remote_path = remote_path
|
||||
self.local_path = local_path
|
||||
self.username = username
|
||||
self.password = password
|
||||
|
||||
def pull_file(self):
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.load_system_host_keys()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect(hostname=self.ip, username=self.username, password=self.password, port=self.port, allow_agent=False,
|
||||
look_for_keys=False)
|
||||
# ssh.close()
|
||||
|
||||
with SCPClient(ssh.get_transport()) as scp:
|
||||
scp.get(remote_path=self.remote_path, local_path=self.local_path, recursive=True)
|
||||
scp.close()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog="lf_utils",
|
||||
formatter_class=argparse.RawTextHelpFormatter,
|
||||
allow_abbrev=True,
|
||||
epilog="About lf_tools.py",
|
||||
description="Tools for LANforge System")
|
||||
parser.add_argument('--host', type=str, help=' --host : IP Address f LANforge System', default="localhost")
|
||||
parser.add_argument('--port', type=int, help='--passwd of dut', default=22)
|
||||
parser.add_argument('--username', type=str, help='--username to use on LANforge', default="lanforge")
|
||||
parser.add_argument('--password', type=str, help='--password to use on LANforge', default="lanforge")
|
||||
parser.add_argument('--remote_path', type=str, help='--password to the given username',
|
||||
default="/home/lanforge/lf_kinstall.pl")
|
||||
parser.add_argument('--local_path', type=str, help='--action to perform'
|
||||
'reboot | run_cmd', default=".")
|
||||
args = parser.parse_args()
|
||||
lf_tools = SCP_File(ip=args.host, port=args.port,
|
||||
username=args.username, password=args.password,
|
||||
remote_path=args.remote_path, local_path=args.local_path)
|
||||
lf_tools.pull_file()
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user