mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2026-03-20 03:41:54 +00:00
Merge branch 'staging-wifi-2006' into staging-wifi-2048
This commit is contained in:
30
.github/workflows/cloud-controller-build.yaml
vendored
30
.github/workflows/cloud-controller-build.yaml
vendored
@@ -19,43 +19,23 @@ env:
|
||||
testbeds: '[
|
||||
{
|
||||
"number": "ext-01",
|
||||
"version": "1.0.0-SNAPSHOT-2021-04-06"
|
||||
"version": "1.1.0-SNAPSHOT-2021-04-27"
|
||||
},
|
||||
{
|
||||
"number": "ext-02",
|
||||
"version": "1.0.0-SNAPSHOT-2021-04-06"
|
||||
"version": "1.1.0-SNAPSHOT-2021-04-27"
|
||||
},
|
||||
{
|
||||
"number": "ext-03",
|
||||
"version": "1.0.0-SNAPSHOT-2021-04-06"
|
||||
"version": "1.1.0-RC1"
|
||||
},
|
||||
{
|
||||
"number": "ext-04",
|
||||
"version": "1.0.0-SNAPSHOT-2021-04-06"
|
||||
},
|
||||
{
|
||||
"number": "ext-05",
|
||||
"version": "1.0.0-SNAPSHOT-2021-04-06T"
|
||||
"version": "1.1.0-RC1"
|
||||
},
|
||||
{
|
||||
"number": "01",
|
||||
"version": "1.0.0-SNAPSHOT-2021-04-06"
|
||||
},
|
||||
{
|
||||
"number": "02",
|
||||
"version": "1.0.0-SNAPSHOT-2021-04-06"
|
||||
},
|
||||
{
|
||||
"number": "04",
|
||||
"version": "1.0.0-SNAPSHOT-2021-04-06"
|
||||
},
|
||||
{
|
||||
"number": "05",
|
||||
"version": "1.0.0-SNAPSHOT-2021-04-06"
|
||||
},
|
||||
{
|
||||
"number": "15",
|
||||
"version": "1.0.0-SNAPSHOT-2021-04-06"
|
||||
"version": "1.1.0-RC1"
|
||||
}
|
||||
]'
|
||||
|
||||
|
||||
33
.github/workflows/quali.yml
vendored
Normal file
33
.github/workflows/quali.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Quali example pipeline
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
quali:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build
|
||||
CLOUDSHELL_USER: admin
|
||||
CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install -r .quali/requirements.txt
|
||||
|
||||
- name: Start reservation
|
||||
id: start
|
||||
run: echo ::set-output name=res_id::$(python .quali/start_reservation.py)
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
echo "simulating test execution"
|
||||
sleep 30
|
||||
|
||||
- name: Stop reservation
|
||||
run: python .quali/stop_reservation.py ${{ steps.start.outputs.res_id }}
|
||||
34
.quali/common.py
Normal file
34
.quali/common.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import os
|
||||
import time
|
||||
|
||||
from cloudshell.api.cloudshell_api import CloudShellAPISession
|
||||
|
||||
TIMEOUT=1200
|
||||
|
||||
def get_session() -> CloudShellAPISession:
|
||||
url = os.environ['CLOUDSHELL_URL']
|
||||
user = os.environ['CLOUDSHELL_USER']
|
||||
password = os.environ['CLOUDSHELL_PASSWORD']
|
||||
|
||||
return CloudShellAPISession(url, user, password, "Global")
|
||||
|
||||
def __wait_for_status(session, res_id, field, target_status):
|
||||
timer = 0
|
||||
sleep_time = 5
|
||||
while True:
|
||||
status = session.GetReservationStatus(res_id).ReservationSlimStatus.__dict__[field]
|
||||
|
||||
if status == target_status:
|
||||
break
|
||||
|
||||
if timer >= TIMEOUT:
|
||||
raise RuntimeError(f'waiting for reservation to reach status {target_status} timed out')
|
||||
|
||||
time.sleep(sleep_time)
|
||||
timer += sleep_time
|
||||
|
||||
def wait_for_provisioning_status(session, res_id, target_status):
|
||||
__wait_for_status(session, res_id, 'ProvisioningStatus', target_status)
|
||||
|
||||
def wait_for_reservation_status(session, res_id, target_status):
|
||||
__wait_for_status(session, res_id, 'Status', target_status)
|
||||
1
.quali/requirements.txt
Normal file
1
.quali/requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
cloudshell-automation-api==2021.1.0.181140
|
||||
31
.quali/start_reservation.py
Normal file
31
.quali/start_reservation.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import os
|
||||
|
||||
from cloudshell.api.cloudshell_api import UpdateTopologyGlobalInputsRequest, UpdateTopologyRequirementsInputsRequest
|
||||
|
||||
from common import wait_for_provisioning_status, get_session
|
||||
|
||||
run_id = os.environ.get('GITHUB_RUN_NUMBER', 1)
|
||||
|
||||
def main():
|
||||
session = get_session()
|
||||
|
||||
reservation = session.CreateImmediateTopologyReservation(
|
||||
reservationName=f'sanity-{run_id}',
|
||||
owner=session.username,
|
||||
durationInMinutes=60,
|
||||
topologyFullPath='Basic Lab',
|
||||
globalInputs=[
|
||||
UpdateTopologyGlobalInputsRequest('Cloud Controller Version', '1.1.0-RC1'),
|
||||
],
|
||||
requirementsInputs=[
|
||||
UpdateTopologyRequirementsInputsRequest('Access Point', 'Ap.Wifi type', 'Wifi5', 'Attributes'),
|
||||
UpdateTopologyRequirementsInputsRequest('Access Point', 'Ap.AP Model', 'ECW5410', 'Attributes')
|
||||
]
|
||||
).Reservation
|
||||
|
||||
print(reservation.Id)
|
||||
|
||||
wait_for_provisioning_status(session, reservation.Id, 'Ready')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
12
.quali/stop_reservation.py
Normal file
12
.quali/stop_reservation.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import sys
|
||||
|
||||
from common import wait_for_reservation_status, get_session
|
||||
|
||||
def main():
|
||||
session = get_session()
|
||||
res_id = sys.argv[1]
|
||||
session.EndReservation(res_id)
|
||||
wait_for_reservation_status(session, res_id, 'Completed')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
1
lanforge/lanforge-scripts
Submodule
1
lanforge/lanforge-scripts
Submodule
Submodule lanforge/lanforge-scripts added at de86a454b2
@@ -11,11 +11,15 @@ Currently Having Methods:
|
||||
"""
|
||||
|
||||
import paramiko
|
||||
from scp import SCPClient
|
||||
import os
|
||||
import allure
|
||||
|
||||
|
||||
class APNOS:
|
||||
|
||||
def __init__(self, credentials=None):
|
||||
def __init__(self, credentials=None, pwd=os.getcwd()):
|
||||
allure.attach(name="APNOS LIbrary: ", body=str(credentials))
|
||||
self.owrt_args = "--prompt root@OpenAp -s serial --log stdout --user root --passwd openwifi"
|
||||
if credentials is None:
|
||||
print("No credentials Given")
|
||||
@@ -27,6 +31,28 @@ class APNOS:
|
||||
self.mode = credentials['jumphost'] # 1 for jumphost, 0 for direct ssh
|
||||
if self.mode:
|
||||
self.tty = credentials['jumphost_tty'] # /dev/ttyAP1
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = '[ -f ~/cicd-git/ ] && echo "True" || echo "False"'
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
if str(stdout.read()).__contains__("False"):
|
||||
cmd = 'mkdir ~/cicd-git/'
|
||||
client.exec_command(cmd)
|
||||
cmd = '[ -f ~/cicd-git/openwrt_ctl.py ] && echo "True" || echo "False"'
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
if str(stdout.read()).__contains__("False"):
|
||||
print("Copying openwrt_ctl serial control Script...")
|
||||
with SCPClient(client.get_transport()) as scp:
|
||||
scp.put(pwd + 'openwrt_ctl.py', '~/cicd-git/openwrt_ctl.py') # Copy my_file.txt to the server
|
||||
cmd = '[ -f ~/cicd-git/openwrt_ctl.py ] && echo "True" || echo "False"'
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
var = str(stdout.read())
|
||||
print(var)
|
||||
if var.__contains__("True"):
|
||||
allure.attach(name="openwrt_ctl Setup", body=str(var))
|
||||
print("APNOS Serial Setup OK")
|
||||
else:
|
||||
allure.attach(name="openwrt_ctl Setup", body=str(var))
|
||||
print("APNOS Serial Setup Fail")
|
||||
|
||||
# Method to connect AP-CLI/ JUMPHOST-CLI
|
||||
def ssh_cli_connect(self):
|
||||
@@ -39,16 +65,33 @@ class APNOS:
|
||||
|
||||
return client
|
||||
|
||||
def reboot(self):
|
||||
client = self.ssh_cli_connect()
|
||||
|
||||
cmd = "reboot"
|
||||
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()
|
||||
client.close()
|
||||
allure.attach(name="AP Reboot", body=str(output))
|
||||
return output
|
||||
|
||||
# Method to get the iwinfo status of AP using AP-CLI/ JUMPHOST-CLI
|
||||
def iwinfo_status(self):
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = 'iwinfo'
|
||||
if self.mode:
|
||||
cmd = f"cd /home/lanforge/lanforge-scripts/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
|
||||
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()
|
||||
allure.attach(body=str("VIF Config: " + str(vif_config) + "\n" + "VIF State: " + str(vif_state)),
|
||||
name="SSID Profiles in VIF Config and VIF State: ")
|
||||
client.close()
|
||||
allure.attach(name="iwinfo Output Msg: ", body=str(output))
|
||||
allure.attach(name="iwinfo config Err Msg: ", body=str(stderr))
|
||||
return output
|
||||
|
||||
# Method to get the vif_config of AP using AP-CLI/ JUMPHOST-CLI
|
||||
@@ -56,11 +99,14 @@ class APNOS:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = "/usr/opensync/bin/ovsh s Wifi_VIF_Config -c"
|
||||
if self.mode:
|
||||
cmd = f"cd /home/lanforge/lanforge-scripts/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
|
||||
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()
|
||||
client.close()
|
||||
allure.attach(name="vif config Output Msg: ", body=str(output))
|
||||
allure.attach(name="vif config Err Msg: ", body=str(stderr))
|
||||
|
||||
return output
|
||||
|
||||
# Method to get the vif_state of AP using AP-CLI/ JUMPHOST-CLI
|
||||
@@ -68,11 +114,13 @@ class APNOS:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = "/usr/opensync/bin/ovsh s Wifi_VIF_State -c"
|
||||
if self.mode:
|
||||
cmd = f"cd /home/lanforge/lanforge-scripts/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
|
||||
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()
|
||||
client.close()
|
||||
allure.attach(name="vif state Output Msg: ", body=str(output))
|
||||
allure.attach(name="vif state Err Msg: ", body=str(stderr))
|
||||
return output
|
||||
|
||||
# Method to get the vif_config ssid's of AP using AP-CLI/ JUMPHOST-CLI
|
||||
@@ -83,6 +131,7 @@ class APNOS:
|
||||
ssid = str(i).replace(" ", "").split(".")
|
||||
if ssid[0].split(":")[0] == "b'ssid":
|
||||
ssid_list.append(ssid[0].split(":")[1].replace("'", ""))
|
||||
allure.attach(name="get_vif_config_ssids ", body=str(ssid_list))
|
||||
return ssid_list
|
||||
|
||||
# Method to get the vif_state ssid's of AP using AP-CLI/ JUMPHOST-CLI
|
||||
@@ -93,6 +142,7 @@ class APNOS:
|
||||
ssid = str(i).replace(" ", "").split(".")
|
||||
if ssid[0].split(":")[0] == "b'ssid":
|
||||
ssid_list.append(ssid[0].split(":")[1].replace("'", ""))
|
||||
allure.attach(name="get_vif_state_ssids ", body=str(ssid_list))
|
||||
return ssid_list
|
||||
|
||||
# Method to get the active firmware of AP using AP-CLI/ JUMPHOST-CLI
|
||||
@@ -101,7 +151,7 @@ class APNOS:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = '/usr/opensync/bin/ovsh s AWLAN_Node -c | grep FW_IMAGE_ACTIVE'
|
||||
if self.mode:
|
||||
cmd = f"cd /home/lanforge/lanforge-scripts/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty}" \
|
||||
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty}" \
|
||||
f" --action cmd --value \"{cmd}\" "
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
output = stdout.read()
|
||||
@@ -112,7 +162,9 @@ class APNOS:
|
||||
client.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(name="get_active_firmware - Exception ", body=str(e))
|
||||
cli_active_fw = "Error"
|
||||
allure.attach(name="get_active_firmware ", body=str(cli_active_fw))
|
||||
return cli_active_fw
|
||||
|
||||
# Method to get the manager state of AP using AP-CLI/ JUMPHOST-CLI
|
||||
@@ -121,15 +173,95 @@ class APNOS:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = '/usr/opensync/bin/ovsh s Manager -c | grep status'
|
||||
if self.mode:
|
||||
cmd = f"cd /home/lanforge/lanforge-scripts/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty}" \
|
||||
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty}" \
|
||||
f" --action cmd --value \"{cmd}\" "
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
output = stdout.read()
|
||||
status = str(output.decode('utf-8').splitlines())
|
||||
print(output, stderr.read())
|
||||
# print(output, stderr.read())
|
||||
client.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(name="get_active_firmware - Exception ", body=str(e))
|
||||
status = "Error"
|
||||
allure.attach(name="get_active_firmware ", body=str(status))
|
||||
return status
|
||||
|
||||
def get_serial_number(self):
|
||||
try:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = "node | grep serial_number"
|
||||
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()
|
||||
output = output.decode('utf-8').splitlines()
|
||||
allure.attach(name="get_serial_number output ", body=str(stderr))
|
||||
serial = output[1].replace(" ", "").split("|")[1]
|
||||
client.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(name="get_serial_number - Exception ", body=str(e))
|
||||
serial = "Error"
|
||||
allure.attach(name="get_serial_number ", body=str(serial))
|
||||
return serial
|
||||
|
||||
def get_redirector(self):
|
||||
try:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = "node | grep redirector_addr"
|
||||
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()
|
||||
allure.attach(name="get_redirector output ", body=str(stderr))
|
||||
redirector = status[1].replace(" ", "").split("|")[1]
|
||||
client.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(name="get_redirector - Exception ", body=str(e))
|
||||
redirector = "Error"
|
||||
allure.attach(name="get_redirector ", body=redirector)
|
||||
return redirector
|
||||
|
||||
def run_generic_command(self, cmd=""):
|
||||
allure.attach(name="run_generic_command ", body=cmd)
|
||||
try:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = cmd
|
||||
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)
|
||||
input = stdin.read().decode('utf-8').splitlines()
|
||||
output = stdout.read().decode('utf-8').splitlines()
|
||||
error = stderr.read().decode('utf-8').splitlines()
|
||||
client.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(name="run_generic_command - Exception ", body=str(e))
|
||||
input = "Error"
|
||||
output = "Error"
|
||||
error = "Error"
|
||||
allure.attach(name="run_generic_command ", body=input)
|
||||
allure.attach(name="run_generic_command ", body=str(output))
|
||||
allure.attach(name="run_generic_command ", body=error)
|
||||
return [input, output, error]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
obj = {
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.230",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
|
||||
}
|
||||
var = APNOS(credentials=obj)
|
||||
r = var.get_redirector()
|
||||
print(r)
|
||||
@@ -5,6 +5,7 @@ make sure pexpect is installed:
|
||||
$ sudo yum install python3-pexpect
|
||||
|
||||
You might need to install pexpect-serial using pip:
|
||||
$ pip3 install serial
|
||||
$ pip3 install pexpect-serial
|
||||
|
||||
./openwrt_ctl.py -l stdout -u root -p TIP -s serial --tty ttyUSB0
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
1. controller_data/sdk_base_url
|
||||
2. login credentials
|
||||
"""
|
||||
import base64
|
||||
import datetime
|
||||
import json
|
||||
import re
|
||||
import ssl
|
||||
@@ -14,10 +12,14 @@ import urllib
|
||||
|
||||
import requests
|
||||
import swagger_client
|
||||
from swagger_client import FirmwareManagementApi
|
||||
from swagger_client import EquipmentGatewayApi
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from swagger_client import EquipmentGatewayApi
|
||||
from swagger_client import FirmwareManagementApi
|
||||
import allure
|
||||
|
||||
import threading
|
||||
|
||||
|
||||
class ConfigureController:
|
||||
|
||||
@@ -25,7 +27,8 @@ class ConfigureController:
|
||||
self.configuration = swagger_client.Configuration()
|
||||
|
||||
def set_credentials(self, controller_data=None):
|
||||
if dict(controller_data).keys().__contains__("username") and dict(controller_data).keys().__contains__("password"):
|
||||
if dict(controller_data).keys().__contains__("username") and dict(controller_data).keys().__contains__(
|
||||
"password"):
|
||||
self.configuration.username = "support@example.com"
|
||||
self.configuration.password = "support"
|
||||
print("Login Credentials set to default: \n user_id: %s\n password: %s\n" % ("support@example.com",
|
||||
@@ -74,15 +77,56 @@ class Controller(ConfigureController):
|
||||
if customer_id is None:
|
||||
self.customer_id = 2
|
||||
print("Setting to default Customer ID 2")
|
||||
|
||||
#
|
||||
# Setting the Controller Client Configuration
|
||||
self.select_controller_data(controller_data=controller_data)
|
||||
self.set_credentials(controller_data=controller_data)
|
||||
# self.configuration.refresh_api_key_hook = self.get_bearer_token
|
||||
self.configuration.refresh_api_key_hook = self.get_bearer_token
|
||||
|
||||
# Connecting to Controller
|
||||
self.api_client = swagger_client.ApiClient(self.configuration)
|
||||
self.login_client = swagger_client.LoginApi(api_client=self.api_client)
|
||||
self.bearer = False
|
||||
self.disconnect = False
|
||||
self.semaphore = False
|
||||
try:
|
||||
self.bearer = self.get_bearer_token()
|
||||
# t1 = threading.Thread(target=self.refresh_instance)
|
||||
# t1.start()
|
||||
self.api_client.default_headers['Authorization'] = "Bearer " + self.bearer._access_token
|
||||
self.status_client = swagger_client.StatusApi(api_client=self.api_client)
|
||||
self.equipment_client = swagger_client.EquipmentApi(self.api_client)
|
||||
self.profile_client = swagger_client.ProfileApi(self.api_client)
|
||||
self.api_client.configuration.api_key_prefix = {
|
||||
"Authorization": "Bearer " + self.bearer._access_token
|
||||
}
|
||||
self.api_client.configuration.refresh_api_key_hook = self.refresh_instance
|
||||
except Exception as e:
|
||||
self.bearer = False
|
||||
print(e)
|
||||
|
||||
print("Connected to Controller Server")
|
||||
|
||||
def get_bearer_token(self):
|
||||
request_body = {
|
||||
"userId": self.configuration.username,
|
||||
"password": self.configuration.password
|
||||
}
|
||||
return self.login_client.get_access_token(request_body)
|
||||
|
||||
def refresh_instance(self):
|
||||
# Connecting to Controller
|
||||
# while True:
|
||||
# print("Controller Refresh Thread Started")
|
||||
# for i in range(0, 800):
|
||||
# if self.disconnect:
|
||||
# break
|
||||
# time.sleep(1)
|
||||
# if self.disconnect:
|
||||
# break
|
||||
# self.semaphore = True
|
||||
self.api_client = swagger_client.ApiClient(self.configuration)
|
||||
self.login_client = swagger_client.LoginApi(api_client=self.api_client)
|
||||
self.bearer = self.get_bearer_token()
|
||||
|
||||
self.api_client.default_headers['Authorization'] = "Bearer " + self.bearer._access_token
|
||||
@@ -92,7 +136,7 @@ class Controller(ConfigureController):
|
||||
self.api_client.configuration.api_key_prefix = {
|
||||
"Authorization": "Bearer " + self.bearer._access_token
|
||||
}
|
||||
self.api_client.configuration.refresh_api_key_hook = self.get_bearer_token()
|
||||
self.api_client.configuration.refresh_api_key_hook = self.refresh_instance
|
||||
self.ping_response = self.portal_ping()
|
||||
self.default_profiles = {}
|
||||
# print(self.bearer)
|
||||
@@ -100,18 +144,13 @@ class Controller(ConfigureController):
|
||||
print("Server not Reachable")
|
||||
exit()
|
||||
print("Connected to Controller Server")
|
||||
|
||||
def get_bearer_token(self):
|
||||
request_body = {
|
||||
"userId": self.configuration.username,
|
||||
"password": self.configuration.password
|
||||
}
|
||||
return self.login_client.get_access_token(request_body)
|
||||
# self.semaphore = False
|
||||
|
||||
def portal_ping(self):
|
||||
return self.login_client.portal_ping()
|
||||
|
||||
def disconnect_Controller(self):
|
||||
self.disconnect = True
|
||||
self.api_client.__del__()
|
||||
|
||||
# Returns a List of All the Equipments that are available in the cloud instances
|
||||
@@ -140,8 +179,9 @@ class Controller(ConfigureController):
|
||||
# Get the equipment id, of a equipment with a serial number
|
||||
def get_equipment_id(self, serial_number=None):
|
||||
equipment_data = self.get_equipment_by_customer_id(max_items=100)
|
||||
print(len(equipment_data))
|
||||
|
||||
for equipment in equipment_data:
|
||||
print(equipment._id)
|
||||
if equipment._serial == serial_number:
|
||||
return equipment._id
|
||||
|
||||
@@ -172,9 +212,9 @@ class Controller(ConfigureController):
|
||||
# print(status_data)
|
||||
try:
|
||||
current_ap_fw = status_data[2]['details']['reportedSwVersion']
|
||||
print(current_ap_fw)
|
||||
# print(current_ap_fw)
|
||||
return current_ap_fw
|
||||
except:
|
||||
except Exception as e:
|
||||
current_ap_fw = "error"
|
||||
return False
|
||||
|
||||
@@ -303,6 +343,7 @@ class ProfileUtility:
|
||||
self.default_profiles['radius'] = i
|
||||
if i._name == "TipWlan-rf":
|
||||
self.default_profiles['rf'] = i
|
||||
# print(i)
|
||||
|
||||
# This will delete the Profiles associated with an equipment of givwn equipment_id, and associate it to default
|
||||
# equipment_ap profile
|
||||
@@ -345,7 +386,7 @@ class ProfileUtility:
|
||||
for i in self.default_profiles:
|
||||
skip_delete_id.append(self.default_profiles[i]._id)
|
||||
delete_ids = list(set(delete_ids) - set(delete_ids).intersection(set(skip_delete_id)))
|
||||
print(delete_ids)
|
||||
# print(delete_ids)
|
||||
for i in delete_ids:
|
||||
self.set_equipment_to_profile(profile_id=i)
|
||||
self.delete_profile(profile_id=delete_ids)
|
||||
@@ -379,8 +420,9 @@ class ProfileUtility:
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": 5000
|
||||
}"""
|
||||
equipment_data = self.sdk_client.equipment_client.get_equipment_by_customer_id(customer_id=2,
|
||||
pagination_context=pagination_context)
|
||||
equipment_data = self.sdk_client.equipment_client. \
|
||||
get_equipment_by_customer_id(customer_id=2,
|
||||
pagination_context=pagination_context)
|
||||
self.get_default_profiles()
|
||||
for i in equipment_data._items:
|
||||
if i._profile_id == profile_id:
|
||||
@@ -403,6 +445,9 @@ class ProfileUtility:
|
||||
default_profile._details["rfConfigMap"]["is5GHz"]["rf"] = profile_data["name"]
|
||||
default_profile._details["rfConfigMap"]["is5GHzL"]["rf"] = profile_data["name"]
|
||||
default_profile._details["rfConfigMap"]["is5GHzU"]["rf"] = profile_data["name"]
|
||||
# for i in profile_data['rfConfigMap']:
|
||||
# for j in profile_data['rfConfigMap'][i]:
|
||||
# default_profile._details["rfConfigMap"][i][j] = profile_data['rfConfigMap'][i][j]
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
self.profile_creation_ids['rf'].append(profile._id)
|
||||
return profile
|
||||
@@ -428,21 +473,17 @@ class ProfileUtility:
|
||||
method call: used to create a ssid profile with the given parameters
|
||||
"""
|
||||
|
||||
def create_open_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
# Open
|
||||
def create_open_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'open'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
@@ -450,22 +491,18 @@ class ProfileUtility:
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = "error"
|
||||
|
||||
return profile
|
||||
|
||||
def create_wpa_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
# wpa personal
|
||||
def create_wpa_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
@@ -477,21 +514,18 @@ class ProfileUtility:
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
def create_wpa2_personal_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
# wpa2 personal
|
||||
def create_wpa2_personal_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
@@ -503,43 +537,111 @@ class ProfileUtility:
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
def create_wpa3_personal_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['keyStr'] = profile_data['security_key']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'wpa3OnlyPSK'
|
||||
profile_id = self.profile_client.create_profile(body=default_profile)._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
return True
|
||||
|
||||
def create_wpa2_enterprise_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
# wpa3 personal
|
||||
def create_wpa3_personal_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['keyStr'] = profile_data['security_key']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'wpa3OnlySAE'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# wpa3 personal mixed mode
|
||||
def create_wpa3_personal_mixed_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['keyStr'] = profile_data['security_key']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'wpa3MixedSAE'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# wpa wpa2 personal mixed mode
|
||||
def create_wpa_wpa2_personal_mixed_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['keyStr'] = profile_data['security_key']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'wpa2PSK'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# wpa enterprise
|
||||
def create_wpa_enterprise_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
default_profile._details['secureMode'] = 'wpaRadius'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# wpa wpa2 enterprise mixed mode
|
||||
def create_wpa_wpa2_enterprise_mixed_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
@@ -556,29 +658,75 @@ class ProfileUtility:
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
def create_wpa3_enterprise_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = []
|
||||
if two4g is True:
|
||||
default_profile._details['appliedRadios'].append("is2dot4GHz")
|
||||
if fiveg is True:
|
||||
default_profile._details['appliedRadios'].append("is5GHzU")
|
||||
default_profile._details['appliedRadios'].append("is5GHz")
|
||||
default_profile._details['appliedRadios'].append("is5GHzL")
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['keyStr'] = profile_data['security_key']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'wpa3OnlyRadius'
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
profile_id = self.profile_client.create_profile(body=default_profile)._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
return True
|
||||
# wpa2 enterprise mode ssid profile
|
||||
def create_wpa2_enterprise_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
default_profile._details['secureMode'] = 'wpa2OnlyRadius'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# wpa3 enterprise mode
|
||||
def create_wpa3_enterprise_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
default_profile._details['secureMode'] = 'wpa3OnlyEAP'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# wpa3 enterprise mixed mode
|
||||
def create_wpa3_enterprise_mixed_ssid_profile(self, profile_data=None):
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
default_profile._details['secureMode'] = 'wpa3MixedEAP'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
"""
|
||||
method call: used to create a ap profile that contains the given ssid profiles
|
||||
@@ -617,6 +765,7 @@ class ProfileUtility:
|
||||
return default_profile
|
||||
|
||||
"""
|
||||
|
||||
method to push the profile to the given equipment
|
||||
"""
|
||||
|
||||
@@ -696,33 +845,32 @@ class JFrogUtility:
|
||||
def __init__(self, credentials=None):
|
||||
if credentials is None:
|
||||
exit()
|
||||
self.user = credentials["username"]
|
||||
self.password = credentials["password"]
|
||||
self.jfrog_url = credentials["jfrog-base-url"]
|
||||
self.build = credentials["build"]
|
||||
self.branch = credentials["branch"]
|
||||
ssl._create_default_https_context = ssl._create_unverified_context
|
||||
|
||||
def get_latest_build(self, model=None):
|
||||
def get_build(self, model=None, version=None):
|
||||
jfrog_url = self.jfrog_url + "/" + model + "/" + self.branch + "/"
|
||||
auth = str(
|
||||
base64.b64encode(
|
||||
bytes('%s:%s' % (self.user, self.password), 'utf-8')
|
||||
),
|
||||
'ascii'
|
||||
).strip()
|
||||
headers = {'Authorization': 'Basic ' + auth}
|
||||
|
||||
''' FIND THE LATEST FILE NAME'''
|
||||
print(jfrog_url)
|
||||
req = urllib.request.Request(jfrog_url, headers=headers)
|
||||
req = urllib.request.Request(jfrog_url)
|
||||
response = urllib.request.urlopen(req)
|
||||
# print(response)
|
||||
html = response.read()
|
||||
soup = BeautifulSoup(html, features="html.parser")
|
||||
last_link = soup.find_all('a', href=re.compile(self.build))[-1]
|
||||
latest_file = last_link['href']
|
||||
latest_fw = latest_file.replace('.tar.gz', '')
|
||||
if self.branch == "trunk":
|
||||
self.build = model
|
||||
last_link = soup.find_all('a', href=re.compile(self.build))
|
||||
latest_fw = None
|
||||
for i in last_link:
|
||||
|
||||
if str(i['href']).__contains__(version):
|
||||
latest_fw = i['href']
|
||||
|
||||
latest_fw = latest_fw.replace('.tar.gz', '')
|
||||
print("Using Firmware Image: ", latest_fw)
|
||||
return latest_fw
|
||||
|
||||
|
||||
@@ -737,7 +885,13 @@ class JFrogUtility:
|
||||
|
||||
class FirmwareUtility(JFrogUtility):
|
||||
|
||||
def __init__(self, sdk_client=None, jfrog_credentials=None, controller_data=None, customer_id=None,model=None):
|
||||
def __init__(self,
|
||||
sdk_client=None,
|
||||
jfrog_credentials=None,
|
||||
controller_data=None,
|
||||
customer_id=None,
|
||||
model=None,
|
||||
version=None):
|
||||
super().__init__(credentials=jfrog_credentials)
|
||||
if sdk_client is None:
|
||||
sdk_client = Controller(controller_data=controller_data, customer_id=customer_id)
|
||||
@@ -746,13 +900,17 @@ class FirmwareUtility(JFrogUtility):
|
||||
self.jfrog_client = JFrogUtility(credentials=jfrog_credentials)
|
||||
self.equipment_gateway_client = EquipmentGatewayApi(api_client=sdk_client.api_client)
|
||||
self.model = model
|
||||
self.fw_version = version
|
||||
|
||||
def get_latest_fw_version(self):
|
||||
def get_fw_version(self):
|
||||
# Get The equipment model
|
||||
self.latest_fw = self.get_latest_build(model=self.model)
|
||||
self.latest_fw = self.get_build(model=self.model, version=self.fw_version)
|
||||
# print("shivam", self.latest_fw)
|
||||
return self.latest_fw
|
||||
|
||||
def upload_fw_on_cloud(self, fw_version=None, force_upload=False):
|
||||
print("Upload fw version :", fw_version)
|
||||
# force_upload = True
|
||||
# if fw_latest available and force upload is False -- Don't upload
|
||||
# if fw_latest available and force upload is True -- Upload
|
||||
# if fw_latest is not available -- Upload
|
||||
@@ -774,10 +932,9 @@ class FirmwareUtility(JFrogUtility):
|
||||
"modelId": fw_version.split("-")[0],
|
||||
"versionName": fw_version + ".tar.gz",
|
||||
"description": fw_version + " FW VERSION",
|
||||
"filename": "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/" + fw_version.split("-")[
|
||||
0] + "/dev/" + fw_version + ".tar.gz",
|
||||
"commit": fw_version.split("-")[5]
|
||||
"filename": self.jfrog_url + "/" + self.model + "/" + self.branch + "/" + fw_version + ".tar.gz",
|
||||
}
|
||||
print(firmware_data["filename"])
|
||||
firmware_id = self.firmware_client.create_firmware_version(body=firmware_data)
|
||||
print("Force Upload :", force_upload, " Uploaded the Image")
|
||||
return firmware_id._id
|
||||
@@ -788,22 +945,24 @@ class FirmwareUtility(JFrogUtility):
|
||||
exit()
|
||||
if (force_upgrade is True) or (self.should_upgrade_ap_fw(equipment_id=equipment_id)):
|
||||
model = self.sdk_client.get_model_name(equipment_id=equipment_id).lower()
|
||||
latest_fw = self.get_latest_fw_version()
|
||||
latest_fw = self.get_fw_version()
|
||||
firmware_id = self.upload_fw_on_cloud(fw_version=latest_fw, force_upload=force_upload)
|
||||
time.sleep(5)
|
||||
try:
|
||||
obj = self.equipment_gateway_client.request_firmware_update(equipment_id=equipment_id,
|
||||
firmware_version_id=firmware_id)
|
||||
|
||||
print("Request firmware upgrade Success! waiting for 300 sec")
|
||||
time.sleep(300)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
obj = False
|
||||
return obj
|
||||
# Write the upgrade fw logic here
|
||||
|
||||
def should_upgrade_ap_fw(self, equipment_id=None):
|
||||
current_fw = self.sdk_client.get_ap_firmware_old_method(equipment_id=equipment_id)
|
||||
latest_fw = self.get_latest_fw_version()
|
||||
latest_fw = self.get_fw_version()
|
||||
print(self.model, current_fw, latest_fw)
|
||||
if current_fw == latest_fw:
|
||||
return False
|
||||
@@ -818,8 +977,30 @@ class FirmwareUtility(JFrogUtility):
|
||||
firmware_version_name=fw_version + ".tar.gz")
|
||||
firmware_version = firmware_version._id
|
||||
print("Firmware ID: ", firmware_version)
|
||||
except:
|
||||
except Exception as e:
|
||||
print(e)
|
||||
firmware_version = False
|
||||
print("firmware not available: ", firmware_version)
|
||||
return firmware_version
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
"""
|
||||
Examples to Try Out
|
||||
"""
|
||||
controller = {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': "1.1.0-SNAPSHOT",
|
||||
'commit_date': "2021-04-27"
|
||||
}
|
||||
sdk_client = Controller(controller_data=controller)
|
||||
# Use Library/ Method Here
|
||||
sdk_client.disconnect_Controller()
|
||||
api = Controller(controller_data=controller)
|
||||
profile = ProfileUtility(sdk_client=api)
|
||||
# print(profile.get_profile_by_name(profile_name="basic-ext-03-03-SSID-open-0-VLAN"))
|
||||
profile.get_default_profiles()
|
||||
api.disconnect_Controller()
|
||||
|
||||
|
||||
@@ -2,36 +2,71 @@
|
||||
# Used by Nightly_Sanity
|
||||
# This has different types of old_pytest like Single client connectivity, Single_Client_EAP, testrail_retest
|
||||
#########################################################################################################
|
||||
import sys
|
||||
import os
|
||||
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
os.path.realpath(__file__)
|
||||
)
|
||||
)
|
||||
if "libs" not in sys.path:
|
||||
sys.path.append(f'../libs')
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../../lanforge/lanforge-scripts/{folder}')
|
||||
|
||||
sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
from sta_connect2 import StaConnect2
|
||||
import time
|
||||
# from eap_connect import EAPConnect
|
||||
from test_ipv4_ttls import TTLSTest
|
||||
|
||||
|
||||
class RunTest:
|
||||
|
||||
def __init__(self, lanforge_ip, lanforge_port, lanforge_prefix):
|
||||
self.lanforge_ip = lanforge_ip
|
||||
self.lanforge_port = lanforge_port
|
||||
self.lanforge_prefix = lanforge_prefix
|
||||
def __init__(self, lanforge_data=None, debug=False):
|
||||
self.lanforge_ip = lanforge_data["ip"]
|
||||
self.lanforge_port = lanforge_data["port"]
|
||||
self.twog_radios = lanforge_data["2.4G-Radio"]
|
||||
self.fiveg_radios = lanforge_data["5G-Radio"]
|
||||
self.ax_radios = lanforge_data["AX-Radio"]
|
||||
self.upstream_port = lanforge_data["upstream"]
|
||||
self.twog_prefix = lanforge_data["2.4G-Station-Name"]
|
||||
self.fiveg_prefix = lanforge_data["5G-Station-Name"]
|
||||
self.ax_prefix = lanforge_data["AX-Station-Name"]
|
||||
self.debug = debug
|
||||
self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=debug)
|
||||
|
||||
def Single_Client_Connectivity(self, upstream_port="eth1", radio="wiphy0", ssid="TestAP", passkey="ssid_psk",
|
||||
security="open",
|
||||
station_name="sta0000", test_case=None, rid=None, client=None, logger=None):
|
||||
def Client_Connectivity(self, ssid="[BLANK]", passkey="[BLANK]", security="open", station_name=[],
|
||||
mode="BRIDGE", vlan_id=1, band="twog"):
|
||||
'''SINGLE CLIENT CONNECTIVITY using test_connect2.py'''
|
||||
self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=False)
|
||||
self.staConnect.sta_mode = 0
|
||||
self.staConnect.upstream_resource = 1
|
||||
self.staConnect.upstream_port = upstream_port
|
||||
self.staConnect.radio = radio
|
||||
if mode == "BRIDGE":
|
||||
self.staConnect.upstream_port = self.upstream_port
|
||||
elif mode == "NAT":
|
||||
self.staConnect.upstream_port = self.upstream_port
|
||||
else:
|
||||
self.staConnect.upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
if band == "twog":
|
||||
self.staConnect.radio = self.twog_radios[0]
|
||||
self.staConnect.sta_prefix = self.twog_prefix
|
||||
if band == "fiveg":
|
||||
self.staConnect.radio = self.fiveg_radios[0]
|
||||
self.staConnect.sta_prefix = self.fiveg_prefix
|
||||
self.staConnect.resource = 1
|
||||
self.staConnect.dut_ssid = ssid
|
||||
self.staConnect.dut_passwd = passkey
|
||||
self.staConnect.dut_security = security
|
||||
self.staConnect.station_names = station_name
|
||||
self.staConnect.sta_prefix = self.lanforge_prefix
|
||||
self.staConnect.runtime_secs = 10
|
||||
self.staConnect.runtime_secs = 40
|
||||
self.staConnect.bringup_time_sec = 60
|
||||
self.staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
# self.staConnect.cleanup()
|
||||
self.staConnect.setup()
|
||||
self.staConnect.start()
|
||||
print("napping %f sec" % self.staConnect.runtime_secs)
|
||||
@@ -41,58 +76,75 @@ class RunTest:
|
||||
run_results = self.staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", self.staConnect.passes)
|
||||
if self.staConnect.passes() == True:
|
||||
print("Single client connection to", self.staConnect.dut_ssid, "successful. Test Passed")
|
||||
client.update_testrail(case_id=test_case, run_id=rid, status_id=1, msg='Client connectivity passed')
|
||||
logger.info("Client connectivity to " + self.staConnect.dut_ssid + " Passed")
|
||||
return ("passed")
|
||||
result = True
|
||||
print("Client Connectivity :", self.staConnect.passes)
|
||||
if self.staConnect.passes():
|
||||
print("client connection to", self.staConnect.dut_ssid, "successful. Test Passed")
|
||||
else:
|
||||
client.update_testrail(case_id=test_case, run_id=rid, status_id=5, msg='Client connectivity failed')
|
||||
print("Single client connection to", self.staConnect.dut_ssid, "unsuccessful. Test Failed")
|
||||
logger.warning("Client connectivity to " + self.staConnect.dut_ssid + " FAILED")
|
||||
return ("failed")
|
||||
print("client connection to", self.staConnect.dut_ssid, "unsuccessful. Test Failed")
|
||||
result = False
|
||||
time.sleep(3)
|
||||
return self.staConnect.passes(), result
|
||||
|
||||
def Single_Client_EAP(self, port, sta_list, ssid_name, radio, security, eap_type,
|
||||
identity, ttls_password, test_case, rid, client, logger):
|
||||
eap_connect = EAPConnect(self.lanforge_ip, self.lanforge_port, _debug_on=False)
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = port
|
||||
eap_connect.security = security
|
||||
eap_connect.sta_list = sta_list
|
||||
eap_connect.station_names = sta_list
|
||||
eap_connect.sta_prefix = self.lanforge_prefix
|
||||
eap_connect.ssid = ssid_name
|
||||
eap_connect.radio = radio
|
||||
eap_connect.eap = eap_type
|
||||
eap_connect.identity = identity
|
||||
eap_connect.ttls_passwd = ttls_password
|
||||
eap_connect.runtime_secs = 10
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
eap_connect.stop()
|
||||
eap_connect.cleanup()
|
||||
run_results = eap_connect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", eap_connect.passes)
|
||||
if eap_connect.passes() == True:
|
||||
print("Single client connection to", ssid_name, "successful. Test Passed")
|
||||
client.update_testrail(case_id=test_case, run_id=rid, status_id=1, msg='Client connectivity passed')
|
||||
logger.info("Client connectivity to " + ssid_name + " Passed")
|
||||
return ("passed")
|
||||
def EAP_Connect(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", mode="BRIDGE", band="twog", vlan_id=100,
|
||||
station_name=[], key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="nolastart",
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="nolaradius"):
|
||||
self.eap_connect = TTLSTest(host=self.lanforge_ip, port=self.lanforge_port,
|
||||
sta_list=station_name, vap=False, _debug_on=self.debug)
|
||||
|
||||
self.eap_connect.station_profile.sta_mode = 0
|
||||
self.eap_connect.upstream_resource = 1
|
||||
if mode == "BRIDGE":
|
||||
self.eap_connect.upstream_port = self.upstream_port
|
||||
elif mode == "NAT":
|
||||
self.eap_connect.upstream_port = self.upstream_port
|
||||
else:
|
||||
client.update_testrail(case_id=test_case, run_id=rid, status_id=5, msg='Client connectivity failed')
|
||||
print("Single client connection to", ssid_name, "unsuccessful. Test Failed")
|
||||
logger.warning("Client connectivity to " + ssid_name + " FAILED")
|
||||
return ("failed")
|
||||
self.eap_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
if band == "twog":
|
||||
self.eap_connect.radio = self.twog_radios[0]
|
||||
# self.eap_connect.sta_prefix = self.twog_prefix
|
||||
if band == "fiveg":
|
||||
self.eap_connect.radio = self.fiveg_radios[0]
|
||||
# self.eap_connect.sta_prefix = self.fiveg_prefix
|
||||
# self.eap_connect.resource = 1
|
||||
if eap == "TTLS":
|
||||
self.eap_connect.ieee80211w = 0
|
||||
self.eap_connect.station_profile.set_command_flag("add_sta", "80211u_enable", 0)
|
||||
self.eap_connect.identity = identity
|
||||
self.eap_connect.ttls_passwd = ttls_passwd
|
||||
if eap == "TLS":
|
||||
self.eap_connect.key_mgmt = "WPA-EAP-SUITE-B"
|
||||
self.eap_connect.station_profile.set_command_flag("add_sta", "80211u_enable", 0)
|
||||
self.eap_connect.pairwise = "TKIP"
|
||||
self.eap_connect.group = "TKIP"
|
||||
self.eap_connect.eap = "EAP-TLS"
|
||||
|
||||
def testrail_retest(self, test_case, rid, ssid_name, client, logger):
|
||||
client.update_testrail(case_id=test_case, run_id=rid, status_id=4,
|
||||
msg='Error in Client Connectivity Test. Needs to be Re-run')
|
||||
print("Error in test for single client connection to", ssid_name)
|
||||
logger.warning("ERROR testing Client connectivity to " + ssid_name)
|
||||
# self.eap_connect.hs20_enable = False
|
||||
self.eap_connect.ssid = ssid
|
||||
self.eap_connect.password = passkey
|
||||
self.eap_connect.security = security
|
||||
self.eap_connect.sta_list = station_name
|
||||
self.eap_connect.build()
|
||||
self.eap_connect.start(station_name, True, True)
|
||||
self.eap_connect.stop()
|
||||
self.eap_connect.cleanup(station_name)
|
||||
return self.eap_connect.passes()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
lanforge_data = {
|
||||
"ip": "192.168.200.81",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "eth1",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
obj = RunTest(lanforge_data=lanforge_data, debug=False)
|
||||
# print(obj.eap_connect.json_get("port/1/1/sta0000?fields=ap,ip"))
|
||||
obj.EAP_Connect(station_name=["sta0000", "sta0001"], eap="TTLS", ssid="testing_radius")
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
class Reporting:
|
||||
|
||||
def __init__(self):
|
||||
self.rid = None
|
||||
pass
|
||||
|
||||
def update_testrail(self, case_id=None, run_id=None, status_id=1, msg=None):
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -27,6 +27,7 @@ class APIClient:
|
||||
self.user = tr_user
|
||||
self.password = tr_pw
|
||||
self.project = project
|
||||
self.rid = None
|
||||
if not base_url.endswith('/'):
|
||||
base_url += '/'
|
||||
self.__url = base_url + 'index.php?/api/v2/'
|
||||
@@ -148,9 +149,10 @@ class APIClient:
|
||||
break
|
||||
return run_id
|
||||
|
||||
def update_testrail(self, case_id, run_id, status_id, msg):
|
||||
def update_testrail(self, case_id, status_id, msg):
|
||||
"Update TestRail for a given run_id and case_id"
|
||||
update_flag = False
|
||||
run_id = self.rid
|
||||
# Get the TestRail client account details
|
||||
# Update the result in TestRail using send_post function.
|
||||
# Parameters for add_result_for_case is the combination of runid and case id.
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
|
||||
CONFIGURATION = {
|
||||
"ext-03": {
|
||||
"basic-ext-03-01": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.0.0-SNAPSHOT',
|
||||
'commit_date': '2021-03-01'
|
||||
'version': "1.1.0-SNAPSHOT",
|
||||
'commit_date': "2021-04-27"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode' : "wifi5",
|
||||
'serial': '903cb3944857',
|
||||
'mode': "wifi5",
|
||||
'serial': '903cb3944807',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.80",
|
||||
'ip': "192.168.200.230",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "version"
|
||||
'version': "ecw5410-2021-03-30-pending-9cb289b"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.80",
|
||||
"ip": "localhost",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
@@ -37,13 +36,13 @@ CONFIGURATION = {
|
||||
}
|
||||
}
|
||||
},
|
||||
"ext-04": {
|
||||
"basic-ext-03-02": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.0.0-SNAPSHOT',
|
||||
'commit_date': '2021-03-01'
|
||||
'version': "1.1.0-SNAPSHOT",
|
||||
'commit_date': "2021-04-27"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
@@ -51,18 +50,18 @@ CONFIGURATION = {
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb394486f',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.81",
|
||||
'ip': "192.168.200.233",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "version"
|
||||
'version': "ecw5410-2021-04-26-pending-3fc41fa"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.81",
|
||||
"ip": "192.168.200.233",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
@@ -74,48 +73,47 @@ CONFIGURATION = {
|
||||
}
|
||||
}
|
||||
},
|
||||
"ext-05": {
|
||||
"basic-ext-03-03": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': '1.0.0-SNAPSHOT',
|
||||
'commit_date': '2021-03-01'
|
||||
'version': "1.1.0-SNAPSHOT",
|
||||
'commit_date': "2021-04-27"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb3944817',
|
||||
'serial': '903cb3944857',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.82",
|
||||
'ip': "192.168.200.80",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 8809,
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "version"
|
||||
'version': "ecw5410-2021-04-26-pending-3fc41fa"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.82",
|
||||
"ip": "192.168.200.80",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "eth1",
|
||||
"upstream": "1.1.eth1",
|
||||
"uplink": "1.1.eth2",
|
||||
"upstream_subnet": "192.168.200.1/24",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan1",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
FIRMWARE = {
|
||||
# jFrog parameters
|
||||
"JFROG":
|
||||
@@ -130,7 +128,7 @@ FIRMWARE = {
|
||||
}
|
||||
|
||||
RADIUS_SERVER_DATA = {
|
||||
"ip": "192.168.200.75",
|
||||
"ip": "10.28.3.100",
|
||||
"port": 1812,
|
||||
"secret": "testing123",
|
||||
"user": "nolaradius",
|
||||
|
||||
@@ -3,6 +3,22 @@ import datetime
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import allure
|
||||
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
|
||||
sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
|
||||
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
@@ -11,7 +27,19 @@ sys.path.append(
|
||||
)
|
||||
if "libs" not in sys.path:
|
||||
sys.path.append(f'../libs')
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
|
||||
sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
from apnos.apnos import APNOS
|
||||
from controller.controller import Controller
|
||||
from controller.controller import ProfileUtility
|
||||
@@ -24,7 +52,13 @@ from configuration import CONFIGURATION
|
||||
from configuration import FIRMWARE
|
||||
from testrails.testrail_api import APIClient
|
||||
from testrails.reporting import Reporting
|
||||
<<<<<<< HEAD
|
||||
from cv_test_manager import cv_test
|
||||
=======
|
||||
import sta_connect2
|
||||
from sta_connect2 import StaConnect2
|
||||
|
||||
>>>>>>> staging-wifi-1960
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addini("tr_url", "Test Rail URL")
|
||||
@@ -58,16 +92,10 @@ def pytest_addoption(parser):
|
||||
)
|
||||
# this has to be the last argument
|
||||
# example: --access-points ECW5410 EA8300-EU
|
||||
parser.addoption(
|
||||
"--model",
|
||||
# nargs="+",
|
||||
default="ecw5410",
|
||||
help="AP Model which is needed to test"
|
||||
)
|
||||
parser.addoption(
|
||||
"--testbed",
|
||||
# nargs="+",
|
||||
default="lab-info",
|
||||
default="basic-01",
|
||||
help="AP Model which is needed to test"
|
||||
)
|
||||
parser.addoption(
|
||||
@@ -76,6 +104,41 @@ def pytest_addoption(parser):
|
||||
default=False,
|
||||
help="Stop using Testrails"
|
||||
)
|
||||
parser.addoption(
|
||||
"--exit-on-fail",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="use to stop execution if failure"
|
||||
)
|
||||
|
||||
# Perfecto Parameters
|
||||
parser.addini("perfectoURL", "Cloud URL")
|
||||
parser.addini("securityToken", "Security Token")
|
||||
parser.addini("platformName-iOS", "iOS Platform")
|
||||
parser.addini("platformName-android", "Android Platform")
|
||||
parser.addini("model-iOS", "iOS Devices")
|
||||
parser.addini("model-android", "Android Devices")
|
||||
parser.addini("bundleId-iOS", "iOS Devices")
|
||||
parser.addini("bundleId-iOS-Settings", "iOS Settings App")
|
||||
parser.addini("appPackage-android", "Android Devices")
|
||||
parser.addini("wifi-SSID-5gl-Pwd", "Wifi 5g Password")
|
||||
parser.addini("wifi-SSID-2g-Pwd", "Wifi 2g Password")
|
||||
parser.addini("Default-SSID-5gl-perfecto-b", "Wifi 5g AP Name")
|
||||
parser.addini("Default-SSID-2g-perfecto-b", "Wifi 2g AP Name")
|
||||
parser.addini("Default-SSID-perfecto-b", "Wifi AP Name")
|
||||
parser.addini("bundleId-iOS-Ping", "Ping Bundle ID")
|
||||
parser.addini("browserType-iOS", "Mobile Browser Name")
|
||||
parser.addini("projectName", "Project Name")
|
||||
parser.addini("projectVersion", "Project Version")
|
||||
parser.addini("jobName", "CI Job Name")
|
||||
parser.addini("jobNumber", "CI Job Number")
|
||||
parser.addini("reportTags", "Report Tags")
|
||||
parser.addoption(
|
||||
"--access-points-perfecto",
|
||||
# nargs="+",
|
||||
default=["Perfecto"],
|
||||
help="list of access points to test"
|
||||
)
|
||||
|
||||
|
||||
"""
|
||||
@@ -83,9 +146,22 @@ Test session base fixture
|
||||
"""
|
||||
|
||||
|
||||
# To be depreciated as testrails will go
|
||||
@pytest.fixture(scope="session")
|
||||
def test_cases():
|
||||
yield TEST_CASES
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_jFrog():
|
||||
yield FIRMWARE["JFROG"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def testbed(request):
|
||||
var = request.config.getoption("--testbed")
|
||||
allure.attach(body=str(var),
|
||||
name="Testbed Selected : ")
|
||||
yield var
|
||||
|
||||
|
||||
@@ -99,54 +175,172 @@ def should_upgrade_firmware(request):
|
||||
yield request.config.getoption("--force-upgrade")
|
||||
|
||||
|
||||
"""
|
||||
Instantiate Objects for Test session
|
||||
"""
|
||||
@pytest.fixture(scope="session")
|
||||
def radius_info():
|
||||
allure.attach(body=str(RADIUS_SERVER_DATA), name="Radius server Info: ")
|
||||
yield RADIUS_SERVER_DATA
|
||||
|
||||
|
||||
# Get Configuration data f
|
||||
@pytest.fixture(scope="session")
|
||||
def get_configuration(testbed):
|
||||
allure.attach(body=str(testbed), name="Testbed Selected: ")
|
||||
yield CONFIGURATION[testbed]
|
||||
|
||||
|
||||
# APNOS Library
|
||||
@pytest.fixture(scope="session")
|
||||
def get_apnos():
|
||||
yield APNOS
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_controller(request, testbed):
|
||||
def get_equipment_id(setup_controller, testbed, get_configuration):
|
||||
equipment_id_list = []
|
||||
for i in get_configuration['access_point']:
|
||||
equipment_id_list.append(setup_controller.get_equipment_id(
|
||||
serial_number=i['serial']))
|
||||
yield equipment_id_list
|
||||
|
||||
|
||||
# APNOS SETUP
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_access_point(testbed, get_apnos, get_configuration):
|
||||
# Used to add openwrtctl.py in case of serial console mode
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
if access_point_info["jumphost"]:
|
||||
allure.attach(name="added openwrtctl.py to :",
|
||||
body=access_point_info['ip'] + ":" + str(access_point_info["port"]))
|
||||
get_apnos(access_point_info, pwd="../libs/apnos/")
|
||||
else:
|
||||
allure.attach(name="Direct AP SSH : ",
|
||||
body=access_point_info['ip'] + ":" + str(access_point_info["port"]))
|
||||
# Write a code to verify Access Point Connectivity
|
||||
yield True
|
||||
|
||||
|
||||
# Controller Fixture
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_controller(request, get_configuration, instantiate_access_point):
|
||||
try:
|
||||
sdk_client = Controller(controller_data=CONFIGURATION[testbed]["controller"])
|
||||
def teardown_session():
|
||||
sdk_client = Controller(controller_data=get_configuration["controller"])
|
||||
allure.attach(body=str(get_configuration["controller"]), name="Controller Instantiated: ")
|
||||
|
||||
def teardown_controller():
|
||||
print("\nTest session Completed")
|
||||
allure.attach(body=str(get_configuration["controller"]), name="Controller Teardown: ")
|
||||
sdk_client.disconnect_Controller()
|
||||
|
||||
request.addfinalizer(teardown_session)
|
||||
request.addfinalizer(teardown_controller)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(body=str(e), name="Controller Instantiation Failed: ")
|
||||
sdk_client = False
|
||||
yield sdk_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def instantiate_firmware(setup_controller, instantiate_jFrog, get_configuration):
|
||||
firmware_client_obj = []
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=setup_controller,
|
||||
model=access_point_info["model"],
|
||||
version=access_point_info["version"])
|
||||
firmware_client_obj.append(firmware_client)
|
||||
yield firmware_client_obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def get_latest_firmware(instantiate_firmware):
|
||||
fw_version_list = []
|
||||
try:
|
||||
|
||||
for fw_obj in instantiate_firmware:
|
||||
latest_firmware = fw_obj.get_fw_version()
|
||||
fw_version_list.append(latest_firmware)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
fw_version_list = []
|
||||
|
||||
yield fw_version_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def upload_firmware(should_upload_firmware, instantiate_firmware, get_latest_firmware):
|
||||
firmware_id_list = []
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
firmware_id = instantiate_firmware[i].upload_fw_on_cloud(fw_version=get_latest_firmware[i],
|
||||
force_upload=should_upload_firmware)
|
||||
firmware_id_list.append(firmware_id)
|
||||
yield firmware_id_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware,
|
||||
should_upgrade_firmware):
|
||||
status_list = []
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
if request.config.getoption("--skip-upgrade"):
|
||||
status = "skip-upgrade"
|
||||
status_list.append(status)
|
||||
else:
|
||||
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
status_list.append(status)
|
||||
else:
|
||||
if should_upgrade_firmware:
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
status_list.append(status)
|
||||
else:
|
||||
status = "skip-upgrade Version Already Available"
|
||||
status_list.append(status)
|
||||
yield status_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def check_ap_firmware_cloud(setup_controller, get_equipment_id):
|
||||
ap_fw_list = []
|
||||
for i in get_equipment_id:
|
||||
ap_fw_list.append(setup_controller.get_ap_firmware_old_method(equipment_id=i))
|
||||
yield ap_fw_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def check_ap_firmware_ssh(get_configuration):
|
||||
active_fw_list = []
|
||||
try:
|
||||
for access_point in get_configuration['access_point']:
|
||||
ap_ssh = APNOS(access_point)
|
||||
active_fw = ap_ssh.get_active_firmware()
|
||||
active_fw_list.append(active_fw)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
active_fw_list = []
|
||||
yield active_fw_list
|
||||
|
||||
|
||||
"""
|
||||
Instantiate Reporting
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_testrail(request):
|
||||
def update_report(request, testbed, get_configuration):
|
||||
if request.config.getoption("--skip-testrail"):
|
||||
tr_client = Reporting()
|
||||
else:
|
||||
tr_client = APIClient(request.config.getini("tr_url"), request.config.getini("tr_user"),
|
||||
request.config.getini("tr_pass"), request.config.getini("tr_project_id"))
|
||||
yield tr_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_firmware(instantiate_controller, instantiate_jFrog, testbed):
|
||||
firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_controller, model=CONFIGURATION[testbed]["access_point"][0]["model"])
|
||||
yield firmware_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_jFrog():
|
||||
yield FIRMWARE["JFROG"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_project(request, instantiate_testrail, testbed, get_latest_firmware):
|
||||
if request.config.getoption("--skip-testrail"):
|
||||
rid = "skip testrails"
|
||||
tr_client.rid = "skip testrails"
|
||||
else:
|
||||
projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
projId = tr_client.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
test_run_name = request.config.getini("tr_prefix") + testbed + "_" + str(
|
||||
<<<<<<< HEAD
|
||||
datetime.date.today()) + "_" + get_latest_firmware
|
||||
instantiate_testrail.create_testrun(name=test_run_name, case_ids=list(TEST_CASES.values()), project_id=projId,
|
||||
milestone_id=request.config.getini("milestone"),
|
||||
@@ -156,8 +350,28 @@ def instantiate_project(request, instantiate_testrail, testbed, get_latest_firmw
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_lanforge():
|
||||
yield True
|
||||
def check_lanforge_connectivity(testbed):
|
||||
lanforge_ip = CONFIGURATION[testbed]['traffic_generator']['details']['ip']
|
||||
lanforge_port = CONFIGURATION[testbed]['traffic_generator']['details']['port']
|
||||
|
||||
try:
|
||||
cv = cv_test(lanforge_ip,lanforge_port)
|
||||
url_data = cv.get_ports("/")
|
||||
lanforge_GUI_version = url_data["VersionInfo"]["BuildVersion"]
|
||||
lanforge_gui_git_version = url_data["VersionInfo"]["GitVersion"]
|
||||
lanforge_gui_build_date = url_data["VersionInfo"]["BuildDate"]
|
||||
print(lanforge_GUI_version,lanforge_gui_build_date,lanforge_gui_git_version)
|
||||
if not (lanforge_GUI_version or lanforge_gui_build_date or lanforge_gui_git_version):
|
||||
yield False
|
||||
else:
|
||||
yield True
|
||||
except:
|
||||
yield False
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def exit_on_fail(request):
|
||||
yield request.config.getoption("--exit-on-fail")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@@ -170,49 +384,64 @@ def test_cases():
|
||||
yield TEST_CASES
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def test_access_point(testbed):
|
||||
ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0])
|
||||
status = ap_ssh.get_manager_state()
|
||||
if "ACTIVE" not in status:
|
||||
time.sleep(30)
|
||||
ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0])
|
||||
status = ap_ssh.get_manager_state()
|
||||
yield status
|
||||
@pytest.fixture(scope="session")
|
||||
def apnos_obj(get_configuration, testbed):
|
||||
yield APNOS(get_configuration[testbed]['access_point'][0])
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_profile_data(testbed):
|
||||
model = CONFIGURATION[testbed]["access_point"][0]["model"]
|
||||
profile_data = {}
|
||||
for mode in "BRIDGE", "NAT", "VLAN":
|
||||
profile_data[mode] = {}
|
||||
for security in "OPEN", "WPA", "WPA2_P", "WPA2_E", "WEP":
|
||||
profile_data[mode][security] = {}
|
||||
for radio in "2G", "5G":
|
||||
profile_data[mode][security][radio] = {}
|
||||
name_string = f"{'Sanity'}-{model}-{radio}_{security}_{mode}"
|
||||
passkey_string = f"{radio}-{security}_{mode}"
|
||||
profile_data[mode][security][radio]["profile_name"] = name_string
|
||||
profile_data[mode][security][radio]["ssid_name"] = name_string
|
||||
if mode == "VLAN":
|
||||
profile_data[mode][security][radio]["vlan"] = 100
|
||||
else:
|
||||
profile_data[mode][security][radio]["vlan"] = 1
|
||||
if mode != "NAT":
|
||||
profile_data[mode][security][radio]["mode"] = "BRIDGE"
|
||||
else:
|
||||
profile_data[mode][security][radio]["mode"] = "NAT"
|
||||
if security != "OPEN":
|
||||
profile_data[mode][security][radio]["security_key"] = passkey_string
|
||||
else:
|
||||
profile_data[mode][security][radio]["security_key"] = "[BLANK]"
|
||||
yield profile_data
|
||||
def instantiate_access_point(testbed):
|
||||
APNOS(CONFIGURATION[testbed]['access_point'][0], pwd="../libs/apnos/")
|
||||
yield True
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def access_point_connectivity(apnos_obj, get_configuration, testbed):
|
||||
ap_conn = {}
|
||||
config_serial = get_configuration[testbed]['access_point'][0]['serial']
|
||||
ap_serial = apnos_obj.get_serial_number()
|
||||
ap_conn["serial"] = True
|
||||
if ap_serial != config_serial:
|
||||
ap_conn["serial"] = False
|
||||
|
||||
ap_conn["redir"] = False
|
||||
ap_redir = apnos_obj.get_redirector()
|
||||
|
||||
# Compare with something ...
|
||||
|
||||
ap_conn["mgr"] = False
|
||||
status = apnos_obj.get_manager_state()
|
||||
if "ACTIVE" not in status:
|
||||
apnos_obj.run_generic_command(cmd="service opensync restart")
|
||||
time.sleep(30)
|
||||
status = apnos_obj.get_manager_state()
|
||||
if "ACTIVE" in status:
|
||||
ap_conn["mgr"] = True
|
||||
else:
|
||||
ap_conn["mgr"] = True
|
||||
yield ap_conn
|
||||
=======
|
||||
datetime.date.today()) + "_" + get_configuration['access_point'][0]['version']
|
||||
tr_client.create_testrun(name=test_run_name, case_ids=list(TEST_CASES.values()), project_id=projId,
|
||||
milestone_id=request.config.getini("milestone"),
|
||||
description="Automated Nightly Sanity test run for new firmware build")
|
||||
rid = tr_client.get_run_id(test_run_name=test_run_name)
|
||||
tr_client.rid = rid
|
||||
yield tr_client
|
||||
|
||||
>>>>>>> staging-wifi-1960
|
||||
|
||||
"""
|
||||
FRAMEWORK MARKER LOGIC
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_security_flags():
|
||||
security = ["open", "wpa", "wpa2_personal", "wpa2_enterprise", "twog", "fiveg", "radius"]
|
||||
# Add more classifications as we go
|
||||
security = ["open", "wpa", "wpa2_personal", "wpa3_personal", "wpa3_personal_mixed",
|
||||
"wpa2_enterprise", "wpa3_enterprise", "twog", "fiveg", "radius"]
|
||||
yield security
|
||||
|
||||
|
||||
@@ -232,30 +461,57 @@ def get_markers(request, get_security_flags):
|
||||
else:
|
||||
security_dict[i] = False
|
||||
# print(security_dict)
|
||||
allure.attach(body=str(security_dict), name="Test Cases Requires: ")
|
||||
yield security_dict
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_latest_firmware(instantiate_firmware):
|
||||
# try:
|
||||
latest_firmware = instantiate_firmware.get_latest_fw_version()
|
||||
# except:
|
||||
# latest_firmware = False
|
||||
yield latest_firmware
|
||||
|
||||
|
||||
# Will be availabe as a test case
|
||||
@pytest.fixture(scope="function")
|
||||
def check_ap_firmware_ssh(testbed):
|
||||
try:
|
||||
ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0])
|
||||
active_fw = ap_ssh.get_active_firmware()
|
||||
print(active_fw)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
active_fw = False
|
||||
yield active_fw
|
||||
def test_access_point(testbed, get_apnos, get_configuration):
|
||||
mgr_status = []
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(access_point_info)
|
||||
ap_ssh.reboot()
|
||||
time.sleep(100)
|
||||
status = ap_ssh.get_manager_state()
|
||||
if "ACTIVE" not in status:
|
||||
time.sleep(30)
|
||||
ap_ssh = APNOS(access_point_info)
|
||||
status = ap_ssh.get_manager_state()
|
||||
mgr_status.append(status)
|
||||
yield mgr_status
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def client_connectivity():
|
||||
yield StaConnect2
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
<<<<<<< HEAD
|
||||
def radius_info():
|
||||
yield RADIUS_SERVER_DATA
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_configuration(testbed):
|
||||
yield CONFIGURATION[testbed]
|
||||
=======
|
||||
def get_lanforge_data(get_configuration):
|
||||
lanforge_data = {}
|
||||
if get_configuration['traffic_generator']['name'] == 'lanforge':
|
||||
lanforge_data = {
|
||||
"lanforge_ip": get_configuration['traffic_generator']['details']['ip'],
|
||||
"lanforge-port-number": get_configuration['traffic_generator']['details']['port'],
|
||||
"lanforge_2dot4g": get_configuration['traffic_generator']['details']['2.4G-Radio'][0],
|
||||
"lanforge_5g": get_configuration['traffic_generator']['details']['5G-Radio'][0],
|
||||
"lanforge_2dot4g_prefix": get_configuration['traffic_generator']['details']['2.4G-Station-Name'],
|
||||
"lanforge_5g_prefix": get_configuration['traffic_generator']['details']['5G-Station-Name'],
|
||||
"lanforge_2dot4g_station": get_configuration['traffic_generator']['details']['2.4G-Station-Name'],
|
||||
"lanforge_5g_station": get_configuration['traffic_generator']['details']['5G-Station-Name'],
|
||||
"lanforge_bridge_port": get_configuration['traffic_generator']['details']['upstream'],
|
||||
"lanforge_vlan_port": get_configuration['traffic_generator']['details']['upstream'] + ".100",
|
||||
"vlan": 100
|
||||
}
|
||||
yield lanforge_data
|
||||
>>>>>>> staging-wifi-1960
|
||||
|
||||
@@ -30,7 +30,7 @@ import pytest
|
||||
pytestmark = [pytest.mark.test_featureA, pytest.mark.bridge]
|
||||
|
||||
|
||||
@pytest.mark.wifi_capacity_test
|
||||
@pytest.mark.test_featureA
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.parametrize(
|
||||
@@ -53,7 +53,7 @@ class TestFeatureABridge(object):
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_2g"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
# Write Your test case Here
|
||||
PASS = True
|
||||
assert PASS
|
||||
@@ -84,7 +84,7 @@ class TestFeatureABridge(object):
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_2g"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
# Write Your test case Here
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
@@ -1,10 +1,45 @@
|
||||
|
||||
"""
|
||||
Test Case Module: setup test cases for basic test cases
|
||||
Details: Firmware Upgrade
|
||||
|
||||
"""
|
||||
import pytest
|
||||
import time
|
||||
|
||||
@pytest.mark.configure_lanforge
|
||||
def test_configure_lanforge(configure_lanforge):
|
||||
|
||||
assert True
|
||||
|
||||
|
||||
@pytest.mark.lanforge_scenario_setup_dut
|
||||
def test_lanforge_scenario_setup_dut(create_lanforge_chamberview_dut):
|
||||
print(create_lanforge_chamberview_dut)
|
||||
ssid = [
|
||||
['ssid_idx=0 ssid=Default-SSID-2g password=12345678 bssid=90:3c:b3:94:48:58'],
|
||||
['ssid_idx=1 ssid=Default-SSID-5gl password=12345678 bssid=90:3c:b3:94:48:59']
|
||||
]
|
||||
|
||||
create_lanforge_chamberview_dut.ssid = ssid
|
||||
create_lanforge_chamberview_dut.setup()
|
||||
create_lanforge_chamberview_dut.add_ssids()
|
||||
create_lanforge_chamberview_dut.cv_test.show_text_blob(None, None, True) # Show changes on GUI
|
||||
create_lanforge_chamberview_dut.cv_test.sync_cv()
|
||||
time.sleep(2)
|
||||
create_lanforge_chamberview_dut.cv_test.show_text_blob(None, None, True) # Show changes on GUI
|
||||
create_lanforge_chamberview_dut.cv_test.sync_cv()
|
||||
|
||||
assert True
|
||||
|
||||
@pytest.mark.lanforge_scenario_setup
|
||||
def test_lanforge_scenario_setup(create_lanforge_chamberview):
|
||||
# raw_line = [
|
||||
# ["profile_link 1.1 vlan-100 1 NA NA eth2,AUTO -1 100"]
|
||||
# ]
|
||||
# print(create_lanforge_chamberview.setup_scenario(create_scenario="TIP-test",raw_line=raw_line))
|
||||
# create_lanforge_chamberview.build_scenario("TIP-test")
|
||||
assert True
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.bridge
|
||||
@@ -74,3 +109,87 @@ def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_tes
|
||||
msg='Cannot reach AP after upgrade to check CLI - re-test required')
|
||||
|
||||
assert check_ap_firmware_ssh == get_latest_firmware
|
||||
|
||||
|
||||
# """
|
||||
# Test Case Module: setup test cases for basic test cases
|
||||
# Details: Firmware Upgrade
|
||||
#
|
||||
# """
|
||||
# import pytest
|
||||
#
|
||||
# @pytest.mark.configure_lanforge
|
||||
# def test_configure_lanforge(configure_lanforge):
|
||||
#
|
||||
# assert True
|
||||
#
|
||||
#
|
||||
# @pytest.mark.sanity
|
||||
# @pytest.mark.bridge
|
||||
# @pytest.mark.nat
|
||||
# @pytest.mark.vlan
|
||||
# @pytest.mark.firmware
|
||||
# class TestFirmware(object):
|
||||
#
|
||||
# @pytest.mark.firmware_create
|
||||
# def test_firmware_create(self, upload_firmware, instantiate_testrail, instantiate_project, test_cases):
|
||||
# if upload_firmware != 0:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='Create new FW version by API successful')
|
||||
# PASS = True
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
|
||||
# status_id=5,
|
||||
# msg='Error creating new FW version by API')
|
||||
# PASS = False
|
||||
# assert PASS
|
||||
#
|
||||
# @pytest.mark.firmware_upgrade
|
||||
# def test_firmware_upgrade_request(self, upgrade_firmware, instantiate_testrail, instantiate_project, test_cases):
|
||||
# print()
|
||||
# if not upgrade_firmware:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
|
||||
# status_id=0,
|
||||
# msg='Error requesting upgrade via API')
|
||||
# PASS = False
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='Upgrade request using API successful')
|
||||
# PASS = True
|
||||
# assert PASS
|
||||
#
|
||||
# @pytest.mark.check_active_firmware_cloud
|
||||
# def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, instantiate_testrail,
|
||||
# instantiate_project, test_cases):
|
||||
# if get_latest_firmware != check_ap_firmware_cloud:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
|
||||
# status_id=5,
|
||||
# msg='CLOUDSDK reporting incorrect firmware version.')
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='CLOUDSDK reporting correct firmware version.')
|
||||
#
|
||||
# assert get_latest_firmware == check_ap_firmware_cloud
|
||||
#
|
||||
#
|
||||
# @pytest.mark.sanity
|
||||
# @pytest.mark.bridge
|
||||
# @pytest.mark.nat
|
||||
# @pytest.mark.vlan
|
||||
# @pytest.mark.check_active_firmware_ap
|
||||
# def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_testrail, instantiate_project,
|
||||
# test_cases):
|
||||
# if check_ap_firmware_ssh == get_latest_firmware:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='Upgrade to ' + get_latest_firmware + ' successful')
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
|
||||
# status_id=4,
|
||||
# msg='Cannot reach AP after upgrade to check CLI - re-test required')
|
||||
#
|
||||
# assert check_ap_firmware_ssh == get_latest_firmware
|
||||
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
"""
|
||||
Test Case Module: setup test cases for bridge mode sanity
|
||||
Details: bridge mode setup
|
||||
|
||||
"""
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.setup_bridge
|
||||
@pytest.mark.bridge
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["BRIDGE"], ["BRIDGE"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestSetupBridge:
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases):
|
||||
if create_profiles['ssid_2g_wpa_bridge']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_2g_wpa_bridge']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases):
|
||||
|
||||
if create_profiles['ssid_5g_wpa_bridge']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_5g_wpa_bridge']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_2g_wpa2_bridge']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_2g_wpa2_bridge']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_5g_wpa2_bridge']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_5g_wpa2_bridge']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.radius
|
||||
def test_setup_radius_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases):
|
||||
|
||||
if create_profiles['radius_profile']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['radius_profile']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_2g_eap_bridge']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_2g_eap_bridge']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_5g_eap_bridge']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_5g_eap_bridge']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ap_bridge']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ap_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ap_bridge']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ap_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['bridge_vifc']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["bridge_vifc"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['bridge_vifc']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["bridge_vifc"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
if setup_profiles['bridge_vifs']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["bridge_vifs"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['bridge_vifs']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["bridge_vifs"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
@@ -1,171 +0,0 @@
|
||||
"""
|
||||
Test Case Module: setup test cases for nat mode sanity
|
||||
Details: nat mode setup
|
||||
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.setup_nat
|
||||
@pytest.mark.nat
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["NAT"], ["NAT"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestSetupnat:
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases):
|
||||
if create_profiles['ssid_2g_wpa_nat']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_2g_wpa_nat']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases):
|
||||
|
||||
if create_profiles['ssid_5g_wpa_nat']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_5g_wpa_nat']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_2g_wpa2_nat']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_2g_wpa2_nat']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_5g_wpa2_nat']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_5g_wpa2_nat']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.radius
|
||||
def test_setup_radius_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases):
|
||||
|
||||
if create_profiles['radius_profile']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['radius_profile']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_2g_eap_nat']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_2g_eap_nat']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_5g_eap_nat']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_5g_eap_nat']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ap_nat']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ap_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ap_nat']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ap_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['nat_vifc']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["nat_vifc"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['nat_vifc']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["nat_vifc"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
if setup_profiles['nat_vifs']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["nat_vifs"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['nat_vifs']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["nat_vifs"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
@@ -1,172 +0,0 @@
|
||||
"""
|
||||
Test Case Module: setup test cases for vlan mode sanity
|
||||
Details: vlan mode setup
|
||||
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.setup_vlan
|
||||
@pytest.mark.vlan
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["VLAN"], ["VLAN"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestSetupvlan:
|
||||
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases):
|
||||
if create_profiles['ssid_2g_wpa_vlan']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_2g_wpa_vlan']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases):
|
||||
|
||||
if create_profiles['ssid_5g_wpa_vlan']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_5g_wpa_vlan']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_2g_wpa2_vlan']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_2g_wpa2_vlan']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_5g_wpa2_vlan']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_5g_wpa2_vlan']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.radius
|
||||
def test_setup_radius_profile(self, create_profiles, instantiate_testrail, instantiate_project, test_cases):
|
||||
|
||||
if create_profiles['radius_profile']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['radius_profile']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["radius_profile"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_2g_eap_vlan']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_2g_eap_vlan']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_2g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ssid_5g_eap_vlan']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ssid_5g_eap_vlan']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ssid_5g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, create_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if create_profiles['ap_vlan']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ap_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert create_profiles['ap_vlan']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ap_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vlan_vifc']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["vlan_vifc"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vlan_vifc']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["vlan_vifc"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
if setup_profiles['vlan_vifs']:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["vlan_vifs"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vlan_vifs']
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["vlan_vifs"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
@@ -48,7 +48,7 @@ class TestBridgeModeClientConnectivity(object):
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_project, test_cases):
|
||||
instantiate_controller, instantiate_project, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -66,7 +66,7 @@ class TestBridgeModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -74,6 +74,8 @@ class TestBridgeModeClientConnectivity(object):
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
if exit_on_fail and staConnect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
@@ -84,18 +86,20 @@ class TestBridgeModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode')
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode')
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2420
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, test_cases):
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -112,7 +116,7 @@ class TestBridgeModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -120,6 +124,8 @@ class TestBridgeModeClientConnectivity(object):
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
if exit_on_fail and staConnect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
@@ -130,18 +136,20 @@ class TestBridgeModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - bridge mode')
|
||||
msg='5G WPA Client Connectivity Passed successfully - bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - bridge mode')
|
||||
msg='5G WPA Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2419
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, test_cases):
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -158,7 +166,7 @@ class TestBridgeModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -166,6 +174,8 @@ class TestBridgeModeClientConnectivity(object):
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
if exit_on_fail and staConnect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
@@ -176,18 +186,20 @@ class TestBridgeModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - bridge mode')
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA2 Client Connectivity Failed - bridge mode')
|
||||
msg='2G WPA2 Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2237
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, test_cases):
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -204,7 +216,7 @@ class TestBridgeModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -212,6 +224,8 @@ class TestBridgeModeClientConnectivity(object):
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
if exit_on_fail and staConnect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
@@ -222,11 +236,12 @@ class TestBridgeModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - bridge mode')
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 Client Connectivity Failed - bridge mode')
|
||||
msg='5G WPA2 Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2236
|
||||
|
||||
@@ -234,7 +249,7 @@ class TestBridgeModeClientConnectivity(object):
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, radius_info, test_cases):
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_E"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -251,15 +266,16 @@ class TestBridgeModeClientConnectivity(object):
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 10
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
if exit_on_fail and eap_connect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
eap_connect.stop()
|
||||
try:
|
||||
eap_connect.cleanup()
|
||||
eap_connect.cleanup()
|
||||
except:
|
||||
pass
|
||||
run_results = eap_connect.get_result_list()
|
||||
@@ -271,11 +287,12 @@ class TestBridgeModeClientConnectivity(object):
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'bridge mode')
|
||||
'bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - bridge mode')
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
# C5214
|
||||
|
||||
@@ -283,7 +300,7 @@ class TestBridgeModeClientConnectivity(object):
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, radius_info, test_cases):
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_E"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -300,14 +317,16 @@ class TestBridgeModeClientConnectivity(object):
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 10
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
if exit_on_fail and eap_connect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
eap_connect.stop()
|
||||
try:
|
||||
eap_connect.cleanup()
|
||||
|
||||
eap_connect.cleanup()
|
||||
except:
|
||||
pass
|
||||
@@ -320,11 +339,13 @@ class TestBridgeModeClientConnectivity(object):
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'bridge mode')
|
||||
'bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - bridge mode')
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
|
||||
@pytest.mark.modify_ssid
|
||||
@@ -334,7 +355,7 @@ class TestBridgeModeClientConnectivity(object):
|
||||
indirect=True
|
||||
)
|
||||
def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_project, test_cases):
|
||||
instantiate_project, test_cases, instantiate_controller, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -351,7 +372,7 @@ class TestBridgeModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -359,6 +380,8 @@ class TestBridgeModeClientConnectivity(object):
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
if exit_on_fail and staConnect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
@@ -370,9 +393,11 @@ class TestBridgeModeClientConnectivity(object):
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["bridge_ssid_update"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - bridge mode '
|
||||
'updated ssid')
|
||||
'updated ssid' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["bridge_ssid_update"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - bridge mode updated ssid')
|
||||
msg='5G WPA Client Connectivity Failed - bridge mode updated ssid' + str(run_results))
|
||||
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
|
||||
@@ -47,7 +47,7 @@ class TestNatModeClientConnectivity(object):
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_project, test_cases):
|
||||
instantiate_controller, instantiate_project, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -65,7 +65,7 @@ class TestNatModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -83,18 +83,21 @@ class TestNatModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - nat mode')
|
||||
msg='2G WPA Client Connectivity Passed successfully - nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - nat mode')
|
||||
msg='2G WPA Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2420
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, test_cases):
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -111,7 +114,7 @@ class TestNatModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -129,18 +132,21 @@ class TestNatModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - nat mode')
|
||||
msg='5G WPA Client Connectivity Passed successfully - nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - nat mode')
|
||||
msg='5G WPA Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2419
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, test_cases):
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -157,7 +163,7 @@ class TestNatModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -175,18 +181,21 @@ class TestNatModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - nat mode')
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA2 Client Connectivity Failed - nat mode')
|
||||
msg='2G WPA2 Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2237
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, test_cases):
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -203,7 +212,7 @@ class TestNatModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -221,11 +230,14 @@ class TestNatModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - nat mode')
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 Client Connectivity Failed - nat mode')
|
||||
msg='5G WPA2 Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2236
|
||||
|
||||
@@ -233,7 +245,7 @@ class TestNatModeClientConnectivity(object):
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, radius_info, test_cases):
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_E"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -250,7 +262,7 @@ class TestNatModeClientConnectivity(object):
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 10
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
@@ -270,11 +282,14 @@ class TestNatModeClientConnectivity(object):
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'nat mode')
|
||||
'nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - nat mode')
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
# C5214
|
||||
|
||||
@@ -282,7 +297,7 @@ class TestNatModeClientConnectivity(object):
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, radius_info, test_cases):
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_E"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -299,7 +314,7 @@ class TestNatModeClientConnectivity(object):
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 10
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
@@ -319,11 +334,14 @@ class TestNatModeClientConnectivity(object):
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'nat mode')
|
||||
'nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - nat mode')
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
|
||||
@pytest.mark.modify_ssid
|
||||
@@ -333,7 +351,7 @@ class TestNatModeClientConnectivity(object):
|
||||
indirect=True
|
||||
)
|
||||
def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_project, test_cases):
|
||||
instantiate_project, test_cases, instantiate_controller, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -350,7 +368,7 @@ class TestNatModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -369,9 +387,12 @@ class TestNatModeClientConnectivity(object):
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["nat_ssid_update"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - nat mode '
|
||||
'updated ssid')
|
||||
'updated ssid' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["nat_ssid_update"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - nat mode updated ssid')
|
||||
msg='5G WPA Client Connectivity Failed - nat mode updated ssid' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
|
||||
@@ -46,7 +46,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa_2g(self, request, get_lanforge_data, setup_profile_data,
|
||||
instantiate_testrail, instantiate_project, test_cases):
|
||||
instantiate_controller, instantiate_testrail, instantiate_project, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -64,7 +64,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
staConnect.setup()
|
||||
@@ -81,18 +81,19 @@ class TestVlanModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - vlan mode')
|
||||
msg='2G WPA Client Connectivity Passed successfully - vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - vlan mode')
|
||||
msg='2G WPA Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2420
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_5g(self, request, get_lanforge_data, setup_profile_data,
|
||||
instantiate_project, instantiate_testrail, test_cases):
|
||||
instantiate_controller, instantiate_project, instantiate_testrail, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -109,7 +110,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -127,18 +128,19 @@ class TestVlanModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - vlan mode')
|
||||
msg='5G WPA Client Connectivity Passed successfully - vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - vlan mode')
|
||||
msg='5G WPA Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2419
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, request, get_lanforge_data, setup_profile_data,
|
||||
instantiate_project, instantiate_testrail, test_cases):
|
||||
instantiate_controller, instantiate_project, instantiate_testrail, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_P"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -155,7 +157,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -173,18 +175,19 @@ class TestVlanModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - vlan mode')
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA2 Client Connectivity Failed - vlan mode')
|
||||
msg='2G WPA2 Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2237
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, request, get_lanforge_data, setup_profile_data,
|
||||
instantiate_project, instantiate_testrail, test_cases):
|
||||
instantiate_controller, instantiate_project, instantiate_testrail, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_P"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -201,7 +204,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -219,11 +222,12 @@ class TestVlanModeClientConnectivity(object):
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - vlan mode')
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 Client Connectivity Failed - vlan mode')
|
||||
msg='5G WPA2 Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2236
|
||||
|
||||
@@ -231,7 +235,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, radius_info, test_cases):
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_E"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -248,7 +252,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 10
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
@@ -268,11 +272,12 @@ class TestVlanModeClientConnectivity(object):
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'vlan mode')
|
||||
'vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - vlan mode')
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
# C5214
|
||||
|
||||
@@ -280,7 +285,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail, radius_info, test_cases):
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_E"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -297,7 +302,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 10
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
@@ -317,11 +322,12 @@ class TestVlanModeClientConnectivity(object):
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'vlan mode')
|
||||
'vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - vlan mode')
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
|
||||
@pytest.mark.modify_ssid
|
||||
@@ -331,7 +337,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
indirect=True
|
||||
)
|
||||
def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_project, test_cases):
|
||||
instantiate_project, test_cases, instantiate_controller):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
@@ -340,7 +346,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
@@ -348,7 +354,7 @@ class TestVlanModeClientConnectivity(object):
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
@@ -367,9 +373,10 @@ class TestVlanModeClientConnectivity(object):
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["vlan_ssid_update"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - vlan mode '
|
||||
'updated ssid')
|
||||
'updated ssid' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["vlan_ssid_update"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - vlan mode updated ssid')
|
||||
msg='5G WPA Client Connectivity Failed - vlan mode updated ssid' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
|
||||
@@ -0,0 +1,496 @@
|
||||
import allure
|
||||
import pytest
|
||||
import time
|
||||
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.bridge, pytest.mark.sanity]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.basic
|
||||
@allure.feature("BRIDGE MODE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupBridge(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
setup_params_general_two = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa_wpa2_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_personal_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_wpa2_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_wpa2_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("BRIDGE MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupBridgeEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
@@ -0,0 +1,495 @@
|
||||
import allure
|
||||
import pytest
|
||||
import time
|
||||
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.NAT, pytest.mark.sanity]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.basic
|
||||
@allure.feature("NAT MODE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupNAT(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
setup_params_general_two = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa_wpa2_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestNATModeConnectivitySuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_personal_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_wpa2_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_wpa2_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("NAT MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupNATEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
@@ -0,0 +1,495 @@
|
||||
import allure
|
||||
import pytest
|
||||
import time
|
||||
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.VLAN, pytest.mark.sanity]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.basic
|
||||
@allure.feature("VLAN MODE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupVLAN(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
setup_params_general_two = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa_wpa2_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.feature("VLAN MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeConnectivitySuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_personal_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_wpa2_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_wpa2_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("VLAN MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupVLANEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
@@ -1,33 +1,19 @@
|
||||
"""
|
||||
conftest.py : Contains fixtures that are specific to basic testbed environment
|
||||
|
||||
Basic Test Scenario : 1 AP, 1 LANforge, 1 Controller Instance
|
||||
|
||||
Includes:
|
||||
|
||||
Setup:
|
||||
setup_profiles
|
||||
create_profiles
|
||||
|
||||
Utilities:
|
||||
update_ssid
|
||||
|
||||
Information:
|
||||
Setup Fixtures: Every Test case Needs to use setup fixtures
|
||||
Setup Fixtures can be customised for all different levels of execution:
|
||||
session level
|
||||
package level
|
||||
module level
|
||||
class level
|
||||
function level
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import sys
|
||||
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
|
||||
sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
@@ -37,11 +23,11 @@ sys.path.append(
|
||||
if "libs" not in sys.path:
|
||||
sys.path.append(f'../libs')
|
||||
|
||||
from apnos.apnos import APNOS
|
||||
from controller.controller import Controller
|
||||
from controller.controller import ProfileUtility
|
||||
from controller.controller import FirmwareUtility
|
||||
import time
|
||||
from lanforge.lf_tests import RunTest
|
||||
import pytest
|
||||
|
||||
import logging
|
||||
from configuration import RADIUS_SERVER_DATA
|
||||
from configuration import TEST_CASES
|
||||
@@ -49,14 +35,17 @@ from configuration import CONFIGURATION
|
||||
from configuration import FIRMWARE
|
||||
from testrails.testrail_api import APIClient
|
||||
from testrails.reporting import Reporting
|
||||
|
||||
import allure
|
||||
from cv_test_manager import cv_test
|
||||
from create_chamberview import CreateChamberview
|
||||
from create_chamberview_dut import DUT
|
||||
|
||||
"""
|
||||
Basic Setup Collector
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@pytest.fixture(scope="session")
|
||||
def get_lanforge_data(testbed):
|
||||
lanforge_data = {}
|
||||
if CONFIGURATION[testbed]['traffic_generator']['name'] == 'lanforge':
|
||||
@@ -80,216 +69,340 @@ def get_lanforge_data(testbed):
|
||||
def instantiate_profile(instantiate_controller):
|
||||
try:
|
||||
profile_object = ProfileUtility(sdk_client=instantiate_controller)
|
||||
except:
|
||||
except Exception as e:
|
||||
profile_object = False
|
||||
yield profile_object
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_equipment_id(instantiate_controller, testbed):
|
||||
equipment_id = 0
|
||||
if len(CONFIGURATION[testbed]['access_point']) == 1:
|
||||
equipment_id = instantiate_controller.get_equipment_id(
|
||||
serial_number=CONFIGURATION[testbed]['access_point'][0]['serial'])
|
||||
yield equipment_id
|
||||
def instantiate_profile():
|
||||
yield ProfileUtility
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def upload_firmware(should_upload_firmware, instantiate_firmware, get_latest_firmware):
|
||||
firmware_id = instantiate_firmware.upload_fw_on_cloud(fw_version=get_latest_firmware,
|
||||
force_upload=should_upload_firmware)
|
||||
yield firmware_id
|
||||
def setup_vlan():
|
||||
vlan_id = [100]
|
||||
allure.attach(body=str(vlan_id), name="VLAN Created: ")
|
||||
yield vlan_id[0]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware,
|
||||
should_upgrade_firmware):
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
if request.config.getoption("--skip-upgrade"):
|
||||
status = "skip-upgrade"
|
||||
else:
|
||||
status = instantiate_firmware.upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
else:
|
||||
if should_upgrade_firmware:
|
||||
status = instantiate_firmware.upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
else:
|
||||
status = "skip-upgrade"
|
||||
yield status
|
||||
@allure.feature("CLIENT CONNECTIVITY SETUP")
|
||||
@pytest.fixture(scope="class")
|
||||
def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment_id,
|
||||
instantiate_profile, get_markers,
|
||||
get_security_flags, get_configuration, radius_info, get_apnos):
|
||||
instantiate_profile = instantiate_profile(sdk_client=setup_controller)
|
||||
vlan_id, mode = 0, 0
|
||||
instantiate_profile.cleanup_objects()
|
||||
parameter = dict(request.param)
|
||||
print(parameter)
|
||||
test_cases = {}
|
||||
profile_data = {}
|
||||
if parameter['mode'] not in ["BRIDGE", "NAT", "VLAN"]:
|
||||
print("Invalid Mode: ", parameter['mode'])
|
||||
allure.attach(body=parameter['mode'], name="Invalid Mode: ")
|
||||
yield test_cases
|
||||
|
||||
if parameter['mode'] == "NAT":
|
||||
mode = "NAT"
|
||||
vlan_id = 1
|
||||
if parameter['mode'] == "BRIDGE":
|
||||
mode = "BRIDGE"
|
||||
vlan_id = 1
|
||||
if parameter['mode'] == "VLAN":
|
||||
mode = "BRIDGE"
|
||||
vlan_id = setup_vlan
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_cloud(instantiate_controller, get_equipment_id):
|
||||
yield instantiate_controller.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Equipment-AP-" + parameter['mode'])
|
||||
|
||||
profile_data["equipment_ap"] = {"profile_name": testbed + "-Equipment-AP-" + parameter['mode']}
|
||||
profile_data["ssid"] = {}
|
||||
for i in parameter["ssid_modes"]:
|
||||
profile_data["ssid"][i] = []
|
||||
for j in range(len(parameter["ssid_modes"][i])):
|
||||
profile_name = testbed + "-SSID-" + i + "-" + str(j) + "-" + parameter['mode']
|
||||
data = parameter["ssid_modes"][i][j]
|
||||
data["profile_name"] = profile_name
|
||||
if "mode" not in dict(data).keys():
|
||||
data["mode"] = mode
|
||||
if "vlan" not in dict(data).keys():
|
||||
data["vlan"] = vlan_id
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
|
||||
profile_data["ssid"][i].append(data)
|
||||
# print(profile_name)
|
||||
# print(profile_data)
|
||||
|
||||
"""
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + mode)
|
||||
time.sleep(10)
|
||||
"""
|
||||
Setting up rf profile
|
||||
"""
|
||||
rf_profile_data = {
|
||||
"name": "RF-Profile-" + testbed + "-" + parameter['mode'] + "-" +
|
||||
get_configuration['access_point'][0]['mode']
|
||||
}
|
||||
|
||||
Profiles Related Fixtures
|
||||
for i in parameter["rf"]:
|
||||
rf_profile_data[i] = parameter['rf'][i]
|
||||
# print(rf_profile_data)
|
||||
|
||||
"""
|
||||
try:
|
||||
instantiate_profile.delete_profile_by_name(profile_name=rf_profile_data['name'])
|
||||
instantiate_profile.set_rf_profile(profile_data=rf_profile_data,
|
||||
mode=get_configuration['access_point'][0]['mode'])
|
||||
allure.attach(body=str(rf_profile_data),
|
||||
name="RF Profile Created : " + get_configuration['access_point'][0]['mode'])
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(body=str(e), name="Exception ")
|
||||
|
||||
# Radius Profile Creation
|
||||
if parameter["radius"]:
|
||||
radius_info = radius_info
|
||||
radius_info["name"] = testbed + "-Automation-Radius-Profile-" + testbed
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + testbed)
|
||||
try:
|
||||
# pass
|
||||
instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
allure.attach(body=str(radius_info),
|
||||
name="Radius Profile Created")
|
||||
test_cases['radius_profile'] = True
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases['radius_profile'] = False
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def get_current_profile_cloud(instantiate_profile):
|
||||
# SSID Profile Creation
|
||||
print(get_markers)
|
||||
for mode in profile_data['ssid']:
|
||||
if mode == "open":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
|
||||
test_cases["open_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["open_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
|
||||
test_cases["open_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["open_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa_ssid_profile(profile_data=j)
|
||||
test_cases["wpa_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa_ssid_profile(profile_data=j)
|
||||
test_cases["wpa_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
if mode == "wpa2_personal":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_personal_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa2_personal_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_personal_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa2_personal_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa3_personal":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa3_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_personal_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_personal_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa3_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_personal_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_personal_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
if mode == "wpa3_personal_mixed":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa3_personal_mixed_ssid_profile(
|
||||
profile_data=j)
|
||||
test_cases["wpa3_personal_mixed_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_personal_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa3_personal_mixed_ssid_profile(
|
||||
profile_data=j)
|
||||
test_cases["wpa3_personal_mixed_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_personal_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa2_enterprise":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_enterprise_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa2_enterprise_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_enterprise_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa2_enterprise_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa3_enterprise":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa3_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_enterprise_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_enterprise_2g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa3_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_enterprise_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_enterprise_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
# Equipment AP Profile Creation
|
||||
try:
|
||||
instantiate_profile.set_ap_profile(profile_data=profile_data['equipment_ap'])
|
||||
test_cases["equipment_ap"] = True
|
||||
allure.attach(body=str(profile_data['equipment_ap']),
|
||||
name="Equipment AP Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["equipment_ap"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="Equipment AP Profile Creation Failed")
|
||||
|
||||
# Push the Equipment AP Profile to AP
|
||||
try:
|
||||
for i in get_equipment_id:
|
||||
instantiate_profile.push_profile_old_method(equipment_id=i)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("failed to create AP Profile")
|
||||
|
||||
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
|
||||
ssid_names = []
|
||||
for i in instantiate_profile.profile_creation_ids["ssid"]:
|
||||
ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i))
|
||||
yield ssid_names
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def setup_profiles(request, create_profiles, instantiate_profile, get_equipment_id, get_current_profile_cloud, testbed):
|
||||
test_cases = {}
|
||||
mode = str(request.param[0]).lower()
|
||||
try:
|
||||
instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
except:
|
||||
print("failed to create AP Profile")
|
||||
ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0])
|
||||
get_current_profile_cloud.sort()
|
||||
# This loop will check the VIF Config with cloud profile
|
||||
for i in range(0, 18):
|
||||
vif_config = list(ap_ssh.get_vif_config_ssids())
|
||||
vif_config.sort()
|
||||
print(vif_config)
|
||||
print(get_current_profile_cloud)
|
||||
if get_current_profile_cloud == vif_config:
|
||||
test_cases[mode + '_vifc'] = True
|
||||
break
|
||||
time.sleep(10)
|
||||
ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0])
|
||||
# This loop will check the VIF Config with VIF State
|
||||
for i in range(0, 18):
|
||||
vif_state = list(ap_ssh.get_vif_state_ssids())
|
||||
vif_state.sort()
|
||||
vif_config = list(ap_ssh.get_vif_config_ssids())
|
||||
vif_config.sort()
|
||||
print(vif_config)
|
||||
print(vif_state)
|
||||
if vif_state == vif_config:
|
||||
test_cases[mode + '_vifs'] = True
|
||||
break
|
||||
time.sleep(10)
|
||||
yield test_cases
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def create_profiles(request, testbed, get_security_flags, get_markers, instantiate_profile, setup_profile_data):
|
||||
profile_id = {"ssid": [], "rf": None, "radius": None, "equipment_ap": None}
|
||||
mode = str(request.param[0])
|
||||
test_cases = {}
|
||||
if mode not in ["BRIDGE", "NAT", "VLAN"]:
|
||||
print("Invalid Mode: ", mode)
|
||||
yield False
|
||||
instantiate_profile.delete_profile_by_name(profile_name="Equipment-AP-" + mode)
|
||||
for i in setup_profile_data[mode]:
|
||||
for j in setup_profile_data[mode][i]:
|
||||
instantiate_profile.delete_profile_by_name(
|
||||
profile_name=setup_profile_data[mode][i][j]['profile_name'])
|
||||
instantiate_profile.delete_profile_by_name(profile_name="Automation-Radius-Profile-" + mode)
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile_data = {
|
||||
"name": "RF-Profile-"+CONFIGURATION[testbed]['access_point'][0]['mode']+CONFIGURATION[testbed]['access_point'][0]['model'] + mode
|
||||
}
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_data['name'])
|
||||
instantiate_profile.set_rf_profile(profile_data=profile_data, mode=CONFIGURATION[testbed]['access_point'][0]['mode'])
|
||||
# Create RF Profile Here
|
||||
if get_markers["radius"]:
|
||||
radius_info = RADIUS_SERVER_DATA
|
||||
radius_info["name"] = "Automation-Radius-Profile-" + mode
|
||||
try:
|
||||
instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
test_cases['radius_profile'] = True
|
||||
except:
|
||||
test_cases['radius_profile'] = False
|
||||
for i in get_security_flags:
|
||||
if get_markers[i] and i == "open":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["OPEN"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_open_ssid_profile(two4g=True, fiveg=False,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_open_' + mode.lower()] = True
|
||||
except:
|
||||
test_cases['ssid_2g_open_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["OPEN"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_open_ssid_profile(two4g=False, fiveg=True,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_open_' + mode.lower()] = True
|
||||
except:
|
||||
test_cases['ssid_5g_open_' + mode.lower()] = False
|
||||
if get_markers[i] and i == "wpa":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa_ssid_profile(two4g=True, fiveg=False, profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_wpa_' + mode.lower()] = True
|
||||
except:
|
||||
test_cases['ssid_5g_wpa_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa_ssid_profile(two4g=False, fiveg=True, profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_wpa_' + mode.lower()] = True
|
||||
except:
|
||||
test_cases['ssid_5g_wpa_' + mode.lower()] = False
|
||||
if get_markers[i] and i == "wpa2_personal":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_P"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_personal_ssid_profile(two4g=True, fiveg=False,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_wpa2_' + mode.lower()] = True
|
||||
except:
|
||||
test_cases['ssid_2g_wpa2_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_P"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_personal_ssid_profile(two4g=False, fiveg=True,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_wpa2_' + mode.lower()] = True
|
||||
except:
|
||||
test_cases['ssid_5g_wpa2_' + mode.lower()] = False
|
||||
if get_markers[i] and i == "wpa2_enterprise":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_E"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_enterprise_ssid_profile(two4g=True, fiveg=False,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_eap_' + mode.lower()] = True
|
||||
except:
|
||||
test_cases['ssid_2g_eap_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_E"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_enterprise_ssid_profile(two4g=False, fiveg=True,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_eap_' + mode.lower()] = True
|
||||
except:
|
||||
test_cases['ssid_5g_eap_' + mode.lower()] = False
|
||||
|
||||
# Create Equipment AP Profile Here
|
||||
profile_data = {
|
||||
"profile_name": "Equipment-AP-" + mode
|
||||
}
|
||||
try:
|
||||
instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
test_cases['ap_' + mode.lower()] = True
|
||||
except:
|
||||
test_cases['ap_' + mode.lower()] = False
|
||||
yield test_cases
|
||||
ssid_names.sort()
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@@ -304,3 +417,84 @@ def update_ssid(request, instantiate_profile, setup_profile_data):
|
||||
requested_profile[3]
|
||||
time.sleep(90)
|
||||
yield status
|
||||
|
||||
|
||||
@pytest.fixture(scope="package")
|
||||
def create_lanforge_chamberview(create_lanforge_chamberview_dut, get_configuration, testbed):
|
||||
lanforge_data = get_configuration['traffic_generator']['details']
|
||||
ip = lanforge_data["ip"]
|
||||
port = lanforge_data["port"]
|
||||
upstream_port = lanforge_data["upstream"] # eth1
|
||||
uplink_port = lanforge_data["uplink"] # eth2
|
||||
upstream_subnet = lanforge_data["upstream_subnet"]
|
||||
scenario_name = "TIP-" + testbed
|
||||
upstream_res = upstream_port.split(".")[0] + "." + upstream_port.split(".")[1]
|
||||
uplink_res = uplink_port.split(".")[0] + "." + uplink_port.split(".")[1]
|
||||
print(ip)
|
||||
print(upstream_port, upstream_res, upstream_port.split(".")[2])
|
||||
# "profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA"
|
||||
# "profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 10.28.2.1/24' NA eth1,eth2 -1 NA"
|
||||
raw_line = [
|
||||
["profile_link " + upstream_res + " upstream-dhcp 1 NA NA " + upstream_port.split(".")[2] + ",AUTO -1 NA"]
|
||||
, ["profile_link " + uplink_res + " uplink-nat 1 'DUT: upstream LAN "
|
||||
+ upstream_subnet + "' NA " + uplink_port.split(".")[2] + " -1 NA"]
|
||||
]
|
||||
print(raw_line)
|
||||
Create_Chamberview = CreateChamberview(ip, port)
|
||||
Create_Chamberview.clean_cv_scenario()
|
||||
Create_Chamberview.clean_cv_scenario(type="Network-Connectivity", scenario_name=scenario_name)
|
||||
|
||||
Create_Chamberview.setup(create_scenario=scenario_name,
|
||||
raw_line=raw_line)
|
||||
|
||||
Create_Chamberview.build(scenario_name)
|
||||
Create_Chamberview.show_text_blob(None, None, True) # Show changes on GUI
|
||||
yield Create_Chamberview
|
||||
|
||||
|
||||
@pytest.fixture(scope="package")
|
||||
def create_lanforge_chamberview_dut(get_configuration, testbed):
|
||||
ap_model = get_configuration["access_point"][0]["model"]
|
||||
version = get_configuration["access_point"][0]["version"]
|
||||
serial = get_configuration["access_point"][0]["serial"]
|
||||
# ap_model = get_configuration["access_point"][0]["model"]
|
||||
lanforge_data = get_configuration['traffic_generator']['details']
|
||||
ip = lanforge_data["ip"]
|
||||
port = lanforge_data["port"]
|
||||
dut = DUT(lfmgr=ip,
|
||||
port=port,
|
||||
dut_name=testbed,
|
||||
sw_version=version,
|
||||
model_num=ap_model,
|
||||
serial_num=serial
|
||||
)
|
||||
dut.setup()
|
||||
yield dut
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def lf_test(get_configuration):
|
||||
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'])
|
||||
yield obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def station_names_twog(request, get_configuration):
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_configuration["traffic_generator"]["details"]["2.4G-Station-Name"] + "0" + str(i))
|
||||
yield station_names
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def station_names_fiveg(request, get_configuration):
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_configuration["traffic_generator"]["details"]["5G-Station-Name"] + "0" + str(i))
|
||||
yield station_names
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def num_stations(request):
|
||||
num_sta = int(request.config.getini("num_stations"))
|
||||
yield num_sta
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import pytest
|
||||
|
||||
|
||||
# @pytest.mark.sanity
|
||||
@pytest.mark.wifi_capacity_test
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["NAT"], ["NAT"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestBridgeModeClientConnectivity(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_2g(self, get_lanforge_data, setup_profile_data):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_2g(self, get_lanforge_data, setup_profile_data):
|
||||
assert True
|
||||
69
tests/e2e/basic/test_firmware.py
Normal file
69
tests/e2e/basic/test_firmware.py
Normal file
@@ -0,0 +1,69 @@
|
||||
"""
|
||||
Test Case Module: setup test cases for basic test cases
|
||||
Details: Firmware Upgrade
|
||||
|
||||
"""
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.firmware, pytest.mark.sanity]
|
||||
|
||||
|
||||
@pytest.mark.firmware_cloud
|
||||
class TestFirmware(object):
|
||||
|
||||
@pytest.mark.firmware_create
|
||||
def test_firmware_create(self, upload_firmware, update_report, test_cases):
|
||||
if upload_firmware != 0:
|
||||
update_report.update_testrail(case_id=test_cases["create_fw"],
|
||||
status_id=1,
|
||||
msg='Create new FW version by API successful')
|
||||
PASS = True
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["create_fw"],
|
||||
status_id=5,
|
||||
msg='Error creating new FW version by API')
|
||||
PASS = False
|
||||
assert PASS
|
||||
|
||||
# @pytest.mark.firmware_upgrade
|
||||
# def test_firmware_upgrade_request(self, upgrade_firmware, update_report, test_cases):
|
||||
# print()
|
||||
# if not upgrade_firmware:
|
||||
# update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
# status_id=0,
|
||||
# msg='Error requesting upgrade via API')
|
||||
# PASS = False
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
# status_id=1,
|
||||
# msg='Upgrade request using API successful')
|
||||
# PASS = True
|
||||
# assert PASS
|
||||
|
||||
@pytest.mark.check_active_firmware_cloud
|
||||
def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, update_report, test_cases):
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
update_report.update_testrail(case_id=test_cases["cloud_fw"],
|
||||
status_id=5,
|
||||
msg='CLOUDSDK reporting incorrect firmware version.')
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["cloud_fw"],
|
||||
status_id=1,
|
||||
msg='CLOUDSDK reporting correct firmware version.')
|
||||
|
||||
assert get_latest_firmware == check_ap_firmware_cloud
|
||||
|
||||
|
||||
@pytest.mark.firmware_ap
|
||||
def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, update_report,
|
||||
test_cases):
|
||||
if check_ap_firmware_ssh == get_latest_firmware:
|
||||
update_report.update_testrail(case_id=test_cases["ap_upgrade"],
|
||||
status_id=1,
|
||||
msg='Upgrade to ' + str(get_latest_firmware) + ' successful')
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["ap_upgrade"],
|
||||
status_id=4,
|
||||
msg='Cannot reach AP after upgrade to check CLI - re-test required')
|
||||
|
||||
assert check_ap_firmware_ssh == get_latest_firmware
|
||||
6
tests/e2e/basic/test_something.py
Normal file
6
tests/e2e/basic/test_something.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.test_lanforge_connectivity
|
||||
def test_cv(create_lanforge_chamberview):
|
||||
assert True
|
||||
@@ -0,0 +1,614 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.sanity]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.basic
|
||||
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeConnectivitySuiteOne(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, setup_profiles, get_lanforge_data, lf_test, update_report, station_names_twog,
|
||||
test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
# if result:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_open_ssid_5g(self, get_lanforge_data, lf_test, test_cases, station_names_fiveg, update_report):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
# if result:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
def test_wpa_ssid_2g(self, request, get_lanforge_data, update_report,
|
||||
lf_test, test_cases, station_names_twog):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, lf_test, update_report, test_cases, station_names_fiveg, get_lanforge_data):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, get_lanforge_data, lf_test, update_report, test_cases,
|
||||
station_names_twog):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA2 Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, get_lanforge_data, update_report, test_cases, station_names_fiveg,
|
||||
lf_test):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_bridge"],
|
||||
status_id=1,
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_bridge"],
|
||||
status_id=5,
|
||||
msg='5G WPA2 Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_general_two = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa_wpa2_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_ssid_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_ssid_5g(self, station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, station_names_fiveg, get_lanforge_data, lf_test, test_cases,
|
||||
update_report):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@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, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@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, station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
@@ -0,0 +1,639 @@
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat, pytest.mark.sanity]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestNATModeConnectivitySuiteOne(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, request, setup_profiles, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_open_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
def test_wpa_ssid_2g(self, request, get_lanforge_data, update_report,
|
||||
lf_test, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, request, lf_test, update_report, test_cases, get_lanforge_data):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, request, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, request, get_lanforge_data, update_report, test_cases, lf_test):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_general_two = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa_wpa2_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.shivam
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestNATModeConnectivitySuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_ssid_2g(self, request, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, request, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@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, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@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, station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestNATModeEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
@@ -0,0 +1,634 @@
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan, pytest.mark.sanity]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.feature("VLAN MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeConnectivity(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, setup_profiles, request, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_open_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = "[BLANK]"
|
||||
security = "open"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
def test_wpa_ssid_2g(self, request, get_lanforge_data, update_report,
|
||||
lf_test, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, request, lf_test, update_report, test_cases, get_lanforge_data):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, request, get_lanforge_data, lf_test, update_report, test_cases):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, request, get_lanforge_data, update_report, test_cases, lf_test):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_general_two = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa_wpa2_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_wpa3_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.shivam
|
||||
@allure.feature("VLAN MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeConnectivitySuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_ssid_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, request, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa3"
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@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, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
@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, station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa3_personal_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = ["wpa3"]
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
@@ -1,19 +0,0 @@
|
||||
import pytest
|
||||
|
||||
|
||||
# @pytest.mark.sanity
|
||||
@pytest.mark.wifi_capacity_test
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
(["BRIDGE"]),
|
||||
indirect=True
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeClientConnectivity(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa_2g(self, request, get_lanforge_data, setup_profile_data):
|
||||
assert True
|
||||
@@ -4,7 +4,7 @@ norecursedirs = .svn _build tmp*
|
||||
addopts= --junitxml=test_everything.xml
|
||||
log_format = %(asctime)s %(levelname)s %(message)s
|
||||
log_date_format = %Y-%m-%d %H:%M:%S
|
||||
|
||||
;norecursedirs=out build
|
||||
num_stations=1
|
||||
|
||||
# Cloud SDK settings
|
||||
|
||||
@@ -1,51 +1,53 @@
|
||||
"""
|
||||
Test Case Module: Testing Basic Connectivity with Resources
|
||||
Mode: BRIDGE
|
||||
|
||||
"""
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
pytestmark = [pytest.mark.test_connection]
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.test_resources]
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.test_controller_connectivity
|
||||
def test_controller_connectivity(instantiate_controller, instantiate_testrail, instantiate_project, test_cases):
|
||||
try:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_ver"], run_id=instantiate_project,
|
||||
status_id=1, msg='Read CloudSDK version from API successfully')
|
||||
PASS = True
|
||||
except:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_ver"], run_id=instantiate_project,
|
||||
status_id=0, msg='Could not read CloudSDK version from API')
|
||||
PASS = False
|
||||
assert instantiate_controller
|
||||
@allure.testcase(name="Test Resources", url="")
|
||||
class TestResources(object):
|
||||
|
||||
@pytest.mark.test_cloud_controller
|
||||
@allure.testcase(name="test_controller_connectivity", url="")
|
||||
def test_controller_connectivity(self, setup_controller, update_report, test_cases):
|
||||
if setup_controller.bearer:
|
||||
allure.attach(name="Controller Connectivity Success", body="")
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=1, msg='Read CloudSDK version from API successfully')
|
||||
else:
|
||||
allure.attach(name="Controller Connectivity Failed", body="")
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=0, msg='Could not read CloudSDK version from API')
|
||||
pytest.exit("Resource Not Available")
|
||||
# print(setup_controller.bearer)
|
||||
assert setup_controller.bearer
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.test_access_points_connectivity
|
||||
def test_access_points_connectivity(test_access_point, instantiate_testrail, instantiate_project, test_cases):
|
||||
if "ACTIVE" not in test_access_point:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_connection"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='CloudSDK connectivity failed')
|
||||
status = False
|
||||
sys.exit()
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_connection"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='Manager status is Active')
|
||||
status = True
|
||||
@pytest.mark.test_access_points_connectivity
|
||||
@allure.testcase(name="test_access_points_connectivity", url="")
|
||||
def test_access_points_connectivity(self, test_access_point, update_report, test_cases):
|
||||
for i in test_access_point:
|
||||
if "ACTIVE" not in i:
|
||||
flag = False
|
||||
|
||||
assert status
|
||||
if flag is False:
|
||||
allure.attach(name="Access Point Connectivity Success", body=str(test_access_point))
|
||||
update_report.update_testrail(case_id=test_cases["cloud_connection"],
|
||||
status_id=5,
|
||||
msg='CloudSDK connectivity failed')
|
||||
|
||||
pytest.exit("Access Point Manafer state is not ACtive")
|
||||
else:
|
||||
allure.attach(name="Access Point Connectivity Failed", body=str(test_access_point))
|
||||
update_report.update_testrail(case_id=test_cases["cloud_connection"],
|
||||
status_id=1,
|
||||
msg='Manager status is Active')
|
||||
|
||||
@pytest.mark.test_lanforge_connectivity
|
||||
def test_lanforge_connectivity(setup_lanforge):
|
||||
assert "instantiate_cloudsdk"
|
||||
assert flag
|
||||
|
||||
|
||||
@pytest.mark.test_perfecto_connectivity
|
||||
def test_perfecto_connectivity(setup_perfecto_devices):
|
||||
assert "instantiate_cloudsdk"
|
||||
|
||||
Reference in New Issue
Block a user