mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 03:48:09 +00:00
restructured the pytest
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
@@ -349,4 +349,3 @@ class TestBridgeModeClientConnectivity(object):
|
||||
msg='5G WPA Client Connectivity Failed - bridge mode updated ssid')
|
||||
assert staConnect.passes()
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import sys
|
||||
if 'apnos' not in sys.path:
|
||||
sys.path.append(f'../libs/apnos')
|
||||
|
||||
if 'cloudsdk_tests' not in sys.path:
|
||||
if 'cloud_controller_tests' not in sys.path:
|
||||
sys.path.append(f'../../libs/cloudsdk')
|
||||
from cloudsdk import CloudSDK
|
||||
from configuration_data import TEST_CASES
|
||||
@@ -5,7 +5,7 @@ About: It contains some Functional Unit Tests for CloudSDK and to run and test t
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
if 'cloudsdk_tests' not in sys.path:
|
||||
if 'cloud_controller_tests' not in sys.path:
|
||||
sys.path.append(f'../../libs/cloudsdk')
|
||||
from cloudsdk import CloudSDK
|
||||
from configuration_data import TEST_CASES
|
||||
651
old_pytest/conftest.py
Normal file
651
old_pytest/conftest.py
Normal file
@@ -0,0 +1,651 @@
|
||||
# import files in the current directory
|
||||
import datetime
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
os.path.realpath(__file__)
|
||||
)
|
||||
)
|
||||
|
||||
if 'cloudsdk' not in sys.path:
|
||||
sys.path.append(f'../libs/cloudsdk')
|
||||
if 'apnos' not in sys.path:
|
||||
sys.path.append(f'../libs/apnos')
|
||||
if 'testrails' not in sys.path:
|
||||
sys.path.append(f'../libs/testrails')
|
||||
|
||||
from apnos import APNOS
|
||||
from cloudsdk import CloudSDK
|
||||
from cloudsdk import ProfileUtility
|
||||
from cloudsdk import FirmwareUtility
|
||||
import pytest
|
||||
import logging
|
||||
from configuration_data import APNOS_CREDENTIAL_DATA
|
||||
from configuration_data import RADIUS_SERVER_DATA
|
||||
from configuration_data import TEST_CASES
|
||||
from configuration_data import NOLA
|
||||
from testrail_api import APIClient
|
||||
from reporting import Reporting
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addini("force-upload", "firmware-upload option")
|
||||
|
||||
parser.addini("jfrog-base-url", "jfrog base url")
|
||||
parser.addini("jfrog-user-id", "jfrog username")
|
||||
parser.addini("jfrog-user-password", "jfrog password")
|
||||
|
||||
parser.addini("testbed-name", "cloud sdk base url")
|
||||
parser.addini("equipment-model", "Equipment Model")
|
||||
|
||||
parser.addini("sdk-user-id", "cloud sdk username")
|
||||
parser.addini("sdk-user-password", "cloud sdk user password")
|
||||
|
||||
parser.addini("sdk-customer-id", "cloud sdk customer id for the access points")
|
||||
parser.addini("sdk-equipment-id", "cloud sdk customer id for the access points")
|
||||
|
||||
parser.addini("testrail-base-url", "testrail base url")
|
||||
parser.addini("testrail-project", "testrail project name to use to generate test reports")
|
||||
parser.addini("testrail-user-id", "testrail username")
|
||||
parser.addini("testrail-user-password", "testrail user password")
|
||||
|
||||
parser.addini("lanforge-ip-address", "LANforge ip address to connect to")
|
||||
parser.addini("lanforge-port-number", "LANforge port number to connect to")
|
||||
parser.addini("lanforge-bridge-port", "LANforge port for bridge mode testing")
|
||||
parser.addini("lanforge-2dot4g-prefix", "LANforge 2.4g prefix")
|
||||
parser.addini("lanforge-5g-prefix", "LANforge 5g prefix")
|
||||
parser.addini("lanforge-2dot4g-station", "LANforge station name for 2.4g")
|
||||
parser.addini("lanforge-5g-station", "LANforge station name for 5g")
|
||||
parser.addini("lanforge-2dot4g-radio", "LANforge radio for 2.4g")
|
||||
parser.addini("lanforge-5g-radio", "LANforge radio for 5g")
|
||||
|
||||
parser.addini("jumphost_ip", "APNOS Jumphost IP Address")
|
||||
parser.addini("jumphost_username", "APNOS Jumphost Username")
|
||||
parser.addini("jumphost_password", "APNOS Jumphost password")
|
||||
parser.addini("jumphost_port", "APNOS Jumphost ssh Port")
|
||||
|
||||
parser.addini("skip-open", "skip open ssid mode")
|
||||
parser.addini("skip-wpa", "skip wpa ssid mode")
|
||||
parser.addini("skip-wpa2", "skip wpa2 ssid mode")
|
||||
parser.addini("skip-eap", "skip eap ssid mode")
|
||||
|
||||
parser.addini("radius_server_ip", "Radius server IP")
|
||||
parser.addini("radius_port", "Radius Port")
|
||||
parser.addini("radius_secret", "Radius shared Secret")
|
||||
|
||||
parser.addini("tr_url", "Test Rail URL")
|
||||
parser.addini("tr_prefix", "Test Rail Prefix (Generally Testbed_name_)")
|
||||
parser.addini("tr_user", "Testrail Username")
|
||||
parser.addini("tr_pass", "Testrail Password")
|
||||
parser.addini("tr_project_id", "Testrail Project ID")
|
||||
parser.addini("milestone", "milestone Id")
|
||||
|
||||
parser.addini("num_stations", "Number of Stations/Clients for testing")
|
||||
|
||||
# change behaviour
|
||||
parser.addoption(
|
||||
"--skip-upgrade",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="skip updating firmware on the AP (useful for local testing)"
|
||||
)
|
||||
# change behaviour
|
||||
parser.addoption(
|
||||
"--force-upgrade",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="force Upgrading Firmware even if it is already latest version"
|
||||
)
|
||||
parser.addoption(
|
||||
"--force-upload",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="force Uploading Firmware even if it is already latest version"
|
||||
)
|
||||
# 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(
|
||||
"--skip-testrail",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Stop using Testrails"
|
||||
)
|
||||
|
||||
|
||||
"""
|
||||
Test session base fixture
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def testrun_session(request):
|
||||
var = request.config.getoption("model")
|
||||
yield var
|
||||
|
||||
|
||||
"""
|
||||
Instantiate Objects for Test session
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_cloudsdk(testrun_session):
|
||||
try:
|
||||
sdk_client = CloudSDK(testbed=NOLA[testrun_session]["cloudsdk_url"],
|
||||
customer_id=NOLA[testrun_session]["customer_id"])
|
||||
except:
|
||||
sdk_client = False
|
||||
yield sdk_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_jFrog(request):
|
||||
jfrog_cred = {
|
||||
"user": request.config.getini("jfrog-user-id"),
|
||||
"password": request.config.getini("jfrog-user-password")
|
||||
}
|
||||
yield jfrog_cred
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_firmware(instantiate_cloudsdk, instantiate_jFrog):
|
||||
try:
|
||||
firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_cloudsdk)
|
||||
except:
|
||||
firmware_client = False
|
||||
yield firmware_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_profile(instantiate_cloudsdk):
|
||||
try:
|
||||
profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
except:
|
||||
profile_object = False
|
||||
yield profile_object
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_testrail(request):
|
||||
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_project(request, instantiate_testrail, testrun_session, get_latest_firmware):
|
||||
if request.config.getoption("--skip-testrail"):
|
||||
rid = "skip testrails"
|
||||
else:
|
||||
projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
test_run_name = request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
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"),
|
||||
description="Automated Nightly Sanity test run for new firmware build")
|
||||
rid = instantiate_testrail.get_run_id(
|
||||
test_run_name=request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
datetime.date.today()) + "_" + get_latest_firmware)
|
||||
yield rid
|
||||
|
||||
|
||||
"""
|
||||
Utility Fixtures
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_equipment_id(testrun_session):
|
||||
yield NOLA[testrun_session]["equipment_id"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_latest_firmware(testrun_session, instantiate_firmware):
|
||||
try:
|
||||
latest_firmware = instantiate_firmware.get_latest_fw_version(testrun_session)
|
||||
except:
|
||||
latest_firmware = False
|
||||
yield latest_firmware
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_ssh(request, testrun_session):
|
||||
try:
|
||||
ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
active_fw = ap_ssh.get_active_firmware()
|
||||
except Exception as e:
|
||||
active_fw = False
|
||||
yield active_fw
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_cloud(instantiate_cloudsdk, get_equipment_id):
|
||||
yield instantiate_cloudsdk.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_ap_manager_status():
|
||||
ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
status = ap_ssh.get_manager_state()
|
||||
if "ACTIVE" not in status:
|
||||
time.sleep(30)
|
||||
ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
status = ap_ssh.get_manager_state()
|
||||
yield status
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def should_upload_firmware(request):
|
||||
yield request.config.getoption("--force-upload")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def should_upgrade_firmware(request):
|
||||
yield request.config.getoption("--force-upgrade")
|
||||
|
||||
|
||||
@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
|
||||
|
||||
|
||||
@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
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_profile_data(testrun_session):
|
||||
profile_data = {}
|
||||
for mode in "BRIDGE", "NAT", "VLAN":
|
||||
profile_data[mode] = {}
|
||||
for security in "OPEN", "WPA", "WPA2_P", "WPA2_E":
|
||||
profile_data[mode][security] = {}
|
||||
for radio in "2G", "5G":
|
||||
profile_data[mode][security][radio] = {}
|
||||
name_string = f"{'Sanity'}-{testrun_session}-{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
|
||||
|
||||
|
||||
"""
|
||||
Profile Utility
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def reset_profile(instantiate_profile):
|
||||
instantiate_profile.profile_creation_ids["ssid"] = []
|
||||
yield True
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def cleanup_cloud_profiles(instantiate_cloudsdk):
|
||||
profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
yield profile_object.cleanup_profiles()
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_radius_profile(instantiate_profile, testrun_session):
|
||||
radius_info = {
|
||||
"name": testrun_session + "-RADIUS-Sanity",
|
||||
"ip": RADIUS_SERVER_DATA["ip"],
|
||||
"port": RADIUS_SERVER_DATA["port"],
|
||||
"secret": RADIUS_SERVER_DATA["secret"]
|
||||
}
|
||||
instantiate_profile.delete_profile_by_name(radius_info["name"])
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile_info = instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
yield profile_info
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def set_rf_profile(instantiate_profile):
|
||||
try:
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.set_rf_profile()
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
"""
|
||||
BRIDGE MOde
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except Exception as e:
|
||||
# (e)
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except Exception as e:
|
||||
# (e)
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
"""
|
||||
NAT MOde
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA2_P']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA2_P']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA2_E']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA2_E']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
"""
|
||||
VLAN MOde
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA2_P']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA2_P']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA2_E']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA2_E']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_ap_profile_bridge(instantiate_profile, testrun_session):
|
||||
try:
|
||||
profile_data = {
|
||||
"profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'BRIDGE'),
|
||||
}
|
||||
profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
except Exception as e:
|
||||
profile_obj = e
|
||||
print(profile_obj)
|
||||
yield profile_obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_ap_profile_nat(instantiate_profile, testrun_session):
|
||||
profile_data = {
|
||||
"profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'NAT'),
|
||||
}
|
||||
profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
yield profile_obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_ap_profile_vlan(instantiate_profile, testrun_session):
|
||||
profile_data = {
|
||||
"profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'VLAN'),
|
||||
}
|
||||
profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
yield profile_obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_current_profile_cloud(instantiate_profile):
|
||||
ssid_names = []
|
||||
print(instantiate_profile.profile_creation_ids["ssid"])
|
||||
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
|
||||
|
||||
|
||||
"""
|
||||
Profile Push Fixtures
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def push_profile(instantiate_profile, get_equipment_id, setup_profile_data):
|
||||
try:
|
||||
instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
status = True
|
||||
except Exception as e:
|
||||
status = False
|
||||
|
||||
yield status
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_lanforge_data(request):
|
||||
lanforge_data = {
|
||||
"lanforge_ip": request.config.getini("lanforge-ip-address"),
|
||||
"lanforge-port-number": request.config.getini("lanforge-port-number"),
|
||||
"lanforge_2dot4g": request.config.getini("lanforge-2dot4g-radio"),
|
||||
"lanforge_5g": request.config.getini("lanforge-5g-radio"),
|
||||
"lanforge_2dot4g_prefix": request.config.getini("lanforge-2dot4g-prefix"),
|
||||
"lanforge_5g_prefix": request.config.getini("lanforge-5g-prefix"),
|
||||
"lanforge_2dot4g_station": request.config.getini("lanforge-2dot4g-station"),
|
||||
"lanforge_5g_station": request.config.getini("lanforge-5g-station"),
|
||||
"lanforge_bridge_port": request.config.getini("lanforge-bridge-port"),
|
||||
"lanforge_vlan_port": "eth1.100",
|
||||
"vlan": 100
|
||||
}
|
||||
yield lanforge_data
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def update_ssid(request, instantiate_profile, setup_profile_data):
|
||||
requested_profile = str(request.param).replace(" ","").split(",")
|
||||
profile = setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]
|
||||
status = instantiate_profile.update_ssid_name(profile_name=profile["profile_name"], new_profile_name=requested_profile[3])
|
||||
setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["profile_name"] = requested_profile[3]
|
||||
setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["ssid_name"] = requested_profile[3]
|
||||
time.sleep(90)
|
||||
yield status
|
||||
61
old_pytest/pytest.ini
Normal file
61
old_pytest/pytest.ini
Normal file
@@ -0,0 +1,61 @@
|
||||
[pytest]
|
||||
addopts= --junitxml=test_everything.xml
|
||||
|
||||
# jFrog parameters
|
||||
jfrog-base-url=tip.jFrog.io/artifactory/tip-wlan-ap-firmware
|
||||
jfrog-user-id=tip-read
|
||||
jfrog-user-password=tip-read
|
||||
|
||||
# Cloud SDK parameters
|
||||
equipment-model=ecw5410
|
||||
sdk-user-id=support@example.com
|
||||
sdk-user-password=support
|
||||
|
||||
# Jumphost
|
||||
jumphost_ip=192.168.200.80
|
||||
jumphost_port=22
|
||||
jumphost_username=lanforge
|
||||
jumphost_password=lanforge
|
||||
|
||||
# LANforge
|
||||
lanforge-ip-address=localhost
|
||||
lanforge-port-number=8080
|
||||
|
||||
lanforge-bridge-port=eth1
|
||||
|
||||
|
||||
lanforge-2dot4g-prefix=wlan
|
||||
lanforge-5g-prefix=wlan
|
||||
|
||||
|
||||
lanforge-2dot4g-radio=wiphy1
|
||||
lanforge-5g-radio=wiphy1
|
||||
|
||||
num_stations=1
|
||||
|
||||
# Cloud SDK settings
|
||||
sdk-customer-id=2
|
||||
sdk-equipment-id=23
|
||||
|
||||
|
||||
# Radius Settings
|
||||
radius_server_ip=192.168.200.75
|
||||
radius_port=1812
|
||||
radius_secret=testing123
|
||||
|
||||
|
||||
# Testrail Info
|
||||
tr_url=https://telecominfraproject.testrail.com
|
||||
tr_prefix=Nola_ext_03_
|
||||
tr_user=shivam.thakur@candelatech.com
|
||||
tr_pass=Something
|
||||
tr_project_id=WLAN
|
||||
milestone=29
|
||||
|
||||
|
||||
filterwarnings =
|
||||
ignore::UserWarning
|
||||
|
||||
markers =
|
||||
sanity: Run the sanity for Client Connectivity test
|
||||
|
||||
0
tests/access_point/__init__.py
Normal file
0
tests/access_point/__init__.py
Normal file
217
tests/configuration.py
Normal file
217
tests/configuration.py
Normal file
@@ -0,0 +1,217 @@
|
||||
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'
|
||||
}
|
||||
|
||||
LabController = [
|
||||
{
|
||||
'ip': "ip address of the controller",
|
||||
'Username': "<username>",
|
||||
'Password': "<password>"
|
||||
},
|
||||
{
|
||||
'ip': "ip address of the controller",
|
||||
'Username': "<username>",
|
||||
'Password': "<password>"
|
||||
}
|
||||
]
|
||||
|
||||
AccessPoints = [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'serial number': 'serial-number',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.80",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "version"
|
||||
},
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'serial number' : 'serial-number',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.80",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "version"
|
||||
}
|
||||
]
|
||||
|
||||
CLOUDSDK_VERSION = {}
|
||||
TrafficGenerator = {
|
||||
"lanforge": {
|
||||
"ip": "192.168.200.80",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": "wihpy0",
|
||||
"5G-Radio": "wiphy1",
|
||||
"AX-Radio": "wiphy2",
|
||||
"upstream": "eth1",
|
||||
"2.4G-Station-Name": "two",
|
||||
"5G-Station-Name": "five",
|
||||
"AX-Station-Name": "ax",
|
||||
},
|
||||
"perfecto": {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
RADIUS_SERVER_DATA = {
|
||||
"ip": "192.168.200.75",
|
||||
"port": 1812,
|
||||
"secret": "testing123"
|
||||
}
|
||||
|
||||
|
||||
LAB_INFO = {
|
||||
"ap_model": "ecw5410",
|
||||
"cloudsdk_url": "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build",
|
||||
"equipment_details": {
|
||||
"serial_number_1": {
|
||||
"ip": "",
|
||||
"firmware_ver": ""
|
||||
|
||||
},
|
||||
"serial_number_2": {
|
||||
"ip": "",
|
||||
"firmware_ver": ""
|
||||
},
|
||||
"serial_number_3": {
|
||||
"ip": "",
|
||||
"firmware_ver": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
APNOS_CREDENTIAL_DATA = {
|
||||
'ip': "192.168.200.80",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'mode': 1,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
|
||||
}
|
||||
|
||||
"""
|
||||
AP --- ssh
|
||||
|
||||
ssh tunnel --- localhost:8800
|
||||
|
||||
"""
|
||||
|
||||
NOLA = {
|
||||
# It is in NOLA-01 equipment 4 lab-ctlr minicom ap1
|
||||
"ecw5410": {
|
||||
"cloudsdk_url": "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build",
|
||||
"customer_id": 2,
|
||||
"equipment_id": 24
|
||||
},
|
||||
"ecw5211": {
|
||||
"cloudsdk_url": "",
|
||||
"customer_id": 2,
|
||||
"equipment_id": ""
|
||||
},
|
||||
# WORKS # NOLA -03 lab-ctlr minicom ap3, lf4
|
||||
"ec420": {
|
||||
"cloudsdk_url": "http://wlan-ui.nola-qa.lab.wlan.tip.build",
|
||||
"customer_id": 2,
|
||||
"equipment_id": 7
|
||||
},
|
||||
"wf194c": {
|
||||
"cloudsdk_url": "",
|
||||
"customer_id": 2,
|
||||
"equipment_id": ""
|
||||
},
|
||||
# NOLA -01 lab-ctlr3 minicom ap3
|
||||
"eap102": {
|
||||
"cloudsdk_url": "http://wlan-ui.nola-qa.lab.wlan.tip.build",
|
||||
"customer_id": 2,
|
||||
"equipment_id": ""
|
||||
},
|
||||
# WORKS # NOLA -02 lab-ctlr minicom ap2, lf2
|
||||
"eap101": {
|
||||
"cloudsdk_url": "http://wlan-ui.nola-qa.lab.wlan.tip.build",
|
||||
"customer_id": 2,
|
||||
"equipment_id": 8
|
||||
},
|
||||
"wf188n": {
|
||||
"cloudsdk_url": "",
|
||||
"customer_id": 2,
|
||||
"equipment_id": ""
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASES = {
|
||||
"ap_upgrade": 2233,
|
||||
"5g_wpa2_bridge": 2236,
|
||||
"2g_wpa2_bridge": 2237,
|
||||
"5g_wpa_bridge": 2419,
|
||||
"2g_wpa_bridge": 2420,
|
||||
"2g_wpa_nat": 4323,
|
||||
"5g_wpa_nat": 4324,
|
||||
"2g_wpa2_nat": 4325,
|
||||
"5g_wpa2_nat": 4326,
|
||||
"2g_eap_bridge": 5214,
|
||||
"5g_eap_bridge": 5215,
|
||||
"2g_eap_nat": 5216,
|
||||
"5g_eap_nat": 5217,
|
||||
"cloud_connection": 5222,
|
||||
"cloud_fw": 5247,
|
||||
"5g_wpa2_vlan": 5248,
|
||||
"5g_wpa_vlan": 5249,
|
||||
"5g_eap_vlan": 5250,
|
||||
"2g_wpa2_vlan": 5251,
|
||||
"2g_wpa_vlan": 5252,
|
||||
"2g_eap_vlan": 5253,
|
||||
"cloud_ver": 5540,
|
||||
"bridge_vifc": 5541,
|
||||
"nat_vifc": 5542,
|
||||
"vlan_vifc": 5543,
|
||||
"bridge_vifs": 5544,
|
||||
"nat_vifs": 5545,
|
||||
"vlan_vifs": 5546,
|
||||
"upgrade_api": 5547,
|
||||
"create_fw": 5548,
|
||||
"ap_bridge": 5641,
|
||||
"ap_nat": 5642,
|
||||
"ap_vlan": 5643,
|
||||
"ssid_2g_eap_bridge": 5644,
|
||||
"ssid_2g_wpa2_bridge": 5645,
|
||||
"ssid_2g_wpa_bridge": 5646,
|
||||
"ssid_5g_eap_bridge": 5647,
|
||||
"ssid_5g_wpa2_bridge": 5648,
|
||||
"ssid_5g_wpa_bridge": 5649,
|
||||
"ssid_2g_eap_nat": 5650,
|
||||
"ssid_2g_wpa2_nat": 5651,
|
||||
"ssid_2g_wpa_nat": 5652,
|
||||
"ssid_5g_eap_nat": 5653,
|
||||
"ssid_5g_wpa2_nat": 5654,
|
||||
"ssid_5g_wpa_nat": 5655,
|
||||
"ssid_2g_eap_vlan": 5656,
|
||||
"ssid_2g_wpa2_vlan": 5657,
|
||||
"ssid_2g_wpa_vlan": 5658,
|
||||
"ssid_5g_eap_vlan": 5659,
|
||||
"ssid_5g_wpa2_vlan": 5660,
|
||||
"ssid_5g_wpa_vlan": 5661,
|
||||
"radius_profile": 5808,
|
||||
"bridge_ssid_update": 8742,
|
||||
"nat_ssid_update": 8743,
|
||||
"vlan_ssid_update": 8744
|
||||
}
|
||||
|
||||
|
||||
"""
|
||||
orch
|
||||
lab-ctlr
|
||||
lab-ctlr2
|
||||
lab-ctlr3
|
||||
lab-ctlr4
|
||||
"""
|
||||
@@ -23,10 +23,10 @@ from cloudsdk import ProfileUtility
|
||||
from cloudsdk import FirmwareUtility
|
||||
import pytest
|
||||
import logging
|
||||
from configuration_data import APNOS_CREDENTIAL_DATA
|
||||
from configuration_data import RADIUS_SERVER_DATA
|
||||
from configuration_data import TEST_CASES
|
||||
from configuration_data import NOLA
|
||||
from configuration import APNOS_CREDENTIAL_DATA
|
||||
from configuration import RADIUS_SERVER_DATA
|
||||
from configuration import TEST_CASES
|
||||
from configuration import NOLA
|
||||
from testrail_api import APIClient
|
||||
from reporting import Reporting
|
||||
|
||||
@@ -142,29 +142,12 @@ def instantiate_cloudsdk(testrun_session):
|
||||
try:
|
||||
sdk_client = CloudSDK(testbed=NOLA[testrun_session]["cloudsdk_url"],
|
||||
customer_id=NOLA[testrun_session]["customer_id"])
|
||||
except:
|
||||
except Exception as e:
|
||||
print(e)
|
||||
sdk_client = False
|
||||
yield sdk_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_jFrog(request):
|
||||
jfrog_cred = {
|
||||
"user": request.config.getini("jfrog-user-id"),
|
||||
"password": request.config.getini("jfrog-user-password")
|
||||
}
|
||||
yield jfrog_cred
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_firmware(instantiate_cloudsdk, instantiate_jFrog):
|
||||
try:
|
||||
firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_cloudsdk)
|
||||
except:
|
||||
firmware_client = False
|
||||
yield firmware_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_profile(instantiate_cloudsdk):
|
||||
try:
|
||||
@@ -174,119 +157,12 @@ def instantiate_profile(instantiate_cloudsdk):
|
||||
yield profile_object
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_testrail(request):
|
||||
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_project(request, instantiate_testrail, testrun_session, get_latest_firmware):
|
||||
if request.config.getoption("--skip-testrail"):
|
||||
rid = "skip testrails"
|
||||
else:
|
||||
projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
test_run_name = request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
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"),
|
||||
description="Automated Nightly Sanity test run for new firmware build")
|
||||
rid = instantiate_testrail.get_run_id(
|
||||
test_run_name=request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
datetime.date.today()) + "_" + get_latest_firmware)
|
||||
yield rid
|
||||
|
||||
|
||||
"""
|
||||
Utility Fixtures
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_equipment_id(testrun_session):
|
||||
yield NOLA[testrun_session]["equipment_id"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_latest_firmware(testrun_session, instantiate_firmware):
|
||||
try:
|
||||
latest_firmware = instantiate_firmware.get_latest_fw_version(testrun_session)
|
||||
except:
|
||||
latest_firmware = False
|
||||
yield latest_firmware
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_ssh(request, testrun_session):
|
||||
try:
|
||||
ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
active_fw = ap_ssh.get_active_firmware()
|
||||
except Exception as e:
|
||||
active_fw = False
|
||||
yield active_fw
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_cloud(instantiate_cloudsdk, get_equipment_id):
|
||||
yield instantiate_cloudsdk.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_ap_manager_status():
|
||||
ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
status = ap_ssh.get_manager_state()
|
||||
if "ACTIVE" not in status:
|
||||
time.sleep(30)
|
||||
ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
status = ap_ssh.get_manager_state()
|
||||
yield status
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def should_upload_firmware(request):
|
||||
yield request.config.getoption("--force-upload")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def should_upgrade_firmware(request):
|
||||
yield request.config.getoption("--force-upgrade")
|
||||
|
||||
|
||||
@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
|
||||
|
||||
|
||||
@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
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_profile_data(testrun_session):
|
||||
profile_data = {}
|
||||
for mode in "BRIDGE", "NAT", "VLAN":
|
||||
profile_data[mode] = {}
|
||||
for security in "OPEN", "WPA", "WPA2_P", "WPA2_E":
|
||||
for security in "OPEN", "WPA", "WPA2_P", "WPA2_E", "WEP":
|
||||
profile_data[mode][security] = {}
|
||||
for radio in "2G", "5G":
|
||||
profile_data[mode][security][radio] = {}
|
||||
@@ -309,343 +185,107 @@ def setup_profile_data(testrun_session):
|
||||
yield profile_data
|
||||
|
||||
|
||||
"""
|
||||
Profile Utility
|
||||
"""
|
||||
@pytest.fixture(scope="session")
|
||||
def get_security_flags():
|
||||
security = ["open", "wpa", "wpa2_personal", "wpa2_enterprise", "twog", "fiveg", "radius"]
|
||||
yield security
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_markers(request, get_security_flags):
|
||||
session = request.node
|
||||
markers = list()
|
||||
security = get_security_flags
|
||||
security_dict = dict().fromkeys(security)
|
||||
for item in session.items:
|
||||
for j in item.iter_markers():
|
||||
markers.append(j.name)
|
||||
print(set(markers))
|
||||
for i in security:
|
||||
if set(markers).__contains__(i):
|
||||
security_dict[i] = True
|
||||
else:
|
||||
security_dict[i] = False
|
||||
print(security_dict)
|
||||
yield security_dict
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_equipment_id(testrun_session):
|
||||
yield NOLA[testrun_session]["equipment_id"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def reset_profile(instantiate_profile):
|
||||
instantiate_profile.profile_creation_ids["ssid"] = []
|
||||
yield True
|
||||
def setup_profiles(create_profiles, instantiate_profile, get_equipment_id):
|
||||
instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
print(create_profiles)
|
||||
yield "set(markers)"
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def cleanup_cloud_profiles(instantiate_cloudsdk):
|
||||
profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
yield profile_object.cleanup_profiles()
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_radius_profile(instantiate_profile, testrun_session):
|
||||
radius_info = {
|
||||
"name": testrun_session + "-RADIUS-Sanity",
|
||||
"ip": RADIUS_SERVER_DATA["ip"],
|
||||
"port": RADIUS_SERVER_DATA["port"],
|
||||
"secret": RADIUS_SERVER_DATA["secret"]
|
||||
}
|
||||
instantiate_profile.delete_profile_by_name(radius_info["name"])
|
||||
@pytest.fixture(scope="class")
|
||||
def create_profiles(request, get_security_flags, get_markers, instantiate_profile, setup_profile_data):
|
||||
profile_id = {"ssid": [], "rf": None, "radius": None, "equipment_ap": None}
|
||||
mode = str(request._parent_request.param)
|
||||
instantiate_profile.cleanup_profiles()
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile_info = instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
yield profile_info
|
||||
# if get_markers["wifi5"]:
|
||||
# # Create Radius Profile
|
||||
# pass
|
||||
# if get_markers["wifi6"]:
|
||||
# # Create Radius Profile
|
||||
# pass
|
||||
|
||||
# Create RF Profile Here
|
||||
instantiate_profile.set_rf_profile()
|
||||
if get_markers["radius"]:
|
||||
radius_info = RADIUS_SERVER_DATA
|
||||
radius_info["name"] = "Automation-Radius-Profile"
|
||||
instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
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"]
|
||||
id = instantiate_profile.create_open_ssid_profile(two4g=True, fiveg=False, profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["OPEN"]["5G"]
|
||||
id = instantiate_profile.create_open_ssid_profile(two4g=False, fiveg=True, profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
if get_markers[i] and i == "wpa":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA"]["2G"]
|
||||
id = instantiate_profile.create_wpa_ssid_profile(two4g=True, fiveg=False, profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA"]["5G"]
|
||||
id = instantiate_profile.create_wpa_ssid_profile(two4g=False, fiveg=True, profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
if get_markers[i] and i == "wpa2_personal":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_P"]["2G"]
|
||||
id = instantiate_profile.create_wpa2_personal_ssid_profile(two4g=True, fiveg=False,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_P"]["5G"]
|
||||
id = instantiate_profile.create_wpa2_personal_ssid_profile(two4g=False, fiveg=True,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
if get_markers[i] and i == "wpa2_enterprise":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_E"]["2G"]
|
||||
id = instantiate_profile.create_wpa2_enterprise_ssid_profile(two4g=True, fiveg=False,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_E"]["5G"]
|
||||
id = instantiate_profile.create_wpa2_enterprise_ssid_profile(two4g=False, fiveg=True,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def set_rf_profile(instantiate_profile):
|
||||
try:
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.set_rf_profile()
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
"""
|
||||
BRIDGE MOde
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except Exception as e:
|
||||
# (e)
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except Exception as e:
|
||||
# (e)
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
"""
|
||||
NAT MOde
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA2_P']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA2_P']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA2_E']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["NAT"]['WPA2_E']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
"""
|
||||
VLAN MOde
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA2_P']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_p_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA2_P']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA2_E']['2G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_wpa2_e_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
try:
|
||||
profile_data = setup_profile_data["VLAN"]['WPA2_E']['5G']
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
except:
|
||||
profile = False
|
||||
yield profile
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_ap_profile_bridge(instantiate_profile, testrun_session):
|
||||
try:
|
||||
profile_data = {
|
||||
"profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'BRIDGE'),
|
||||
}
|
||||
profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
except Exception as e:
|
||||
profile_obj = e
|
||||
print(profile_obj)
|
||||
yield profile_obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_ap_profile_nat(instantiate_profile, testrun_session):
|
||||
# Create Equipment AP Profile Here
|
||||
profile_data = {
|
||||
"profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'NAT'),
|
||||
"profile_name": "Equipment-AP-" + mode
|
||||
}
|
||||
profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
yield profile_obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_ap_profile_vlan(instantiate_profile, testrun_session):
|
||||
profile_data = {
|
||||
"profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'VLAN'),
|
||||
}
|
||||
profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
yield profile_obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_current_profile_cloud(instantiate_profile):
|
||||
ssid_names = []
|
||||
print(instantiate_profile.profile_creation_ids["ssid"])
|
||||
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
|
||||
|
||||
|
||||
"""
|
||||
Profile Push Fixtures
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def push_profile(instantiate_profile, get_equipment_id, setup_profile_data):
|
||||
try:
|
||||
instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
status = True
|
||||
except Exception as e:
|
||||
status = False
|
||||
|
||||
yield status
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_lanforge_data(request):
|
||||
lanforge_data = {
|
||||
"lanforge_ip": request.config.getini("lanforge-ip-address"),
|
||||
"lanforge-port-number": request.config.getini("lanforge-port-number"),
|
||||
"lanforge_2dot4g": request.config.getini("lanforge-2dot4g-radio"),
|
||||
"lanforge_5g": request.config.getini("lanforge-5g-radio"),
|
||||
"lanforge_2dot4g_prefix": request.config.getini("lanforge-2dot4g-prefix"),
|
||||
"lanforge_5g_prefix": request.config.getini("lanforge-5g-prefix"),
|
||||
"lanforge_2dot4g_station": request.config.getini("lanforge-2dot4g-station"),
|
||||
"lanforge_5g_station": request.config.getini("lanforge-5g-station"),
|
||||
"lanforge_bridge_port": request.config.getini("lanforge-bridge-port"),
|
||||
"lanforge_vlan_port": "eth1.100",
|
||||
"vlan": 100
|
||||
}
|
||||
yield lanforge_data
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def update_ssid(request, instantiate_profile, setup_profile_data):
|
||||
requested_profile = str(request.param).replace(" ","").split(",")
|
||||
profile = setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]
|
||||
status = instantiate_profile.update_ssid_name(profile_name=profile["profile_name"], new_profile_name=requested_profile[3])
|
||||
setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["profile_name"] = requested_profile[3]
|
||||
setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["ssid_name"] = requested_profile[3]
|
||||
time.sleep(90)
|
||||
yield status
|
||||
instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
yield profile_id
|
||||
|
||||
0
tests/controller/__init__.py
Normal file
0
tests/controller/__init__.py
Normal file
562
tests/controller/conftest.py
Normal file
562
tests/controller/conftest.py
Normal file
@@ -0,0 +1,562 @@
|
||||
# # import files in the current directory
|
||||
# import datetime
|
||||
# import sys
|
||||
# import os
|
||||
# import time
|
||||
#
|
||||
# sys.path.append(
|
||||
# os.path.dirname(
|
||||
# os.path.realpath(__file__)
|
||||
# )
|
||||
# )
|
||||
#
|
||||
# if 'cloudsdk' not in sys.path:
|
||||
# sys.path.append(f'../libs/cloudsdk')
|
||||
# if 'apnos' not in sys.path:
|
||||
# sys.path.append(f'../libs/apnos')
|
||||
# if 'testrails' not in sys.path:
|
||||
# sys.path.append(f'../libs/testrails')
|
||||
#
|
||||
# from apnos import APNOS
|
||||
# from cloudsdk import CloudSDK
|
||||
# from cloudsdk import ProfileUtility
|
||||
# from cloudsdk import FirmwareUtility
|
||||
# import pytest
|
||||
# import logging
|
||||
# from configuration import APNOS_CREDENTIAL_DATA
|
||||
# from configuration import RADIUS_SERVER_DATA
|
||||
# from configuration import TEST_CASES
|
||||
# from configuration import NOLA
|
||||
# from testrail_api import APIClient
|
||||
# from reporting import Reporting
|
||||
#
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Test session base fixture
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def testrun_session(request):
|
||||
# var = request.config.getoption("model")
|
||||
# yield var
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Instantiate Objects for Test session
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_cloudsdk(testrun_session):
|
||||
# try:
|
||||
# sdk_client = CloudSDK(testbed=NOLA[testrun_session]["cloudsdk_url"],
|
||||
# customer_id=NOLA[testrun_session]["customer_id"])
|
||||
# except:
|
||||
# sdk_client = False
|
||||
# yield sdk_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_jFrog(request):
|
||||
# jfrog_cred = {
|
||||
# "user": request.config.getini("jfrog-user-id"),
|
||||
# "password": request.config.getini("jfrog-user-password")
|
||||
# }
|
||||
# yield jfrog_cred
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_firmware(instantiate_cloudsdk, instantiate_jFrog):
|
||||
# try:
|
||||
# firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# firmware_client = False
|
||||
# yield firmware_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_profile(instantiate_cloudsdk):
|
||||
# try:
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# profile_object = False
|
||||
# yield profile_object
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_testrail(request):
|
||||
# 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_project(request, instantiate_testrail, testrun_session, get_latest_firmware):
|
||||
# if request.config.getoption("--skip-testrail"):
|
||||
# rid = "skip testrails"
|
||||
# else:
|
||||
# projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
# test_run_name = request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# 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"),
|
||||
# description="Automated Nightly Sanity test run for new firmware build")
|
||||
# rid = instantiate_testrail.get_run_id(
|
||||
# test_run_name=request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# datetime.date.today()) + "_" + get_latest_firmware)
|
||||
# yield rid
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Utility Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_equipment_id(testrun_session):
|
||||
# yield NOLA[testrun_session]["equipment_id"]
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_latest_firmware(testrun_session, instantiate_firmware):
|
||||
# try:
|
||||
# latest_firmware = instantiate_firmware.get_latest_fw_version(testrun_session)
|
||||
# except:
|
||||
# latest_firmware = False
|
||||
# yield latest_firmware
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_ssh(request, testrun_session):
|
||||
# try:
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# active_fw = ap_ssh.get_active_firmware()
|
||||
# except Exception as e:
|
||||
# active_fw = False
|
||||
# yield active_fw
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_cloud(instantiate_cloudsdk, get_equipment_id):
|
||||
# yield instantiate_cloudsdk.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_ap_manager_status():
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# if "ACTIVE" not in status:
|
||||
# time.sleep(30)
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upload_firmware(request):
|
||||
# yield request.config.getoption("--force-upload")
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upgrade_firmware(request):
|
||||
# yield request.config.getoption("--force-upgrade")
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def setup_profile_data(testrun_session):
|
||||
# profile_data = {}
|
||||
# for mode in "BRIDGE", "NAT", "VLAN":
|
||||
# profile_data[mode] = {}
|
||||
# for security in "OPEN", "WPA", "WPA2_P", "WPA2_E":
|
||||
# profile_data[mode][security] = {}
|
||||
# for radio in "2G", "5G":
|
||||
# profile_data[mode][security][radio] = {}
|
||||
# name_string = f"{'Sanity'}-{testrun_session}-{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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Utility
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="class")
|
||||
# def reset_profile(instantiate_profile):
|
||||
# instantiate_profile.profile_creation_ids["ssid"] = []
|
||||
# yield True
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def cleanup_cloud_profiles(instantiate_cloudsdk):
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# yield profile_object.cleanup_profiles()
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_radius_profile(instantiate_profile, testrun_session):
|
||||
# radius_info = {
|
||||
# "name": testrun_session + "-RADIUS-Sanity",
|
||||
# "ip": RADIUS_SERVER_DATA["ip"],
|
||||
# "port": RADIUS_SERVER_DATA["port"],
|
||||
# "secret": RADIUS_SERVER_DATA["secret"]
|
||||
# }
|
||||
# instantiate_profile.delete_profile_by_name(radius_info["name"])
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile_info = instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
# yield profile_info
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def set_rf_profile(instantiate_profile):
|
||||
# try:
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.set_rf_profile()
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# BRIDGE MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# NAT MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# VLAN MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_bridge(instantiate_profile, testrun_session):
|
||||
# try:
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'BRIDGE'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# except Exception as e:
|
||||
# profile_obj = e
|
||||
# print(profile_obj)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_nat(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'NAT'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_vlan(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'VLAN'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_current_profile_cloud(instantiate_profile):
|
||||
# ssid_names = []
|
||||
# print(instantiate_profile.profile_creation_ids["ssid"])
|
||||
# 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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Push Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def push_profile(instantiate_profile, get_equipment_id, setup_profile_data):
|
||||
# try:
|
||||
# instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
# status = True
|
||||
# except Exception as e:
|
||||
# status = False
|
||||
#
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_lanforge_data(request):
|
||||
# lanforge_data = {
|
||||
# "lanforge_ip": request.config.getini("lanforge-ip-address"),
|
||||
# "lanforge-port-number": request.config.getini("lanforge-port-number"),
|
||||
# "lanforge_2dot4g": request.config.getini("lanforge-2dot4g-radio"),
|
||||
# "lanforge_5g": request.config.getini("lanforge-5g-radio"),
|
||||
# "lanforge_2dot4g_prefix": request.config.getini("lanforge-2dot4g-prefix"),
|
||||
# "lanforge_5g_prefix": request.config.getini("lanforge-5g-prefix"),
|
||||
# "lanforge_2dot4g_station": request.config.getini("lanforge-2dot4g-station"),
|
||||
# "lanforge_5g_station": request.config.getini("lanforge-5g-station"),
|
||||
# "lanforge_bridge_port": request.config.getini("lanforge-bridge-port"),
|
||||
# "lanforge_vlan_port": "eth1.100",
|
||||
# "vlan": 100
|
||||
# }
|
||||
# yield lanforge_data
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def update_ssid(request, instantiate_profile, setup_profile_data):
|
||||
# requested_profile = str(request.param).replace(" ","").split(",")
|
||||
# profile = setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]
|
||||
# status = instantiate_profile.update_ssid_name(profile_name=profile["profile_name"], new_profile_name=requested_profile[3])
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["profile_name"] = requested_profile[3]
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["ssid_name"] = requested_profile[3]
|
||||
# time.sleep(90)
|
||||
# yield status
|
||||
19
tests/controller/test_cloud_basic.py
Normal file
19
tests/controller/test_cloud_basic.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import pytest
|
||||
from configuration import CLOUDSDK_VERSION
|
||||
|
||||
|
||||
@pytest.mark.sdk_version_check
|
||||
def test_cloud_sdk_version(instantiate_cloudsdk):
|
||||
try:
|
||||
response = instantiate_cloudsdk.portal_ping()
|
||||
if CLOUDSDK_VERSION['project_version'] == response._project_version and \
|
||||
CLOUDSDK_VERSION['commit_id'] == response._commit_id:
|
||||
PASS = True
|
||||
else:
|
||||
PASS = False
|
||||
except Exception as e:
|
||||
print(e)
|
||||
PASS = False
|
||||
assert PASS
|
||||
|
||||
|
||||
0
tests/controller/test_cloud_equipment.py
Normal file
0
tests/controller/test_cloud_equipment.py
Normal file
0
tests/controller/test_cloud_firmware.py
Normal file
0
tests/controller/test_cloud_firmware.py
Normal file
0
tests/controller/test_cloud_profiles.py
Normal file
0
tests/controller/test_cloud_profiles.py
Normal file
0
tests/e2e/__init__.py
Normal file
0
tests/e2e/__init__.py
Normal file
0
tests/e2e/advanced/__init__.py
Normal file
0
tests/e2e/advanced/__init__.py
Normal file
651
tests/e2e/advanced/conftest.py
Normal file
651
tests/e2e/advanced/conftest.py
Normal file
@@ -0,0 +1,651 @@
|
||||
# # import files in the current directory
|
||||
# import datetime
|
||||
# import sys
|
||||
# import os
|
||||
# import time
|
||||
#
|
||||
# sys.path.append(
|
||||
# os.path.dirname(
|
||||
# os.path.realpath(__file__)
|
||||
# )
|
||||
# )
|
||||
#
|
||||
# if 'cloudsdk' not in sys.path:
|
||||
# sys.path.append(f'../libs/cloudsdk')
|
||||
# if 'apnos' not in sys.path:
|
||||
# sys.path.append(f'../libs/apnos')
|
||||
# if 'testrails' not in sys.path:
|
||||
# sys.path.append(f'../libs/testrails')
|
||||
#
|
||||
# from apnos import APNOS
|
||||
# from cloudsdk import CloudSDK
|
||||
# from cloudsdk import ProfileUtility
|
||||
# from cloudsdk import FirmwareUtility
|
||||
# import pytest
|
||||
# import logging
|
||||
# from configuration import APNOS_CREDENTIAL_DATA
|
||||
# from configuration import RADIUS_SERVER_DATA
|
||||
# from configuration import TEST_CASES
|
||||
# from configuration import NOLA
|
||||
# from testrail_api import APIClient
|
||||
# from reporting import Reporting
|
||||
#
|
||||
#
|
||||
# def pytest_addoption(parser):
|
||||
# parser.addini("force-upload", "firmware-upload option")
|
||||
#
|
||||
# parser.addini("jfrog-base-url", "jfrog base url")
|
||||
# parser.addini("jfrog-user-id", "jfrog username")
|
||||
# parser.addini("jfrog-user-password", "jfrog password")
|
||||
#
|
||||
# parser.addini("testbed-name", "cloud sdk base url")
|
||||
# parser.addini("equipment-model", "Equipment Model")
|
||||
#
|
||||
# parser.addini("sdk-user-id", "cloud sdk username")
|
||||
# parser.addini("sdk-user-password", "cloud sdk user password")
|
||||
#
|
||||
# parser.addini("sdk-customer-id", "cloud sdk customer id for the access points")
|
||||
# parser.addini("sdk-equipment-id", "cloud sdk customer id for the access points")
|
||||
#
|
||||
# parser.addini("testrail-base-url", "testrail base url")
|
||||
# parser.addini("testrail-project", "testrail project name to use to generate test reports")
|
||||
# parser.addini("testrail-user-id", "testrail username")
|
||||
# parser.addini("testrail-user-password", "testrail user password")
|
||||
#
|
||||
# parser.addini("lanforge-ip-address", "LANforge ip address to connect to")
|
||||
# parser.addini("lanforge-port-number", "LANforge port number to connect to")
|
||||
# parser.addini("lanforge-bridge-port", "LANforge port for bridge mode testing")
|
||||
# parser.addini("lanforge-2dot4g-prefix", "LANforge 2.4g prefix")
|
||||
# parser.addini("lanforge-5g-prefix", "LANforge 5g prefix")
|
||||
# parser.addini("lanforge-2dot4g-station", "LANforge station name for 2.4g")
|
||||
# parser.addini("lanforge-5g-station", "LANforge station name for 5g")
|
||||
# parser.addini("lanforge-2dot4g-radio", "LANforge radio for 2.4g")
|
||||
# parser.addini("lanforge-5g-radio", "LANforge radio for 5g")
|
||||
#
|
||||
# parser.addini("jumphost_ip", "APNOS Jumphost IP Address")
|
||||
# parser.addini("jumphost_username", "APNOS Jumphost Username")
|
||||
# parser.addini("jumphost_password", "APNOS Jumphost password")
|
||||
# parser.addini("jumphost_port", "APNOS Jumphost ssh Port")
|
||||
#
|
||||
# parser.addini("skip-open", "skip open ssid mode")
|
||||
# parser.addini("skip-wpa", "skip wpa ssid mode")
|
||||
# parser.addini("skip-wpa2", "skip wpa2 ssid mode")
|
||||
# parser.addini("skip-eap", "skip eap ssid mode")
|
||||
#
|
||||
# parser.addini("radius_server_ip", "Radius server IP")
|
||||
# parser.addini("radius_port", "Radius Port")
|
||||
# parser.addini("radius_secret", "Radius shared Secret")
|
||||
#
|
||||
# parser.addini("tr_url", "Test Rail URL")
|
||||
# parser.addini("tr_prefix", "Test Rail Prefix (Generally Testbed_name_)")
|
||||
# parser.addini("tr_user", "Testrail Username")
|
||||
# parser.addini("tr_pass", "Testrail Password")
|
||||
# parser.addini("tr_project_id", "Testrail Project ID")
|
||||
# parser.addini("milestone", "milestone Id")
|
||||
#
|
||||
# parser.addini("num_stations", "Number of Stations/Clients for testing")
|
||||
#
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--skip-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="skip updating firmware on the AP (useful for local testing)"
|
||||
# )
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--force-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Upgrading Firmware even if it is already latest version"
|
||||
# )
|
||||
# parser.addoption(
|
||||
# "--force-upload",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Uploading Firmware even if it is already latest version"
|
||||
# )
|
||||
# # 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(
|
||||
# "--skip-testrail",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="Stop using Testrails"
|
||||
# )
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Test session base fixture
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def testrun_session(request):
|
||||
# var = request.config.getoption("model")
|
||||
# yield var
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Instantiate Objects for Test session
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_cloudsdk(testrun_session):
|
||||
# try:
|
||||
# sdk_client = CloudSDK(testbed=NOLA[testrun_session]["cloudsdk_url"],
|
||||
# customer_id=NOLA[testrun_session]["customer_id"])
|
||||
# except:
|
||||
# sdk_client = False
|
||||
# yield sdk_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_jFrog(request):
|
||||
# jfrog_cred = {
|
||||
# "user": request.config.getini("jfrog-user-id"),
|
||||
# "password": request.config.getini("jfrog-user-password")
|
||||
# }
|
||||
# yield jfrog_cred
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_firmware(instantiate_cloudsdk, instantiate_jFrog):
|
||||
# try:
|
||||
# firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# firmware_client = False
|
||||
# yield firmware_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_profile(instantiate_cloudsdk):
|
||||
# try:
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# profile_object = False
|
||||
# yield profile_object
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_testrail(request):
|
||||
# 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_project(request, instantiate_testrail, testrun_session, get_latest_firmware):
|
||||
# if request.config.getoption("--skip-testrail"):
|
||||
# rid = "skip testrails"
|
||||
# else:
|
||||
# projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
# test_run_name = request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# 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"),
|
||||
# description="Automated Nightly Sanity test run for new firmware build")
|
||||
# rid = instantiate_testrail.get_run_id(
|
||||
# test_run_name=request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# datetime.date.today()) + "_" + get_latest_firmware)
|
||||
# yield rid
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Utility Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_equipment_id(testrun_session):
|
||||
# yield NOLA[testrun_session]["equipment_id"]
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_latest_firmware(testrun_session, instantiate_firmware):
|
||||
# try:
|
||||
# latest_firmware = instantiate_firmware.get_latest_fw_version(testrun_session)
|
||||
# except:
|
||||
# latest_firmware = False
|
||||
# yield latest_firmware
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_ssh(request, testrun_session):
|
||||
# try:
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# active_fw = ap_ssh.get_active_firmware()
|
||||
# except Exception as e:
|
||||
# active_fw = False
|
||||
# yield active_fw
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_cloud(instantiate_cloudsdk, get_equipment_id):
|
||||
# yield instantiate_cloudsdk.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_ap_manager_status():
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# if "ACTIVE" not in status:
|
||||
# time.sleep(30)
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upload_firmware(request):
|
||||
# yield request.config.getoption("--force-upload")
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upgrade_firmware(request):
|
||||
# yield request.config.getoption("--force-upgrade")
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def setup_profile_data(testrun_session):
|
||||
# profile_data = {}
|
||||
# for mode in "BRIDGE", "NAT", "VLAN":
|
||||
# profile_data[mode] = {}
|
||||
# for security in "OPEN", "WPA", "WPA2_P", "WPA2_E":
|
||||
# profile_data[mode][security] = {}
|
||||
# for radio in "2G", "5G":
|
||||
# profile_data[mode][security][radio] = {}
|
||||
# name_string = f"{'Sanity'}-{testrun_session}-{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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Utility
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="class")
|
||||
# def reset_profile(instantiate_profile):
|
||||
# instantiate_profile.profile_creation_ids["ssid"] = []
|
||||
# yield True
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def cleanup_cloud_profiles(instantiate_cloudsdk):
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# yield profile_object.cleanup_profiles()
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_radius_profile(instantiate_profile, testrun_session):
|
||||
# radius_info = {
|
||||
# "name": testrun_session + "-RADIUS-Sanity",
|
||||
# "ip": RADIUS_SERVER_DATA["ip"],
|
||||
# "port": RADIUS_SERVER_DATA["port"],
|
||||
# "secret": RADIUS_SERVER_DATA["secret"]
|
||||
# }
|
||||
# instantiate_profile.delete_profile_by_name(radius_info["name"])
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile_info = instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
# yield profile_info
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def set_rf_profile(instantiate_profile):
|
||||
# try:
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.set_rf_profile()
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# BRIDGE MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# NAT MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# VLAN MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_bridge(instantiate_profile, testrun_session):
|
||||
# try:
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'BRIDGE'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# except Exception as e:
|
||||
# profile_obj = e
|
||||
# print(profile_obj)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_nat(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'NAT'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_vlan(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'VLAN'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_current_profile_cloud(instantiate_profile):
|
||||
# ssid_names = []
|
||||
# print(instantiate_profile.profile_creation_ids["ssid"])
|
||||
# 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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Push Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def push_profile(instantiate_profile, get_equipment_id, setup_profile_data):
|
||||
# try:
|
||||
# instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
# status = True
|
||||
# except Exception as e:
|
||||
# status = False
|
||||
#
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_lanforge_data(request):
|
||||
# lanforge_data = {
|
||||
# "lanforge_ip": request.config.getini("lanforge-ip-address"),
|
||||
# "lanforge-port-number": request.config.getini("lanforge-port-number"),
|
||||
# "lanforge_2dot4g": request.config.getini("lanforge-2dot4g-radio"),
|
||||
# "lanforge_5g": request.config.getini("lanforge-5g-radio"),
|
||||
# "lanforge_2dot4g_prefix": request.config.getini("lanforge-2dot4g-prefix"),
|
||||
# "lanforge_5g_prefix": request.config.getini("lanforge-5g-prefix"),
|
||||
# "lanforge_2dot4g_station": request.config.getini("lanforge-2dot4g-station"),
|
||||
# "lanforge_5g_station": request.config.getini("lanforge-5g-station"),
|
||||
# "lanforge_bridge_port": request.config.getini("lanforge-bridge-port"),
|
||||
# "lanforge_vlan_port": "eth1.100",
|
||||
# "vlan": 100
|
||||
# }
|
||||
# yield lanforge_data
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def update_ssid(request, instantiate_profile, setup_profile_data):
|
||||
# requested_profile = str(request.param).replace(" ","").split(",")
|
||||
# profile = setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]
|
||||
# status = instantiate_profile.update_ssid_name(profile_name=profile["profile_name"], new_profile_name=requested_profile[3])
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["profile_name"] = requested_profile[3]
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["ssid_name"] = requested_profile[3]
|
||||
# time.sleep(90)
|
||||
# yield status
|
||||
0
tests/e2e/basic/__init__.py
Normal file
0
tests/e2e/basic/__init__.py
Normal file
0
tests/e2e/basic/air_time_fairnes/__init__.py
Normal file
0
tests/e2e/basic/air_time_fairnes/__init__.py
Normal file
0
tests/e2e/basic/client_connectivity/__init__.py
Normal file
0
tests/e2e/basic/client_connectivity/__init__.py
Normal file
370
tests/e2e/basic/client_connectivity/test_bridge_mode.py
Normal file
370
tests/e2e/basic/client_connectivity/test_bridge_mode.py
Normal file
@@ -0,0 +1,370 @@
|
||||
import pytest
|
||||
|
||||
|
||||
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 *
|
||||
from configuration import TEST_CASES
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
|
||||
import sta_connect2
|
||||
from sta_connect2 import StaConnect2
|
||||
import eap_connect
|
||||
from eap_connect import EAPConnect
|
||||
import time
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.bridges
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
(["BRIDGE"]),
|
||||
indirect=True
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeClientConnectivity(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_everything(self):
|
||||
assert True
|
||||
# @pytest.mark.wpa
|
||||
# @pytest.mark.twog
|
||||
# def test_client_wpa_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
# instantiate_project):
|
||||
# profile_data = setup_profile_data["BRIDGE"]["WPA"]["2G"]
|
||||
# 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))
|
||||
# print(profile_data, get_lanforge_data)
|
||||
# staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
# debug_=False)
|
||||
# staConnect.sta_mode = 0
|
||||
# staConnect.upstream_resource = 1
|
||||
# staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
# staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
# staConnect.resource = 1
|
||||
# staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
# staConnect.dut_passwd = profile_data["security_key"]
|
||||
# staConnect.dut_security = "wpa"
|
||||
# staConnect.station_names = station_names
|
||||
# staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
# staConnect.runtime_secs = 10
|
||||
# staConnect.bringup_time_sec = 60
|
||||
# staConnect.cleanup_on_exit = True
|
||||
# # staConnect.cleanup()
|
||||
# staConnect.setup()
|
||||
# staConnect.start()
|
||||
# print("napping %f sec" % staConnect.runtime_secs)
|
||||
# time.sleep(staConnect.runtime_secs)
|
||||
# staConnect.stop()
|
||||
# staConnect.cleanup()
|
||||
# run_results = staConnect.get_result_list()
|
||||
# for result in run_results:
|
||||
# print("test result: " + result)
|
||||
# # result = 'pass'
|
||||
# print("Single Client Connectivity :", staConnect.passes)
|
||||
# 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')
|
||||
# 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')
|
||||
# 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):
|
||||
# profile_data = setup_profile_data["BRIDGE"]["WPA"]["5G"]
|
||||
# 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))
|
||||
# staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
# debug_=False)
|
||||
# staConnect.sta_mode = 0
|
||||
# staConnect.upstream_resource = 1
|
||||
# staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
# staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
# staConnect.resource = 1
|
||||
# staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
# staConnect.dut_passwd = profile_data["security_key"]
|
||||
# staConnect.dut_security = "wpa"
|
||||
# staConnect.station_names = station_names
|
||||
# staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
# staConnect.runtime_secs = 10
|
||||
# staConnect.bringup_time_sec = 60
|
||||
# staConnect.cleanup_on_exit = True
|
||||
# # staConnect.cleanup()
|
||||
# staConnect.setup()
|
||||
# staConnect.start()
|
||||
# print("napping %f sec" % staConnect.runtime_secs)
|
||||
# time.sleep(staConnect.runtime_secs)
|
||||
# staConnect.stop()
|
||||
# staConnect.cleanup()
|
||||
# run_results = staConnect.get_result_list()
|
||||
# for result in run_results:
|
||||
# print("test result: " + result)
|
||||
# # result = 'pass'
|
||||
# print("Single Client Connectivity :", staConnect.passes)
|
||||
# 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')
|
||||
# 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')
|
||||
# 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):
|
||||
# profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["2G"]
|
||||
# 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))
|
||||
# staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
# debug_=False)
|
||||
# staConnect.sta_mode = 0
|
||||
# staConnect.upstream_resource = 1
|
||||
# staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
# staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
# staConnect.resource = 1
|
||||
# staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
# staConnect.dut_passwd = profile_data["security_key"]
|
||||
# staConnect.dut_security = "wpa2"
|
||||
# staConnect.station_names = station_names
|
||||
# staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
# staConnect.runtime_secs = 10
|
||||
# staConnect.bringup_time_sec = 60
|
||||
# staConnect.cleanup_on_exit = True
|
||||
# # staConnect.cleanup()
|
||||
# staConnect.setup()
|
||||
# staConnect.start()
|
||||
# print("napping %f sec" % staConnect.runtime_secs)
|
||||
# time.sleep(staConnect.runtime_secs)
|
||||
# staConnect.stop()
|
||||
# staConnect.cleanup()
|
||||
# run_results = staConnect.get_result_list()
|
||||
# for result in run_results:
|
||||
# print("test result: " + result)
|
||||
# # result = 'pass'
|
||||
# print("Single Client Connectivity :", staConnect.passes)
|
||||
# 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')
|
||||
# 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')
|
||||
# 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):
|
||||
# profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["5G"]
|
||||
# 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))
|
||||
# staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
# debug_=False)
|
||||
# staConnect.sta_mode = 0
|
||||
# staConnect.upstream_resource = 1
|
||||
# staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
# staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
# staConnect.resource = 1
|
||||
# staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
# staConnect.dut_passwd = profile_data["security_key"]
|
||||
# staConnect.dut_security = "wpa2"
|
||||
# staConnect.station_names = station_names
|
||||
# staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
# staConnect.runtime_secs = 10
|
||||
# staConnect.bringup_time_sec = 60
|
||||
# staConnect.cleanup_on_exit = True
|
||||
# # staConnect.cleanup()
|
||||
# staConnect.setup()
|
||||
# staConnect.start()
|
||||
# print("napping %f sec" % staConnect.runtime_secs)
|
||||
# time.sleep(staConnect.runtime_secs)
|
||||
# staConnect.stop()
|
||||
# staConnect.cleanup()
|
||||
# run_results = staConnect.get_result_list()
|
||||
# for result in run_results:
|
||||
# print("test result: " + result)
|
||||
# # result = 'pass'
|
||||
# print("Single Client Connectivity :", staConnect.passes)
|
||||
# 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')
|
||||
# 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')
|
||||
# assert staConnect.passes()
|
||||
# # C2236
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
# instantiate_testrail):
|
||||
# profile_data = setup_profile_data["BRIDGE"]["WPA2_E"]["2G"]
|
||||
# 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))
|
||||
# eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
# eap_connect.upstream_resource = 1
|
||||
# eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
# eap_connect.security = "wpa2"
|
||||
# eap_connect.sta_list = station_names
|
||||
# eap_connect.station_names = station_names
|
||||
# eap_connect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
# eap_connect.ssid = profile_data["ssid_name"]
|
||||
# eap_connect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
# eap_connect.eap = "TTLS"
|
||||
# eap_connect.identity = "nolaradius"
|
||||
# eap_connect.ttls_passwd = "nolastart"
|
||||
# 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()
|
||||
# try:
|
||||
# eap_connect.cleanup()
|
||||
# eap_connect.cleanup()
|
||||
# except:
|
||||
# pass
|
||||
# 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():
|
||||
# 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')
|
||||
# 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')
|
||||
# assert eap_connect.passes()
|
||||
# # C5214
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
# instantiate_testrail):
|
||||
# profile_data = setup_profile_data["BRIDGE"]["WPA2_E"]["5G"]
|
||||
# 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))
|
||||
# eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
# eap_connect.upstream_resource = 1
|
||||
# eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
# eap_connect.security = "wpa2"
|
||||
# eap_connect.sta_list = station_names
|
||||
# eap_connect.station_names = station_names
|
||||
# eap_connect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
# eap_connect.ssid = profile_data["ssid_name"]
|
||||
# eap_connect.radio = get_lanforge_data["lanforge_5g"]
|
||||
# eap_connect.eap = "TTLS"
|
||||
# eap_connect.identity = "nolaradius"
|
||||
# eap_connect.ttls_passwd = "nolastart"
|
||||
# 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()
|
||||
# try:
|
||||
# eap_connect.cleanup()
|
||||
# eap_connect.cleanup()
|
||||
# except:
|
||||
# pass
|
||||
# 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():
|
||||
# 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')
|
||||
# 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')
|
||||
# assert eap_connect.passes()
|
||||
#
|
||||
# @pytest.mark.modify_ssid
|
||||
# @pytest.mark.parametrize(
|
||||
# 'update_ssid',
|
||||
# (["BRIDGE, WPA, 5G, Sanity-updated-5G-WPA-BRIDGE"]),
|
||||
# indirect=True
|
||||
# )
|
||||
# def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
# instantiate_project):
|
||||
# profile_data = setup_profile_data["BRIDGE"]["WPA"]["5G"]
|
||||
# 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))
|
||||
# staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
# debug_=False)
|
||||
# staConnect.sta_mode = 0
|
||||
# staConnect.upstream_resource = 1
|
||||
# staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
# staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
# staConnect.resource = 1
|
||||
# staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
# staConnect.dut_passwd = profile_data["security_key"]
|
||||
# staConnect.dut_security = "wpa"
|
||||
# staConnect.station_names = station_names
|
||||
# staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
# staConnect.runtime_secs = 10
|
||||
# staConnect.bringup_time_sec = 60
|
||||
# staConnect.cleanup_on_exit = True
|
||||
# # staConnect.cleanup()
|
||||
# staConnect.setup()
|
||||
# staConnect.start()
|
||||
# print("napping %f sec" % staConnect.runtime_secs)
|
||||
# time.sleep(staConnect.runtime_secs)
|
||||
# staConnect.stop()
|
||||
# staConnect.cleanup()
|
||||
# run_results = staConnect.get_result_list()
|
||||
# for result in run_results:
|
||||
# print("test result: " + result)
|
||||
# # result = 'pass'
|
||||
# print("Single Client Connectivity :", staConnect.passes)
|
||||
# if staConnect.passes():
|
||||
# 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')
|
||||
# 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')
|
||||
# assert staConnect.passes()
|
||||
#
|
||||
364
tests/e2e/basic/client_connectivity/test_nat_mode.py
Normal file
364
tests/e2e/basic/client_connectivity/test_nat_mode.py
Normal file
@@ -0,0 +1,364 @@
|
||||
import pytest
|
||||
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-something")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
from configuration import TEST_CASES
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
|
||||
import sta_connect2
|
||||
from sta_connect2 import StaConnect2
|
||||
import eap_connect
|
||||
from eap_connect import EAPConnect
|
||||
import time
|
||||
#
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.nat
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
(["NAT"]),
|
||||
indirect=True
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
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):
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||
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))
|
||||
print(profile_data, get_lanforge_data)
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
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')
|
||||
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')
|
||||
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):
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
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))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
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')
|
||||
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')
|
||||
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):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||
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))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
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')
|
||||
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')
|
||||
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):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||
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))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
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')
|
||||
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')
|
||||
assert staConnect.passes()
|
||||
# C2236
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_E"]["2G"]
|
||||
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))
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = station_names
|
||||
eap_connect.station_names = station_names
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
eap_connect.ssid = profile_data["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = "nolaradius"
|
||||
eap_connect.ttls_passwd = "nolastart"
|
||||
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()
|
||||
try:
|
||||
eap_connect.cleanup()
|
||||
eap_connect.cleanup()
|
||||
except:
|
||||
pass
|
||||
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():
|
||||
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')
|
||||
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')
|
||||
assert eap_connect.passes()
|
||||
# C5214
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_testrail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_E"]["5G"]
|
||||
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))
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = station_names
|
||||
eap_connect.station_names = station_names
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
eap_connect.ssid = profile_data["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_5g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = "nolaradius"
|
||||
eap_connect.ttls_passwd = "nolastart"
|
||||
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()
|
||||
try:
|
||||
eap_connect.cleanup()
|
||||
eap_connect.cleanup()
|
||||
except:
|
||||
pass
|
||||
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():
|
||||
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')
|
||||
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')
|
||||
assert eap_connect.passes()
|
||||
|
||||
@pytest.mark.modify_ssid
|
||||
@pytest.mark.parametrize(
|
||||
'update_ssid',
|
||||
(["NAT, WPA, 5G, Sanity-updated-5G-WPA-NAT"]),
|
||||
indirect=True
|
||||
)
|
||||
def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_project):
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
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))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
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')
|
||||
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')
|
||||
assert staConnect.passes()
|
||||
357
tests/e2e/basic/client_connectivity/test_vlan_mode.py
Normal file
357
tests/e2e/basic/client_connectivity/test_vlan_mode.py
Normal file
@@ -0,0 +1,357 @@
|
||||
import pytest
|
||||
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-something")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
from configuration import TEST_CASES
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
|
||||
import sta_connect2
|
||||
from sta_connect2 import StaConnect2
|
||||
import eap_connect
|
||||
from eap_connect import EAPConnect
|
||||
import time
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.vlan
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
(["VLAN"]),
|
||||
indirect=True
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
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):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA"]["2G"]
|
||||
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))
|
||||
print(profile_data, get_lanforge_data)
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
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')
|
||||
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')
|
||||
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):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA"]["5G"]
|
||||
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))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
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"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
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')
|
||||
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')
|
||||
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):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_P"]["2G"]
|
||||
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))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
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')
|
||||
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')
|
||||
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):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_P"]["5G"]
|
||||
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))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
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"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
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')
|
||||
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')
|
||||
assert staConnect.passes()
|
||||
# C2236
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_E"]["2G"]
|
||||
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))
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = station_names
|
||||
eap_connect.station_names = station_names
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
eap_connect.ssid = profile_data["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = "nolaradius"
|
||||
eap_connect.ttls_passwd = "nolastart"
|
||||
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()
|
||||
try:
|
||||
eap_connect.cleanup()
|
||||
eap_connect.cleanup()
|
||||
except:
|
||||
pass
|
||||
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():
|
||||
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')
|
||||
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')
|
||||
assert eap_connect.passes()
|
||||
# C5214
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_E"]["5G"]
|
||||
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))
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = station_names
|
||||
eap_connect.station_names = station_names
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
eap_connect.ssid = profile_data["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_5g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = "nolaradius"
|
||||
eap_connect.ttls_passwd = "nolastart"
|
||||
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()
|
||||
try:
|
||||
eap_connect.cleanup()
|
||||
eap_connect.cleanup()
|
||||
except:
|
||||
pass
|
||||
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():
|
||||
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')
|
||||
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')
|
||||
assert eap_connect.passes()
|
||||
|
||||
@pytest.mark.modify_ssid
|
||||
@pytest.mark.parametrize(
|
||||
'update_ssid',
|
||||
(["VLAN, WPA, 5G, Sanity-updated-5G-WPA-VLAN"]),
|
||||
indirect=True
|
||||
)
|
||||
def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_project):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA"]["5G"]
|
||||
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))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
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')
|
||||
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')
|
||||
assert staConnect.passes()
|
||||
651
tests/e2e/basic/conftest.py
Normal file
651
tests/e2e/basic/conftest.py
Normal file
@@ -0,0 +1,651 @@
|
||||
# # import files in the current directory
|
||||
# import datetime
|
||||
# import sys
|
||||
# import os
|
||||
# import time
|
||||
#
|
||||
# sys.path.append(
|
||||
# os.path.dirname(
|
||||
# os.path.realpath(__file__)
|
||||
# )
|
||||
# )
|
||||
#
|
||||
# if 'cloudsdk' not in sys.path:
|
||||
# sys.path.append(f'../libs/cloudsdk')
|
||||
# if 'apnos' not in sys.path:
|
||||
# sys.path.append(f'../libs/apnos')
|
||||
# if 'testrails' not in sys.path:
|
||||
# sys.path.append(f'../libs/testrails')
|
||||
#
|
||||
# from apnos import APNOS
|
||||
# from cloudsdk import CloudSDK
|
||||
# from cloudsdk import ProfileUtility
|
||||
# from cloudsdk import FirmwareUtility
|
||||
# import pytest
|
||||
# import logging
|
||||
# from configuration import APNOS_CREDENTIAL_DATA
|
||||
# from configuration import RADIUS_SERVER_DATA
|
||||
# from configuration import TEST_CASES
|
||||
# from configuration import NOLA
|
||||
# from testrail_api import APIClient
|
||||
# from reporting import Reporting
|
||||
#
|
||||
#
|
||||
# def pytest_addoption(parser):
|
||||
# parser.addini("force-upload", "firmware-upload option")
|
||||
#
|
||||
# parser.addini("jfrog-base-url", "jfrog base url")
|
||||
# parser.addini("jfrog-user-id", "jfrog username")
|
||||
# parser.addini("jfrog-user-password", "jfrog password")
|
||||
#
|
||||
# parser.addini("testbed-name", "cloud sdk base url")
|
||||
# parser.addini("equipment-model", "Equipment Model")
|
||||
#
|
||||
# parser.addini("sdk-user-id", "cloud sdk username")
|
||||
# parser.addini("sdk-user-password", "cloud sdk user password")
|
||||
#
|
||||
# parser.addini("sdk-customer-id", "cloud sdk customer id for the access points")
|
||||
# parser.addini("sdk-equipment-id", "cloud sdk customer id for the access points")
|
||||
#
|
||||
# parser.addini("testrail-base-url", "testrail base url")
|
||||
# parser.addini("testrail-project", "testrail project name to use to generate test reports")
|
||||
# parser.addini("testrail-user-id", "testrail username")
|
||||
# parser.addini("testrail-user-password", "testrail user password")
|
||||
#
|
||||
# parser.addini("lanforge-ip-address", "LANforge ip address to connect to")
|
||||
# parser.addini("lanforge-port-number", "LANforge port number to connect to")
|
||||
# parser.addini("lanforge-bridge-port", "LANforge port for bridge mode testing")
|
||||
# parser.addini("lanforge-2dot4g-prefix", "LANforge 2.4g prefix")
|
||||
# parser.addini("lanforge-5g-prefix", "LANforge 5g prefix")
|
||||
# parser.addini("lanforge-2dot4g-station", "LANforge station name for 2.4g")
|
||||
# parser.addini("lanforge-5g-station", "LANforge station name for 5g")
|
||||
# parser.addini("lanforge-2dot4g-radio", "LANforge radio for 2.4g")
|
||||
# parser.addini("lanforge-5g-radio", "LANforge radio for 5g")
|
||||
#
|
||||
# parser.addini("jumphost_ip", "APNOS Jumphost IP Address")
|
||||
# parser.addini("jumphost_username", "APNOS Jumphost Username")
|
||||
# parser.addini("jumphost_password", "APNOS Jumphost password")
|
||||
# parser.addini("jumphost_port", "APNOS Jumphost ssh Port")
|
||||
#
|
||||
# parser.addini("skip-open", "skip open ssid mode")
|
||||
# parser.addini("skip-wpa", "skip wpa ssid mode")
|
||||
# parser.addini("skip-wpa2", "skip wpa2 ssid mode")
|
||||
# parser.addini("skip-eap", "skip eap ssid mode")
|
||||
#
|
||||
# parser.addini("radius_server_ip", "Radius server IP")
|
||||
# parser.addini("radius_port", "Radius Port")
|
||||
# parser.addini("radius_secret", "Radius shared Secret")
|
||||
#
|
||||
# parser.addini("tr_url", "Test Rail URL")
|
||||
# parser.addini("tr_prefix", "Test Rail Prefix (Generally Testbed_name_)")
|
||||
# parser.addini("tr_user", "Testrail Username")
|
||||
# parser.addini("tr_pass", "Testrail Password")
|
||||
# parser.addini("tr_project_id", "Testrail Project ID")
|
||||
# parser.addini("milestone", "milestone Id")
|
||||
#
|
||||
# parser.addini("num_stations", "Number of Stations/Clients for testing")
|
||||
#
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--skip-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="skip updating firmware on the AP (useful for local testing)"
|
||||
# )
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--force-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Upgrading Firmware even if it is already latest version"
|
||||
# )
|
||||
# parser.addoption(
|
||||
# "--force-upload",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Uploading Firmware even if it is already latest version"
|
||||
# )
|
||||
# # 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(
|
||||
# "--skip-testrail",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="Stop using Testrails"
|
||||
# )
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Test session base fixture
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def testrun_session(request):
|
||||
# var = request.config.getoption("model")
|
||||
# yield var
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Instantiate Objects for Test session
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_cloudsdk(testrun_session):
|
||||
# try:
|
||||
# sdk_client = CloudSDK(testbed=NOLA[testrun_session]["cloudsdk_url"],
|
||||
# customer_id=NOLA[testrun_session]["customer_id"])
|
||||
# except:
|
||||
# sdk_client = False
|
||||
# yield sdk_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_jFrog(request):
|
||||
# jfrog_cred = {
|
||||
# "user": request.config.getini("jfrog-user-id"),
|
||||
# "password": request.config.getini("jfrog-user-password")
|
||||
# }
|
||||
# yield jfrog_cred
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_firmware(instantiate_cloudsdk, instantiate_jFrog):
|
||||
# try:
|
||||
# firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# firmware_client = False
|
||||
# yield firmware_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_profile(instantiate_cloudsdk):
|
||||
# try:
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# profile_object = False
|
||||
# yield profile_object
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_testrail(request):
|
||||
# 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_project(request, instantiate_testrail, testrun_session, get_latest_firmware):
|
||||
# if request.config.getoption("--skip-testrail"):
|
||||
# rid = "skip testrails"
|
||||
# else:
|
||||
# projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
# test_run_name = request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# 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"),
|
||||
# description="Automated Nightly Sanity test run for new firmware build")
|
||||
# rid = instantiate_testrail.get_run_id(
|
||||
# test_run_name=request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# datetime.date.today()) + "_" + get_latest_firmware)
|
||||
# yield rid
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Utility Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_equipment_id(testrun_session):
|
||||
# yield NOLA[testrun_session]["equipment_id"]
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_latest_firmware(testrun_session, instantiate_firmware):
|
||||
# try:
|
||||
# latest_firmware = instantiate_firmware.get_latest_fw_version(testrun_session)
|
||||
# except:
|
||||
# latest_firmware = False
|
||||
# yield latest_firmware
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_ssh(request, testrun_session):
|
||||
# try:
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# active_fw = ap_ssh.get_active_firmware()
|
||||
# except Exception as e:
|
||||
# active_fw = False
|
||||
# yield active_fw
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_cloud(instantiate_cloudsdk, get_equipment_id):
|
||||
# yield instantiate_cloudsdk.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_ap_manager_status():
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# if "ACTIVE" not in status:
|
||||
# time.sleep(30)
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upload_firmware(request):
|
||||
# yield request.config.getoption("--force-upload")
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upgrade_firmware(request):
|
||||
# yield request.config.getoption("--force-upgrade")
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def setup_profile_data(testrun_session):
|
||||
# profile_data = {}
|
||||
# for mode in "BRIDGE", "NAT", "VLAN":
|
||||
# profile_data[mode] = {}
|
||||
# for security in "OPEN", "WPA", "WPA2_P", "WPA2_E":
|
||||
# profile_data[mode][security] = {}
|
||||
# for radio in "2G", "5G":
|
||||
# profile_data[mode][security][radio] = {}
|
||||
# name_string = f"{'Sanity'}-{testrun_session}-{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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Utility
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="class")
|
||||
# def reset_profile(instantiate_profile):
|
||||
# instantiate_profile.profile_creation_ids["ssid"] = []
|
||||
# yield True
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def cleanup_cloud_profiles(instantiate_cloudsdk):
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# yield profile_object.cleanup_profiles()
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_radius_profile(instantiate_profile, testrun_session):
|
||||
# radius_info = {
|
||||
# "name": testrun_session + "-RADIUS-Sanity",
|
||||
# "ip": RADIUS_SERVER_DATA["ip"],
|
||||
# "port": RADIUS_SERVER_DATA["port"],
|
||||
# "secret": RADIUS_SERVER_DATA["secret"]
|
||||
# }
|
||||
# instantiate_profile.delete_profile_by_name(radius_info["name"])
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile_info = instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
# yield profile_info
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def set_rf_profile(instantiate_profile):
|
||||
# try:
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.set_rf_profile()
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# BRIDGE MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# NAT MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# VLAN MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_bridge(instantiate_profile, testrun_session):
|
||||
# try:
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'BRIDGE'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# except Exception as e:
|
||||
# profile_obj = e
|
||||
# print(profile_obj)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_nat(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'NAT'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_vlan(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'VLAN'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_current_profile_cloud(instantiate_profile):
|
||||
# ssid_names = []
|
||||
# print(instantiate_profile.profile_creation_ids["ssid"])
|
||||
# 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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Push Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def push_profile(instantiate_profile, get_equipment_id, setup_profile_data):
|
||||
# try:
|
||||
# instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
# status = True
|
||||
# except Exception as e:
|
||||
# status = False
|
||||
#
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_lanforge_data(request):
|
||||
# lanforge_data = {
|
||||
# "lanforge_ip": request.config.getini("lanforge-ip-address"),
|
||||
# "lanforge-port-number": request.config.getini("lanforge-port-number"),
|
||||
# "lanforge_2dot4g": request.config.getini("lanforge-2dot4g-radio"),
|
||||
# "lanforge_5g": request.config.getini("lanforge-5g-radio"),
|
||||
# "lanforge_2dot4g_prefix": request.config.getini("lanforge-2dot4g-prefix"),
|
||||
# "lanforge_5g_prefix": request.config.getini("lanforge-5g-prefix"),
|
||||
# "lanforge_2dot4g_station": request.config.getini("lanforge-2dot4g-station"),
|
||||
# "lanforge_5g_station": request.config.getini("lanforge-5g-station"),
|
||||
# "lanforge_bridge_port": request.config.getini("lanforge-bridge-port"),
|
||||
# "lanforge_vlan_port": "eth1.100",
|
||||
# "vlan": 100
|
||||
# }
|
||||
# yield lanforge_data
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def update_ssid(request, instantiate_profile, setup_profile_data):
|
||||
# requested_profile = str(request.param).replace(" ","").split(",")
|
||||
# profile = setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]
|
||||
# status = instantiate_profile.update_ssid_name(profile_name=profile["profile_name"], new_profile_name=requested_profile[3])
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["profile_name"] = requested_profile[3]
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["ssid_name"] = requested_profile[3]
|
||||
# time.sleep(90)
|
||||
# yield status
|
||||
0
tests/e2e/basic/dataplane_throughput/__init__.py
Normal file
0
tests/e2e/basic/dataplane_throughput/__init__.py
Normal file
0
tests/e2e/basic/dual_band_performance/__init__.py
Normal file
0
tests/e2e/basic/dual_band_performance/__init__.py
Normal file
0
tests/e2e/basic/wifi_capacity_test/__init__.py
Normal file
0
tests/e2e/basic/wifi_capacity_test/__init__.py
Normal file
0
tests/e2e/interOp/__init__.py
Normal file
0
tests/e2e/interOp/__init__.py
Normal file
651
tests/e2e/interOp/conftest.py
Normal file
651
tests/e2e/interOp/conftest.py
Normal file
@@ -0,0 +1,651 @@
|
||||
# # import files in the current directory
|
||||
# import datetime
|
||||
# import sys
|
||||
# import os
|
||||
# import time
|
||||
#
|
||||
# sys.path.append(
|
||||
# os.path.dirname(
|
||||
# os.path.realpath(__file__)
|
||||
# )
|
||||
# )
|
||||
#
|
||||
# if 'cloudsdk' not in sys.path:
|
||||
# sys.path.append(f'../libs/cloudsdk')
|
||||
# if 'apnos' not in sys.path:
|
||||
# sys.path.append(f'../libs/apnos')
|
||||
# if 'testrails' not in sys.path:
|
||||
# sys.path.append(f'../libs/testrails')
|
||||
#
|
||||
# from apnos import APNOS
|
||||
# from cloudsdk import CloudSDK
|
||||
# from cloudsdk import ProfileUtility
|
||||
# from cloudsdk import FirmwareUtility
|
||||
# import pytest
|
||||
# import logging
|
||||
# from configuration import APNOS_CREDENTIAL_DATA
|
||||
# from configuration import RADIUS_SERVER_DATA
|
||||
# from configuration import TEST_CASES
|
||||
# from configuration import NOLA
|
||||
# from testrail_api import APIClient
|
||||
# from reporting import Reporting
|
||||
#
|
||||
#
|
||||
# def pytest_addoption(parser):
|
||||
# parser.addini("force-upload", "firmware-upload option")
|
||||
#
|
||||
# parser.addini("jfrog-base-url", "jfrog base url")
|
||||
# parser.addini("jfrog-user-id", "jfrog username")
|
||||
# parser.addini("jfrog-user-password", "jfrog password")
|
||||
#
|
||||
# parser.addini("testbed-name", "cloud sdk base url")
|
||||
# parser.addini("equipment-model", "Equipment Model")
|
||||
#
|
||||
# parser.addini("sdk-user-id", "cloud sdk username")
|
||||
# parser.addini("sdk-user-password", "cloud sdk user password")
|
||||
#
|
||||
# parser.addini("sdk-customer-id", "cloud sdk customer id for the access points")
|
||||
# parser.addini("sdk-equipment-id", "cloud sdk customer id for the access points")
|
||||
#
|
||||
# parser.addini("testrail-base-url", "testrail base url")
|
||||
# parser.addini("testrail-project", "testrail project name to use to generate test reports")
|
||||
# parser.addini("testrail-user-id", "testrail username")
|
||||
# parser.addini("testrail-user-password", "testrail user password")
|
||||
#
|
||||
# parser.addini("lanforge-ip-address", "LANforge ip address to connect to")
|
||||
# parser.addini("lanforge-port-number", "LANforge port number to connect to")
|
||||
# parser.addini("lanforge-bridge-port", "LANforge port for bridge mode testing")
|
||||
# parser.addini("lanforge-2dot4g-prefix", "LANforge 2.4g prefix")
|
||||
# parser.addini("lanforge-5g-prefix", "LANforge 5g prefix")
|
||||
# parser.addini("lanforge-2dot4g-station", "LANforge station name for 2.4g")
|
||||
# parser.addini("lanforge-5g-station", "LANforge station name for 5g")
|
||||
# parser.addini("lanforge-2dot4g-radio", "LANforge radio for 2.4g")
|
||||
# parser.addini("lanforge-5g-radio", "LANforge radio for 5g")
|
||||
#
|
||||
# parser.addini("jumphost_ip", "APNOS Jumphost IP Address")
|
||||
# parser.addini("jumphost_username", "APNOS Jumphost Username")
|
||||
# parser.addini("jumphost_password", "APNOS Jumphost password")
|
||||
# parser.addini("jumphost_port", "APNOS Jumphost ssh Port")
|
||||
#
|
||||
# parser.addini("skip-open", "skip open ssid mode")
|
||||
# parser.addini("skip-wpa", "skip wpa ssid mode")
|
||||
# parser.addini("skip-wpa2", "skip wpa2 ssid mode")
|
||||
# parser.addini("skip-eap", "skip eap ssid mode")
|
||||
#
|
||||
# parser.addini("radius_server_ip", "Radius server IP")
|
||||
# parser.addini("radius_port", "Radius Port")
|
||||
# parser.addini("radius_secret", "Radius shared Secret")
|
||||
#
|
||||
# parser.addini("tr_url", "Test Rail URL")
|
||||
# parser.addini("tr_prefix", "Test Rail Prefix (Generally Testbed_name_)")
|
||||
# parser.addini("tr_user", "Testrail Username")
|
||||
# parser.addini("tr_pass", "Testrail Password")
|
||||
# parser.addini("tr_project_id", "Testrail Project ID")
|
||||
# parser.addini("milestone", "milestone Id")
|
||||
#
|
||||
# parser.addini("num_stations", "Number of Stations/Clients for testing")
|
||||
#
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--skip-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="skip updating firmware on the AP (useful for local testing)"
|
||||
# )
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--force-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Upgrading Firmware even if it is already latest version"
|
||||
# )
|
||||
# parser.addoption(
|
||||
# "--force-upload",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Uploading Firmware even if it is already latest version"
|
||||
# )
|
||||
# # 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(
|
||||
# "--skip-testrail",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="Stop using Testrails"
|
||||
# )
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Test session base fixture
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def testrun_session(request):
|
||||
# var = request.config.getoption("model")
|
||||
# yield var
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Instantiate Objects for Test session
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_cloudsdk(testrun_session):
|
||||
# try:
|
||||
# sdk_client = CloudSDK(testbed=NOLA[testrun_session]["cloudsdk_url"],
|
||||
# customer_id=NOLA[testrun_session]["customer_id"])
|
||||
# except:
|
||||
# sdk_client = False
|
||||
# yield sdk_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_jFrog(request):
|
||||
# jfrog_cred = {
|
||||
# "user": request.config.getini("jfrog-user-id"),
|
||||
# "password": request.config.getini("jfrog-user-password")
|
||||
# }
|
||||
# yield jfrog_cred
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_firmware(instantiate_cloudsdk, instantiate_jFrog):
|
||||
# try:
|
||||
# firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# firmware_client = False
|
||||
# yield firmware_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_profile(instantiate_cloudsdk):
|
||||
# try:
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# profile_object = False
|
||||
# yield profile_object
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_testrail(request):
|
||||
# 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_project(request, instantiate_testrail, testrun_session, get_latest_firmware):
|
||||
# if request.config.getoption("--skip-testrail"):
|
||||
# rid = "skip testrails"
|
||||
# else:
|
||||
# projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
# test_run_name = request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# 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"),
|
||||
# description="Automated Nightly Sanity test run for new firmware build")
|
||||
# rid = instantiate_testrail.get_run_id(
|
||||
# test_run_name=request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# datetime.date.today()) + "_" + get_latest_firmware)
|
||||
# yield rid
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Utility Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_equipment_id(testrun_session):
|
||||
# yield NOLA[testrun_session]["equipment_id"]
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_latest_firmware(testrun_session, instantiate_firmware):
|
||||
# try:
|
||||
# latest_firmware = instantiate_firmware.get_latest_fw_version(testrun_session)
|
||||
# except:
|
||||
# latest_firmware = False
|
||||
# yield latest_firmware
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_ssh(request, testrun_session):
|
||||
# try:
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# active_fw = ap_ssh.get_active_firmware()
|
||||
# except Exception as e:
|
||||
# active_fw = False
|
||||
# yield active_fw
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_cloud(instantiate_cloudsdk, get_equipment_id):
|
||||
# yield instantiate_cloudsdk.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_ap_manager_status():
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# if "ACTIVE" not in status:
|
||||
# time.sleep(30)
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upload_firmware(request):
|
||||
# yield request.config.getoption("--force-upload")
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upgrade_firmware(request):
|
||||
# yield request.config.getoption("--force-upgrade")
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def setup_profile_data(testrun_session):
|
||||
# profile_data = {}
|
||||
# for mode in "BRIDGE", "NAT", "VLAN":
|
||||
# profile_data[mode] = {}
|
||||
# for security in "OPEN", "WPA", "WPA2_P", "WPA2_E":
|
||||
# profile_data[mode][security] = {}
|
||||
# for radio in "2G", "5G":
|
||||
# profile_data[mode][security][radio] = {}
|
||||
# name_string = f"{'Sanity'}-{testrun_session}-{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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Utility
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="class")
|
||||
# def reset_profile(instantiate_profile):
|
||||
# instantiate_profile.profile_creation_ids["ssid"] = []
|
||||
# yield True
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def cleanup_cloud_profiles(instantiate_cloudsdk):
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# yield profile_object.cleanup_profiles()
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_radius_profile(instantiate_profile, testrun_session):
|
||||
# radius_info = {
|
||||
# "name": testrun_session + "-RADIUS-Sanity",
|
||||
# "ip": RADIUS_SERVER_DATA["ip"],
|
||||
# "port": RADIUS_SERVER_DATA["port"],
|
||||
# "secret": RADIUS_SERVER_DATA["secret"]
|
||||
# }
|
||||
# instantiate_profile.delete_profile_by_name(radius_info["name"])
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile_info = instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
# yield profile_info
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def set_rf_profile(instantiate_profile):
|
||||
# try:
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.set_rf_profile()
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# BRIDGE MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# NAT MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# VLAN MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_bridge(instantiate_profile, testrun_session):
|
||||
# try:
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'BRIDGE'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# except Exception as e:
|
||||
# profile_obj = e
|
||||
# print(profile_obj)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_nat(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'NAT'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_vlan(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'VLAN'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_current_profile_cloud(instantiate_profile):
|
||||
# ssid_names = []
|
||||
# print(instantiate_profile.profile_creation_ids["ssid"])
|
||||
# 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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Push Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def push_profile(instantiate_profile, get_equipment_id, setup_profile_data):
|
||||
# try:
|
||||
# instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
# status = True
|
||||
# except Exception as e:
|
||||
# status = False
|
||||
#
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_lanforge_data(request):
|
||||
# lanforge_data = {
|
||||
# "lanforge_ip": request.config.getini("lanforge-ip-address"),
|
||||
# "lanforge-port-number": request.config.getini("lanforge-port-number"),
|
||||
# "lanforge_2dot4g": request.config.getini("lanforge-2dot4g-radio"),
|
||||
# "lanforge_5g": request.config.getini("lanforge-5g-radio"),
|
||||
# "lanforge_2dot4g_prefix": request.config.getini("lanforge-2dot4g-prefix"),
|
||||
# "lanforge_5g_prefix": request.config.getini("lanforge-5g-prefix"),
|
||||
# "lanforge_2dot4g_station": request.config.getini("lanforge-2dot4g-station"),
|
||||
# "lanforge_5g_station": request.config.getini("lanforge-5g-station"),
|
||||
# "lanforge_bridge_port": request.config.getini("lanforge-bridge-port"),
|
||||
# "lanforge_vlan_port": "eth1.100",
|
||||
# "vlan": 100
|
||||
# }
|
||||
# yield lanforge_data
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def update_ssid(request, instantiate_profile, setup_profile_data):
|
||||
# requested_profile = str(request.param).replace(" ","").split(",")
|
||||
# profile = setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]
|
||||
# status = instantiate_profile.update_ssid_name(profile_name=profile["profile_name"], new_profile_name=requested_profile[3])
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["profile_name"] = requested_profile[3]
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["ssid_name"] = requested_profile[3]
|
||||
# time.sleep(90)
|
||||
# yield status
|
||||
0
tests/e2e/mdu/__init__.py
Normal file
0
tests/e2e/mdu/__init__.py
Normal file
651
tests/e2e/mdu/conftest.py
Normal file
651
tests/e2e/mdu/conftest.py
Normal file
@@ -0,0 +1,651 @@
|
||||
# # import files in the current directory
|
||||
# import datetime
|
||||
# import sys
|
||||
# import os
|
||||
# import time
|
||||
#
|
||||
# sys.path.append(
|
||||
# os.path.dirname(
|
||||
# os.path.realpath(__file__)
|
||||
# )
|
||||
# )
|
||||
#
|
||||
# if 'cloudsdk' not in sys.path:
|
||||
# sys.path.append(f'../libs/cloudsdk')
|
||||
# if 'apnos' not in sys.path:
|
||||
# sys.path.append(f'../libs/apnos')
|
||||
# if 'testrails' not in sys.path:
|
||||
# sys.path.append(f'../libs/testrails')
|
||||
#
|
||||
# from apnos import APNOS
|
||||
# from cloudsdk import CloudSDK
|
||||
# from cloudsdk import ProfileUtility
|
||||
# from cloudsdk import FirmwareUtility
|
||||
# import pytest
|
||||
# import logging
|
||||
# from configuration import APNOS_CREDENTIAL_DATA
|
||||
# from configuration import RADIUS_SERVER_DATA
|
||||
# from configuration import TEST_CASES
|
||||
# from configuration import NOLA
|
||||
# from testrail_api import APIClient
|
||||
# from reporting import Reporting
|
||||
#
|
||||
#
|
||||
# def pytest_addoption(parser):
|
||||
# parser.addini("force-upload", "firmware-upload option")
|
||||
#
|
||||
# parser.addini("jfrog-base-url", "jfrog base url")
|
||||
# parser.addini("jfrog-user-id", "jfrog username")
|
||||
# parser.addini("jfrog-user-password", "jfrog password")
|
||||
#
|
||||
# parser.addini("testbed-name", "cloud sdk base url")
|
||||
# parser.addini("equipment-model", "Equipment Model")
|
||||
#
|
||||
# parser.addini("sdk-user-id", "cloud sdk username")
|
||||
# parser.addini("sdk-user-password", "cloud sdk user password")
|
||||
#
|
||||
# parser.addini("sdk-customer-id", "cloud sdk customer id for the access points")
|
||||
# parser.addini("sdk-equipment-id", "cloud sdk customer id for the access points")
|
||||
#
|
||||
# parser.addini("testrail-base-url", "testrail base url")
|
||||
# parser.addini("testrail-project", "testrail project name to use to generate test reports")
|
||||
# parser.addini("testrail-user-id", "testrail username")
|
||||
# parser.addini("testrail-user-password", "testrail user password")
|
||||
#
|
||||
# parser.addini("lanforge-ip-address", "LANforge ip address to connect to")
|
||||
# parser.addini("lanforge-port-number", "LANforge port number to connect to")
|
||||
# parser.addini("lanforge-bridge-port", "LANforge port for bridge mode testing")
|
||||
# parser.addini("lanforge-2dot4g-prefix", "LANforge 2.4g prefix")
|
||||
# parser.addini("lanforge-5g-prefix", "LANforge 5g prefix")
|
||||
# parser.addini("lanforge-2dot4g-station", "LANforge station name for 2.4g")
|
||||
# parser.addini("lanforge-5g-station", "LANforge station name for 5g")
|
||||
# parser.addini("lanforge-2dot4g-radio", "LANforge radio for 2.4g")
|
||||
# parser.addini("lanforge-5g-radio", "LANforge radio for 5g")
|
||||
#
|
||||
# parser.addini("jumphost_ip", "APNOS Jumphost IP Address")
|
||||
# parser.addini("jumphost_username", "APNOS Jumphost Username")
|
||||
# parser.addini("jumphost_password", "APNOS Jumphost password")
|
||||
# parser.addini("jumphost_port", "APNOS Jumphost ssh Port")
|
||||
#
|
||||
# parser.addini("skip-open", "skip open ssid mode")
|
||||
# parser.addini("skip-wpa", "skip wpa ssid mode")
|
||||
# parser.addini("skip-wpa2", "skip wpa2 ssid mode")
|
||||
# parser.addini("skip-eap", "skip eap ssid mode")
|
||||
#
|
||||
# parser.addini("radius_server_ip", "Radius server IP")
|
||||
# parser.addini("radius_port", "Radius Port")
|
||||
# parser.addini("radius_secret", "Radius shared Secret")
|
||||
#
|
||||
# parser.addini("tr_url", "Test Rail URL")
|
||||
# parser.addini("tr_prefix", "Test Rail Prefix (Generally Testbed_name_)")
|
||||
# parser.addini("tr_user", "Testrail Username")
|
||||
# parser.addini("tr_pass", "Testrail Password")
|
||||
# parser.addini("tr_project_id", "Testrail Project ID")
|
||||
# parser.addini("milestone", "milestone Id")
|
||||
#
|
||||
# parser.addini("num_stations", "Number of Stations/Clients for testing")
|
||||
#
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--skip-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="skip updating firmware on the AP (useful for local testing)"
|
||||
# )
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--force-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Upgrading Firmware even if it is already latest version"
|
||||
# )
|
||||
# parser.addoption(
|
||||
# "--force-upload",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Uploading Firmware even if it is already latest version"
|
||||
# )
|
||||
# # 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(
|
||||
# "--skip-testrail",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="Stop using Testrails"
|
||||
# )
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Test session base fixture
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def testrun_session(request):
|
||||
# var = request.config.getoption("model")
|
||||
# yield var
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Instantiate Objects for Test session
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_cloudsdk(testrun_session):
|
||||
# try:
|
||||
# sdk_client = CloudSDK(testbed=NOLA[testrun_session]["cloudsdk_url"],
|
||||
# customer_id=NOLA[testrun_session]["customer_id"])
|
||||
# except:
|
||||
# sdk_client = False
|
||||
# yield sdk_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_jFrog(request):
|
||||
# jfrog_cred = {
|
||||
# "user": request.config.getini("jfrog-user-id"),
|
||||
# "password": request.config.getini("jfrog-user-password")
|
||||
# }
|
||||
# yield jfrog_cred
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_firmware(instantiate_cloudsdk, instantiate_jFrog):
|
||||
# try:
|
||||
# firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# firmware_client = False
|
||||
# yield firmware_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_profile(instantiate_cloudsdk):
|
||||
# try:
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# profile_object = False
|
||||
# yield profile_object
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_testrail(request):
|
||||
# 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_project(request, instantiate_testrail, testrun_session, get_latest_firmware):
|
||||
# if request.config.getoption("--skip-testrail"):
|
||||
# rid = "skip testrails"
|
||||
# else:
|
||||
# projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
# test_run_name = request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# 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"),
|
||||
# description="Automated Nightly Sanity test run for new firmware build")
|
||||
# rid = instantiate_testrail.get_run_id(
|
||||
# test_run_name=request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# datetime.date.today()) + "_" + get_latest_firmware)
|
||||
# yield rid
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Utility Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_equipment_id(testrun_session):
|
||||
# yield NOLA[testrun_session]["equipment_id"]
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_latest_firmware(testrun_session, instantiate_firmware):
|
||||
# try:
|
||||
# latest_firmware = instantiate_firmware.get_latest_fw_version(testrun_session)
|
||||
# except:
|
||||
# latest_firmware = False
|
||||
# yield latest_firmware
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_ssh(request, testrun_session):
|
||||
# try:
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# active_fw = ap_ssh.get_active_firmware()
|
||||
# except Exception as e:
|
||||
# active_fw = False
|
||||
# yield active_fw
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_cloud(instantiate_cloudsdk, get_equipment_id):
|
||||
# yield instantiate_cloudsdk.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_ap_manager_status():
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# if "ACTIVE" not in status:
|
||||
# time.sleep(30)
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upload_firmware(request):
|
||||
# yield request.config.getoption("--force-upload")
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upgrade_firmware(request):
|
||||
# yield request.config.getoption("--force-upgrade")
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def setup_profile_data(testrun_session):
|
||||
# profile_data = {}
|
||||
# for mode in "BRIDGE", "NAT", "VLAN":
|
||||
# profile_data[mode] = {}
|
||||
# for security in "OPEN", "WPA", "WPA2_P", "WPA2_E":
|
||||
# profile_data[mode][security] = {}
|
||||
# for radio in "2G", "5G":
|
||||
# profile_data[mode][security][radio] = {}
|
||||
# name_string = f"{'Sanity'}-{testrun_session}-{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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Utility
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="class")
|
||||
# def reset_profile(instantiate_profile):
|
||||
# instantiate_profile.profile_creation_ids["ssid"] = []
|
||||
# yield True
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def cleanup_cloud_profiles(instantiate_cloudsdk):
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# yield profile_object.cleanup_profiles()
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_radius_profile(instantiate_profile, testrun_session):
|
||||
# radius_info = {
|
||||
# "name": testrun_session + "-RADIUS-Sanity",
|
||||
# "ip": RADIUS_SERVER_DATA["ip"],
|
||||
# "port": RADIUS_SERVER_DATA["port"],
|
||||
# "secret": RADIUS_SERVER_DATA["secret"]
|
||||
# }
|
||||
# instantiate_profile.delete_profile_by_name(radius_info["name"])
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile_info = instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
# yield profile_info
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def set_rf_profile(instantiate_profile):
|
||||
# try:
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.set_rf_profile()
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# BRIDGE MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# NAT MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# VLAN MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_bridge(instantiate_profile, testrun_session):
|
||||
# try:
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'BRIDGE'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# except Exception as e:
|
||||
# profile_obj = e
|
||||
# print(profile_obj)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_nat(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'NAT'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_vlan(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'VLAN'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_current_profile_cloud(instantiate_profile):
|
||||
# ssid_names = []
|
||||
# print(instantiate_profile.profile_creation_ids["ssid"])
|
||||
# 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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Push Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def push_profile(instantiate_profile, get_equipment_id, setup_profile_data):
|
||||
# try:
|
||||
# instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
# status = True
|
||||
# except Exception as e:
|
||||
# status = False
|
||||
#
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_lanforge_data(request):
|
||||
# lanforge_data = {
|
||||
# "lanforge_ip": request.config.getini("lanforge-ip-address"),
|
||||
# "lanforge-port-number": request.config.getini("lanforge-port-number"),
|
||||
# "lanforge_2dot4g": request.config.getini("lanforge-2dot4g-radio"),
|
||||
# "lanforge_5g": request.config.getini("lanforge-5g-radio"),
|
||||
# "lanforge_2dot4g_prefix": request.config.getini("lanforge-2dot4g-prefix"),
|
||||
# "lanforge_5g_prefix": request.config.getini("lanforge-5g-prefix"),
|
||||
# "lanforge_2dot4g_station": request.config.getini("lanforge-2dot4g-station"),
|
||||
# "lanforge_5g_station": request.config.getini("lanforge-5g-station"),
|
||||
# "lanforge_bridge_port": request.config.getini("lanforge-bridge-port"),
|
||||
# "lanforge_vlan_port": "eth1.100",
|
||||
# "vlan": 100
|
||||
# }
|
||||
# yield lanforge_data
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def update_ssid(request, instantiate_profile, setup_profile_data):
|
||||
# requested_profile = str(request.param).replace(" ","").split(",")
|
||||
# profile = setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]
|
||||
# status = instantiate_profile.update_ssid_name(profile_name=profile["profile_name"], new_profile_name=requested_profile[3])
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["profile_name"] = requested_profile[3]
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["ssid_name"] = requested_profile[3]
|
||||
# time.sleep(90)
|
||||
# yield status
|
||||
0
tests/e2e/mesh/__init__.py
Normal file
0
tests/e2e/mesh/__init__.py
Normal file
651
tests/e2e/mesh/conftest.py
Normal file
651
tests/e2e/mesh/conftest.py
Normal file
@@ -0,0 +1,651 @@
|
||||
# # import files in the current directory
|
||||
# import datetime
|
||||
# import sys
|
||||
# import os
|
||||
# import time
|
||||
#
|
||||
# sys.path.append(
|
||||
# os.path.dirname(
|
||||
# os.path.realpath(__file__)
|
||||
# )
|
||||
# )
|
||||
#
|
||||
# if 'cloudsdk' not in sys.path:
|
||||
# sys.path.append(f'../libs/cloudsdk')
|
||||
# if 'apnos' not in sys.path:
|
||||
# sys.path.append(f'../libs/apnos')
|
||||
# if 'testrails' not in sys.path:
|
||||
# sys.path.append(f'../libs/testrails')
|
||||
#
|
||||
# from apnos import APNOS
|
||||
# from cloudsdk import CloudSDK
|
||||
# from cloudsdk import ProfileUtility
|
||||
# from cloudsdk import FirmwareUtility
|
||||
# import pytest
|
||||
# import logging
|
||||
# from configuration import APNOS_CREDENTIAL_DATA
|
||||
# from configuration import RADIUS_SERVER_DATA
|
||||
# from configuration import TEST_CASES
|
||||
# from configuration import NOLA
|
||||
# from testrail_api import APIClient
|
||||
# from reporting import Reporting
|
||||
#
|
||||
#
|
||||
# def pytest_addoption(parser):
|
||||
# parser.addini("force-upload", "firmware-upload option")
|
||||
#
|
||||
# parser.addini("jfrog-base-url", "jfrog base url")
|
||||
# parser.addini("jfrog-user-id", "jfrog username")
|
||||
# parser.addini("jfrog-user-password", "jfrog password")
|
||||
#
|
||||
# parser.addini("testbed-name", "cloud sdk base url")
|
||||
# parser.addini("equipment-model", "Equipment Model")
|
||||
#
|
||||
# parser.addini("sdk-user-id", "cloud sdk username")
|
||||
# parser.addini("sdk-user-password", "cloud sdk user password")
|
||||
#
|
||||
# parser.addini("sdk-customer-id", "cloud sdk customer id for the access points")
|
||||
# parser.addini("sdk-equipment-id", "cloud sdk customer id for the access points")
|
||||
#
|
||||
# parser.addini("testrail-base-url", "testrail base url")
|
||||
# parser.addini("testrail-project", "testrail project name to use to generate test reports")
|
||||
# parser.addini("testrail-user-id", "testrail username")
|
||||
# parser.addini("testrail-user-password", "testrail user password")
|
||||
#
|
||||
# parser.addini("lanforge-ip-address", "LANforge ip address to connect to")
|
||||
# parser.addini("lanforge-port-number", "LANforge port number to connect to")
|
||||
# parser.addini("lanforge-bridge-port", "LANforge port for bridge mode testing")
|
||||
# parser.addini("lanforge-2dot4g-prefix", "LANforge 2.4g prefix")
|
||||
# parser.addini("lanforge-5g-prefix", "LANforge 5g prefix")
|
||||
# parser.addini("lanforge-2dot4g-station", "LANforge station name for 2.4g")
|
||||
# parser.addini("lanforge-5g-station", "LANforge station name for 5g")
|
||||
# parser.addini("lanforge-2dot4g-radio", "LANforge radio for 2.4g")
|
||||
# parser.addini("lanforge-5g-radio", "LANforge radio for 5g")
|
||||
#
|
||||
# parser.addini("jumphost_ip", "APNOS Jumphost IP Address")
|
||||
# parser.addini("jumphost_username", "APNOS Jumphost Username")
|
||||
# parser.addini("jumphost_password", "APNOS Jumphost password")
|
||||
# parser.addini("jumphost_port", "APNOS Jumphost ssh Port")
|
||||
#
|
||||
# parser.addini("skip-open", "skip open ssid mode")
|
||||
# parser.addini("skip-wpa", "skip wpa ssid mode")
|
||||
# parser.addini("skip-wpa2", "skip wpa2 ssid mode")
|
||||
# parser.addini("skip-eap", "skip eap ssid mode")
|
||||
#
|
||||
# parser.addini("radius_server_ip", "Radius server IP")
|
||||
# parser.addini("radius_port", "Radius Port")
|
||||
# parser.addini("radius_secret", "Radius shared Secret")
|
||||
#
|
||||
# parser.addini("tr_url", "Test Rail URL")
|
||||
# parser.addini("tr_prefix", "Test Rail Prefix (Generally Testbed_name_)")
|
||||
# parser.addini("tr_user", "Testrail Username")
|
||||
# parser.addini("tr_pass", "Testrail Password")
|
||||
# parser.addini("tr_project_id", "Testrail Project ID")
|
||||
# parser.addini("milestone", "milestone Id")
|
||||
#
|
||||
# parser.addini("num_stations", "Number of Stations/Clients for testing")
|
||||
#
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--skip-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="skip updating firmware on the AP (useful for local testing)"
|
||||
# )
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--force-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Upgrading Firmware even if it is already latest version"
|
||||
# )
|
||||
# parser.addoption(
|
||||
# "--force-upload",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Uploading Firmware even if it is already latest version"
|
||||
# )
|
||||
# # 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(
|
||||
# "--skip-testrail",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="Stop using Testrails"
|
||||
# )
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Test session base fixture
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def testrun_session(request):
|
||||
# var = request.config.getoption("model")
|
||||
# yield var
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Instantiate Objects for Test session
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_cloudsdk(testrun_session):
|
||||
# try:
|
||||
# sdk_client = CloudSDK(testbed=NOLA[testrun_session]["cloudsdk_url"],
|
||||
# customer_id=NOLA[testrun_session]["customer_id"])
|
||||
# except:
|
||||
# sdk_client = False
|
||||
# yield sdk_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_jFrog(request):
|
||||
# jfrog_cred = {
|
||||
# "user": request.config.getini("jfrog-user-id"),
|
||||
# "password": request.config.getini("jfrog-user-password")
|
||||
# }
|
||||
# yield jfrog_cred
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_firmware(instantiate_cloudsdk, instantiate_jFrog):
|
||||
# try:
|
||||
# firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# firmware_client = False
|
||||
# yield firmware_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_profile(instantiate_cloudsdk):
|
||||
# try:
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# profile_object = False
|
||||
# yield profile_object
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_testrail(request):
|
||||
# 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_project(request, instantiate_testrail, testrun_session, get_latest_firmware):
|
||||
# if request.config.getoption("--skip-testrail"):
|
||||
# rid = "skip testrails"
|
||||
# else:
|
||||
# projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
# test_run_name = request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# 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"),
|
||||
# description="Automated Nightly Sanity test run for new firmware build")
|
||||
# rid = instantiate_testrail.get_run_id(
|
||||
# test_run_name=request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# datetime.date.today()) + "_" + get_latest_firmware)
|
||||
# yield rid
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Utility Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_equipment_id(testrun_session):
|
||||
# yield NOLA[testrun_session]["equipment_id"]
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_latest_firmware(testrun_session, instantiate_firmware):
|
||||
# try:
|
||||
# latest_firmware = instantiate_firmware.get_latest_fw_version(testrun_session)
|
||||
# except:
|
||||
# latest_firmware = False
|
||||
# yield latest_firmware
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_ssh(request, testrun_session):
|
||||
# try:
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# active_fw = ap_ssh.get_active_firmware()
|
||||
# except Exception as e:
|
||||
# active_fw = False
|
||||
# yield active_fw
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_cloud(instantiate_cloudsdk, get_equipment_id):
|
||||
# yield instantiate_cloudsdk.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_ap_manager_status():
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# if "ACTIVE" not in status:
|
||||
# time.sleep(30)
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upload_firmware(request):
|
||||
# yield request.config.getoption("--force-upload")
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upgrade_firmware(request):
|
||||
# yield request.config.getoption("--force-upgrade")
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def setup_profile_data(testrun_session):
|
||||
# profile_data = {}
|
||||
# for mode in "BRIDGE", "NAT", "VLAN":
|
||||
# profile_data[mode] = {}
|
||||
# for security in "OPEN", "WPA", "WPA2_P", "WPA2_E":
|
||||
# profile_data[mode][security] = {}
|
||||
# for radio in "2G", "5G":
|
||||
# profile_data[mode][security][radio] = {}
|
||||
# name_string = f"{'Sanity'}-{testrun_session}-{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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Utility
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="class")
|
||||
# def reset_profile(instantiate_profile):
|
||||
# instantiate_profile.profile_creation_ids["ssid"] = []
|
||||
# yield True
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def cleanup_cloud_profiles(instantiate_cloudsdk):
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# yield profile_object.cleanup_profiles()
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_radius_profile(instantiate_profile, testrun_session):
|
||||
# radius_info = {
|
||||
# "name": testrun_session + "-RADIUS-Sanity",
|
||||
# "ip": RADIUS_SERVER_DATA["ip"],
|
||||
# "port": RADIUS_SERVER_DATA["port"],
|
||||
# "secret": RADIUS_SERVER_DATA["secret"]
|
||||
# }
|
||||
# instantiate_profile.delete_profile_by_name(radius_info["name"])
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile_info = instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
# yield profile_info
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def set_rf_profile(instantiate_profile):
|
||||
# try:
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.set_rf_profile()
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# BRIDGE MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# NAT MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# VLAN MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_bridge(instantiate_profile, testrun_session):
|
||||
# try:
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'BRIDGE'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# except Exception as e:
|
||||
# profile_obj = e
|
||||
# print(profile_obj)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_nat(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'NAT'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_vlan(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'VLAN'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_current_profile_cloud(instantiate_profile):
|
||||
# ssid_names = []
|
||||
# print(instantiate_profile.profile_creation_ids["ssid"])
|
||||
# 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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Push Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def push_profile(instantiate_profile, get_equipment_id, setup_profile_data):
|
||||
# try:
|
||||
# instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
# status = True
|
||||
# except Exception as e:
|
||||
# status = False
|
||||
#
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_lanforge_data(request):
|
||||
# lanforge_data = {
|
||||
# "lanforge_ip": request.config.getini("lanforge-ip-address"),
|
||||
# "lanforge-port-number": request.config.getini("lanforge-port-number"),
|
||||
# "lanforge_2dot4g": request.config.getini("lanforge-2dot4g-radio"),
|
||||
# "lanforge_5g": request.config.getini("lanforge-5g-radio"),
|
||||
# "lanforge_2dot4g_prefix": request.config.getini("lanforge-2dot4g-prefix"),
|
||||
# "lanforge_5g_prefix": request.config.getini("lanforge-5g-prefix"),
|
||||
# "lanforge_2dot4g_station": request.config.getini("lanforge-2dot4g-station"),
|
||||
# "lanforge_5g_station": request.config.getini("lanforge-5g-station"),
|
||||
# "lanforge_bridge_port": request.config.getini("lanforge-bridge-port"),
|
||||
# "lanforge_vlan_port": "eth1.100",
|
||||
# "vlan": 100
|
||||
# }
|
||||
# yield lanforge_data
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def update_ssid(request, instantiate_profile, setup_profile_data):
|
||||
# requested_profile = str(request.param).replace(" ","").split(",")
|
||||
# profile = setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]
|
||||
# status = instantiate_profile.update_ssid_name(profile_name=profile["profile_name"], new_profile_name=requested_profile[3])
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["profile_name"] = requested_profile[3]
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["ssid_name"] = requested_profile[3]
|
||||
# time.sleep(90)
|
||||
# yield status
|
||||
0
tests/e2e/scale/__init__.py
Normal file
0
tests/e2e/scale/__init__.py
Normal file
651
tests/e2e/scale/conftest.py
Normal file
651
tests/e2e/scale/conftest.py
Normal file
@@ -0,0 +1,651 @@
|
||||
# # import files in the current directory
|
||||
# import datetime
|
||||
# import sys
|
||||
# import os
|
||||
# import time
|
||||
#
|
||||
# sys.path.append(
|
||||
# os.path.dirname(
|
||||
# os.path.realpath(__file__)
|
||||
# )
|
||||
# )
|
||||
#
|
||||
# if 'cloudsdk' not in sys.path:
|
||||
# sys.path.append(f'../libs/cloudsdk')
|
||||
# if 'apnos' not in sys.path:
|
||||
# sys.path.append(f'../libs/apnos')
|
||||
# if 'testrails' not in sys.path:
|
||||
# sys.path.append(f'../libs/testrails')
|
||||
#
|
||||
# from apnos import APNOS
|
||||
# from cloudsdk import CloudSDK
|
||||
# from cloudsdk import ProfileUtility
|
||||
# from cloudsdk import FirmwareUtility
|
||||
# import pytest
|
||||
# import logging
|
||||
# from configuration import APNOS_CREDENTIAL_DATA
|
||||
# from configuration import RADIUS_SERVER_DATA
|
||||
# from configuration import TEST_CASES
|
||||
# from configuration import NOLA
|
||||
# from testrail_api import APIClient
|
||||
# from reporting import Reporting
|
||||
#
|
||||
#
|
||||
# def pytest_addoption(parser):
|
||||
# parser.addini("force-upload", "firmware-upload option")
|
||||
#
|
||||
# parser.addini("jfrog-base-url", "jfrog base url")
|
||||
# parser.addini("jfrog-user-id", "jfrog username")
|
||||
# parser.addini("jfrog-user-password", "jfrog password")
|
||||
#
|
||||
# parser.addini("testbed-name", "cloud sdk base url")
|
||||
# parser.addini("equipment-model", "Equipment Model")
|
||||
#
|
||||
# parser.addini("sdk-user-id", "cloud sdk username")
|
||||
# parser.addini("sdk-user-password", "cloud sdk user password")
|
||||
#
|
||||
# parser.addini("sdk-customer-id", "cloud sdk customer id for the access points")
|
||||
# parser.addini("sdk-equipment-id", "cloud sdk customer id for the access points")
|
||||
#
|
||||
# parser.addini("testrail-base-url", "testrail base url")
|
||||
# parser.addini("testrail-project", "testrail project name to use to generate test reports")
|
||||
# parser.addini("testrail-user-id", "testrail username")
|
||||
# parser.addini("testrail-user-password", "testrail user password")
|
||||
#
|
||||
# parser.addini("lanforge-ip-address", "LANforge ip address to connect to")
|
||||
# parser.addini("lanforge-port-number", "LANforge port number to connect to")
|
||||
# parser.addini("lanforge-bridge-port", "LANforge port for bridge mode testing")
|
||||
# parser.addini("lanforge-2dot4g-prefix", "LANforge 2.4g prefix")
|
||||
# parser.addini("lanforge-5g-prefix", "LANforge 5g prefix")
|
||||
# parser.addini("lanforge-2dot4g-station", "LANforge station name for 2.4g")
|
||||
# parser.addini("lanforge-5g-station", "LANforge station name for 5g")
|
||||
# parser.addini("lanforge-2dot4g-radio", "LANforge radio for 2.4g")
|
||||
# parser.addini("lanforge-5g-radio", "LANforge radio for 5g")
|
||||
#
|
||||
# parser.addini("jumphost_ip", "APNOS Jumphost IP Address")
|
||||
# parser.addini("jumphost_username", "APNOS Jumphost Username")
|
||||
# parser.addini("jumphost_password", "APNOS Jumphost password")
|
||||
# parser.addini("jumphost_port", "APNOS Jumphost ssh Port")
|
||||
#
|
||||
# parser.addini("skip-open", "skip open ssid mode")
|
||||
# parser.addini("skip-wpa", "skip wpa ssid mode")
|
||||
# parser.addini("skip-wpa2", "skip wpa2 ssid mode")
|
||||
# parser.addini("skip-eap", "skip eap ssid mode")
|
||||
#
|
||||
# parser.addini("radius_server_ip", "Radius server IP")
|
||||
# parser.addini("radius_port", "Radius Port")
|
||||
# parser.addini("radius_secret", "Radius shared Secret")
|
||||
#
|
||||
# parser.addini("tr_url", "Test Rail URL")
|
||||
# parser.addini("tr_prefix", "Test Rail Prefix (Generally Testbed_name_)")
|
||||
# parser.addini("tr_user", "Testrail Username")
|
||||
# parser.addini("tr_pass", "Testrail Password")
|
||||
# parser.addini("tr_project_id", "Testrail Project ID")
|
||||
# parser.addini("milestone", "milestone Id")
|
||||
#
|
||||
# parser.addini("num_stations", "Number of Stations/Clients for testing")
|
||||
#
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--skip-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="skip updating firmware on the AP (useful for local testing)"
|
||||
# )
|
||||
# # change behaviour
|
||||
# parser.addoption(
|
||||
# "--force-upgrade",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Upgrading Firmware even if it is already latest version"
|
||||
# )
|
||||
# parser.addoption(
|
||||
# "--force-upload",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="force Uploading Firmware even if it is already latest version"
|
||||
# )
|
||||
# # 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(
|
||||
# "--skip-testrail",
|
||||
# action="store_true",
|
||||
# default=False,
|
||||
# help="Stop using Testrails"
|
||||
# )
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Test session base fixture
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def testrun_session(request):
|
||||
# var = request.config.getoption("model")
|
||||
# yield var
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Instantiate Objects for Test session
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_cloudsdk(testrun_session):
|
||||
# try:
|
||||
# sdk_client = CloudSDK(testbed=NOLA[testrun_session]["cloudsdk_url"],
|
||||
# customer_id=NOLA[testrun_session]["customer_id"])
|
||||
# except:
|
||||
# sdk_client = False
|
||||
# yield sdk_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_jFrog(request):
|
||||
# jfrog_cred = {
|
||||
# "user": request.config.getini("jfrog-user-id"),
|
||||
# "password": request.config.getini("jfrog-user-password")
|
||||
# }
|
||||
# yield jfrog_cred
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_firmware(instantiate_cloudsdk, instantiate_jFrog):
|
||||
# try:
|
||||
# firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# firmware_client = False
|
||||
# yield firmware_client
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_profile(instantiate_cloudsdk):
|
||||
# try:
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# except:
|
||||
# profile_object = False
|
||||
# yield profile_object
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def instantiate_testrail(request):
|
||||
# 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_project(request, instantiate_testrail, testrun_session, get_latest_firmware):
|
||||
# if request.config.getoption("--skip-testrail"):
|
||||
# rid = "skip testrails"
|
||||
# else:
|
||||
# projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id"))
|
||||
# test_run_name = request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# 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"),
|
||||
# description="Automated Nightly Sanity test run for new firmware build")
|
||||
# rid = instantiate_testrail.get_run_id(
|
||||
# test_run_name=request.config.getini("tr_prefix") + testrun_session + "_" + str(
|
||||
# datetime.date.today()) + "_" + get_latest_firmware)
|
||||
# yield rid
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Utility Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_equipment_id(testrun_session):
|
||||
# yield NOLA[testrun_session]["equipment_id"]
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def get_latest_firmware(testrun_session, instantiate_firmware):
|
||||
# try:
|
||||
# latest_firmware = instantiate_firmware.get_latest_fw_version(testrun_session)
|
||||
# except:
|
||||
# latest_firmware = False
|
||||
# yield latest_firmware
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_ssh(request, testrun_session):
|
||||
# try:
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# active_fw = ap_ssh.get_active_firmware()
|
||||
# except Exception as e:
|
||||
# active_fw = False
|
||||
# yield active_fw
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def check_ap_firmware_cloud(instantiate_cloudsdk, get_equipment_id):
|
||||
# yield instantiate_cloudsdk.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_ap_manager_status():
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# if "ACTIVE" not in status:
|
||||
# time.sleep(30)
|
||||
# ap_ssh = APNOS(APNOS_CREDENTIAL_DATA)
|
||||
# status = ap_ssh.get_manager_state()
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upload_firmware(request):
|
||||
# yield request.config.getoption("--force-upload")
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def should_upgrade_firmware(request):
|
||||
# yield request.config.getoption("--force-upgrade")
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @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
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def setup_profile_data(testrun_session):
|
||||
# profile_data = {}
|
||||
# for mode in "BRIDGE", "NAT", "VLAN":
|
||||
# profile_data[mode] = {}
|
||||
# for security in "OPEN", "WPA", "WPA2_P", "WPA2_E":
|
||||
# profile_data[mode][security] = {}
|
||||
# for radio in "2G", "5G":
|
||||
# profile_data[mode][security][radio] = {}
|
||||
# name_string = f"{'Sanity'}-{testrun_session}-{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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Utility
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="class")
|
||||
# def reset_profile(instantiate_profile):
|
||||
# instantiate_profile.profile_creation_ids["ssid"] = []
|
||||
# yield True
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def cleanup_cloud_profiles(instantiate_cloudsdk):
|
||||
# profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk)
|
||||
# yield profile_object.cleanup_profiles()
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_radius_profile(instantiate_profile, testrun_session):
|
||||
# radius_info = {
|
||||
# "name": testrun_session + "-RADIUS-Sanity",
|
||||
# "ip": RADIUS_SERVER_DATA["ip"],
|
||||
# "port": RADIUS_SERVER_DATA["port"],
|
||||
# "secret": RADIUS_SERVER_DATA["secret"]
|
||||
# }
|
||||
# instantiate_profile.delete_profile_by_name(radius_info["name"])
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile_info = instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
# yield profile_info
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def set_rf_profile(instantiate_profile):
|
||||
# try:
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.set_rf_profile()
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# BRIDGE MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except Exception as e:
|
||||
# # (e)
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# NAT MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_nat(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["NAT"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# """
|
||||
# VLAN MOde
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_p_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_P']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['2G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_wpa2_e_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data):
|
||||
# try:
|
||||
# profile_data = setup_profile_data["VLAN"]['WPA2_E']['5G']
|
||||
# instantiate_profile.get_default_profiles()
|
||||
# profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
# except:
|
||||
# profile = False
|
||||
# yield profile
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_bridge(instantiate_profile, testrun_session):
|
||||
# try:
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'BRIDGE'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# except Exception as e:
|
||||
# profile_obj = e
|
||||
# print(profile_obj)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_nat(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'NAT'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="session")
|
||||
# def create_ap_profile_vlan(instantiate_profile, testrun_session):
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'VLAN'),
|
||||
# }
|
||||
# profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
# yield profile_obj
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_current_profile_cloud(instantiate_profile):
|
||||
# ssid_names = []
|
||||
# print(instantiate_profile.profile_creation_ids["ssid"])
|
||||
# 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
|
||||
#
|
||||
#
|
||||
# """
|
||||
# Profile Push Fixtures
|
||||
# """
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def push_profile(instantiate_profile, get_equipment_id, setup_profile_data):
|
||||
# try:
|
||||
# instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
# status = True
|
||||
# except Exception as e:
|
||||
# status = False
|
||||
#
|
||||
# yield status
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def get_lanforge_data(request):
|
||||
# lanforge_data = {
|
||||
# "lanforge_ip": request.config.getini("lanforge-ip-address"),
|
||||
# "lanforge-port-number": request.config.getini("lanforge-port-number"),
|
||||
# "lanforge_2dot4g": request.config.getini("lanforge-2dot4g-radio"),
|
||||
# "lanforge_5g": request.config.getini("lanforge-5g-radio"),
|
||||
# "lanforge_2dot4g_prefix": request.config.getini("lanforge-2dot4g-prefix"),
|
||||
# "lanforge_5g_prefix": request.config.getini("lanforge-5g-prefix"),
|
||||
# "lanforge_2dot4g_station": request.config.getini("lanforge-2dot4g-station"),
|
||||
# "lanforge_5g_station": request.config.getini("lanforge-5g-station"),
|
||||
# "lanforge_bridge_port": request.config.getini("lanforge-bridge-port"),
|
||||
# "lanforge_vlan_port": "eth1.100",
|
||||
# "vlan": 100
|
||||
# }
|
||||
# yield lanforge_data
|
||||
#
|
||||
#
|
||||
# @pytest.fixture(scope="function")
|
||||
# def update_ssid(request, instantiate_profile, setup_profile_data):
|
||||
# requested_profile = str(request.param).replace(" ","").split(",")
|
||||
# profile = setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]
|
||||
# status = instantiate_profile.update_ssid_name(profile_name=profile["profile_name"], new_profile_name=requested_profile[3])
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["profile_name"] = requested_profile[3]
|
||||
# setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["ssid_name"] = requested_profile[3]
|
||||
# time.sleep(90)
|
||||
# yield status
|
||||
@@ -1,4 +1,6 @@
|
||||
[pytest]
|
||||
python_files = test_*.py setup_*.py
|
||||
norecursedirs = .svn _build tmp*
|
||||
addopts= --junitxml=test_everything.xml
|
||||
|
||||
# jFrog parameters
|
||||
|
||||
20
tests/setup_connectivity.py
Normal file
20
tests/setup_connectivity.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.order(1)
|
||||
class TestConnection:
|
||||
@pytest.mark.test_cloud_connectivity
|
||||
def test_cloud_connectivity(self, instantiate_cloudsdk):
|
||||
assert instantiate_cloudsdk
|
||||
|
||||
@pytest.mark.test_access_points_connectivity
|
||||
def test_access_points_connectivity(self, instantiate_cloudsdk):
|
||||
assert instantiate_cloudsdk
|
||||
|
||||
@pytest.mark.test_lanforge_connectivity
|
||||
def test_lanforge_connectivity(self):
|
||||
assert "instantiate_cloudsdk"
|
||||
|
||||
@pytest.mark.test_perfecto_connectivity
|
||||
def test_perfecto_connectivity(self):
|
||||
assert "instantiate_cloudsdk"
|
||||
322
tests/setup_e2e_tests.py
Normal file
322
tests/setup_e2e_tests.py
Normal file
@@ -0,0 +1,322 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.bridge
|
||||
class TestSetupBridge:
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_setup_rf_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_setup_radius_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
def test_setup_open_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_open_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_setup_equipment_ap_profile(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_push_profile(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_verify_vif_config(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_verify_vif_state(self):
|
||||
assert True
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.nat
|
||||
class TestSetupNAT:
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_setup_rf_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_setup_radius_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
def test_setup_open_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_open_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_setup_equipment_ap_profile(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_push_profile(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_verify_vif_config(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_verify_vif_state(self):
|
||||
assert True
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.vlan
|
||||
class TestSetupVLAN:
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_setup_rf_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_setup_radius_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
def test_setup_open_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_open_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_personal_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_personal_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, cleanup_profile):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_setup_equipment_ap_profile(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_push_profile(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_verify_vif_config(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.open
|
||||
def test_verify_vif_state(self):
|
||||
assert True
|
||||
Reference in New Issue
Block a user