Added cloudsdk pytests and directory structuring

Signed-off-by: shivam <shivam.thakur@candelatech.com>
This commit is contained in:
shivam
2021-03-10 17:36:06 +05:30
parent 46b159783f
commit edd393e2ac
47 changed files with 196 additions and 10162 deletions

View File

@@ -1,29 +0,0 @@
import pytest
@pytest.mark.usefixtures('setup_cloudsdk')
@pytest.mark.usefixtures('update_firmware')
@pytest.mark.UHF # example of a class mark
class Test24ghz(object):
@pytest.mark.wpa2
def test_single_client_wpa2(self, setup_cloudsdk, update_firmware):
print(setup_cloudsdk)
assert 1 == 0
@pytest.mark.open
def test_single_client_open(self, setup_cloudsdk, update_firmware):
print(setup_cloudsdk)
assert 1 == 0
@pytest.mark.usefixtures('setup_cloudsdk')
@pytest.mark.usefixtures('update_firmware')
@pytest.mark.SHF # example of a class mark
class Test50ghz(object):
@pytest.mark.wpa2
def test_single_client_wpa2(self, setup_cloudsdk, update_firmware):
print(setup_cloudsdk)
assert 1 == 0
@pytest.mark.open
def test_single_client_open(self, setup_cloudsdk, update_firmware):
print(setup_cloudsdk)
assert 1 == 0

View File

@@ -54,7 +54,7 @@ class ConfigureCloudSDK:
"""
Library for cloudSDK generic usages, it instantiate the bearer and credentials.
Library for cloudsdk generic usages, it instantiate the bearer and credentials.
It provides the connectivity to the cloud.
"""
@@ -64,9 +64,12 @@ class CloudSDK(ConfigureCloudSDK):
constructor for cloudsdk library : can be used from pytest framework
"""
def __init__(self, testbed=None):
def __init__(self, testbed=None, customer_id=None):
super().__init__()
if customer_id is None:
print("Invalid Customer Id")
exit()
self.customer_id = customer_id
# Setting the CloudSDK Client Configuration
self.select_testbed(testbed=testbed)
self.set_credentials()
@@ -85,6 +88,7 @@ class CloudSDK(ConfigureCloudSDK):
}
self.api_client.configuration.refresh_api_key_hook = self.get_bearer_token()
self.ping_response = self.portal_ping()
self.default_profiles = {}
# print(self.bearer)
if self.ping_response._application_name != 'PortalServer':
print("Server not Reachable")
@@ -108,14 +112,16 @@ class CloudSDK(ConfigureCloudSDK):
Equipment Utilities
"""
def get_equipment_by_customer_id(self, customer_id=None, max_items=10):
# Returns a List of All the Equipments that are available
def get_equipment_by_customer_id(self, max_items=10):
pagination_context = """{
"model_type": "PaginationContext",
"maxItemsPerPage": """+str(max_items)+"""
"maxItemsPerPage": """ + str(max_items) + """
}"""
print(self.equipment_client.get_equipment_by_customer_id(customer_id=customer_id,
pagination_context=pagination_context))
equipment_data = self.equipment_client.get_equipment_by_customer_id(customer_id=self.customer_id,
pagination_context=pagination_context)
return equipment_data._items
def request_ap_reboot(self):
pass
@@ -141,57 +147,16 @@ class CloudSDK(ConfigureCloudSDK):
Captive-Portal
"""
def get_profile_template(self, customer_id=None, profile_name=None):
pagination_context = """{
"model_type": "PaginationContext",
"maxItemsPerPage": 100
}"""
profiles = self.profile_client.get_profiles_by_customer_id(customer_id=customer_id,
pagination_context=pagination_context)._items
for i in profiles:
if i._name == profile_name:
return i
return None
def get_profiles_by_customer_id(self, customer_id=None):
pagination_context = """{
"model_type": "PaginationContext",
"maxItemsPerPage": 100
}"""
self.default_profiles = {}
print(len((self.profile_client.get_profiles_by_customer_id(customer_id=customer_id,
pagination_context=pagination_context))._items))
for i in self.profile_client.get_profiles_by_customer_id(customer_id=customer_id,
pagination_context=pagination_context)._items:
print(i._name, i._id)
if i._name == "TipWlan-Cloud-Wifi":
self.default_profiles['ssid'] = i
if i._name == "TipWlan-Cloud-Wifi":
self.default_profiles['ssid'] = i
if i._name == "TipWlan-Cloud-Wifi":
self.default_profiles['ssid'] = i
def create_profile(self, profile_type=None, customer_id=None, profile_name=None):
if profile_type is None or customer_id is None or profile_name is None:
return "Invalid profile_type/customer_id/profile_name"
profile_data = {
"profileType": profile_type, # eg. ("equipment_ap", "ssid", "rf", "radius", "captive_portal")
"customerId": customer_id,
"name": profile_name
}
return "Profile Created Successfully!"
class APUtils:
class ProfileUtility:
"""
constructor for Access Point Utility library : can be used from pytest framework
to control Access Points
"""
def __init__(self, sdk_client=None, testbed=None):
def __init__(self, sdk_client=None, testbed=None, customer_id=None):
if sdk_client is None:
sdk_client = CloudSDK(testbed=testbed)
sdk_client = CloudSDK(testbed=testbed, customer_id=customer_id)
self.sdk_client = sdk_client
self.profile_client = swagger_client.ProfileApi(api_client=self.sdk_client.api_client)
self.profile_creation_ids = {
@@ -200,14 +165,52 @@ class APUtils:
"radius": [],
"rf": []
}
self.default_profiles = {}
self.profile_ids = []
def get_profile_by_name(self, profile_name=None):
pagination_context = """{
"model_type": "PaginationContext",
"maxItemsPerPage": 1000
}"""
profiles = self.profile_client.get_profiles_by_customer_id(customer_id=self.sdk_client.customer_id,
pagination_context=pagination_context)
for i in profiles._items:
if i._name == profile_name:
return i
return None
def get_default_profiles(self):
pagination_context = """{
"model_type": "PaginationContext",
"maxItemsPerPage": 100
}"""
items = self.profile_client.get_profiles_by_customer_id(customer_id=self.sdk_client.customer_id,
pagination_context=pagination_context)
for i in items._items:
# print(i._name, i._id)
if i._name == "TipWlan-Cloud-Wifi":
self.default_profiles['ssid'] = i
if i._name == "TipWlan-3-Radios":
self.default_profiles['equipment_ap_3_radios'] = i
if i._name == "TipWlan-2-Radios":
self.default_profiles['equipment_ap_3_radios'] = i
if i._name == "Captive-Portal":
self.default_profiles['captive_portal'] = i
if i._name == "Radius-Profile":
self.default_profiles['radius'] = i
if i._name == "TipWlan-rf":
self.default_profiles['rf'] = i
"""
method call: used to create the rf profile and push set the parameters accordingly and update
"""
def select_rf_profile(self, profile_data=None):
default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-rf")
def set_rf_profile(self, profile_data=None):
default_profile = self.default_profiles['rf']
# default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-rf")
if profile_data is None:
self.profile_creation_ids['rf'].append(default_profile._id)
# Need to add functionality to add similar Profile and modify accordingly
@@ -219,7 +222,8 @@ class APUtils:
def create_open_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
if profile_data is None:
return False
default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile = self.default_profiles['ssid']
# default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile._details['appliedRadios'] = []
if two4g is True:
default_profile._details['appliedRadios'].append("is2dot4GHz")
@@ -239,7 +243,8 @@ class APUtils:
def create_wpa_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
if profile_data is None:
return False
default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile = self.default_profiles['ssid']
# default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile._details['appliedRadios'] = []
if two4g is True:
default_profile._details['appliedRadios'].append("is2dot4GHz")
@@ -260,7 +265,8 @@ class APUtils:
def create_wpa2_personal_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
if profile_data is None:
return False
default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile = self.default_profiles['ssid']
# default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile._details['appliedRadios'] = []
if two4g is True:
default_profile._details['appliedRadios'].append("is2dot4GHz")
@@ -282,7 +288,8 @@ class APUtils:
def create_wpa3_personal_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
if profile_data is None:
return False
default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile = self.default_profiles['ssid']
# default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile._details['appliedRadios'] = []
if two4g is True:
default_profile._details['appliedRadios'].append("is2dot4GHz")
@@ -303,7 +310,8 @@ class APUtils:
def create_wpa2_enterprise_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
if profile_data is None:
return False
default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile = self.default_profiles['ssid']
# default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile._details['appliedRadios'] = []
if two4g is True:
default_profile._details['appliedRadios'].append("is2dot4GHz")
@@ -323,7 +331,8 @@ class APUtils:
def create_wpa3_enterprise_ssid_profile(self, two4g=True, fiveg=True, profile_data=None):
if profile_data is None:
return False
default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile = self.default_profiles['ssid']
# default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-Cloud-Wifi")
default_profile._details['appliedRadios'] = []
if two4g is True:
default_profile._details['appliedRadios'].append("is2dot4GHz")
@@ -348,7 +357,8 @@ class APUtils:
def set_ap_profile(self, profile_data=None):
if profile_data is None:
return False
default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-2-Radios")
default_profile = self.default_profiles['equipment_ap_2_radios']
# default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="TipWlan-2-Radios")
default_profile._child_profile_ids = []
for i in self.profile_creation_ids:
for j in self.profile_creation_ids[i]:
@@ -432,10 +442,44 @@ class APUtils:
response = requests.request("PUT", url, headers=headers, data=json.dumps(equipment_info))
class JFrogUtility:
def __init__(self, credentials=None):
if credentials is None:
exit()
self.user = credentials["user"]
self.password = credentials["password"]
self.jfrog_url = "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/"
self.build = "pending"
def list_revisions(self):
pass
def get_latest_build(self):
pass
if __name__ == "__main__":
sdk_client = CloudSDK(testbed="nola-ext-04")
print(sdk_client.get_equipment_by_customer_id(customer_id=2))
sdk_client.disconnect_cloudsdk()
testbeds = ["nola-01", "nola-02", "nola-04", "nola-ext-01", "nola-ext-02", "nola-ext-03", "nola-ext-04",
"nola-ext-05"]
for i in testbeds:
sdk_client = CloudSDK(testbed=i, customer_id=2)
print(sdk_client.get_equipment_by_customer_id())
print(sdk_client.portal_ping() is None)
break
# ap_utils = ProfileUtility(sdk_client=sdk_client)
# ap_utils.get_default_profiles()
# for j in ap_utils.default_profiles:
# print(ap_utils.default_profiles[j]._id)
# data = sdk_client.get_equipment_by_customer_id()
# equipment_ids = []
# for i in data:
# equipment_ids.append(i)
# print(equipment_ids[0]._details._equipment_model)
sdk_client.disconnect_cloudsdk()
time.sleep(2)
# sdk_client.get_equipment_by_customer_id(customer_id=2)
# ap_utils = APUtils(sdk_client=sdk_client)
# print(sdk_client.configuration.api_key_prefix)
@@ -494,7 +538,6 @@ if __name__ == "__main__":
# # # obj.get_profiles_by_customer_id(customer_id=2)
# # # print(obj.default_profiles)
# # time.sleep(20)
# # # Please change the equipment ID with the respective testbed
# #ap_utils.push_profile(equipment_id=11)
@@ -504,6 +547,7 @@ if __name__ == "__main__":
# ap_utils.delete_profile(profile_id=ap_utils.profile_ids)
def test_open_ssid():
sdk_client = CloudSDK(testbed="nola-ext-04")
ap_utils = APUtils(sdk_client=sdk_client)
@@ -522,13 +566,23 @@ def test_open_ssid():
ap_utils.push_profile_old_method(equipment_id='12')
sdk_client.disconnect_cloudsdk()
pass
def test_wpa_ssid():
pass
def test_wpa2_personal_ssid():
pass
def test_wpa3_personal_ssid():
pass
def test_wpa2_enterprise_ssid():
pass
def test_wpa3_enterprise_ssid():
pass
pass

View File

@@ -1,78 +0,0 @@
# import files in the current directory
import sys
import os
sys.path.append(
os.path.dirname(
os.path.realpath( __file__ )
)
)
import pytest
from configuration_data import PROFILE_DATA
def pytest_addoption(parser):
parser.addini("jfrog-base-url", "jfrog base url")
parser.addini("jfrog-user-id", "jfrog username")
parser.addini("jfrog-user-password", "jfrog password")
parser.addini("sdk-base-url", "cloud sdk base url")
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("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-radio", "LANforge radio to use")
parser.addini("lanforge-ethernet-port", "LANforge ethernet adapter to use")
# change behaviour
parser.addoption(
"--skip-update-firmware",
action="store_true",
default=False,
help="skip updating firmware on the AP (useful for local testing)"
)
# this has to be the last argument
# example: --access-points ECW5410 EA8300-EU
parser.addoption(
"--access-points",
nargs="+",
default=[ "ECW5410" ],
help="list of access points to test"
)
def pytest_generate_tests(metafunc):
metafunc.parametrize("access_points", metafunc.config.getoption('--access-points'), scope="session")
# run something after all tests are done regardless of the outcome
def pytest_unconfigure(config):
print("Tests cleanup done")
@pytest.fixture(scope="function")
def setup_cloudsdk(request, instantiate_cloudsdk):
def fin():
print(f"Cloud SDK cleanup for {request.node.originalname}")
request.addfinalizer(fin)
yield PROFILE_DATA[request.node.originalname]
@pytest.fixture(scope="session")
def update_firmware(request, instantiate_jFrog, instantiate_cloudsdk, retrieve_latest_image, access_points):
if request.config.getoption("--skip-update-firmware"):
return
yield "update_firmware"
@pytest.fixture(scope="session")
def retrieve_latest_image(request, access_points):
if request.config.getoption("--skip-update-firmware"):
return
yield "retrieve_latest_image"
@pytest.fixture(scope="session")
def instantiate_cloudsdk(request):
yield "instantiate_cloudsdk"
@pytest.fixture(scope="session")
def instantiate_jFrog(request):
yield "instantiate_jFrog"

View File

@@ -1,29 +0,0 @@
[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
sdk-base-url=wlan-portal-svc.cicd.lab.wlan.tip.build
sdk-user-id=support@example.com
sdk-user-password=support
# Testrails parameters
testrail-base-url=telecominfraproject.testrail.com
testrail-project=opsfleet-wlan
testrail-user-id=gleb@opsfleet.com
testrail-user-password=use_command_line_to_pass_this
# LANforge
lanforge-ip-address=localhost
lanforge-port-number=8080
lanforge-radio=wiphy4
lanforge-ethernet-port=eth2
# Cloud SDK settings
sdk-customer-id=2
markers =
UHF: marks tests as using 2.4 ghz frequency
SHF: marks tests as using 5.0 ghz frequency
open: marks tests as using no security
wpa2: marks tests as using wpa2 security

View File

@@ -1,6 +1,7 @@
"""
A set of constants describing cloud controllers properties
"""
import os
SDK_BASE_URLS = {
"nola-01": "https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build",
@@ -12,6 +13,11 @@ SDK_BASE_URLS = {
}
LOGIN_CREDENTIALS = {
"user_id": "support@example.com",
"userId": "support@example.com",
"password": "support"
}
JFROG_CREDENTIALS = {
"userId": os.getenv('JFROG_USER'),
"password": os.getenv('JFROG_PWD')
}

View File

@@ -1,16 +0,0 @@
FROM python:3.8
WORKDIR /ci
RUN apt update && apt install vim -y && rm -rf /var/lib/apt/lists/*
RUN pip3 install requests xlsxwriter pandas pytest
COPY wlan-lanforge-scripts/py-json/LANforge /ci/LANforge/
COPY wlan-lanforge-scripts/py-json/realm.py /ci/
COPY wlan-lanforge-scripts/py-json/generic_cx.py /ci/
COPY wlan-lanforge-scripts/py-scripts/sta_connect2.py /ci/
COPY wlan-testing/pytest/conftest.py /ci/
COPY wlan-testing/pytest/test* /ci/
COPY wlan-testing/pytest/pytest.ini /ci/
COPY wlan-testing/pytest/helpers /ci/helpers/
ENTRYPOINT [ "pytest" ]

View File

@@ -1,35 +0,0 @@
# This assumes you have ssh tunnels set up as suggested in ../tools/USAGE_EXAMPLES.txt
# Attempt to run pytest against nola-12. Doesn't work, cloud is down, but of course maybe more problems too.
pytest test_24ghz.py --testrail-user-id NONE --ap-jumphost-address localhost --ap-jumphost-port 8823 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --lanforge-ip-address localhost --lanforge-port-number 8822 \
--default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \
--skip-radius --skip-wpa --verbose --testbed "NOLA-12c" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \
--ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge --access-points wf188n
# Run nightly against NOLA-01
./Nightly_Sanity.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --skip-upgrade True --testbed "NOLA-01h" \
--lanforge-ip-address localhost --lanforge-port-number 8802 --default_ap_profile TipWlan-2-Radios \
--skip_radius --lanforge-2g-radio 1.1.wiphy4 --lanforge-5g-radio 1.1.wiphy5 \
--sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build
# Run nightly against NOLA-04 from lab-ctlr itself.
./Nightly_Sanity.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 22 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 --skip-upgrade True --testbed "NOLA-04ben" \
--lanforge-ip-address lf4 --lanforge-port-number 8080 --default_ap_profile TipWlan-2-Radios \
--skip_radius --lanforge-2g-radio 1.1.wiphy4 --lanforge-5g-radio 1.1.wiphy5 \
--sdk-base-url https://wlan-portal-svc-nola-04.cicd.lab.wlan.tip.build
# Run nightly against NOLA-04 from dev machine with ssh tunnel.
./Nightly_Sanity.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8813 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 --skip-upgrade True --testbed "NOLA-04ben" \
--lanforge-ip-address localhost --lanforge-port-number 8812 --default_ap_profile TipWlan-2-Radios \
--skip_radius --lanforge-2g-radio 1.1.wiphy4 --lanforge-5g-radio 1.1.wiphy5 \
--sdk-base-url https://wlan-portal-svc-nola-04.cicd.lab.wlan.tip.build

View File

@@ -1,487 +0,0 @@
#!/usr/bin/python3
import sys
if "libs" not in sys.path:
sys.path.append("../libs")
from UnitTestBase import *
class NightlySanity:
def __init__(self, args=None, base=None, lanforge_data=None, test=None, reporting=None, build=None):
self.args = args
self.model = self.args.model
self.client: TestRail_Client = TestRail_Client(args)
self.logger = base.logger
self.rid = None
# Get Cloud Bearer Token
self.cloud: CloudSDK = CloudSDK(args)
cloud_type = "v1"
self.bearer = self.cloud.get_bearer(args.sdk_base_url, cloud_type)
self.customer_id = "2"
self.test = test
self.reporting = reporting
self.lanforge_data = lanforge_data
if lanforge_data is None:
exit()
self.cloud_sdk_models = {
"ec420": "EC420-G1",
"ea8300": "EA8300-CA",
"ecw5211": "ECW5211",
"ecw5410": "ECW5410",
"wf188n": "WF188N"
}
self.jfrog_build = build
self.ap_object = None
self.equipment_id = self.args.equipment_id
self.report_data = dict()
self.ap_cli_info = get_ap_info(self.args)
self.ap_current_fw = self.ap_cli_info['active_fw']
self.report_data = dict()
self.firmware = {}
if self.equipment_id == "-1":
eq_id = ap_ssh_ovsh_nodec(args, 'id')
print("EQ Id: %s" % (eq_id))
# Now, query equipment to find something that matches.
eq = self.cloud.get_customer_equipment(self.customer_id)
for item in eq:
for e in item['items']:
print(e['id'], " ", e['inventoryId'])
if e['inventoryId'].endswith("_%s" % (eq_id)):
print("Found equipment ID: %s inventoryId: %s",
e['id'], e['inventoryId'])
self.equipment_id = str(e['id'])
if self.equipment_id == "-1":
print("ERROR: Could not find equipment-id.")
exit()
def configure_dut(self):
# Check for latest Firmware
latest_fw = self.jfrog_build.check_latest_fw(self.model)
if latest_fw is None:
print("AP Model doesn't match the available Models")
exit()
self.firmware = {
"latest": latest_fw,
"current": self.ap_current_fw
}
# Create Test session
self.create_test_run_session()
key = self.args.model; # TODO: Not sure about this.
# Check if AP needs Upgrade
if (self.firmware["current"] is not None) and self.firmware["latest"] != self.firmware["current"]:
do_upgrade = self.cloud.should_upgrade_ap_fw(self.args.force_upgrade, self.args.skip_upgrade, self.report_data,
self.firmware["latest"],
self.args.model,
self.firmware["current"], self.logger, key)
elif (self.firmware["current"] is not None) and self.firmware["latest"] == self.firmware["current"]:
do_upgrade = False
print("AP ia already having Latest Firmware...")
else:
print("Skipping this Profile")
exit()
# Upgrade the Firmware on AP
if do_upgrade:
cloud_model = self.cloud_sdk_models[self.args.model]
pf = self.cloud.do_upgrade_ap_fw(self.args, self.report_data, test_cases, self.client,
self.firmware["latest"], cloud_model, self.args.model,
self.args.jfrog_user_id, self.args.jfrog_user_password, self.rid,
self.customer_id, self.equipment_id, self.logger)
print(self.report_data)
if not pf:
exit()
return self.firmware
def create_test_run_session(self):
today = str(date.today())
case_ids = list(test_cases.values())
proj_id = self.client.get_project_id(project_name=self.args.testrail_project)
test_run_name = self.args.testrail_run_prefix + self.model + "_" + today + "_" + self.firmware["latest"]
self.client.create_testrun(name=test_run_name, case_ids=case_ids, project_id=proj_id,
milestone_id=self.args.milestone,
description="Automated Nightly Sanity test run for new firmware build")
self.rid = self.client.get_run_id(test_run_name=self.args.testrail_run_prefix + self.model + "_" + today + "_" + self.firmware["latest"])
print("TIP run ID is:", self.rid)
def start_test(self):
if True:
# Check AP Manager Status
manager_status = self.ap_cli_info['state']
print(manager_status)
"""
if manager_status != "active":
print("Manager status is " + manager_status + "! Not connected to the cloud.")
print("Waiting 30 seconds and re-checking status")
time.sleep(30)
ap_cli_info = ssh_cli_active_fw(self.args)
manager_status = ap_cli_info['state']
if manager_status != "active":
print("Manager status is", manager_status, "! Not connected to the cloud.")
print("Manager status fails multiple checks - failing test case.")
# fail cloud connectivity testcase
self.client.update_testrail(case_id=test_cases["cloud_connection"], run_id=self.rid,
status_id=5,
msg='CloudSDK connectivity failed')
self.report_data['tests'][self.model][test_cases["cloud_connection"]] = "failed"
print(self.report_data['tests'][self.model])
else:
print("Manager status is Active. Proceeding to connectivity testing!")
# TC522 pass in Testrail
self.client.update_testrail(case_id=test_cases["cloud_connection"], run_id=self.rid, status_id=1,
msg='Manager status is Active')
self.report_data['tests'][self.model][test_cases["cloud_connection"]] = "passed"
print(self.report_data['tests'][self.model])
else:
print("Manager status is Active. Proceeding to connectivity testing!")
# TC5222 pass in testrail
self.client.update_testrail(case_id=test_cases["cloud_connection"], run_id=self.rid, status_id=1,
msg='Manager status is Active')
self.report_data['tests'][self.model][test_cases["cloud_connection"]] = "passed"
print(self.report_data['tests'][self.model])
# Pass cloud connectivity test case
"""
# Update in reporting
self.reporting.update_json_report(self.report_data)
self.ap_object = CreateAPProfiles(self.args, cloud=self.cloud, client=self.client, fw_model=self.model)
#
# # Logic to create AP Profiles (Bridge Mode)
nprefix = "%s-Nightly"%(self.args.testbed)
self.ap_object.set_ssid_psk_data(ssid_2g_wpa="%s-SSID-2G-WPA"%(nprefix),
ssid_5g_wpa="%s-SSID-5G-WPA"%(nprefix),
psk_2g_wpa="%s_2g_wpa"%(nprefix),
psk_5g_wpa="%s_5g_wpa"%(nprefix),
ssid_2g_wpa2="%s-SSID-2G-WPA2"%(nprefix),
ssid_5g_wpa2="%s-SSID-5G-WPA2"%(nprefix),
psk_2g_wpa2="%s_2g_wpa2"%(nprefix),
psk_5g_wpa2="%s_5g_wpa2"%(nprefix))
print("creating Profiles")
ssid_template = "TipWlan-Cloud-Wifi"
if not self.args.skip_profiles:
if not self.args.skip_radius:
radius_name = "Automation_Radius_Nightly-01"
radius_template = "templates/radius_profile_template.json"
self.ap_object.create_radius_profile(radius_name=radius_name, radius_template=radius_template, rid=self.rid,
key=self.model)
self.ap_object.create_ssid_profiles(ssid_template=ssid_template, skip_eap=True, mode="bridge")
print("Create AP with equipment-id: ", self.equipment_id)
self.ap_object.create_ap_profile(eq_id=self.equipment_id, fw_model=self.model, mode="bridge")
self.ap_object.validate_changes(mode="bridge")
print("Profiles Created")
self.test_2g(mode="bridge")
self.test_5g(mode="bridge")
time.sleep(10)
self.reporting.update_json_report(report_data=self.ap_object.report_data)
self.ap_object = CreateAPProfiles(self.args, cloud=self.cloud, client=self.client, fw_model=self.model)
# Logic to create AP Profiles (NAT Mode)
self.ap_object.set_ssid_psk_data(ssid_2g_wpa="%s-SSID-NAT-2G-WPA"%(nprefix),
ssid_5g_wpa="%s-SSID-NAT-5G-WPA"%(nprefix),
psk_2g_wpa="%s_2g_nat_wpa"%(nprefix),
psk_5g_wpa="%s_5g_nat_wpa"%(nprefix),
ssid_2g_wpa2="%s-SSID-NAT-2G-WPA2"%(nprefix),
ssid_5g_wpa2="%s-SSID-NAT-5G-WPA2"%(nprefix),
psk_2g_wpa2="%s_2g_nat_wpa2"%(nprefix),
psk_5g_wpa2="%s_5g_nat_wpa2"%(nprefix))
print("creating Profiles")
ssid_template = "TipWlan-Cloud-Wifi"
if not self.args.skip_profiles:
if not self.args.skip_radius:
# Radius Profile needs to be set here
# obj.create_radius_profile(radius_name, rid, key)
pass
self.ap_object.create_ssid_profiles(ssid_template=ssid_template, mode="nat")
print("Create AP with equipment-id: ", self.equipment_id)
self.ap_object.create_ap_profile(eq_id=self.equipment_id, fw_model=self.model, mode="nat")
self.ap_object.validate_changes(mode="nat")
self.test_2g(mode="nat")
self.test_5g(mode="nat")
time.sleep(10)
self.reporting.update_json_report(report_data=self.ap_object.report_data)
def setup_report(self):
self.report_data["cloud_sdk"] = dict.fromkeys(ap_models, "")
for key in self.report_data["cloud_sdk"]:
self.report_data["cloud_sdk"][key] = {
"date": "N/A",
"commitId": "N/A",
"projectVersion": "N/A"
}
self.report_data["fw_available"] = dict.fromkeys(ap_models, "Unknown")
self.report_data["fw_under_test"] = dict.fromkeys(ap_models, "N/A")
self.report_data['pass_percent'] = dict.fromkeys(ap_models, "")
self.report_data['tests'] = dict.fromkeys(ap_models, "")
for key in ap_models:
self.report_data['tests'][key] = dict.fromkeys(test_cases.values(), "not run")
print(self.report_data)
self.reporting.update_json_report(report_data=self.report_data)
def test_2g(self, mode="bridge"):
if not self.args.skip_radius:
# Run Client Single Connectivity Test Cases for Bridge SSIDs
# TC5214 - 2.4 GHz WPA2-Enterprise
test_case = test_cases["2g_eap_" + mode]
radio = command_line_args.lanforge_2g_radio
sta_list = [lanforge_prefix + "5214"]
ssid_name = ssid_2g_eap;
security = "wpa2"
eap_type = "TTLS"
try:
test_result = self.test.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type,
identity, ttls_password, test_case, rid, client, logger)
except:
test_result = "error"
self.test.testrail_retest(test_case, rid, ssid_name, client, logger)
pass
report_data['tests'][key][int(test_case)] = test_result
print(report_data['tests'][key])
time.sleep(10)
# Run Client Single Connectivity Test Cases for Bridge SSIDs
# TC - 2.4 GHz WPA2
test_case = test_cases["2g_wpa2_" + mode]
station = [self.lanforge_data['prefix'] + "2237"]
ssid_name = self.ap_object.ssid_data['2g']['wpa2'][mode]
ssid_psk = self.ap_object.psk_data['2g']['wpa2'][mode]
security = "wpa2"
upstream_port = "eth2"
print(self.lanforge_data['port'])
try:
test_result = self.test.Single_Client_Connectivity(upstream_port=upstream_port,
radio=self.lanforge_data['2g_radio'],
ssid=ssid_name,
passkey=ssid_psk,
security=security,
station_name=station, test_case=test_case, rid=self.rid,
client=self.client, logger=self.logger)
except:
test_result = "error"
self.test.testrail_retest(test_case, self.rid, ssid_name, self.client, self.logger)
pass
self.report_data['tests'][self.model][int(test_case)] = test_result
print(self.report_data['tests'][self.model])
time.sleep(10)
# TC - 2.4 GHz WPA
test_case = test_cases["2g_wpa_" + mode]
station = [self.lanforge_data['prefix'] + "2420"]
ssid_name = self.ap_object.ssid_data['2g']['wpa'][mode]
ssid_psk = self.ap_object.psk_data['2g']['wpa'][mode]
security = "wpa"
upstream_port = "eth2"
print(self.lanforge_data['port'])
try:
test_result = self.test.Single_Client_Connectivity(upstream_port=upstream_port,
radio=self.lanforge_data['2g_radio'],
ssid=ssid_name,
passkey=ssid_psk,
security=security,
station_name=station, test_case=test_case, rid=self.rid,
client=self.client, logger=self.logger)
except:
test_result = "error"
self.test.testrail_retest(test_case, self.rid, ssid_name, self.client, self.logger)
pass
self.report_data['tests'][self.model][int(test_case)] = test_result
print(self.report_data['tests'][self.model])
time.sleep(10)
def test_5g(self, mode="bridge"):
if not self.args.skip_radius:
# TC - 5 GHz WPA2-Enterprise
test_case = self.test_cases["5g_eap_" + mode]
radio = lanforge_5g_radio
sta_list = [lanforge_prefix + "5215"]
ssid_name = ssid_5g_eap
security = "wpa2"
eap_type = "TTLS"
try:
test_result = Test.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type,
identity, ttls_password, test_case, rid, client, logger)
except:
test_result = "error"
Test.testrail_retest(test_case, rid, ssid_name, client, logger)
pass
report_data['tests'][key][int(test_case)] = test_result
print(report_data['tests'][key])
time.sleep(10)
# TC 5 GHz WPA2
test_case = test_cases["5g_wpa2_" + mode]
station = [self.lanforge_data['prefix'] + "2236"]
ssid_name = self.ap_object.ssid_data['5g']['wpa2'][mode]
ssid_psk = self.ap_object.psk_data['5g']['wpa2'][mode]
security = "wpa2"
upstream_port = "eth2"
try:
test_result = self.test.Single_Client_Connectivity(upstream_port=upstream_port,
radio=self.lanforge_data['5g_radio'],
ssid=ssid_name,
passkey=ssid_psk,
security=security,
station_name=station, test_case=test_case, rid=self.rid,
client=self.client, logger=self.logger)
except:
test_result = "error"
self.test.testrail_retest(test_case, self.rid, ssid_name, self.client, self.logger)
pass
self.report_data['tests'][self.model][int(test_case)] = test_result
print(self.report_data['tests'][self.model])
time.sleep(10)
# # TC - 5 GHz WPA
test_case = test_cases["5g_wpa_" + mode]
station = [self.lanforge_data['prefix'] + "2419"]
ssid_name = self.ap_object.ssid_data['5g']['wpa'][mode]
ssid_psk = self.ap_object.psk_data['5g']['wpa'][mode]
security = "wpa"
upstream_port = "eth2"
try:
test_result = self.test.Single_Client_Connectivity(upstream_port=upstream_port,
radio=self.lanforge_data['5g_radio'],
ssid=ssid_name,
passkey=ssid_psk,
security=security,
station_name=station, test_case=test_case, rid=self.rid,
client=self.client, logger=self.logger)
except:
test_result = "error"
self.test.testrail_retest(test_case, self.rid, ssid_name, self.client, self.logger)
pass
self.report_data['tests'][self.model][int(test_case)] = test_result
print(self.report_data['tests'][self.model])
time.sleep(10)
def main():
parser = argparse.ArgumentParser(description="Nightly Combined Tests", add_help=False)
parser.add_argument("--default_ap_profile", type=str,
help="Default AP profile to use as basis for creating new ones, typically: TipWlan-2-Radios or TipWlan-3-Radios",
required=True)
parser.add_argument("--skip_radius", dest="skip_radius", action='store_true',
help="Should we skip the RADIUS configs or not")
parser.add_argument("--skip_profiles", dest="skip_profiles", action='store_true',
help="Should we skip applying profiles?")
parser.add_argument("--skip_wpa", dest="skip_wpa", action='store_false',
help="Should we skip applying profiles?")
parser.add_argument("--skip_wpa2", dest="skip_wpa2", action='store_false',
help="Should we skip applying profiles?")
parser.add_argument("--skip_eap", dest="skip_eap", action='store_false',
help="Should we skip applying profiles?")
reporting = Reporting(reports_root=os.getcwd() + "/reports/")
base = UnitTestBase("query-sdk", parser, reporting)
command_line_args = base.command_line_args
# cmd line takes precedence over env-vars.
cloudsdk_url = command_line_args.sdk_base_url # was os.getenv('CLOUD_SDK_URL')
local_dir = command_line_args.local_dir # was os.getenv('SANITY_LOG_DIR')
report_path = command_line_args.report_path # was os.getenv('SANITY_REPORT_DIR')
report_template = command_line_args.report_template # was os.getenv('REPORT_TEMPLATE')
# TestRail Information
tr_user = command_line_args.testrail_user_id # was os.getenv('TR_USER')
tr_pw = command_line_args.testrail_user_password # was os.getenv('TR_PWD')
milestone_id = command_line_args.milestone # was os.getenv('MILESTONE')
project_id = command_line_args.testrail_project # was os.getenv('PROJECT_ID')
test_run_prefix = command_line_args.testrail_run_prefix # os.getenv('TEST_RUN_PREFIX')
# Jfrog credentials
jfrog = {
"user": command_line_args.jfrog_user_id, # was os.getenv('JFROG_USER')
"pass": command_line_args.jfrog_user_password # was os.getenv('JFROG_PWD')
}
# EAP Credentials
eap_cred = {
"identity": command_line_args.eap_id,
"ttls_password": command_line_args.ttls_password
}
# AP Credentials
ap_cred = {
"username": command_line_args.ap_username
}
# LANForge Information
lanforge = {
"ip": command_line_args.lanforge_ip_address,
"port": command_line_args.lanforge_port_number,
"prefix": command_line_args.lanforge_prefix,
"2g_radio": command_line_args.lanforge_2g_radio,
"5g_radio": command_line_args.lanforge_5g_radio
}
build = command_line_args.build_id
logger = base.logger
hdlr = base.hdlr
if command_line_args.testbed is None:
print("ERROR: Must specify --testbed argument for this test.")
sys.exit(1)
print("Start of Sanity Testing...")
print("Testing Latest Build with Tag: " + build)
if command_line_args.skip_upgrade:
print("Will skip upgrading AP firmware...")
# Testrail Project and Run ID Information
test = RunTest(lanforge_ip=lanforge["ip"], lanforge_port=lanforge["port"], lanforge_prefix=lanforge["prefix"])
build_obj = GetBuild(jfrog['user'], jfrog['pass'], build)
# sanity_status = json.load(open("sanity_status.json"))
obj = NightlySanity(args=command_line_args, base=base, lanforge_data=lanforge, test=test, reporting=reporting,
build=build_obj)
obj.configure_dut()
proj_id = obj.client.get_project_id(project_name=project_id)
print("TIP WLAN Project ID is:", proj_id)
logger.info('Start of Nightly Sanity')
obj.setup_report()
obj.start_test()
if __name__ == "__main__":
main()

View File

@@ -1,2 +0,0 @@
## Testcases
This directory contains the automated test cases for the TIP Open Wi-Fi Solution

View File

@@ -1,530 +0,0 @@
import csv
import sys
import time
import datetime
from datetime import date
import json
import os
import logging
import single_client_throughput
import cloudsdk
from cloudsdk import CloudSDK
import lab_ap_info
cloudSDK_url=os.getenv('CLOUD_SDK_URL')
station = ["tput5000"]
runtime = 10
csv_path=os.getenv('CSV_PATH')
bridge_upstream_port = "eth2"
nat_upstream_port = "eth2"
vlan_upstream_port = "vlan100"
#EAP Credentials
identity=os.getenv('EAP_IDENTITY')
ttls_password=os.getenv('EAP_PWD')
local_dir=os.getenv('TPUT_LOG_DIR')
logger = logging.getLogger('Throughput_Test')
hdlr = logging.FileHandler(local_dir+"/Throughput_Testing.log")
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.INFO)
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
if 'py-json' not in sys.path:
sys.path.append('../../py-json')
def throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput):
#parse client_tput list returned from single_client_throughput
udp_ds = client_tput[0].partition(": ")[2]
udp_us = client_tput[1].partition(": ")[2]
tcp_ds = client_tput[2].partition(": ")[2]
tcp_us = client_tput[3].partition(": ")[2]
# Find band for CSV ---> This code is not great, it SHOULD get that info from LANForge!
if "5G" in ssid_name:
frequency = "5 GHz"
elif "2dot4G" in ssid_name:
frequency = "2.4 GHz"
else:
frequency = "Unknown"
# Append row to top of CSV file
row = [ap_model, firmware, frequency, mimo, security, mode, udp_ds, udp_us, tcp_ds, tcp_us]
with open(csv_file, 'r') as readFile:
reader = csv.reader(readFile)
lines = list(reader)
lines.insert(1, row)
with open(csv_file, 'w') as writeFile:
writer = csv.writer(writeFile)
writer.writerows(lines)
readFile.close()
writeFile.close()
#Import dictionaries for AP Info
from lab_ap_info import equipment_id_dict
from lab_ap_info import profile_info_dict
from lab_ap_info import ap_models
from lab_ap_info import mimo_2dot4g
from lab_ap_info import mimo_5g
from lab_ap_info import customer_id
from lab_ap_info import cloud_type
#import json file to determine if throughput should be run for specific AP model
sanity_status = json.load(open("sanity_status.json"))
#create CSV file for test run
today = str(date.today())
csv_file = csv_path+"throughput_test_"+today+".csv"
headers = ['AP Type', 'Firmware','Radio', 'MIMO', 'Security', 'Mode', 'UDP Downstream (Mbps)', 'UDP Upstream (Mbps)', 'TCP Downstream (Mbps)', 'TCP Upstream (Mbps)']
with open(csv_file, "w") as file:
create = csv.writer(file)
create.writerow(headers)
file.close()
ap_firmware_dict = {
"ea8300": '',
"ecw5211": '',
"ecw5410": '',
"ec420": ''
}
logger.info('Start of Throughput Test')
for key in equipment_id_dict:
if sanity_status['sanity_status'][key] == "passed":
logger.info("Running throughput test on " + key)
##Get Bearer Token to make sure its valid (long tests can require re-auth)
bearer = CloudSDK.get_bearer(cloudSDK_url, cloud_type)
###Get Current AP Firmware
equipment_id = equipment_id_dict[key]
ap_fw = CloudSDK.ap_firmware(customer_id, equipment_id, cloudSDK_url, bearer)
fw_model = ap_fw.partition("-")[0]
print("AP MODEL UNDER TEST IS", fw_model)
print('Current AP Firmware:', ap_fw)
##add current FW to dictionary
ap_firmware_dict[fw_model] = ap_fw
###########################################################################
############## Bridge Throughput Testing #################################
###########################################################################
print("Testing for Bridge SSIDs")
logger.info("Starting Brdige SSID tput tests on " + key)
###Set Proper AP Profile for Bridge SSID Tests
test_profile_id = profile_info_dict[fw_model]["profile_id"]
#print(test_profile_id)
ap_profile = CloudSDK.set_ap_profile(equipment_id, test_profile_id, cloudSDK_url, bearer)
### Wait for Profile Push
print('-----------------PROFILE PUSH -------------------')
time.sleep(180)
##Set port for LANForge
port = bridge_upstream_port
# 5G WPA2 Enterprise UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
sta_list = station
radio = lab_ap_info.lanforge_5g
ssid_name = profile_info_dict[fw_model]["fiveG_WPA2-EAP_SSID"]
security = "wpa2"
eap_type = "TTLS"
mode = "Bridge"
mimo = mimo_5g[fw_model]
client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, port)
print(fw_model, "5 GHz WPA2-EAP throughput:\n", client_tput)
security = "wpa2-eap"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
#5G WPA2 UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_5g
ssid_name = profile_info_dict[fw_model]["fiveG_WPA2_SSID"]
ssid_psk = profile_info_dict[fw_model]["fiveG_WPA2_PSK"]
security = "wpa2"
mode = "Bridge"
mimo = mimo_5g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "5 GHz WPA2 throughput:\n",client_tput)
security = "wpa2-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 5G WPA UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_5g
ssid_name = profile_info_dict[fw_model]["fiveG_WPA_SSID"]
ssid_psk = profile_info_dict[fw_model]["fiveG_WPA_PSK"]
security = "wpa"
mode = "Bridge"
mimo = mimo_5g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "5 GHz WPA throughput:\n",client_tput)
security = "wpa-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 5G Open UDP DS/US and TCP DS/US
# ap_model = fw_model
# firmware = ap_fw
# radio = lab_ap_info.lanforge_5g
# ssid_name = profile_info_dict[fw_model]["fiveG_OPEN_SSID"]
# ssid_psk = "BLANK"
# security = "open"
#mode = "Bridge"
#mimo = mimo_5g[fw_model]
# client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
#print(fw_model, "5 GHz Open throughput:\n",client_tput)
#throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G WPA2 Enterprise UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
sta_list = station
radio = lab_ap_info.lanforge_2dot4g
ssid_name = profile_info_dict[fw_model]["twoFourG_WPA2-EAP_SSID"]
security = "wpa2"
eap_type = "TTLS"
mode = "Bridge"
mimo = mimo_2dot4g[fw_model]
client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity,
ttls_password, port)
print(fw_model, "2.4 GHz WPA2-EAP throughput:\n", client_tput)
security = "wpa2-eap"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G WPA2 UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_2dot4g
ssid_name = profile_info_dict[fw_model]["twoFourG_WPA2_SSID"]
ssid_psk = profile_info_dict[fw_model]["twoFourG_WPA2_PSK"]
security = "wpa2"
mode = "Bridge"
mimo = mimo_2dot4g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "2.4 GHz WPA2 throughput:\n",client_tput)
security = "wpa2-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G WPA UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_2dot4g
ssid_name = profile_info_dict[fw_model]["twoFourG_WPA_SSID"]
ssid_psk = profile_info_dict[fw_model]["twoFourG_WPA_PSK"]
security = "wpa"
mode = "Bridge"
mimo = mimo_2dot4g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "2.4 GHz WPA throughput:\n",client_tput)
security = "wpa-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G Open UDP DS/US and TCP DS/US
#ap_model = fw_model
#firmware = ap_fw
# radio = lab_ap_info.lanforge_5g
# ssid_name = profile_info_dict[fw_model]["twoFourG_OPEN_SSID"]
# ssid_psk = "BLANK"
# security = "open"
#mode = "Bridge"
#mimo = mimo_2dot4g[fw_model]
#client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
#print(fw_model, "2.4 GHz Open throughput:\n",client_tput)
#throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
###########################################################################
################# NAT Mode Throughput Testing ############################
###########################################################################
print('Testing for NAT SSIDs')
logger.info("Starting NAT SSID tput tests on " + key)
###Set Proper AP Profile for NAT SSID Tests
test_profile_id = profile_info_dict[fw_model + '_nat']["profile_id"]
print(test_profile_id)
ap_profile = CloudSDK.set_ap_profile(equipment_id, test_profile_id, cloudSDK_url, bearer)
### Wait for Profile Push
print('-----------------PROFILE PUSH -------------------')
time.sleep(180)
##Set port for LANForge
port = nat_upstream_port
# 5G WPA2 Enterprise UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
sta_list = station
radio = lab_ap_info.lanforge_5g
ssid_name = profile_info_dict[fw_model+'_nat']["fiveG_WPA2-EAP_SSID"]
security = "wpa2"
eap_type = "TTLS"
mode = "NAT"
mimo = mimo_5g[fw_model]
client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity,
ttls_password, port)
print(fw_model, "5 GHz WPA2-EAP NAT throughput:\n", client_tput)
security = "wpa2-eap"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 5G WPA2 NAT UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_5g
ssid_name = profile_info_dict[fw_model+'_nat']["fiveG_WPA2_SSID"]
ssid_psk = profile_info_dict[fw_model+'_nat']["fiveG_WPA2_PSK"]
security = "wpa2"
mode = "NAT"
mimo = mimo_5g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "5 GHz WPA2 NAT throughput:\n", client_tput)
security = "wpa2-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 5G WPA UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_5g
ssid_name = profile_info_dict[fw_model+'_nat']["fiveG_WPA_SSID"]
ssid_psk = profile_info_dict[fw_model+'_nat']["fiveG_WPA_PSK"]
security = "wpa"
mode = "NAT"
mimo = mimo_5g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "5 GHz WPA NAT throughput:\n", client_tput)
security = "wpa-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 5G Open UDP DS/US and TCP DS/US
# ap_model = fw_model
# firmware = ap_fw
# radio = lab_ap_info.lanforge_5g
# ssid_name = profile_info_dict[fw_model+'_nat']["fiveG_OPEN_SSID"]
# ssid_psk = "BLANK"
# security = "open"
# mode = "NAT"
#mimo = mimo_5g[fw_model]
# client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
# print(fw_model, "5 GHz Open NAT throughput:\n",client_tput)
# throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G WPA2 Enterprise UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
sta_list = station
radio = lab_ap_info.lanforge_2dot4g
ssid_name = profile_info_dict[fw_model+'_nat']["twoFourG_WPA2-EAP_SSID"]
security = "wpa2"
eap_type = "TTLS"
mode = "NAT"
mimo = mimo_2dot4g[fw_model]
client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, port)
print(fw_model, "2.4 GHz WPA2-EAP NAT throughput:\n", client_tput)
security = "wpa2-eap"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G WPA2 UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_2dot4g
ssid_name = profile_info_dict[fw_model+'_nat']["twoFourG_WPA2_SSID"]
ssid_psk = profile_info_dict[fw_model+'_nat']["twoFourG_WPA2_PSK"]
security = "wpa2"
mode = "NAT"
mimo = mimo_2dot4g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "2.4 GHz WPA2 NAT throughput:\n", client_tput)
security = "wpa2-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G WPA UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_2dot4g
ssid_name = profile_info_dict[fw_model+'_nat']["twoFourG_WPA_SSID"]
ssid_psk = profile_info_dict[fw_model+'_nat']["twoFourG_WPA_PSK"]
security = "wpa"
mode = "NAT"
mimo = mimo_2dot4g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "2.4 GHz WPA NAT throughput:\n", client_tput)
security = "wpa-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G Open NAT UDP DS/US and TCP DS/US
# ap_model = fw_model
# firmware = ap_fw
# radio = lab_ap_info.lanforge_5g
# ssid_name = profile_info_dict[fw_model+'_nat']["twoFourG_OPEN_SSID"]
# ssid_psk = "BLANK"
# security = "open"
# mode = "NAT"
#mimo = mimo_2dot4g[fw_model]
# client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
# print(fw_model, "2.4 GHz Open NAT throughput:\n",client_tput)
# throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
###########################################################################
################# Custom VLAN Mode Throughput Testing #####################
###########################################################################
print('Testing for Custom VLAN SSIDs')
logger.info("Starting Custom VLAN SSID tput tests on " + key)
###Set Proper AP Profile for NAT SSID Tests
test_profile_id = profile_info_dict[fw_model + '_vlan']["profile_id"]
print(test_profile_id)
ap_profile = CloudSDK.set_ap_profile(equipment_id, test_profile_id, cloudSDK_url, bearer)
### Wait for Profile Push
print('-----------------PROFILE PUSH -------------------')
time.sleep(180)
##Set port for LANForge
port = vlan_upstream_port
# 5G WPA2 Enterprise UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
sta_list = station
radio = lab_ap_info.lanforge_5g
ssid_name = profile_info_dict[fw_model + '_vlan']["fiveG_WPA2-EAP_SSID"]
security = "wpa2"
eap_type = "TTLS"
mode = "VLAN"
mimo = mimo_5g[fw_model]
client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, port)
print(fw_model, "5 GHz WPA2-EAP VLAN throughput:\n", client_tput)
security = "wpa2-eap"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 5G WPA2 VLAN UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_5g
ssid_name = profile_info_dict[fw_model + '_vlan']["fiveG_WPA2_SSID"]
ssid_psk = profile_info_dict[fw_model + '_vlan']["fiveG_WPA2_PSK"]
security = "wpa2"
mode = "VLAN"
mimo = mimo_5g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "5 GHz WPA2 VLAN throughput:\n", client_tput)
security = "wpa2-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 5G WPA UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_5g
ssid_name = profile_info_dict[fw_model + '_vlan']["fiveG_WPA_SSID"]
ssid_psk = profile_info_dict[fw_model + '_vlan']["fiveG_WPA_PSK"]
security = "wpa"
mode = "VLAN"
mimo = mimo_5g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "5 GHz WPA VLAN throughput:\n", client_tput)
security = "wpa-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 5G Open UDP DS/US and TCP DS/US
# ap_model = fw_model
# firmware = ap_fw
# radio = lab_ap_info.lanforge_5g
# ssid_name = profile_info_dict[fw_model+'_vlan']["fiveG_OPEN_SSID"]
# ssid_psk = "BLANK"
# security = "open"
# mode = "VLAN"
# mimo = mimo_5g[fw_model]
# client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
# print(fw_model, "5 GHz Open VLAN throughput:\n",client_tput)
# throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G WPA2 Enterprise UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
sta_list = station
radio = lab_ap_info.lanforge_2dot4g
ssid_name = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA2-EAP_SSID"]
security = "wpa2"
eap_type = "TTLS"
mode = "VLAN"
mimo = mimo_2dot4g[fw_model]
client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, port)
print(fw_model, "2.4 GHz WPA2-EAP VLAN throughput:\n", client_tput)
security = "wpa2-eap"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G WPA2 UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_2dot4g
ssid_name = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA2_SSID"]
ssid_psk = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA2_PSK"]
security = "wpa2"
mode = "VLAN"
mimo = mimo_2dot4g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "2.4 GHz WPA2 VLAN throughput:\n", client_tput)
security = "wpa2-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G WPA UDP DS/US and TCP DS/US
ap_model = fw_model
firmware = ap_fw
radio = lab_ap_info.lanforge_2dot4g
ssid_name = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA_SSID"]
ssid_psk = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA_PSK"]
security = "wpa"
mode = "VLAN"
mimo = mimo_2dot4g[fw_model]
client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
print(fw_model, "2.4 GHz WPA VLAN throughput:\n", client_tput)
security = "wpa-psk"
throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
# 2.4G Open VLAN UDP DS/US and TCP DS/US
# ap_model = fw_model
# firmware = ap_fw
# radio = lab_ap_info.lanforge_5g
# ssid_name = profile_info_dict[fw_model+'_vlan']["twoFourG_OPEN_SSID"]
# ssid_psk = "BLANK"
# security = "open"
# mode = "VLAN"
# mimo = mimo_2dot4g[fw_model]
# client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port)
# print(fw_model, "2.4 GHz Open VLAN throughput:\n",client_tput)
# throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput)
#Indicates throughput has been run for AP model
sanity_status['sanity_status'][key] = "tput run"
logger.info("Trhoughput tests complete on " + key)
elif sanity_status['sanity_status'][key] == "tput run":
print("Throughput test already run on", key)
logger.info("Throughput test already run on "+ key +" for latest AP FW")
else:
print(key,"did not pass Nightly Sanity. Skipping throughput test on this AP Model")
logger.info(key+" did not pass Nightly Sanity. Skipping throughput test.")
#Indicate which AP model has had tput test to external json file
with open('sanity_status.json', 'w') as json_file:
json.dump(sanity_status, json_file)
with open(csv_file, 'r') as readFile:
reader = csv.reader(readFile)
lines = list(reader)
row_count = len(lines)
#print(row_count)
if row_count <= 1:
os.remove(csv_file)
file.close()
else:
print("Saving File")
file.close()
print(" -- Throughput Testing Complete -- ")

View File

@@ -1,406 +0,0 @@
#!/usr/bin/python3
import sys
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
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'../libs/lanforge')
sys.path.append(f'../libs/testrails')
sys.path.append(f'../libs/apnos')
sys.path.append(f'../libs/cloudsdk')
sys.path.append(f'../libs')
sys.path.append(f'../tests/test_utility/')
import base64
import urllib.request
from bs4 import BeautifulSoup
import ssl
import subprocess, os
from artifactory import ArtifactoryPath
import tarfile
import paramiko
from paramiko import SSHClient
from scp import SCPClient
import os
import pexpect
from pexpect import pxssh
import paramiko
from scp import SCPClient
import pprint
from pprint import pprint
from os import listdir
import re
import requests
import json
import logging
import datetime
import time
from datetime import date
from shutil import copyfile
import argparse
from unittest.mock import Mock
from lf_tests import *
from ap_plus_sdk import *
from lab_ap_info import *
from JfrogHelper import *
from reporting import Reporting
# For finding files
# https://stackoverflow.com/questions/3207219/how-do-i-list-all-files-of-a-directory
import glob
# external_results_dir=/var/tmp/lanforge
# To run this from your home system to NOLA-01 testbed, use this command. This assumes you have set up an ssh tunnel
# logged to the cicd jumphost that can reach the lab. In separate console to set up the ssh tunnel: ssh -C -L
# 7220:lab-ctlr:22 ubuntu@3.130.51.163 On local machine:
# ./query_ssids.py --testrail-user-id NONE --model ecw5410
# --ap-jumphost-address localhost --ap-jumphost-port 7220 --ap-jumphost-password secret --ap-jumphost-tty /dev/ttyAP1
import testrail_api
from LANforge.LFUtils import *
# if you lack __init__.py in this directory you will not find sta_connect module#
import sta_connect2
from sta_connect2 import StaConnect2
import testrail_api
from testrail_api import TestRail_Client
import eap_connect
from eap_connect import EAPConnect
import cloudsdk
from cloudsdk import CloudSDK
from cloudsdk import CreateAPProfiles
import ap_ssh
from ap_ssh import *
# Import info for lab setup and APs under test
import lab_ap_info
from lab_ap_info import cloud_sdk_models
from lab_ap_info import ap_models
from lab_ap_info import customer_id
from lab_ap_info import cloud_type
from lab_ap_info import test_cases
from lab_ap_info import radius_info
# keep in sync with that below.
def add_base_parse_args(parser):
parser.add_argument("-b", "--build-id", type=str,
help="FW commit ID (latest pending build on dev is default)",
default="pending")
parser.add_argument("--skip-upgrade", type=bool, help="Skip upgrading firmware",
default=False)
parser.add_argument("--force-upgrade", type=bool,
help="Force upgrading firmware even if it is already current version",
default=False)
parser.add_argument("-m", "--model", type=str,
choices=['ea8300', 'ecw5410', 'ecw5211', 'ec420', 'wf188n', 'eap102', 'eap101', 'cig194c', 'None'],
help="AP model to be run", required=True)
parser.add_argument("--equipment-id", type=str,
help="AP model ID, as exists in the cloud-sdk. -1 to auto-detect.",
default="-1")
parser.add_argument("--object-id", type=str,
help="Used when querying and deleting individual objects.",
default=None)
parser.add_argument("--customer-id", type=str,
help="Specify cloud customer-id, default is 2",
default="2")
parser.add_argument("--testbed", type=str,
help="Testbed name, will be prefixed to profile names and similar",
default=None)
parser.add_argument("--sdk-base-url", type=str,
help="cloudsdk base url, default: https://wlan-portal-svc.cicd.lab.wlan.tip.build",
default="https://wlan-portal-svc.cicd.lab.wlan.tip.build")
parser.add_argument("--sdk-user-id", type=str, help="cloudsdk user id, default: support@example.conf",
default="support@example.com")
parser.add_argument("--sdk-user-password", type=str, help="cloudsdk user password, default: support",
default="support")
parser.add_argument("--jfrog-base-url", type=str, help="jfrog base url",
default="tip.jFrog.io/artifactory/tip-wlan-ap-firmware")
parser.add_argument("--jfrog-user-id", type=str, help="jfrog user id",
default="tip-read")
parser.add_argument("--jfrog-user-password", type=str, help="jfrog user password",
default="tip-read")
parser.add_argument("--testrail-base-url", type=str, help="testrail base url",
# was os.getenv('TESTRAIL_URL')
default="https://telecominfraproject.testrail.com")
parser.add_argument("--testrail-project", type=str, help="testrail project name",
default="opsfleet-wlan")
parser.add_argument("--testrail-user-id", type=str,
help="testrail user id. Use 'NONE' to disable use of testrails.",
default="NONE")
parser.add_argument("--testrail-user-password", type=str, help="testrail user password",
default="password")
parser.add_argument("--testrail-run-prefix", type=str, help="testrail run prefix",
default="prefix-1")
parser.add_argument("--testrail-milestone", dest="milestone", type=str, help="testrail milestone ID",
default="milestone-1")
parser.add_argument("--lanforge-ip-address", type=str, help="ip address of the lanforge gui",
default="127.0.0.1")
parser.add_argument("--lanforge-port-number", type=str, help="port of the lanforge gui",
default="8080")
parser.add_argument("--lanforge-prefix", type=str, help="LANforge api prefix string",
default="sdk")
parser.add_argument("--lanforge-2g-radio", type=str, help="LANforge 2Ghz radio to use for testing",
default="1.1.wiphy0")
parser.add_argument("--lanforge-5g-radio", type=str, help="LANforge 5Ghz radio to use for testing",
default="1.1.wiphy1")
parser.add_argument("--local_dir", type=str, help="Sanity logging directory",
default="logs")
parser.add_argument("--report-path", type=str, help="Sanity report directory",
default="reports")
parser.add_argument("--report-template", type=str, help="Sanity report template",
default="reports/report_template.php")
parser.add_argument("--eap-id", type=str, help="EAP indentity",
default="lanforge")
parser.add_argument("--ttls-password", type=str, help="TTLS password",
default="lanforge")
parser.add_argument("--ap-ip", type=str, help="AP IP Address, for direct ssh access if not using jumphost",
default="127.0.0.1")
parser.add_argument("--ap-username", type=str, help="AP username",
default="root")
parser.add_argument("--ap-password", type=str, help="AP password",
default="root")
parser.add_argument("--ap-jumphost-address", type=str,
help="IP of system that we can ssh in to get serial console access to AP",
default=None)
parser.add_argument("--ap-jumphost-port", type=str,
help="SSH port to use in case we are using ssh tunneling or other non-standard ports",
default="22")
parser.add_argument("--ap-jumphost-username", type=str,
help="User-ID for system that we can ssh in to get serial console access to AP",
default="lanforge")
parser.add_argument("--ap-jumphost-password", type=str,
help="Passwort for system that we can ssh in to get serial console access to AP",
default="lanforge")
parser.add_argument("--ap-jumphost-wlan-testing", type=str, help="wlan-testing repo dir on the jumphost",
default="git/wlan-testing")
parser.add_argument("--ap-jumphost-tty", type=str, help="Serial port for the AP we wish to talk to",
default="UNCONFIGURED-JUMPHOST-TTY")
parser.add_argument('--skip-update-firmware', dest='update_firmware', action='store_false')
parser.set_defaults(update_firmware=True)
parser.add_argument('--verbose', dest='verbose', action='store_true')
parser.set_defaults(verbose=False)
# Keep in sync with that above
def add_base_parse_args_pytest(parser):
parser.addoption("--default-ap-profile", type=str,
help="Default AP profile to use as basis for creating new ones, typically: TipWlan-2-Radios or TipWlan-3-Radios",
default="TipWlan-2-Radios")
parser.addoption("--skip-radius", dest="skip_radius", action='store_true',
help="Should we skip the RADIUS configs or not")
parser.addoption("--skip-profiles", dest="skip_profiles", action='store_true',
help="Should we skip applying profiles?")
parser.addoption("--skip-wpa", dest="skip_wpa", action='store_false',
help="Should we skip applying profiles?")
parser.addoption("--skip-wpa2", dest="skip_wpa2", action='store_false',
help="Should we skip applying profiles?")
parser.addoption("--psk-5g-wpa2", dest="psk_5g_wpa2", type=str,
help="Allow over-riding the 5g-wpa2 PSK value.")
parser.addoption("--psk-5g-wpa", dest="psk_5g_wpa", type=str,
help="Allow over-riding the 5g-wpa PSK value.")
parser.addoption("--psk-2g-wpa2", dest="psk_2g_wpa2", type=str,
help="Allow over-riding the 2g-wpa2 PSK value.")
parser.addoption("--psk-2g-wpa", dest="psk_2g_wpa", type=str,
help="Allow over-riding the 2g-wpa PSK value.")
parser.addoption("--ssid-5g-wpa2", dest="ssid_5g_wpa2", type=str,
help="Allow over-riding the 5g-wpa2 SSID value.")
parser.addoption("--ssid-5g-wpa", dest="ssid_5g_wpa", type=str,
help="Allow over-riding the 5g-wpa SSID value.")
parser.addoption("--ssid-2g-wpa2", dest="ssid_2g_wpa2", type=str,
help="Allow over-riding the 2g-wpa2 SSID value.")
parser.addoption("--ssid-2g-wpa", dest="ssid_2g_wpa", type=str,
help="Allow over-riding the 2g-wpa SSID value.")
parser.addoption("--mode", dest="mode", choices=['bridge', 'nat', 'vlan'], type=str,
help="Mode of AP Profile [bridge/nat/vlan]", default="bridge")
parser.addoption("--build-id", type=str,
help="FW commit ID (latest pending build on dev is default)",
default="pending")
parser.addoption("--skip-upgrade", type=bool, help="Skip upgrading firmware",
default=False)
parser.addoption("--force-upgrade", type=bool,
help="Force upgrading firmware even if it is already current version",
default=False)
# --access-points instead
# parser.addoption("--model", type=str,
# choices=['ea8300', 'ecw5410', 'ecw5211', 'ec420', 'wf188n', 'eap102', 'None'],
# help="AP model to be run", required=True)
parser.addoption("--equipment-id", type=str,
help="AP model ID, as exists in the cloud-sdk. -1 to auto-detect.",
default="-1")
parser.addoption("--object-id", type=str,
help="Used when querying and deleting individual objects.",
default=None)
parser.addoption("--customer-id", type=str,
help="Specify cloud customer-id, default is 2",
default="2")
parser.addoption("--testbed", type=str,
help="Testbed name, will be prefixed to profile names and similar",
default=None)
parser.addoption("--sdk-base-url", type=str,
help="cloudsdk base url, default: https://wlan-portal-svc.cicd.lab.wlan.tip.build",
default="https://wlan-portal-svc.cicd.lab.wlan.tip.build")
parser.addoption("--sdk-user-id", type=str, help="cloudsdk user id, default: support@example.conf",
default="support@example.com")
parser.addoption("--sdk-user-password", type=str, help="cloudsdk user password, default: support",
default="support")
parser.addoption("--jfrog-base-url", type=str, help="jfrog base url",
default="tip.jFrog.io/artifactory/tip-wlan-ap-firmware")
parser.addoption("--jfrog-user-id", type=str, help="jfrog user id",
default="tip-read")
parser.addoption("--jfrog-user-password", type=str, help="jfrog user password",
default="tip-read")
parser.addoption("--testrail-base-url", type=str, help="testrail base url",
# was os.getenv('TESTRAIL_URL')
default="https://telecominfraproject.testrail.com")
parser.addoption("--testrail-project", type=str, help="testrail project name",
default="opsfleet-wlan")
parser.addoption("--testrail-user-id", type=str,
help="testrail user id. Use 'NONE' to disable use of testrails.",
default="NONE")
parser.addoption("--testrail-user-password", type=str, help="testrail user password",
default="password")
parser.addoption("--testrail-run-prefix", type=str, help="testrail run prefix",
default="prefix-1")
parser.addoption("--testrail-milestone", dest="milestone", type=str, help="testrail milestone ID",
default="milestone-1")
parser.addoption("--lanforge-ip-address", type=str, help="ip address of the lanforge gui",
default="127.0.0.1")
parser.addoption("--lanforge-port-number", type=str, help="port of the lanforge gui",
default="8080")
parser.addoption("--lanforge-prefix", type=str, help="LANforge api prefix string",
default="sdk")
parser.addoption("--lanforge-2g-radio", type=str, help="LANforge 2Ghz radio to use for testing",
default="1.1.wiphy0")
parser.addoption("--lanforge-5g-radio", type=str, help="LANforge 5Ghz radio to use for testing",
default="1.1.wiphy1")
parser.addoption("--local_dir", type=str, help="Sanity logging directory",
default="logs")
parser.addoption("--report-path", type=str, help="Sanity report directory",
default="reports")
parser.addoption("--report-template", type=str, help="Sanity report template",
default="reports/report_template.php")
parser.addoption("--eap-id", type=str, help="EAP indentity",
default="lanforge")
parser.addoption("--ttls-password", type=str, help="TTLS password",
default="lanforge")
parser.addoption("--ap-ip", type=str, help="AP IP Address, for direct ssh access if not using jumphost",
default="127.0.0.1")
parser.addoption("--ap-username", type=str, help="AP username",
default="root")
parser.addoption("--ap-password", type=str, help="AP password",
default="root")
parser.addoption("--ap-jumphost-address", type=str,
help="IP of system that we can ssh in to get serial console access to AP",
default=None)
parser.addoption("--ap-jumphost-port", type=str,
help="SSH port to use in case we are using ssh tunneling or other non-standard ports",
default="22")
parser.addoption("--ap-jumphost-username", type=str,
help="User-ID for system that we can ssh in to get serial console access to AP",
default="lanforge")
parser.addoption("--ap-jumphost-password", type=str,
help="Passwort for system that we can ssh in to get serial console access to AP",
default="lanforge")
parser.addoption("--ap-jumphost-wlan-testing", type=str, help="wlan-testing repo dir on the jumphost",
default="git/wlan-testing")
parser.addoption("--ap-jumphost-tty", type=str, help="Serial port for the AP we wish to talk to",
default="UNCONFIGURED-JUMPHOST-TTY")
parser.addoption('--skip-update-firmware', dest='update_firmware', action='store_false', default=True)
parser.addoption('--tip-verbose', dest='verbose', action='store_true', default=False)
class UnitTestBase:
def __init__(self, log_name, args, reporting=None):
self.parser = argparse.ArgumentParser(description="Sanity Testing on Firmware Build", parents=[args])
add_base_parse_args(self.parser)
self.command_line_args = self.parser.parse_args()
# cmd line takes precedence over env-vars.
self.cloudSDK_url = self.command_line_args.sdk_base_url # was os.getenv('CLOUD_SDK_URL')
self.local_dir = self.command_line_args.local_dir # was os.getenv('SANITY_LOG_DIR')
self.report_path = self.command_line_args.report_path # was os.getenv('SANITY_REPORT_DIR')
self.report_template = self.command_line_args.report_template # was os.getenv('REPORT_TEMPLATE')
## TestRail Information
self.tr_user = self.command_line_args.testrail_user_id # was os.getenv('TR_USER')
self.tr_pw = self.command_line_args.testrail_user_password # was os.getenv('TR_PWD')
self.milestoneId = self.command_line_args.milestone # was os.getenv('MILESTONE')
self.projectId = self.command_line_args.testrail_project # was os.getenv('PROJECT_ID')
self.testRunPrefix = self.command_line_args.testrail_run_prefix # os.getenv('TEST_RUN_PREFIX')
##Jfrog credentials
self.jfrog_user = self.command_line_args.jfrog_user_id # was os.getenv('JFROG_USER')
self.jfrog_pwd = self.command_line_args.jfrog_user_password # was os.getenv('JFROG_PWD')
##EAP Credentials
self.identity = self.command_line_args.eap_id # was os.getenv('EAP_IDENTITY')
self.ttls_password = self.command_line_args.ttls_password # was os.getenv('EAP_PWD')
## AP Credentials
self.ap_username = self.command_line_args.ap_username # was os.getenv('AP_USER')
##LANForge Information
self.lanforge_ip = self.command_line_args.lanforge_ip_address
self.lanforge_port = self.command_line_args.lanforge_port_number
self.lanforge_prefix = self.command_line_args.lanforge_prefix
self.build = self.command_line_args.build_id
self.logger = logging.getLogger(log_name)
if not reporting:
self.hdlr = logging.FileHandler("./logs/test_run.log")
else:
self.hdlr = logging.FileHandler(reporting.report_path + "/test_run.log")
self.formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
self.hdlr.setFormatter(self.formatter)
self.logger.addHandler(self.hdlr)
self.logger.setLevel(logging.INFO)
####Use variables other than defaults for running tests on custom FW etc
self.model_id = self.command_line_args.model
self.equipment_id = self.command_line_args.equipment_id
###Get Cloud Bearer Token
self.cloud: CloudSDK = CloudSDK(self.command_line_args)
self.bearer = self.cloud.get_bearer(self.cloudSDK_url, cloud_type)
self.customer_id = self.command_line_args.customer_id

View File

@@ -1,187 +0,0 @@
##################################################################################
# Module contains functions to get specific data from AP CLI using SSH
#
# Used by Nightly_Sanity and Throughput_Test #####################################
##################################################################################
import paramiko
from paramiko import SSHClient
import socket
import os
import subprocess
owrt_args = "--prompt root@OpenAp -s serial --log stdout --user root --passwd openwifi"
def ssh_cli_active_fw(ap_ip, username, password):
print(ap_ip)
try:
if 'tty' in ap_ip:
print("AP is connected using serial cable")
ap_cmd = '/usr/opensync/bin/ovsh s AWLAN_Node -c | grep FW_IMAGE_ACTIVE'
cmd = "cd ../../lanforge/lanforge-scripts && python3 openwrt_ctl.py %s -t %s --action cmd --value \"%s\""%(owrt_args, ap_ip, ap_cmd)
with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) as p:
output, errors = p.communicate()
version_matrix = str(output.decode('utf-8').splitlines())
version_matrix_split = version_matrix.partition('FW_IMAGE_ACTIVE","')[2]
cli_active_fw = version_matrix_split.partition('"],[')[0]
print(cli_active_fw)
ap_cmd = '/usr/opensync/bin/ovsh s Manager -c | grep status'
cmd = "cd ../../lanforge/lanforge-scripts && python3 openwrt_ctl.py %s -t %s --action cmd --value \"%s\"" % (owrt_args, ap_ip, ap_cmd)
with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) as p:
output, errors = p.communicate()
status = str(output.decode('utf-8').splitlines())
else:
print("AP is accessible by SSH")
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(ap_ip, username=username, password=password, timeout=5)
stdin, stdout, stderr = client.exec_command('/usr/opensync/bin/ovsh s AWLAN_Node -c | grep FW_IMAGE_ACTIVE')
version_matrix = str(stdout.read(), 'utf-8')
err = str(stderr.read(), 'utf-8')
#print("version-matrix: %s stderr: %s" % (version_matrix, err))
version_matrix_split = version_matrix.partition('FW_IMAGE_ACTIVE","')[2]
cli_active_fw = version_matrix_split.partition('"],[')[0]
stdin, stdout, stderr = client.exec_command('/usr/opensync/bin/ovsh s Manager -c | grep status')
status = str(stdout.read(), 'utf-8')
print("status: %s" %(status))
if "ACTIVE" in status:
# print("AP is in Active state")
state = "active"
elif "BACKOFF" in status:
# print("AP is in Backoff state")
state = "backoff"
else:
# print("AP is not in Active state")
state = "unknown"
cli_info = {
"state": state,
"active_fw": cli_active_fw
}
return (cli_info)
except paramiko.ssh_exception.AuthenticationException:
print("Authentication Error, Check Credentials")
return "ERROR"
except paramiko.SSHException:
print("Cannot SSH to the AP")
return "ERROR"
except socket.timeout:
print("AP Unreachable")
return "ERROR"
def iwinfo_status(ap_ip, username, password):
try:
if 'tty' in ap_ip:
ap_cmd = 'iwinfo | grep ESSID'
cmd = "cd ../../lanforge/lanforge-scripts && python3 openwrt_ctl.py %s -t %s --action cmd --value \"%s\"" % (
owrt_args, ap_ip, ap_cmd)
with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) as p:
output, errors = p.communicate()
for line in output.decode('utf-8').splitlines():
print(line)
else:
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(ap_ip, username=username, password=password, timeout=5)
stdin, stdout, stderr = client.exec_command('iwinfo | grep ESSID')
for line in stdout.read().splitlines():
print(line)
except paramiko.ssh_exception.AuthenticationException:
print("Authentication Error, Check Credentials")
return "ERROR"
except paramiko.SSHException:
print("Cannot SSH to the AP")
return "ERROR"
except socket.timeout:
print("AP Unreachable")
return "ERROR"
def get_vif_config(ap_ip, username, password):
try:
if 'tty' in ap_ip:
ap_cmd = "/usr/opensync/bin/ovsh s Wifi_VIF_Config -c | grep 'ssid :'"
cmd = "cd ../../lanforge/lanforge-scripts && python3 openwrt_ctl.py %s -t %s --action cmd --value \"%s\"" % (
owrt_args, ap_ip, ap_cmd)
with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) as p:
output, errors = p.communicate()
ssid_output_raw = output.decode('utf-8').splitlines()
raw = output.decode('utf-8').splitlines()
ssid_output = []
for line in raw:
if 'ssid :' in line:
ssid_output.append(line)
print(ssid_output)
ssid_list = [s.replace('ssid : ','') for s in ssid_output]
return ssid_list
else:
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(ap_ip, username=username, password=password, timeout=5)
stdin, stdout, stderr = client.exec_command(
"/usr/opensync/bin/ovsh s Wifi_VIF_Config -c | grep 'ssid :'")
output = str(stdout.read(), 'utf-8')
ssid_output = output.splitlines()
ssid_list = [s.strip('ssid : ') for s in ssid_output]
return ssid_list
except paramiko.ssh_exception.AuthenticationException:
print("Authentication Error, Check Credentials")
return "ERROR"
except paramiko.SSHException:
print("Cannot SSH to the AP")
return "ERROR"
except socket.timeout:
print("AP Unreachable")
return "ERROR"
def get_vif_state(ap_ip, username, password):
try:
if 'tty' in ap_ip:
ap_cmd = "/usr/opensync/bin/ovsh s Wifi_VIF_State -c | grep 'ssid :'"
cmd = "cd ../../lanforge/lanforge-scripts && python3 openwrt_ctl.py %s -t %s --action cmd --value \"%s\"" % (
owrt_args, ap_ip, ap_cmd)
with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) as p:
output, errors = p.communicate()
ssid_output_raw = output.decode('utf-8').splitlines()
raw = output.decode('utf-8').splitlines()
ssid_output = []
for line in raw:
if 'ssid :' in line:
ssid_output.append(line)
print(ssid_output)
ssid_list = [s.replace('ssid : ','') for s in ssid_output]
return ssid_list
else:
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(ap_ip, username=username, password=password, timeout=5)
stdin, stdout, stderr = client.exec_command(
"/usr/opensync/bin/ovsh s Wifi_VIF_State -c | grep 'ssid :'")
output = str(stdout.read(), 'utf-8')
ssid_output = output.splitlines()
ssid_list = [s.strip('ssid : ') for s in ssid_output]
return ssid_list
except paramiko.ssh_exception.AuthenticationException:
print("Authentication Error, Check Credentials")
return "ERROR"
except paramiko.SSHException:
print("Cannot SSH to the AP")
return "ERROR"
except socket.timeout:
print("AP Unreachable")
return "ERROR"

File diff suppressed because it is too large Load Diff

View File

@@ -1,292 +0,0 @@
#!/usr/bin/python3
##################################################################################
# Module contains functions to interact with CloudSDK using APIs
# Start by calling get_bearer to obtain bearer token, then other APIs can be used
#
# Used by Nightly_Sanity and Throughput_Test #####################################
##################################################################################
import base64
import urllib.request
from bs4 import BeautifulSoup
import ssl
import subprocess, os
from artifactory import ArtifactoryPath
import tarfile
import paramiko
from paramiko import SSHClient
from scp import SCPClient
import os
import pexpect
from pexpect import pxssh
import sys
import paramiko
from scp import SCPClient
import pprint
from pprint import pprint
from os import listdir
import re
import requests
import json
import logging
import datetime
import time
###Class for CloudSDK Interaction via RestAPI
class CloudSDK:
def get_bearer(cloudSDK_url, cloud_type, user, password):
cloud_login_url = cloudSDK_url+"/management/"+cloud_type+"/oauth2/token"
payload = '''
{
"userId": "'''+user+'''",
"password": "'''+password+'''"
}
'''
headers = {
'Content-Type': 'application/json'
}
try:
token_response = requests.request("POST", cloud_login_url, headers=headers, data=payload)
except requests.exceptions.RequestException as e:
raise SystemExit("Exiting Script! Cloud not get bearer token for reason:",e)
token_data = token_response.json()
bearer_token = token_data['access_token']
return(bearer_token)
def ap_firmware(customer_id,equipment_id, cloudSDK_url, bearer):
equip_fw_url = cloudSDK_url+"/portal/status/forEquipment?customerId="+customer_id+"&equipmentId="+equipment_id
payload = {}
headers = {
'Authorization': 'Bearer ' + bearer
}
status_response = requests.request("GET", equip_fw_url, headers=headers, data=payload)
status_code = status_response.status_code
if status_code == 200:
status_data = status_response.json()
#print(status_data)
try:
current_ap_fw = status_data[2]['details']['reportedSwVersion']
return current_ap_fw
except:
current_ap_fw = "error"
return "ERROR"
else:
return "ERROR"
def CloudSDK_images(apModel, cloudSDK_url, bearer):
getFW_url = cloudSDK_url+"/portal/firmware/version/byEquipmentType?equipmentType=AP&modelId=" + apModel
payload = {}
headers = {
'Authorization': 'Bearer ' + bearer
}
response = requests.request("GET", getFW_url, headers=headers, data=payload)
ap_fw_details = response.json()
###return ap_fw_details
fwlist = []
for version in ap_fw_details:
fwlist.append(version.get('versionName'))
return(fwlist)
#fw_versionNames = ap_fw_details[0]['versionName']
#return fw_versionNames
def firwmare_upload(commit, apModel,latest_image,fw_url,cloudSDK_url,bearer):
fw_upload_url = cloudSDK_url+"/portal/firmware/version"
payload = "{\n \"model_type\": \"FirmwareVersion\",\n \"id\": 0,\n \"equipmentType\": \"AP\",\n \"modelId\": \""+apModel+"\",\n \"versionName\": \""+latest_image+"\",\n \"description\": \"\",\n \"filename\": \""+fw_url+"\",\n \"commit\": \""+commit+"\",\n \"validationMethod\": \"MD5_CHECKSUM\",\n \"validationCode\": \"19494befa87eb6bb90a64fd515634263\",\n \"releaseDate\": 1596192028877,\n \"createdTimestamp\": 0,\n \"lastModifiedTimestamp\": 0\n}\n\n"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + bearer
}
response = requests.request("POST", fw_upload_url, headers=headers, data=payload)
#print(response)
upload_result = response.json()
return(upload_result)
def get_firmware_id(latest_ap_image, cloudSDK_url, bearer):
#print(latest_ap_image)
fw_id_url = cloudSDK_url+"/portal/firmware/version/byName?firmwareVersionName="+latest_ap_image
payload = {}
headers = {
'Authorization': 'Bearer ' + bearer
}
response = requests.request("GET", fw_id_url, headers=headers, data=payload)
fw_data = response.json()
latest_fw_id = fw_data['id']
return latest_fw_id
def delete_firmware(fw_id, cloudSDK_url, bearer):
url = cloudSDK_url + '/portal/firmware/version?firmwareVersionId=' + fw_id
payload = {}
headers = {
'Authorization': 'Bearer ' + bearer
}
response = requests.request("DELETE", url, headers=headers, data=payload)
return(response)
def update_firmware(equipment_id, latest_firmware_id, cloudSDK_url, bearer):
url = cloudSDK_url+"/portal/equipmentGateway/requestFirmwareUpdate?equipmentId="+equipment_id+"&firmwareVersionId="+latest_firmware_id
payload = {}
headers = {
'Authorization': 'Bearer ' + bearer
}
response = requests.request("POST", url, headers=headers, data=payload)
#print(response.text)
return response.json()
def set_ap_profile(equipment_id, test_profile_id, cloudSDK_url, bearer):
###Get AP Info
url = cloudSDK_url+"/portal/equipment?equipmentId="+equipment_id
payload = {}
headers = {
'Authorization': 'Bearer ' + bearer
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response)
###Add Lab Profile ID to Equipment
equipment_info = response.json()
#print(equipment_info)
equipment_info["profileId"] = test_profile_id
#print(equipment_info)
###Update AP Info with Required Profile ID
url = cloudSDK_url+"/portal/equipment"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + bearer
}
response = requests.request("PUT", url, headers=headers, data=json.dumps(equipment_info))
#print(response)
def get_cloudsdk_version(cloudSDK_url, bearer):
#print(latest_ap_image)
url = cloudSDK_url+"/ping"
payload = {}
headers = {
'Authorization': 'Bearer ' + bearer
}
response = requests.request("GET", url, headers=headers, data=payload)
cloud_sdk_version = response.json()
return cloud_sdk_version
def create_ap_profile(cloudSDK_url, bearer, template, name, customer_id, child_profiles):
with open(template, 'r+') as ap_profile:
profile = json.load(ap_profile)
profile["name"] = name
profile['customerId'] = customer_id
profile["childProfileIds"] = child_profiles
with open(template, 'w') as ap_profile:
json.dump(profile, ap_profile)
url = cloudSDK_url+"/portal/profile"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + bearer
}
response = requests.request("POST", url, headers=headers, data=open(template, 'rb'))
ap_profile = response.json()
print(ap_profile)
ap_profile_id = ap_profile['id']
return ap_profile_id
def create_ssid_profile(cloudSDK_url, bearer, template, name, customer_id, ssid, passkey, radius, security, mode, vlan, radios):
with open(template, 'r+') as ssid_profile:
profile = json.load(ssid_profile)
profile['name'] = name
profile['customerId'] = customer_id
profile['details']['ssid'] = ssid
profile['details']['keyStr'] = passkey
profile['details']['radiusServiceId'] = radius
profile['details']['secureMode'] = security
profile['details']['forwardMode'] = mode
profile['details']['vlanId'] = vlan
profile['details']['appliedRadios'] = radios
if radius != 0:
profile["childProfileIds"] = [radius]
else:
profile["childProfileIds"] = []
with open(template, 'w') as ssid_profile:
json.dump(profile, ssid_profile)
url = cloudSDK_url + "/portal/profile"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + bearer
}
response = requests.request("POST", url, headers=headers, data=open(template, 'rb'))
ssid_profile = response.json()
#print(ssid_profile)
ssid_profile_id = ssid_profile['id']
return ssid_profile_id
def create_radius_profile(cloudSDK_url, bearer, template, name, customer_id, server_ip, secret, auth_port):
with open(template, 'r+') as radius_profile:
profile = json.load(radius_profile)
profile['name'] = name
profile['customerId'] = customer_id
profile['details']["primaryRadiusAuthServer"]['ipAddress'] = server_ip
profile['details']["primaryRadiusAuthServer"]['secret'] = secret
profile['details']["primaryRadiusAuthServer"]['port'] = auth_port
with open(template, 'w') as radius_profile:
json.dump(profile, radius_profile)
url = cloudSDK_url + "/portal/profile"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + bearer
}
response = requests.request("POST", url, headers=headers, data=open(template, 'rb'))
radius_profile = response.json()
radius_profile_id = radius_profile['id']
return radius_profile_id
def delete_profile(cloudSDK_url, bearer, profile_id):
url = cloudSDK_url + "/portal/profile?profileId="+profile_id
payload = {}
headers = {
'Authorization': 'Bearer ' + bearer
}
del_profile = requests.request("DELETE", url, headers=headers, data=payload)
status_code = del_profile.status_code
if status_code == 200:
return("SUCCESS")
else:
return ("ERROR")
def update_ssid_profile(cloudSDK_url, bearer, profile_id, new_ssid, new_secure_mode, new_psk):
get_profile_url = cloudSDK_url + "/portal/profile?profileId="+profile_id
payload = {}
headers = headers = {
'Authorization': 'Bearer ' + bearer
}
response = requests.request("GET", get_profile_url, headers=headers, data=payload)
original_profile = response.json()
print(original_profile)
original_profile['details']['ssid'] = new_ssid
original_profile['details']['secureMode'] = new_secure_mode
original_profile['details']['keyStr'] = new_psk
put_profile_url = cloudSDK_url + "/portal/profile"
payload = original_profile
headers = headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + bearer
}
response = requests.request("PUT", put_profile_url, headers=headers, json=payload)
print(response)
updated_profile = response.json()
return updated_profile

View File

@@ -1,249 +0,0 @@
#!/usr/bin/python3
##AP Models Under Test
ap_models = ["ecw5410"]
##Cloud Type(cloudSDK = v1)
cloud_type = "v1"
cloudSDK_url = "https://wlan-portal-svc-nola-04.cicd.lab.wlan.tip.build"
customer_id = "2"
cloud_user = "support@example.com"
cloud_password = "support"
# LANForge Info
lanforge_ip = "10.28.3.12"
lanforge_2dot4g = "wiphy4"
lanforge_5g = "wiphy5"
# For single client connectivity use cases, use full station name for prefix to only read traffic from client under test
lanforge_2dot4g_prefix = "test"
lanforge_5g_prefix = "test"
lanforge_2dot4g_station = "test1234"
lanforge_5g_station = "test1234"
# Used for bridge and NAT
lanforge_bridge_port = "eth2"
# VLAN interface on LANForge - must be configured to use alias of "vlan###" to accommodate sta_connect2 library
lanforge_vlan_port = "vlan100"
vlan = 100
##Equipment IDs for Lab APs under test
equipment_id_dict = {
"ecw5410": "1",
}
# Equipment IPs for SSH or serial connection information
equipment_ip_dict = {
"ecw5410": "/dev/ttyAP4"
}
equipment_credentials_dict = {
"ecw5410": "openwifi",
}
##RADIUS Info
radius_info = {
"server_ip": "10.28.3.100",
"secret": "testing123",
"auth_port": 1812,
"eap_identity": "nolaradius",
"eap_pwd": "nolastart"
}
##AP Models for firmware upload
cloud_sdk_models = {
"ec420": "EC420-G1",
"ea8300": "EA8300-CA",
"ecw5211": "ECW5211",
"ecw5410": "ECW5410",
"wf188n": "WF188N",
"wf194c": "WF194C",
"ex227": "EX227",
"ex447": "EX447",
"eap101": "EAP101",
"eap102": "EAP102"
}
ap_spec = {
"ec420": "wifi5",
"ea8300": "wifi5",
"ecw5211": "wifi5",
"ecw5410": "wifi5",
"wf188n": "wifi6",
"wf194c": "wifi6",
"ex227": "wifi6",
"ex447": "wifi6",
"eap101": "wifi6",
"eap102": "wifi6"
}
mimo_5g = {
"ec420": "4x4",
"ea8300": "2x2",
"ecw5211": "2x2",
"ecw5410": "4x4",
"wf188n": "2x2",
"wf194c": "8x8",
"ex227": "",
"ex447": "",
"eap101": "2x2",
"eap102": "4x4"
}
mimo_2dot4g = {
"ec420": "2x2",
"ea8300": "2x2",
"ecw5211": "2x2",
"ecw5410": "4x4",
"wf188n": "2x2",
"wf194c": "4x4",
"ex227": "",
"ex447": "",
"eap101": "2x2",
"eap102": "4x4"
}
sanity_status = {
"ea8300": "failed",
"ecw5211": 'passed',
"ecw5410": 'failed',
"ec420": 'failed',
"wf188n": "failed",
"wf194c": "failed",
"ex227": "failed",
"ex447": "failed",
"eap101": "failed",
"eap102": "failed"
}
##Test Case information - Maps a generic TC name to TestRail TC numbers
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
}
## Other profiles
radius_profile = 9
rf_profile_wifi5 = 10
rf_profile_wifi6 = 762
###Testing AP Profile Information
profile_info_dict = {
"ecw5410": {
"fiveG_WPA2_SSID": "ECW5410_5G_WPA2",
"fiveG_WPA2_PSK": "Connectus123$",
"fiveG_WPA_SSID": "ECW5410_5G_WPA",
"fiveG_WPA_PSK": "Connectus123$",
"fiveG_OPEN_SSID": "ECW5410_5G_OPEN",
"fiveG_WPA2-EAP_SSID": "ECW5410_5G_WPA2-EAP",
"twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN",
"twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2",
"twoFourG_WPA2_PSK": "Connectus123$",
"twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA",
"twoFourG_WPA_PSK": "Connectus123$",
"twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP",
"ssid_list": [
"ECW5410_5G_WPA2",
"ECW5410_5G_WPA",
"ECW5410_5G_WPA2-EAP",
"ECW5410_2dot4G_WPA2",
"ECW5410_2dot4G_WPA",
"ECW5410_2dot4G_WPA2-EAP"
]
},
"ecw5410_nat": {
"fiveG_WPA2_SSID": "ECW5410_5G_WPA2_NAT",
"fiveG_WPA2_PSK": "Connectus123$",
"fiveG_WPA_SSID": "ECW5410_5G_WPA_NAT",
"fiveG_WPA_PSK": "Connectus123$",
"fiveG_OPEN_SSID": "ECW5410_5G_OPEN_NAT",
"fiveG_WPA2-EAP_SSID": "ECW5410_5G_WPA2-EAP_NAT",
"twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN_NAT",
"twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2_NAT",
"twoFourG_WPA2_PSK": "Connectus123$",
"twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA_NAT",
"twoFourG_WPA_PSK": "Connectus123$",
"twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP_NAT",
"ssid_list": [
"ECW5410_5G_WPA2_NAT",
"ECW5410_5G_WPA_NAT",
"ECW5410_5G_WPA2-EAP_NAT",
"ECW5410_2dot4G_WPA2_NAT",
"ECW5410_2dot4G_WPA_NAT",
"ECW5410_2dot4G_WPA2-EAP_NAT"
]
},
"ecw5410_vlan": {
"fiveG_WPA2_SSID": "ECW5410_5G_WPA2_VLAN",
"fiveG_WPA2_PSK": "Connectus123$",
"fiveG_WPA_SSID": "ECW5410_5G_WPA_VLAN",
"fiveG_WPA_PSK": "Connectus123$",
"fiveG_OPEN_SSID": "ECW5410_5G_OPEN_VLAN",
"fiveG_WPA2-EAP_SSID": "ECW5410_5G_WPA2-EAP_VLAN",
"twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN_VLAN",
"twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2_VLAN",
"twoFourG_WPA2_PSK": "Connectus123$",
"twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA_VLAN",
"twoFourG_WPA_PSK": "Connectus123$",
"twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP_VLAN",
"ssid_list": [
"ECW5410_5G_WPA2_VLAN",
"ECW5410_5G_WPA_VLAN",
"ECW5410_5G_WPA2-EAP_VLAN",
"ECW5410_2dot4G_WPA2_VLAN",
"ECW5410_2dot4G_WPA_VLAN",
"ECW5410_2dot4G_WPA2-EAP_VLAN"
]
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
{"sanity_status": {"ea8300": "passed", "ecw5211": "passed", "ecw5410": "passed", "ec420": "passed", "wf188n": "failed", "wf193c": "failed", "ex227": "passed", "ex447": "failed", "eap101": "failed", "eap102": "failed", "wf194c": "failed"}, "sanity_run": {"new_data": "yes"}}

View File

@@ -1 +0,0 @@
{"model_type": "Profile", "id": 2, "customerId": "2", "profileType": "equipment_ap", "name": "Nightly_Sanity_wf194c_2021-02-23_vlan", "details": {"model_type": "ApNetworkConfiguration", "networkConfigVersion": "AP-1", "equipmentType": "AP", "vlanNative": true, "vlan": 0, "ntpServer": {"model_type": "AutoOrManualString", "auto": true, "value": null}, "syslogRelay": {"model_type": "SyslogRelay", "enabled": false, "srvHostIp": null, "srvHostPort": 514, "severity": "NOTICE"}, "rtlsSettings": {"model_type": "RtlsSettings", "enabled": false, "srvHostIp": null, "srvHostPort": 0}, "syntheticClientEnabled": false, "ledControlEnabled": true, "equipmentDiscovery": false, "greTunnelName": null, "greParentIfName": null, "greLocalInetAddr": null, "greRemoteInetAddr": null, "greRemoteMacAddr": null, "radioMap": {"is5GHz": {"model_type": "RadioProfileConfiguration", "bestApEnabled": true, "bestAPSteerType": "both"}, "is2dot4GHz": {"model_type": "RadioProfileConfiguration", "bestApEnabled": true, "bestAPSteerType": "both"}, "is5GHzU": {"model_type": "RadioProfileConfiguration", "bestApEnabled": true, "bestAPSteerType": "both"}, "is5GHzL": {"model_type": "RadioProfileConfiguration", "bestApEnabled": true, "bestAPSteerType": "both"}}, "profileType": "equipment_ap"}, "createdTimestamp": 1598524693438, "lastModifiedTimestamp": 1607377963675, "childProfileIds": [762, 1292, 1293, 1294, 1295, 1296, 1297, 1299, 1300, 1301, 1302, 1303, 1304]}

View File

@@ -1 +0,0 @@
{"model_type": "Profile", "id": 129, "customerId": "2", "profileType": "radius", "name": "Automation_RADIUS_2021-02-23", "details": {"model_type": "RadiusProfile", "primaryRadiusAuthServer": {"model_type": "RadiusServer", "ipAddress": "10.10.10.203", "secret": "testing123", "port": 1812, "timeout": 5}, "secondaryRadiusAuthServer": null, "primaryRadiusAccountingServer": null, "secondaryRadiusAccountingServer": null, "profileType": "radius"}, "createdTimestamp": 1602263176599, "lastModifiedTimestamp": 1611708334061, "childProfileIds": []}

View File

@@ -1 +0,0 @@
{"model_type": "Profile", "id": 28, "customerId": "2", "profileType": "ssid", "name": "wf194c_2G_WPA_VLAN_2021-02-23", "details": {"model_type": "SsidConfiguration", "ssid": "WF194C_2dot4G_WPA_VLAN", "appliedRadios": ["is2dot4GHz"], "ssidAdminState": "enabled", "secureMode": "wpaPSK", "vlanId": 100, "keyStr": "Connectus123$", "broadcastSsid": "enabled", "keyRefresh": 0, "noLocalSubnets": false, "radiusServiceName": "Radius-Accounting-Profile", "radiusAccountingServiceName": null, "radiusAcountingServiceInterval": null, "captivePortalId": null, "bandwidthLimitDown": 0, "bandwidthLimitUp": 0, "clientBandwidthLimitDown": 0, "clientBandwidthLimitUp": 0, "videoTrafficOnly": false, "radioBasedConfigs": {"is2dot4GHz": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}, "is5GHz": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}, "is5GHzU": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}, "is5GHzL": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}}, "bonjourGatewayProfileId": null, "enable80211w": null, "wepConfig": null, "forwardMode": "BRIDGE", "profileType": "ssid", "radiusServiceId": 0}, "createdTimestamp": 1598557809816, "lastModifiedTimestamp": 1598557809816, "childProfileIds": []}

View File

@@ -1,276 +0,0 @@
#!/usr/bin/python3
##AP Models Under Test
ap_models = ["ecw5410"]
##Cloud Type(cloudSDK = v1)
cloud_type = "v1"
cloudSDK_url = "https://wlan-portal-svc-nola-ext-02.cicd.lab.wlan.tip.build"
customer_id = "2"
cloud_user = "support@example.com"
cloud_password = "support"
##LANForge Info
lanforge_ip = "10.10.10.201"
lanforge_2dot4g = "wiphy6"
lanforge_5g = "wiphy6"
# For single client connectivity use cases, use full station name for prefix to only read traffic from client under test
lanforge_2dot4g_prefix = "wlan6"
lanforge_5g_prefix = "wlan6"
lanforge_2dot4g_station = "wlan6"
lanforge_5g_station = "wlan6"
lanforge_bridge_port = "eth2"
# VLAN interface on LANForge - must be configured to use alias of "vlan###" to accommodate sta_connect2 library
lanforge_vlan_port = "vlan100"
vlan = 100
# Equipment IDs for Lab APs under test - for test to loop through multiple APs put additional keys in the dictionary
equipment_id_dict = {
"ecw5410": "5",
}
# Equipment IPs for SSH or serial connection information
equipment_ip_dict = {
"ecw5410": "10.10.10.105"
}
equipment_credentials_dict = {
"ecw5410": "openwifi",
}
##RADIUS Info
radius_info = {
"server_ip": "10.10.10.203",
"secret": "testing123",
"auth_port": 1812,
"eap_identity": "testing",
"eap_pwd": "admin123"
}
## Other profiles
radius_profile = 9 # used as backup
rf_profile_wifi5 = 10
rf_profile_wifi6 = 762
##AP Models for firmware upload
cloud_sdk_models = {
"ec420": "EC420-G1",
"ea8300": "EA8300-CA",
"ecw5211": "ECW5211",
"ecw5410": "ECW5410",
"wf188n": "WF188N",
"wf194c": "WF194C",
"ex227": "EX227",
"ex447": "EX447",
"eap101": "EAP101",
"eap102": "EAP102"
}
ap_spec = {
"ec420": "wifi5",
"ea8300": "wifi5",
"ecw5211": "wifi5",
"ecw5410": "wifi5",
"wf188n": "wifi6",
"wf194c": "wifi6",
"ex227": "wifi6",
"ex447": "wifi6",
"eap101": "wifi6",
"eap102": "wifi6"
}
mimo_5g = {
"ec420": "4x4",
"ea8300": "2x2",
"ecw5211": "2x2",
"ecw5410": "4x4",
"wf188n": "2x2",
"wf194c": "8x8",
"ex227": "",
"ex447": "",
"eap101": "2x2",
"eap102": "4x4"
}
mimo_2dot4g = {
"ec420": "2x2",
"ea8300": "2x2",
"ecw5211": "2x2",
"ecw5410": "4x4",
"wf188n": "2x2",
"wf194c": "4x4",
"ex227": "",
"ex447": "",
"eap101": "2x2",
"eap102": "4x4"
}
sanity_status = {
"ea8300": "failed",
"ecw5211": 'passed',
"ecw5410": 'failed',
"ec420": 'failed',
"wf188n": "failed",
"wf194c": "failed",
"ex227": "failed",
"ex447": "failed",
"eap101": "failed",
"eap102": "failed"
}
##Test Case information - Maps a generic TC name to TestRail TC numbers
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
}
###Testing AP Profile Information
profile_info_dict = {
"ecw5410": {
"fiveG_WPA2_SSID": "ECW5410_5G_WPA2",
"fiveG_WPA2_PSK": "Connectus123$",
"fiveG_WPA_SSID": "ECW5410_5G_WPA",
"fiveG_WPA_PSK": "Connectus123$",
"fiveG_OPEN_SSID": "ECW5410_5G_OPEN",
"fiveG_WPA2-EAP_SSID": "ECW5410_5G_WPA2-EAP",
"twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN",
"twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2",
"twoFourG_WPA2_PSK": "Connectus123$",
"twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA",
"twoFourG_WPA_PSK": "Connectus123$",
"twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP",
"ssid_list": [
"ECW5410_5G_WPA2",
"ECW5410_5G_WPA",
"ECW5410_5G_WPA2-EAP",
"ECW5410_2dot4G_WPA2",
"ECW5410_2dot4G_WPA",
"ECW5410_2dot4G_WPA2-EAP"
]
},
"ecw5410_nat": {
"fiveG_WPA2_SSID": "ECW5410_5G_WPA2_NAT",
"fiveG_WPA2_PSK": "Connectus123$",
"fiveG_WPA_SSID": "ECW5410_5G_WPA_NAT",
"fiveG_WPA_PSK": "Connectus123$",
"fiveG_OPEN_SSID": "ECW5410_5G_OPEN_NAT",
"fiveG_WPA2-EAP_SSID": "ECW5410_5G_WPA2-EAP_NAT",
"twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN_NAT",
"twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2_NAT",
"twoFourG_WPA2_PSK": "Connectus123$",
"twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA_NAT",
"twoFourG_WPA_PSK": "Connectus123$",
"twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP_NAT",
"ssid_list": [
"ECW5410_5G_WPA2_NAT",
"ECW5410_5G_WPA_NAT",
"ECW5410_5G_WPA2-EAP_NAT",
"ECW5410_2dot4G_WPA2_NAT",
"ECW5410_2dot4G_WPA_NAT",
"ECW5410_2dot4G_WPA2-EAP_NAT"
]
},
"ecw5410_vlan": {
"fiveG_WPA2_SSID": "ECW5410_5G_WPA2_VLAN",
"fiveG_WPA2_PSK": "Connectus123$",
"fiveG_WPA_SSID": "ECW5410_5G_WPA_VLAN",
"fiveG_WPA_PSK": "Connectus123$",
"fiveG_OPEN_SSID": "ECW5410_5G_OPEN_VLAN",
"fiveG_WPA2-EAP_SSID": "ECW5410_5G_WPA2-EAP_VLAN",
"twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN_VLAN",
"twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2_VLAN",
"twoFourG_WPA2_PSK": "Connectus123$",
"twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA_VLAN",
"twoFourG_WPA_PSK": "Connectus123$",
"twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP_VLAN",
"ssid_list": [
"ECW5410_5G_WPA2_VLAN",
"ECW5410_5G_WPA_VLAN",
"ECW5410_5G_WPA2-EAP_VLAN",
"ECW5410_2dot4G_WPA2_VLAN",
"ECW5410_2dot4G_WPA_VLAN",
"ECW5410_2dot4G_WPA2-EAP_VLAN"
]
},
# example for tri-radio AP
"ea8300": {
"fiveG_WPA2_SSID": "EA8300_5G_WPA2",
"fiveG_WPA2_PSK": "Connectus123$",
"fiveG_WPA_SSID": "EA8300_5G_WPA",
"fiveG_WPA_PSK": "Connectus123$",
"fiveG_OPEN_SSID": "EA8300_5G_OPEN",
"fiveG_WPA2-EAP_SSID": "EA8300_5G_WPA2-EAP",
"twoFourG_OPEN_SSID": "EA8300_2dot4G_OPEN",
"twoFourG_WPA2_SSID": "EA8300_2dot4G_WPA2",
"twoFourG_WPA2_PSK": "Connectus123$",
"twoFourG_WPA_SSID": "EA8300_2dot4G_WPA",
"twoFourG_WPA_PSK": "Connectus123$",
"twoFourG_WPA2-EAP_SSID": "EA8300_2dot4G_WPA2-EAP",
# EA8300 has 2x 5GHz SSIDs because it is a tri-radio AP!
"ssid_list": [
"EA8300_5G_WPA2",
"EA8300_5G_WPA2",
"EA8300_5G_WPA",
"EA8300_5G_WPA",
"EA8300_5G_WPA2-EAP",
"EA8300_5G_WPA2-EAP",
"EA8300_2dot4G_WPA2",
"EA8300_2dot4G_WPA",
"EA8300_2dot4G_WPA2-EAP"
]
},
}

View File

@@ -1,194 +0,0 @@
"""TestRail API binding for Python 3.x.
"""
####################################################################
# Custom version of testrail_api module
#
# Used by Nightly_Sanity ###########################################
####################################################################
import base64
import json
import requests
from pprint import pprint
import os
tr_user=os.getenv('TR_USER')
tr_pw=os.getenv('TR_PWD')
project = os.getenv('PROJECT_ID')
class APIClient:
def __init__(self, base_url):
self.user = tr_user
self.password = tr_pw
if not base_url.endswith('/'):
base_url += '/'
self.__url = base_url + 'index.php?/api/v2/'
def send_get(self, uri, filepath=None):
"""Issue a GET request (read) against the API.
Args:
uri: The API method to call including parameters, e.g. get_case/1.
filepath: The path and file name for attachment download; used only
for 'get_attachment/:attachment_id'.
Returns:
A dict containing the result of the request.
"""
return self.__send_request('GET', uri, filepath)
def send_post(self, uri, data):
"""Issue a POST request (write) against the API.
Args:
uri: The API method to call, including parameters, e.g. add_case/1.
data: The data to submit as part of the request as a dict; strings
must be UTF-8 encoded. If adding an attachment, must be the
path to the file.
Returns:
A dict containing the result of the request.
"""
return self.__send_request('POST', uri, data)
def __send_request(self, method, uri, data):
url = self.__url + uri
auth = str(
base64.b64encode(
bytes('%s:%s' % (self.user, self.password), 'utf-8')
),
'ascii'
).strip()
headers = {'Authorization': 'Basic ' + auth}
#print("Method =" , method)
if method == 'POST':
if uri[:14] == 'add_attachment': # add_attachment API method
files = {'attachment': (open(data, 'rb'))}
response = requests.post(url, headers=headers, files=files)
files['attachment'].close()
else:
headers['Content-Type'] = 'application/json'
payload = bytes(json.dumps(data), 'utf-8')
response = requests.post(url, headers=headers, data=payload)
else:
headers['Content-Type'] = 'application/json'
response = requests.get(url, headers=headers)
#print("headers = ", headers)
#print("resonse=", response)
#print("response code =", response.status_code)
if response.status_code > 201:
try:
error = response.json()
except: # response.content not formatted as JSON
error = str(response.content)
#raise APIError('TestRail API returned HTTP %s (%s)' % (response.status_code, error))
print('TestRail API returned HTTP %s (%s)' % (response.status_code, error))
return
else:
print(uri[:15])
if uri[:15] == 'get_attachments': # Expecting file, not JSON
try:
print('opening file')
print (str(response.content))
open(data, 'wb').write(response.content)
print('opened file')
return (data)
except:
return ("Error saving attachment.")
else:
try:
return response.json()
except: # Nothing to return
return {}
def get_project_id(self, project_name):
"Get the project ID using project name"
project_id = None
projects = client.send_get('get_projects')
##pprint(projects)
for project in projects:
if project['name']== project_name:
project_id = project['id']
# project_found_flag=True
break
print("project Id =",project_id)
return project_id
def get_run_id(self, test_run_name):
"Get the run ID using test name and project name"
run_id = None
project_id = client.get_project_id(project_name=project)
try:
test_runs = client.send_get('get_runs/%s' % (project_id))
#print("------------TEST RUNS----------")
#pprint(test_runs)
except Exception:
print
'Exception in update_testrail() updating TestRail.'
return None
else:
for test_run in test_runs:
if test_run['name'] == test_run_name:
run_id = test_run['id']
#print("run Id in Test Runs=",run_id)
break
return run_id
def update_testrail(self, case_id, run_id, status_id, msg):
"Update TestRail for a given run_id and case_id"
update_flag = False
# Get the TestRail client account details
# Update the result in TestRail using send_post function.
# Parameters for add_result_for_case is the combination of runid and case id.
# status_id is 1 for Passed, 2 For Blocked, 4 for Retest and 5 for Failed
#status_id = 1 if result_flag is True else 5
print("result status Pass/Fail = ", status_id)
print("case id=", case_id)
print("run id passed to update is ", run_id, case_id)
if run_id is not None:
try:
result = client.send_post(
'add_result_for_case/%s/%s' % (run_id, case_id),
{'status_id': status_id, 'comment': msg})
print("result in post",result)
except Exception:
print
'Exception in update_testrail() updating TestRail.'
else:
print
'Updated test result for case: %s in test run: %s with msg:%s' % (case_id, run_id, msg)
return update_flag
def create_testrun(self, name, case_ids, project_id, milestone_id, description):
result = client.send_post(
'add_run/%s' % (project_id),
{'name': name, 'case_ids': case_ids, 'milestone_id': milestone_id, 'description': description, 'include_all': False})
print("result in post", result)
def update_testrun(self, runid, description):
result = client.send_post(
'update_run/%s' % (runid),
{'description': description})
print("result in post", result)
client: APIClient = APIClient(os.getenv('TR_URL'))
class APIError(Exception):
pass

View File

@@ -0,0 +1,26 @@
import pytest
import sys
if 'cloudsdk' not in sys.path:
sys.path.append(f'../../libs/cloudsdk')
from cloudsdk import CloudSDK
@pytest.mark.login
class TestLogin:
def test_token_login(self):
try:
obj = CloudSDK(testbed="nola-ext-04", customer_id=2)
bearer = obj.get_bearer_token()
value = bearer._access_token is None
except:
value = True
assert value == False
def test_ping(self):
try:
obj = CloudSDK(testbed="nola-ext-04", customer_id=2)
value = obj.portal_ping() is None
except:
value = True
assert value == False

View File

@@ -1,287 +1,79 @@
import pytest
from time import sleep, gmtime, strftime
# import files in the current directory
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), 'helpers'))
sys.path.append(f'..')
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'../../libs/lanforge/')
sys.path.append(f'../../libs/cloudsdk/')
sys.path.append(f'../../libs/apnos/')
sys.path.append(f'../../libs/testrails/')
sys.path.append(f'../../libs/')
sys.path.append(f'../test_utility/')
from utils import *
from UnitTestBase import *
from JfrogHelper import *
from cloudsdk import *
from testrail_api import TestRail_Client
sys.path.append(
os.path.dirname(
os.path.realpath( __file__ )
)
)
import pytest
from configuration_data import PROFILE_DATA
def pytest_addoption(parser):
parser.addini("jfrog-base-url", "jfrog base url")
parser.addini("jfrog-user-id", "jfrog username")
parser.addini("jfrog-user-password", "jfrog password")
parser.addini("sdk-base-url", "cloud sdk base url")
parser.addini("testbed-name", "cloud sdk base url")
parser.addini("sdk-user-id", "cloud sdk username")
parser.addini("sdk-user-password", "cloud sdk user password")
parser.addini("customer-id", "cloud sdk customer id for the access points")
parser.addini("equipment-id", "cloud sdk equipment id for the access point")
parser.addini("default-ap-profile", "cloud sdk default AP profile name")
parser.addini("verbose", "Enable verbose logs?")
parser.addini("ap-ip", "AP IP address (or can use serial)")
parser.addini("ap-username", "AP username")
parser.addini("ap-password", "AP password")
parser.addini("ap-jumphost-address", "AP jumphost IP address")
parser.addini("ap-jumphost-username", "AP jumphost username")
parser.addini("ap-jumphost-password", "AP jumphost password")
parser.addini("ap-jumphost-port", "AP jumphost port")
parser.addini("ap-jumphost-wlan-testing", "AP jumphost wlan-testing code directory")
parser.addini("ap-jumphost-tty", "AP jumphost TTY")
parser.addini("build-id", "What build flavor to use, ie 'pending'")
parser.addini("testbed", "Testbed name")
parser.addini("mode", "AP Mode, bridge/vlan/nat")
parser.addini("skip-wpa", "Should we skip setting up WPA?", default=False)
parser.addini("skip-wpa2", "Should we skip setting up WPA2?", default=False)
parser.addini("skip-radius", "Should we skip setting up EAP/Radius?", default=False)
parser.addini("skip-profiles", "Should we skip setting up profiles")
parser.addini("ssid-2g-wpa", "Configure ssid-2g-wpa")
parser.addini("psk-2g-wpa", "Configure psk-2g-wpa")
parser.addini("ssid-5g-wpa", "Configure ssid-5g-wpa")
parser.addini("psk-5g-wpa", "Configure psk-5g-wpa")
parser.addini("ssid-2g-wpa2", "Configure ssid-2g-wpa2")
parser.addini("psk-2g-wpa2", "Configure psk-2g-wpa2")
parser.addini("ssid-5g-wpa2", "Configure ssid-5g-wpa2")
parser.addini("psk-5g-wpa2", "Configure psk-5g-wpa2")
parser.addini("sdk-customer-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-2g-radio", "LANforge radio to use")
parser.addini("lanforge-5g-radio", "LANforge radio to use")
parser.addini("lanforge-radio", "LANforge radio to use")
parser.addini("lanforge-ethernet-port", "LANforge ethernet adapter to use")
add_base_parse_args_pytest(parser)
# change behaviour
parser.addoption(
"--skip-update-firmware",
action="store_true",
default=False,
help="skip updating firmware on the AP (useful for local testing)"
)
# this has to be the last argument
# example: --access-points ECW5410 EA8300-EU
parser.addoption(
"--access-points",
nargs="+",
# nargs="+",
default=[ "ECW5410" ],
help="list of access points to test"
)
def pytest_generate_tests(metafunc):
metafunc.parametrize("access_points", metafunc.config.getoption('--access-points'), scope="session")
if 'access_points' in metafunc.fixturenames:
metafunc.parametrize("access_points", metafunc.config.getoption('--access-points'), scope="session")
# run something after all tests are done regardless of the outcome
def pytest_unconfigure(config):
print("Tests cleanup done")
@pytest.fixture(scope="session")
def setup_testrails(request, instantiate_testrail, access_points):
if request.config.getoption("--testrail-user-id") == "NONE":
yield -1
return # needed to stop fixture execution
if request.config.getoption("--skip-update-firmware"):
firmware_update_case = []
else:
firmware_update_case = [ 2831 ]
seen = {None}
test_data = []
session = request.node
for item in session.items:
cls = item.getparent(pytest.Class)
if cls not in seen:
if hasattr(cls.obj, "get_test_data"):
test_data.append(cls.obj.get_test_data())
seen.add(cls)
testrail_project_id = instantiate_testrail.get_project_id(request.config.getini("testrail-project"))
runId = instantiate_testrail.create_testrun(
name=f'Nightly_model_{access_points}_{strftime("%Y-%m-%d", gmtime())}',
case_ids=( [*test_data] + firmware_update_case ),
project_id=testrail_project_id
)
yield runId
# TODO: Should not be session wide I think, you will want to run different
# configurations (bridge, nat, vlan, wpa/wpa2/eap, etc
@pytest.fixture(scope="session")
def setup_cloudsdk(request, instantiate_cloudsdk, instantiate_testrail):
# snippet to do cleanup after all the tests are done
@pytest.fixture(scope="function")
def setup_cloudsdk(request, instantiate_cloudsdk):
def fin():
print("Cloud SDK cleanup done")
print(f"Cloud SDK cleanup for {request.node.originalname}")
request.addfinalizer(fin)
# Set up bridged setup by default.
command_line_args = create_command_line_args(request)
cloud = instantiate_cloudsdk
cloud.assert_bad_response = True
equipment_id = instantiate_cloudsdk.equipment_id
print("equipment-id: %s" % (equipment_id))
if equipment_id == "-1":
print("ERROR: Could not find equipment-id.")
sys.exit(1)
###Get Current AP info
try:
ap_cli_info = ssh_cli_active_fw(command_line_args)
ap_cli_fw = ap_cli_info['active_fw']
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
ap_cli_info = "ERROR"
print("FAILED: Cannot Reach AP CLI.");
sys.exit(1)
# LANForge Information
lanforge = {
"ip": "localhost",
"port": 8806,
# "prefix": command_line_args.lanforge_prefix,
"2g_radio": "wiphy4",
"5g_radio": "wiphy5",
"eth_port": "eth2"
}
fw_model = ap_cli_fw.partition("-")[0]
print('Current Active AP FW from CLI:', ap_cli_fw)
radius_name = "%s-%s-%s" % (command_line_args.testbed, fw_model, "Radius")
print("Create profiles")
ap_object = CreateAPProfiles(command_line_args, cloud=cloud, client=instantiate_testrail, fw_model=fw_model)
# Logic to create AP Profiles (Bridge Mode)
# ap_object.set_ssid_psk_data(ssid_2g_wpa="Pytest-run-2g-wpa",
# ssid_5g_wpa="Pytest-run-2g-wpa",
# psk_2g_wpa="Pytest-run-2g-wpa",
# psk_5g_wpa="Pytest-run-2g-wpa",
# ssid_2g_wpa2="Pytest-run-2g-wpa",
# ssid_5g_wpa2="Pytest-run-2g-wpa",
# psk_2g_wpa2="Pytest-run-2g-wpa",
# psk_5g_wpa2="Pytest-run-2g-wpa")
print(ap_object)
today = str(date.today())
rid = instantiate_testrail.get_run_id(
test_run_name=command_line_args.testrail_run_prefix + fw_model + "_" + today + "_" + "ecw5410-2021-02-12-pending-e8bb466")
print("creating Profiles")
ssid_template = "TipWlan-Cloud-Wifi"
if not command_line_args.skip_profiles:
if not command_line_args.skip_radius:
# Radius Profile needs to be set here
radius_name = "Test-Radius-" + str(time.time()).split(".")[0]
radius_template = "templates/radius_profile_template.json"
ap_object.create_radius_profile(radius_name=radius_name, radius_template=radius_template, rid=rid,
key=fw_model)
ap_object.create_ssid_profiles(ssid_template=ssid_template, skip_eap=True, skip_wpa=True,
skip_wpa2=False, mode="bridge")
print("Create AP with equipment-id: ", equipment_id)
ap_object.create_ap_profile(eq_id=equipment_id, fw_model=fw_model, mode=command_line_args.mode)
ap_object.validate_changes(mode=command_line_args.mode)
print("Profiles Created")
data = {"lanforge": lanforge, "ap_object": ap_object}
yield data
yield PROFILE_DATA[request.node.originalname]
@pytest.fixture(scope="session")
def update_firmware(request, setup_testrails, instantiate_jFrog, instantiate_cloudsdk, access_points):
def update_firmware(request, instantiate_jFrog, instantiate_cloudsdk, retrieve_latest_image, access_points):
if request.config.getoption("--skip-update-firmware"):
return True
return
yield "update_firmware"
#access_points is really a single AP.
ap = access_points
if True:
latest_image = instantiate_jFrog.get_latest_image(ap)
if latest_image is None:
print("AP Model: %s doesn't match the available Models"%(ap))
sys.exit(1) # TODO: How to return error properly here?
cloudModel = cloud_sdk_models[ap]
logger = None
report_data = None
test_cases = None
testrail_client = None
jfrog_user = instantiate_jFrog.get_user()
jfrog_pwd = instantiate_jFrog.get_passwd()
testrail_rid = 0
customer_id = request.config.getoption("--customer-id")
equipment_id = instantiate_cloudsdk.equipment_id
pf = instantiate_cloudsdk.do_upgrade_ap_fw(request.config, report_data, test_cases, testrail_client,
latest_image, cloudModel, ap, jfrog_user, jfrog_pwd, testrail_rid,
customer_id, equipment_id, logger)
return pf
@pytest.fixture(scope="session")
def retrieve_latest_image(request, access_points):
if request.config.getoption("--skip-update-firmware"):
return
yield "retrieve_latest_image"
@pytest.fixture(scope="session")
def instantiate_cloudsdk(request):
command_line_args = create_command_line_args(request)
rv = CloudSDK(command_line_args)
equipment_id = request.config.getoption("--equipment-id")
if equipment_id == "-1":
eq_id = ap_ssh_ovsh_nodec(command_line_args, 'id')
print("EQ Id: %s" % (eq_id))
# Now, query equipment to find something that matches.
eq = rv.get_customer_equipment(customer_id)
for item in eq:
for e in item['items']:
print(e['id'], " ", e['inventoryId'])
if e['inventoryId'].endswith("_%s" % (eq_id)):
print("Found equipment ID: %s inventoryId: %s" % (e['id'], e['inventoryId']))
equipment_id = str(e['id'])
rv.equipment_id = equipment_id
if equipment_id == "-1":
print("EQ ID invalid: ", equipment_id)
sys.exit(1)
yield rv
@pytest.fixture(scope="session")
def instantiate_testrail(request):
yield TestRail_Client(create_command_line_args(request))
yield "instantiate_cloudsdk"
@pytest.fixture(scope="session")
def instantiate_jFrog(request):
yield GetBuild(
request.config.getini("jfrog-user-id"),
request.config.getini("jfrog-user-password"),
"pending", # TODO make this optional
url=request.config.getini("jfrog-base-url")
)
yield "instantiate_jFrog"

View File

@@ -1,354 +0,0 @@
#!/usr/bin/env python3
#########################################################################################################
# Built to allow connection and test of clients using EAP-TTLS.
# Functions can be called to create a station, create TCP and UDP traffic, run it a short amount of time.
#
# Used by Nightly_Sanity and Throughput_Test ############################################################
#########################################################################################################
# This will create a station, create TCP and UDP traffic, run it a short amount of time,
# and verify whether traffic was sent and received. It also verifies the station connected
# to the requested BSSID if bssid is specified as an argument.
# The script will clean up the station and connections at the end of the test.
import sys
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
if 'py-json' not in sys.path:
sys.path.append('../../py-json')
import argparse
import LANforge
from LANforge import LFUtils
# from LANforge import LFCliBase
from LANforge import lfcli_base
from LANforge.lfcli_base import LFCliBase
from LANforge.LFUtils import *
import realm
from realm import Realm
from lf_lib import *
import pprint
OPEN="open"
WEP="wep"
WPA="wpa"
WPA2="wpa2"
MODE_AUTO=0
class EAPConnect(LFCliBase):
def __init__(self, host, port, security=None, ssid=None, sta_list=None, number_template="00000", _debug_on=False, _dut_bssid="",
_exit_on_error=False, _sta_name=None, _resource=1, radio="wiphy0", key_mgmt="WPA-EAP", eap="", identity="",
ttls_passwd="", hessid=None, ttls_realm="", domain="", _sta_prefix='eap', _exit_on_fail=False, _cleanup_on_exit=True):
super().__init__(host, port, _debug=_debug_on, _halt_on_error=_exit_on_error, _exit_on_fail=_exit_on_fail)
self.host = host
self.port = port
self.ssid = ssid
self.radio = radio
self.security = security
#self.password = password
self.sta_list = sta_list
self.key_mgmt = key_mgmt
self.eap = eap
self.sta_prefix = _sta_prefix
self.identity = identity
self.ttls_passwd = ttls_passwd
self.ttls_realm = ttls_realm
self.domain = domain
self.hessid = hessid
self.dut_bssid = _dut_bssid
self.timeout = 120
self.number_template = number_template
self.debug = _debug_on
self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port)
self.station_profile = self.local_realm.new_station_profile()
self.station_profile.lfclient_url = self.lfclient_url
self.station_profile.ssid = self.ssid
self.station_profile.security = self.security
self.station_profile.number_template_ = self.number_template
self.station_profile.mode = 0
#Added to test_ipv4_ttls code
self.upstream_url = None # defer construction
self.sta_url_map = None
self.upstream_resource = None
self.upstream_port = "eth2"
self.station_names = []
if _sta_name is not None:
self.station_names = [_sta_name]
self.localrealm = Realm(lfclient_host=host, lfclient_port=port)
self.resource = _resource
self.cleanup_on_exit = _cleanup_on_exit
self.resulting_stations = {}
self.resulting_endpoints = {}
self.station_profile = None
self.l3_udp_profile = None
self.l3_tcp_profile = None
# def get_realm(self) -> Realm: # py > 3.6
def get_realm(self):
return self.localrealm
def get_station_url(self, sta_name_=None):
if sta_name_ is None:
raise ValueError("get_station_url wants a station name")
if self.sta_url_map is None:
self.sta_url_map = {}
for sta_name in self.station_names:
self.sta_url_map[sta_name] = "port/1/%s/%s" % (self.resource, sta_name)
return self.sta_url_map[sta_name_]
def get_upstream_url(self):
if self.upstream_url is None:
self.upstream_url = "port/1/%s/%s" % (self.upstream_resource, self.upstream_port)
return self.upstream_url
# Compare pre-test values to post-test values
def compare_vals(self, name, postVal, print_pass=False, print_fail=True):
# print(f"Comparing {name}")
if postVal > 0:
self._pass("%s %s" % (name, postVal), print_pass)
else:
self._fail("%s did not report traffic: %s" % (name, postVal), print_fail)
def remove_stations(self):
for name in self.station_names:
LFUtils.removePort(self.resource, name, self.lfclient_url)
def num_associated(self, bssid):
counter = 0
# print("there are %d results" % len(self.station_results))
fields = "_links,port,alias,ip,ap,port+type"
self.station_results = self.localrealm.find_ports_like("%s*"%self.sta_prefix, fields, debug_=False)
if (self.station_results is None) or (len(self.station_results) < 1):
self.get_failed_result_list()
for eid,record in self.station_results.items():
#print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ")
#pprint(eid)
#pprint(record)
if record["ap"] == bssid:
counter += 1
#print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ")
return counter
def clear_test_results(self):
self.resulting_stations = {}
self.resulting_endpoints = {}
super().clear_test_results()
#super(StaConnect, self).clear_test_results().test_results.clear()
def setup(self):
self.clear_test_results()
self.check_connect()
upstream_json = self.json_get("%s?fields=alias,phantom,down,port,ip" % self.get_upstream_url(), debug_=False)
if upstream_json is None:
self._fail(message="Unable to query %s, bye" % self.upstream_port, print_=True)
return False
if upstream_json['interface']['ip'] == "0.0.0.0":
if self.debug:
pprint.pprint(upstream_json)
self._fail("Warning: %s lacks ip address" % self.get_upstream_url(), print_=True)
return False
# remove old stations
print("Removing old stations")
for sta_name in self.station_names:
sta_url = self.get_station_url(sta_name)
response = self.json_get(sta_url)
if (response is not None) and (response["interface"] is not None):
for sta_name in self.station_names:
LFUtils.removePort(self.resource, sta_name, self.lfclient_url)
LFUtils.wait_until_ports_disappear(self.lfclient_url, self.station_names)
# Create stations and turn dhcp on
self.station_profile = self.localrealm.new_station_profile()
# Build stations
self.station_profile.use_security(self.security, self.ssid, passwd="[BLANK]")
self.station_profile.set_number_template(self.number_template)
print("Creating stations")
self.station_profile.set_command_flag("add_sta", "create_admin_down", 1)
self.station_profile.set_command_param("set_port", "report_timer", 1500)
self.station_profile.set_command_flag("set_port", "rpt_timer", 1)
self.station_profile.set_wifi_extra(key_mgmt=self.key_mgmt, eap=self.eap, identity=self.identity,
passwd=self.ttls_passwd,
realm=self.ttls_realm, domain=self.domain,
hessid=self.hessid)
self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug, use_radius=True, hs20_enable=False)
self._pass("PASS: Station build finished")
self.create_traffic = createTraffic(self.localrealm, self.sta_prefix, self.resource, self.upstream_port)
self.create_traffic.lf_l3_udp_profile()
self.create_traffic.lf_l3_tcp_profile()
def start(self):
if self.station_profile is None:
self._fail("Incorrect setup")
pprint.pprint(self.station_profile)
if self.station_profile.up is None:
self._fail("Incorrect station profile, missing profile.up")
if self.station_profile.up == False:
print("\nBringing ports up...")
data = {"shelf": 1,
"resource": self.resource,
"port": "ALL",
"probe_flags": 1}
self.json_post("/cli-json/nc_show_ports", data)
self.station_profile.admin_up()
LFUtils.waitUntilPortsAdminUp(self.resource, self.lfclient_url, self.station_names)
# station_info = self.jsonGet(self.mgr_url, "%s?fields=port,ip,ap" % (self.getStaUrl()))
duration = 0
maxTime = 60
ip = "0.0.0.0"
ap = ""
print("Waiting for %s stations to associate to AP: " % len(self.station_names), end="")
connected_stations = {}
while (len(connected_stations.keys()) < len(self.station_names)) and (duration < maxTime):
duration += 3
time.sleep(3)
print(".", end="")
for sta_name in self.station_names:
sta_url = self.get_station_url(sta_name)
station_info = self.json_get(sta_url + "?fields=port,ip,ap")
# LFUtils.debug_printer.pprint(station_info)
if (station_info is not None) and ("interface" in station_info):
if "ip" in station_info["interface"]:
ip = station_info["interface"]["ip"]
if "ap" in station_info["interface"]:
ap = station_info["interface"]["ap"]
if (ap == "Not-Associated") or (ap == ""):
if self.debug:
print(" -%s," % sta_name, end="")
else:
if ip == "0.0.0.0":
if self.debug:
print(" %s (0.0.0.0)" % sta_name, end="")
else:
connected_stations[sta_name] = sta_url
data = {
"shelf":1,
"resource": self.resource,
"port": "ALL",
"probe_flags": 1
}
self.json_post("/cli-json/nc_show_ports", data)
for sta_name in self.station_names:
sta_url = self.get_station_url(sta_name)
station_info = self.json_get(sta_url) # + "?fields=port,ip,ap")
if station_info is None:
print("unable to query %s" % sta_url)
self.resulting_stations[sta_url] = station_info
ap = station_info["interface"]["ap"]
ip = station_info["interface"]["ip"]
if (ap != "") and (ap != "Not-Associated"):
print(" %s +AP %s, " % (sta_name, ap), end="")
if self.dut_bssid != "":
if self.dut_bssid.lower() == ap.lower():
self._pass(sta_name+" connected to BSSID: " + ap)
# self.test_results.append("PASSED: )
# print("PASSED: Connected to BSSID: "+ap)
else:
self._fail("%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap))
else:
self._fail(sta_name+" did not connect to AP")
return False
if ip == "0.0.0.0":
self._fail("%s did not get an ip. Ending test" % sta_name)
else:
self._pass("%s connected to AP: %s With IP: %s" % (sta_name, ap, ip))
if self.passes() == False:
if self.cleanup_on_exit:
print("Cleaning up...")
self.remove_stations()
return False
# start cx traffic
print("\nStarting CX Traffic")
self.create_traffic.l3_udp_profile.start_cx()
self.create_traffic.l3_tcp_profile.start_cx()
time.sleep(1)
self.create_traffic.l3_tcp_profile.refresh_cx()
self.create_traffic.l3_udp_profile.refresh_cx()
def collect_endp_stats(self, endp_map):
print("Collecting Data")
fields="?fields=name,tx+bytes,rx+bytes"
for (cx_name, endps) in endp_map.items():
try:
endp_url = "/endp/%s%s" % (endps[0], fields)
endp_json = self.json_get(endp_url)
self.resulting_endpoints[endp_url] = endp_json
ptest_a_tx = endp_json['endpoint']['tx bytes']
ptest_a_rx = endp_json['endpoint']['rx bytes']
#ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % cx_names[cx_name]["b"])
endp_url = "/endp/%s%s" % (endps[1], fields)
endp_json = self.json_get(endp_url)
self.resulting_endpoints[endp_url] = endp_json
ptest_b_tx = endp_json['endpoint']['tx bytes']
ptest_b_rx = endp_json['endpoint']['rx bytes']
self.compare_vals("testTCP-A TX", ptest_a_tx)
self.compare_vals("testTCP-A RX", ptest_a_rx)
self.compare_vals("testTCP-B TX", ptest_b_tx)
self.compare_vals("testTCP-B RX", ptest_b_rx)
except Exception as e:
print("Is this the function having the error?")
self.error(e)
def stop(self):
# stop cx traffic
print("Stopping CX Traffic")
self.create_traffic.l3_udp_profile.stop_cx()
self.create_traffic.l3_tcp_profile.stop_cx()
# Refresh stats
print("\nRefresh CX stats")
self.create_traffic.l3_udp_profile.refresh_cx()
self.create_traffic.l3_tcp_profile.refresh_cx()
print("Sleeping for 5 seconds")
time.sleep(5)
# get data for endpoints JSON
self.collect_endp_stats(self.create_traffic.l3_udp_profile.created_cx)
self.collect_endp_stats(self.create_traffic.l3_tcp_profile.created_cx)
# print("\n")
def cleanup(self):
# remove all endpoints and cxs
if self.cleanup_on_exit:
for sta_name in self.station_names:
LFUtils.removePort(self.resource, sta_name, self.lfclient_url)
curr_endp_names = []
removeCX(self.lfclient_url, self.create_traffic.l3_udp_profile.get_cx_names())
removeCX(self.lfclient_url, self.create_traffic.l3_tcp_profile.get_cx_names())
for (cx_name, endp_names) in self.create_traffic.l3_udp_profile.created_cx.items():
curr_endp_names.append(endp_names[0])
curr_endp_names.append(endp_names[1])
for (cx_name, endp_names) in self.create_traffic.l3_tcp_profile.created_cx.items():
curr_endp_names.append(endp_names[0])
curr_endp_names.append(endp_names[1])
removeEndps(self.lfclient_url, curr_endp_names, debug= self.debug)
# ~class
if __name__ == "__main__":
main()

View File

@@ -1,64 +0,0 @@
import re
import requests
import json
import argparse
# Map firmware directory name to cloud's model name.
cloud_sdk_models = {
"ec420": "EC420-G1",
"ea8300": "EA8300-CA",
"ecw5211": "ECW5211",
"ecw5410": "ECW5410",
"wf188n": "WF188N"
}
# To better interoperate with libs that want to take a cmd-line-args thing vs
# the pytest request config.
def create_command_line_args(request):
parser = argparse.ArgumentParser(description="Fake")
command_line_args, unknown = parser.parse_known_args()
# And then overwrite it with whatever pytest is using (which is likely same in many cases)
command_line_args.equipment_id = request.config.getoption("--equipment-id")
command_line_args.customer_id = request.config.getoption("--customer-id")
command_line_args.sdk_base_url = request.config.getoption("--sdk-base-url")
command_line_args.sdk_user_id = request.config.getoption("--sdk-user-id")
command_line_args.sdk_user_password = request.config.getoption("--sdk-user-password")
command_line_args.default_ap_profile = request.config.getoption("--default-ap-profile")
command_line_args.verbose = request.config.getoption("--verbose")
command_line_args.ap_ip = request.config.getoption("--ap-ip")
command_line_args.ap_username = request.config.getoption("--ap-username")
command_line_args.ap_password = request.config.getoption("--ap-password")
command_line_args.ap_jumphost_address = request.config.getoption("--ap-jumphost-address")
command_line_args.ap_jumphost_username = request.config.getoption("--ap-jumphost-username")
command_line_args.ap_jumphost_password = request.config.getoption("--ap-jumphost-password")
command_line_args.ap_jumphost_port = request.config.getoption("--ap-jumphost-port")
command_line_args.ap_jumphost_wlan_testing = request.config.getoption("--ap-jumphost-wlan-testing") # directory
command_line_args.ap_jumphost_tty = request.config.getoption("--ap-jumphost-tty")
command_line_args.build_id = request.config.getoption("--build-id")
command_line_args.testbed = request.config.getoption("--testbed")
command_line_args.mode = request.config.getoption("--mode")
command_line_args.skip_wpa = request.config.getoption("--skip-wpa")
command_line_args.skip_wpa2 = request.config.getoption("--skip-wpa2")
command_line_args.skip_radius = request.config.getoption("--skip-radius")
command_line_args.skip_profiles = request.config.getoption("--skip-profiles")
command_line_args.ssid_2g_wpa = request.config.getoption("--ssid-2g-wpa")
command_line_args.ssid_5g_wpa = request.config.getoption("--ssid-5g-wpa")
command_line_args.psk_2g_wpa = request.config.getoption("--psk-2g-wpa")
command_line_args.psk_5g_wpa = request.config.getoption("--psk-5g-wpa")
command_line_args.ssid_2g_wpa2 = request.config.getoption("--ssid-2g-wpa2")
command_line_args.ssid_5g_wpa2 = request.config.getoption("--ssid-5g-wpa2")
command_line_args.psk_2g_wpa2 = request.config.getoption("--psk-2g-wpa2")
command_line_args.psk_5g_wpa2 = request.config.getoption("--psk-5g-wpa2")
command_line_args.testrail_base_url = request.config.getoption("--testrail-base-url")
command_line_args.testrail_project = request.config.getoption("--testrail-project")
command_line_args.testrail_user_id = request.config.getoption("--testrail-user-id")
command_line_args.testrail_user_password = request.config.getoption("--testrail-user-password")
command_line_args.testrail_run_prefix = request.config.getoption("--testrail-run-prefix")
command_line_args.testrail_milestone = request.config.getoption("--testrail-milestone")
return command_line_args

View File

@@ -1,15 +1,15 @@
[pytest]
addopts= --junitxml=test_everything.xml
# jFrog parameters
jfrog-base-url=https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/
jfrog-base-url=tip.jFrog.io/artifactory/tip-wlan-ap-firmware
jfrog-user-id=tip-read
jfrog-user-password=tip-read
# Cloud SDK parameters
sdk-base-url=https://wlan-portal-svc.cicd.lab.wlan.tip.build
testbed-name=nola-ext-04
sdk-user-id=support@example.com
sdk-user-password=support
# Testrails parameters
testrail-base-url=https://telecominfraproject.testrail.com
testrail-base-url=telecominfraproject.testrail.com
testrail-project=opsfleet-wlan
testrail-user-id=gleb@opsfleet.com
testrail-user-password=use_command_line_to_pass_this
@@ -20,13 +20,11 @@ lanforge-radio=wiphy4
lanforge-ethernet-port=eth2
# Cloud SDK settings
customer-id=2
# equipment ID is unique for each AP, have to be told what to use or query it based on other info.
equipment-id=-1
sdk-customer-id=2
markers =
featureA: marks tests as slow (deselect with '-m "not slow"')
featureB
featureC
featureD
featureE
login: marks cloudsdk login
UHF: marks tests as using 2.4 ghz frequency
SHF: marks tests as using 5.0 ghz frequency
open: marks tests as using no security
wpa2: marks tests as using wpa2 security

View File

@@ -1 +0,0 @@
{"sanity_status": {"ea8300": "failed", "ecw5211": "failed", "ecw5410": "failed", "ec420": "failed"}, "sanity_run": {"new_data": "yes"}}

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
{"model_type": "Profile", "id": 129, "customerId": "2", "profileType": "radius", "name": "Automation_Radius_Nightly-01", "details": {"model_type": "RadiusProfile", "primaryRadiusAuthServer": {"model_type": "RadiusServer", "ipAddress": "18.189.25.141", "secret": "testing123", "port": 1812, "timeout": 5}, "secondaryRadiusAuthServer": null, "primaryRadiusAccountingServer": null, "secondaryRadiusAccountingServer": null, "profileType": "radius"}, "createdTimestamp": 1602263176599, "lastModifiedTimestamp": 1611708334061, "childProfileIds": []}

View File

@@ -1,622 +0,0 @@
<! DOCTYPE html>
<html>
<head>
<title>Testing Report</title>
<head>
<?php
//error_reporting(E_ALL);
//ini_set('display_errors', '1');
$results = file_get_contents('report_data.json');
$json = json_decode($results, true);
?>
<body bgcolor="grey">
<style>
.tab1 {
tab-size: 8;
}
.tab2 {
tab-size: 14;
}
.tab4 {
margin-left: 188;
}
div.sanity {
background-color: lightgray;
width: 975px;
border-style: ridge;
padding: 10px;
left: 0;
font-size: 15px;
line-height: 25px
}
</style>
<header>
<h1 style="color:green; font-size:40px; text-align: center">CICD Nightly Sanity Report - <?php echo basename(dirname(__FILE__)) ?></h1>
</header>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="4" CELLSPACING="3" Style="background-color: lightgray; font-size:16px">
<TR>
<TH COLSPAN="7"><BR><H3>Test Results</H3>
</TH>
</TR>
<TR>
<TH COLSPAN="2" ROWSPAN="7"></TH>
<TH></TH>
<TH WIDTH="150px">EA8300 Result</TH>
<TH WIDTH="150px">ECW5211 Result</TH>
<TH WIDTH="150px">ECW5410 Result</TH>
<TH WIDTH="150px">EC420 Result</TH>
</TR>
<TR ALIGN="CENTER">
<TD ALIGN="LEFT" style="font-weight:bold">New FW Available</TD>
<TD style="font-weight:bold"><?php echo print_r($json['fw_available']['ea8300'],true) ?></TD>
<TD style="font-weight:bold"><?php echo print_r($json['fw_available']['ecw5211'],true) ?></TD>
<TD style="font-weight:bold"><?php echo print_r($json['fw_available']['ecw5410'],true) ?></TD>
<TD style="font-weight:bold"><?php echo print_r($json['fw_available']['ec420'],true) ?></TD>
</TR>
<TR ALIGN="CENTER" style="font-weight:bold">
<TD ALIGN="LEFT" >FW Under Test</TD>
<TD style="font-size:12px"><?php echo print_r($json['fw_under_test']['ea8300'],true) ?></TD>
<TD style="font-size:12px"><?php echo print_r($json['fw_under_test']['ecw5211'],true) ?></TD>
<TD style="font-size:12px"><?php echo print_r($json['fw_under_test']['ecw5410'],true) ?></TD>
<TD style="font-size:12px"><?php echo print_r($json['fw_under_test']['ec420'],true) ?></TD>
</TR>
<TR ALIGN="CENTER" style="font-weight:bold">
<TD ALIGN="LEFT" >CloudSDK Commit Date</TD>
<TD style="font-size:12px"><?php echo print_r($json['cloud_sdk']['ea8300']['date'],true) ?></TD>
<TD style="font-size:12px"><?php echo print_r($json['cloud_sdk']['ecw5211']['date'],true) ?></TD>
<TD style="font-size:12px"><?php echo print_r($json['cloud_sdk']['ecw5410']['date'],true) ?></TD>
<TD style="font-size:12px"><?php echo print_r($json['cloud_sdk']['ec420']['date'],true) ?></TD>
</TR>
<TR ALIGN="CENTER" style="font-weight:bold">
<TD ALIGN="LEFT" >CloudSDK Commit ID</TD>
<TD style="font-size:10px"><?php echo print_r($json['cloud_sdk']['ea8300']['commitId'],true) ?></TD>
<TD style="font-size:10px"><?php echo print_r($json['cloud_sdk']['ecw5211']['commitId'],true) ?></TD>
<TD style="font-size:10px"><?php echo print_r($json['cloud_sdk']['ecw5410']['commitId'],true) ?></TD>
<TD style="font-size:10px"><?php echo print_r($json['cloud_sdk']['ec420']['commitId'],true) ?></TD>
</TR>
<TR ALIGN="CENTER" style="font-weight:bold">
<TD ALIGN="LEFT" >CloudSDK Project Version</TD>
<TD style="font-size:12px"><?php echo print_r($json['cloud_sdk']['ea8300']['projectVersion'],true) ?></TD>
<TD style="font-size:12px"><?php echo print_r($json['cloud_sdk']['ecw5211']['projectVersion'],true) ?></TD>
<TD style="font-size:12px"><?php echo print_r($json['cloud_sdk']['ecw5410']['projectVersion'],true) ?></TD>
<TD style="font-size:12px"><?php echo print_r($json['cloud_sdk']['ec420']['projectVersion'],true) ?></TD>
</TR>
<TR ALIGN="CENTER" style="font-weight:bold">
<TD ALIGN="LEFT">Test Pass Rate</TD>
<TD style="font-size:14px"><?php echo print_r($json['pass_percent']['ea8300'],true) ?></TD>
<TD style="font-size:14px"><?php echo print_r($json['pass_percent']['ecw5211'],true) ?></TD>
<TD style="font-size:14px"><?php echo print_r($json['pass_percent']['ecw5410'],true) ?></TD>
<TD style="font-size:14px"><?php echo print_r($json['pass_percent']['ec420'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TH>Test Case</TH>
<TH WIDTH= 7%">Category</TH>
<TH>Description</TH>
<TH></TH>
<TH></TH>
<TH></TH>
<TH></TH>
<TR ALIGN="CENTER">
<TD>5540</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Get CloudSDK Version with API</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5540'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5540'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5540'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5540'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5548</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create FW version on CloudSDK using API</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5548'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5548'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5548'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5548'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5547</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Request AP Upgrade using API</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5547'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5547'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5547'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5547'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>2233</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">AP Upgrade Successful</TD>
<TD><?php echo print_r($json['tests']['ea8300']['2233'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['2233'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['2233'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['2233'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5247</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">CloudSDK Reports Correct FW</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5247'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5247'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5247'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5247'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5222</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">AP-CloudSDK Connection Active </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5222'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5222'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5222'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5222'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5808</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create RADIUS Profile </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5808'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5808'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5808'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5808'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5644</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 2.4 GHz WPA2-EAP - Bridge Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5644'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5644'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5644'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5644'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5645</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 2.4 GHz WPA2 - Bridge Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5645'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5645'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5645'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5645'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5646</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 2.4 GHz WPA - Bridge Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5646'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5646'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5646'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5646'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5647</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 5 GHz WPA2-EAP - Bridge Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5646'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5646'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5646'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5646'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5647</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 5 GHz WPA2 - Bridge Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5647'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5647'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5647'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5647'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5648</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 5 GHz WPA - Bridge Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5648'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5648'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5648'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5648'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5641</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create AP Profile - Bridge Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5641'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5641'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5641'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5641'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5541</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">CloudSDK Pushes Correct AP Profile - Bridge Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5541'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5541'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5541'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5541'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5544</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">AP Applies Correct AP Profile - Bridge Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5544'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5544'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5544'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5544'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5214</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 2.4 GHz WPA2-EAP - Bridge Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5214'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5214'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5214'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5214'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>2237</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 2.4 GHz WPA2 - Bridge Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['2237'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['2237'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['2237'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['2237'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>2420</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 2.4 GHz WPA - Bridge Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['2420'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['2420'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['2420'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['2420'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5215</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 5 GHz WPA2-EAP - Bridge Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5215'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5215'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5215'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5215'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>2236</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 5 GHz WPA2 - Bridge Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['2236'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['2236'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['2236'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['2236'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>2419</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 5 GHz WPA - Bridge Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['2419'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['2419'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['2419'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['2419'],true) ?></TD>
<TR ALIGN="CENTER">
<TD>5650</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 2.4 GHz WPA2-EAP - NAT Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5650'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5650'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5650'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5650'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5651</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 2.4 GHz WPA2 - NAT Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5651'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5651'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5651'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5651'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5652</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 2.4 GHz WPA - NAT Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5652'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5652'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5652'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5652'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5653</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 5 GHz WPA2-EAP - NAT Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5653'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5653'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5653'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5653'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5654</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 5 GHz WPA2 - NAT Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5654'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5654'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5654'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5654'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5655</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 5 GHz WPA - NAT Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5655'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5655'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5655'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5655'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5642</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create AP Profile - NAT Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5642'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5642'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5642'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5642'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5542</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">CloudSDK Pushes Correct AP Profile - NAT Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5542'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5542'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5542'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5542'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5545</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">AP Applies Correct AP Profile - NAT Mode </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5545'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5545'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5545'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5545'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5216</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 2.4 GHz WPA2-EAP - NAT Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5216'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5216'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5216'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5216'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>4325</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 2.4 GHz WPA2 - NAT Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['4325'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['4325'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['4325'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['4325'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>4323</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 2.4 GHz WPA - NAT Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['4323'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['4323'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['4323'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['4323'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5217</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 5 GHz WPA2-EAP - NAT Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5217'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5217'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5217'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5217'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>4326</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 5 GHz WPA2 - NAT Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['4326'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['4326'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['4326'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['4326'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>4324</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 5 GHz WPA - NAT Mode</TD>
<TD><?php echo print_r($json['tests']['ea8300']['4324'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['4324'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['4324'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['4324'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5656</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 2.4 GHz WPA2-EAP - Custom VLAN </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5656'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5656'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5656'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5656'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5657</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 2.4 GHz WPA2 - Custom VLAN </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5657'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5657'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5657'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5657'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5658</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 2.4 GHz WPA - Custom VLAN </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5658'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5658'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5658'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5658'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5659</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 5 GHz WPA2-EAP - Custom VLAN </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5659'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5659'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5659'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5659'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5660</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 5 GHz WPA2 - Custom VLAN </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5660'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5660'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5660'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5660'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5661</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create SSID Profile 5 GHz WPA - Custom VLAN </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5661'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5661'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5661'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5661'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5643</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">Create AP Profile - Custom VLAN </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5643'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5643'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5643'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5643'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5543</TD>
<TD>CloudSDK</TD>
<TD ALIGN="LEFT">CloudSDK Pushes Correct AP Profile - Custom VLAN </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5543'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5543'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5543'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5543'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5546</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">AP Applies Correct AP Profile - Custom VLAN </TD>
<TD><?php echo print_r($json['tests']['ea8300']['5546'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5546'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5546'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5546'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5253</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 2.4 GHz WPA2-EAP - Custom VLAN</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5253'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5253'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5253'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5253'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5251</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 2.4 GHz WPA2 - Custom VLAN</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5251'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5251'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5251'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5251'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5252</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 2.4 GHz WPA - Custom VLAN</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5252'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5252'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5252'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5252'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5250</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 5 GHz WPA2-EAP - Custom VLAN</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5250'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5250'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5250'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5250'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5248</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 5 GHz WPA2 - Custom VLAN</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5248'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5248'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5248'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5248'],true) ?></TD>
</TR>
<TR ALIGN="CENTER">
<TD>5249</TD>
<TD>AP</TD>
<TD ALIGN="LEFT">Client connects to 5 GHz WPA - Custom VLAN</TD>
<TD><?php echo print_r($json['tests']['ea8300']['5249'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5211']['5249'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ecw5410']['5249'],true) ?></TD>
<TD><?php echo print_r($json['tests']['ec420']['5249'],true) ?></TD>
</TR>
</TABLE>
</body>

View File

@@ -1 +0,0 @@
{"model_type": "Profile", "id": 28, "customerId": 2, "profileType": "ssid", "name": "NOLA-01-ecw5410-2G_WPA", "details": {"model_type": "SsidConfiguration", "ssid": "ECW5410_2dot4G_WPA", "appliedRadios": ["is2dot4GHz"], "ssidAdminState": "enabled", "secureMode": "wpaPSK", "vlanId": 1, "keyStr": "Connectus123$", "broadcastSsid": "enabled", "keyRefresh": 0, "noLocalSubnets": false, "radiusServiceName": "Radius-Accounting-Profile", "radiusAccountingServiceName": null, "radiusAcountingServiceInterval": null, "captivePortalId": null, "bandwidthLimitDown": 0, "bandwidthLimitUp": 0, "clientBandwidthLimitDown": 0, "clientBandwidthLimitUp": 0, "videoTrafficOnly": false, "radioBasedConfigs": {"is2dot4GHz": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}, "is5GHz": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}, "is5GHzU": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}, "is5GHzL": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}}, "bonjourGatewayProfileId": null, "enable80211w": null, "wepConfig": null, "forwardMode": "BRIDGE", "profileType": "ssid"}, "createdTimestamp": 1598557809816, "lastModifiedTimestamp": 1598557809816, "childProfileIds": []}

View File

@@ -1,66 +0,0 @@
# https://docs.pytest.org/en/latest/example/markers.html
# https://docs.pytest.org/en/latest/usage.html
# http://pythontesting.net/framework/pytest/pytest-introduction/
import sys
import pytest
from time import sleep, gmtime, strftime
from sta_connect2 import StaConnect2
@pytest.mark.usefixtures('setup_testrails')
@pytest.mark.usefixtures('setup_cloudsdk')
@pytest.mark.usefixtures('update_firmware')
@pytest.mark.usefixtures('instantiate_testrail')
class Test24ghz(object):
@pytest.mark.client_connectivity
def test_single_client_wpa2(self, setup_testrails, setup_cloudsdk, update_firmware, instantiate_testrail):
lf_config = setup_cloudsdk["lanforge"]
# ap_profile = setup_cloudsdk["ap_object"]
staConnect = StaConnect2(lf_config["ip"], lf_config["port"], debug_=False)
staConnect.sta_mode = 0
staConnect.upstream_resource = 1
staConnect.upstream_port = lf_config["eth_port"]
staConnect.radio = lf_config["2g_radio"]
# staConnect.runtime_secs = lf_config["runtime_duration"]
staConnect.resource = 1
staConnect.dut_ssid = "NOLA-01g-ecw5410-2G_WPA2"
staConnect.dut_passwd = "ecw5410-2G_WPA2"
staConnect.dut_security = "wpa2"
staConnect.station_names = ['sta0000']
staConnect.bringup_time_sec = 60
staConnect.cleanup_on_exit = True
staConnect.setup()
staConnect.start()
sleep(staConnect.runtime_secs)
staConnect.stop()
staConnect.cleanup()
assert staConnect.passes()
if setup_testrails > 0:
instantiate_testrail.update_testrail(case_id=2835, run_id=setup_testrails, status_id=1, msg="testing")
# @pytest.mark.client_connectivity
# def test_single_client_wpa(self):
# pass
#
# @pytest.mark.client_connectivity
# def test_single_client_eap(self):
# pass
#@pytest.mark.featureB
#def test_feature_b(self):
# pass
#@pytest.mark.featureC
#def test_feature_c(self):
# assert 1 == 0
#@pytest.mark.featureD
#def test_feature_d(self):
# pytest.skip("speedup")
#@pytest.mark.xfail
#@pytest.mark.featureE
#def test_feature_e(self):
# assert 1 == 0

View File

@@ -1,46 +0,0 @@
import os
from datetime import date, datetime
from shutil import copyfile
import json
class Reporting:
def __init__(self, reports_root="../reports/"):
self.reports_root = reports_root
self.report_id = self.create_report_id()
self.report_path = self.reports_root + self.report_id
self.templates_root = os.path.abspath(self.reports_root + "../templates")
try:
os.mkdir(self.report_path)
print("Successfully created the directory %s " % self.report_path)
except OSError:
print("Creation of the directory %s failed" % self.report_path)
try:
copyfile(self.templates_root + "/report_template.php", self.report_path + '/report.php')
except:
print("No report template created. Report data will still be saved. Continuing with tests...")
def create_report_id(self):
today = str(date.today())
now = str(datetime.now()).split(" ")[1].split(".")[0].replace(":", "-")
id = today + "-" + now
return id
def update_json_report(self, report_data):
try:
with open(self.report_path + '/report_data.json', 'w') as report_json_file:
json.dump(report_data, report_json_file)
report_json_file.close()
except Exception as e:
print(e)
def main():
Reporting()
if __name__ == '__main__':
main()

View File

@@ -1,2 +0,0 @@
## Tools
Handy tools made by utliziing the cloud and ap libraries

View File

@@ -1,150 +0,0 @@
All of this assumes you are running on some developer system, with ssh tunnels
into the 'ubuntu' jumphost machine.
ssh -C -L 8800:lf1:4002 -L 8801:lf1:5901 -L 8802:lf1:8080 -L 8803:lab-ctlr:22 \
-L 8810:lf4:4002 -L 8811:lf4:5901 -L 8812:lf4:8080 -L 8813:lab-ctlr:22 \
-L 8850:lf5:4002 -L 8851:lf5:5901 -L 8852:lf5:8080 -L 8853:lab-ctlr2:22 \
-L 8860:lf6:4002 -L 8861:lf6:5901 -L 8862:lf6:8080 -L 8863:lab-ctlr2:22 \
-L 8870:lf7:4002 -L 8871:lf7:5901 -L 8872:lf7:8080 -L 8873:lab-ctlr2:22 \
-L 8880:lf8:4002 -L 8881:lf8:5901 -L 8882:lf8:8080 -L 8883:lab-ctlr2:22 \
-L 8890:lf9:4002 -L 8891:lf9:5901 -L 8892:lf9:8080 -L 8893:lab-ctlr3:22 \
-L 8900:lf10:4002 -L 8901:lf10:5901 -L 8902:lf10:8080 -L 8903:lab-ctlr3:22 \
-L 8910:lf11:4002 -L 8911:lf11:5901 -L 8912:lf11:8080 -L 8913:lab-ctlr3:22 \
-L 8950:lf15:4002 -L 8951:lf15:5901 -L 8952:lf115:8080 -L 8953:lab-ctlr4:22 \
-L 8820:lf12:4002 -L 8821:lf12:5901 -L 8822:lf12:8080 -L 8823:lab-ctlr4:22 \
ubuntu@orch
The ports are used as:
4002: LANforge GUI connection to LANforge in the testbed.
5901: VNC connection to LANforge machine.
8080: LANforge JSON/API connection.
22: ssh shell access to lab controller
Each testbed will have a set of 4 ssh tunnels. Some are duplicated since
lab-controllers are shared. I figure a consistent pattern is worth a few
duplicated tunnels.
Testbed-01
# Set AP profile on NOLA-01
./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --lanforge-ip-address localhost --lanforge-port-number 8802 \
--default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \
--skip-radius --skip-wpa --verbose --testbed "NOLA-01" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \
--ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge
./Nightly_Sanity.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed "NOLA-01r" --lanforge-ip-address localhost --lanforge-port-number 8802 --default_ap_profile TipWlan-2-Radios --lanforge-2g-radio 1.1.wiphy4 --lanforge-5g-radio 1.1.wiphy5 --skip-upgrade True --testrail-milestone milestone-1 --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build
# Set AP profile on NOLA-06 (eap101)
./sdk_set_profile.py --testrail-user-id NONE --model eap101 --ap-jumphost-address localhost --ap-jumphost-port 8863 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP2 --lanforge-ip-address localhost --lanforge-port-number 8862 \
--default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \
--skip-radius --skip-wpa --verbose --testbed "NOLA-06" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \
--ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge
./Nightly_Sanity.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed "NOLA-01r" --lanforge-ip-address localhost --lanforge-port-number 8802 --default_ap_profile TipWlan-2-Radios --lanforge-2g-radio 1.1.wiphy4 --lanforge-5g-radio 1.1.wiphy5 --skip-upgrade True --testrail-milestone milestone-1 --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build
Testbed-09 (perfecto)
# Set AP profile (ssid, etc) on 'b' chamber. AP is ttyAP4
./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 \
--lanforge-ip-address localhost --lanforge-port-number 8892 \
--default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \
--skip-radius --skip-wpa --verbose --testbed "NOLA-09b" \
--ssid-5g-wpa2 Default-SSID-5gl-perfecto-b --psk-5g-wpa2 12345678 \
--ssid-2g-wpa2 Default-SSID-2g-perfecto-b --psk-2g-wpa2 12345678 --mode bridge
# Upgrade 'b' chamber AP
./sdk_upgrade_fw.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 --testbed \"NOLA-09b\" \
--sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build --force-upgrade true
# Set AP profile (ssid, etc) on 'a' chamber. AP is ttyAP1
./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 \
--lanforge-ip-address localhost --lanforge-port-number 8892 \
--default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \
--skip-radius --skip-wpa --verbose --testbed "NOLA-09a" \
--ssid-5g-wpa2 Default-SSID-5gl-perfecto --psk-5g-wpa2 12345678 \
--ssid-2g-wpa2 Default-SSID-2g-perfecto --psk-2g-wpa2 12345678 --mode bridge
# Upgrade 'a' chamber AP
./sdk_upgrade_fw.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed \"NOLA-09a\" \
--sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build --force-upgrade true
Testbed 10 (Advanced setup, 2D turntable chamber plus medium chamber, RF attenuator, etc)
./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8903 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP2 --lanforge-ip-address localhost --lanforge-port-number 8902 \
--default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \
--skip-radius --skip-wpa --verbose --testbed "NOLA-10" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \
--ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge
# Upgrade AP
./sdk_upgrade_fw.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8903 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP2 --testbed \"NOLA-10\" \
--sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build --force-upgrade true
Testbed 11 (Advanced setup, 2D turntable chamber plus medium chamber, RF attenuator, etc)
./sdk_set_profile.py --testrail-user-id NONE --model eap102 --ap-jumphost-address localhost --ap-jumphost-port 8913 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP3 --lanforge-ip-address localhost --lanforge-port-number 8912 \
--default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \
--skip-radius --skip-wpa --verbose --testbed "NOLA-11" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \
--ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge
# Upgrade AP
./sdk_upgrade_fw.py --testrail-user-id NONE --model eap102 --ap-jumphost-address localhost --ap-jumphost-port 8913 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP3 --testbed \"NOLA-11\" \
--sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build --force-upgrade true
Testbed 12 (Basic, wf188n)
# Upgrade firmware to latest
./sdk_upgrade_fw.py --testrail-user-id NONE --model wf188n --ap-jumphost-address localhost --ap-jumphost-port 8823 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed \"NOLA-12\" \
--sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build --force-upgrade true
./sdk_set_profile.py --testrail-user-id NONE --model wf188n --ap-jumphost-address localhost --ap-jumphost-port 8823 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --lanforge-ip-address localhost --lanforge-port-number 8822 \
--default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \
--skip-radius --skip-wpa --verbose --testbed "NOLA-12" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \
--ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge
# Query an ssid
./query_sdk.py --testrail-user-id NONE --model wf188n --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \
--sdk-user-id support@example.com --sdk-user-password support --equipment_id 3 --type profile --cmd get --object_id 11
Testbed-15
# Set AP profile on NOLA-15 (ap-1)
./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8953 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 --lanforge-ip-address localhost --lanforge-port-number 8952 \
--default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-15.cicd.lab.wlan.tip.build \
--skip-radius --skip-wpa --verbose --testbed "NOLA-15" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \
--ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge
# Update firmware (ap-1)
./sdk_upgrade_fw.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8953 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 --testbed \"NOLA-15\" \
--sdk-base-url https://wlan-portal-svc-nola-15.cicd.lab.wlan.tip.build --force-upgrade true
# Set AP profile on NOLA-15 (ap-2, cig194c)
./sdk_set_profile.py --testrail-user-id NONE --model cig194c --ap-jumphost-address localhost --ap-jumphost-port 8953 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP5 --lanforge-ip-address localhost --lanforge-port-number 8952 \
--default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-15.cicd.lab.wlan.tip.build \
--skip-radius --skip-wpa --verbose --testbed "NOLA-15b" --ssid-5g-wpa2 Default-SSID-5gl-cig --psk-5g-wpa2 12345678 \
--ssid-2g-wpa2 Default-SSID-2g-cig --psk-2g-wpa2 12345678 --mode bridge

View File

@@ -1,31 +0,0 @@
#!/bin/bash
# Commands to grab debug info off of NOLA-01. Everything is hard-coded assuming you use
# ssh tunnel in the suggested way. Otherwise, you will need to edit things...
set -x
NOLANUM=01
PORTAL=wlan-portal-svc.cicd.lab.wlan.tip.build
APPORT=8803
APTTY=/dev/ttyAP1
MODEL=ecw5410
# cloud sdk profile dump
./query_sdk.py --testrail-user-id NONE --model $MODEL --sdk-base-url https://$PORTAL --sdk-user-id support@example.com \
--sdk-user-password support --type profile --cmd get > /tmp/nola-$NOLANUM-profiles.txt
# cloud version info
./query_sdk.py --testrail-user-id NONE --model $MODEL --sdk-base-url https://$PORTAL --sdk-user-id support@example.com \
--sdk-user-password support --type ping > /tmp/nola-$NOLANUM-sdk-ping.txt
# ovsdb-client dump
./query_ap.py --ap-jumphost-address localhost --ap-jumphost-port $APPORT --ap-jumphost-password pumpkin77 --ap-jumphost-tty $APTTY -m $MODEL --cmd "ovsdb-client dump" > /tmp/nola-$NOLANUM-ap.txt
# interface info
./query_ap.py --ap-jumphost-address localhost --ap-jumphost-port $APPORT --ap-jumphost-password pumpkin77 --ap-jumphost-tty $APTTY -m $MODEL --cmd "iwinfo && brctl show" > /tmp/nola-$NOLANUM-ap-if.txt
# TODO: Add more things here as we learn what better provides debug info to cloud.
echo "Grab: /tmp/nola-$NOLANUM-profiles.txt /tmp/nola-$NOLANUM-ap.txt /tmp/nola-$NOLANUM-ap-if.txt /tmp/nola-$NOLANUM-sdk-ping.txt"

View File

@@ -1,31 +0,0 @@
#!/bin/bash
# Commands to grab debug info off of NOLA-12. Everything is hard-coded assuming you use
# ssh tunnel in the suggested way. Otherwise, you will need to edit things...
set -x
NOLANUM=12
PORTAL=wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build
APPORT=8823
APTTY=/dev/ttyAP1
MODEL=wf188n
# cloud sdk profile dump
./query_sdk.py --testrail-user-id NONE --model $MODEL --sdk-base-url https://$PORTAL --sdk-user-id support@example.com \
--sdk-user-password support --type profile --cmd get > /tmp/nola-$NOLANUM-profiles.txt
# cloud version info
./query_sdk.py --testrail-user-id NONE --model $MODEL --sdk-base-url https://$PORTAL --sdk-user-id support@example.com \
--sdk-user-password support --type ping > /tmp/nola-$NOLANUM-sdk-ping.txt
# ovsdb-client dump
./query_ap.py --ap-jumphost-address localhost --ap-jumphost-port $APPORT --ap-jumphost-password pumpkin77 --ap-jumphost-tty $APTTY -m $MODEL --cmd "ovsdb-client dump" > /tmp/nola-$NOLANUM-ap.txt
# interface info
./query_ap.py --ap-jumphost-address localhost --ap-jumphost-port $APPORT --ap-jumphost-password pumpkin77 --ap-jumphost-tty $APTTY -m $MODEL --cmd "iwinfo && brctl show" > /tmp/nola-$NOLANUM-ap-if.txt
# TODO: Add more things here as we learn what better provides debug info to cloud.
echo "Grab: /tmp/nola-$NOLANUM-profiles.txt /tmp/nola-$NOLANUM-ap.txt /tmp/nola-$NOLANUM-ap-if.txt /tmp/nola-$NOLANUM-sdk-ping.txt"

View File

@@ -1 +0,0 @@
Logs go here, don't commit them!

View File

@@ -1,44 +0,0 @@
#!/usr/bin/python3
# Example command line:
#./query_ap.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --cmd "ifconfig -a"
import sys
sys.path.append(f'../tests')
from UnitTestBase import *
parser = argparse.ArgumentParser(description="Query AP", add_help=False)
parser.add_argument("--cmd", type=str, help="Command-line to run on AP",
default = "ifconfig -a")
parser.add_argument("--ap_ssh", type=str, help="ap_ssh method to execute.",
default = None, choices=["get_vif_config", "get_vif_state"])
reporting = Reporting(reports_root=os.getcwd() + "/reports/")
base = UnitTestBase("query-ap", parser, reporting)
cmd = base.command_line_args.cmd
try:
if base.command_line_args.ap_ssh != None:
ap_cmd = base.command_line_args.ap_ssh
if ap_cmd == "get_vif_config":
print(get_vif_config(base.command_line_args))
sys.exit(0)
if ap_cmd == "get_vif_state":
print(get_vif_state(base.command_line_args))
sys.exit(0)
print("Un-known ap-ssh method: %s"%(ap_cmd))
sys.exit(1)
print("Command: %s"%(cmd))
rv = ap_ssh_cmd(base.command_line_args, cmd)
print("Command Output:\n%s"%(rv))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to execute command on AP")

View File

@@ -1,253 +0,0 @@
#!/usr/bin/python3
import sys
sys.path.append(f'../tests')
from UnitTestBase import *
parser = argparse.ArgumentParser(description="Query SDK Objects", add_help=False)
parser.add_argument("--type", type=str, help="Type of thing to query",
choices=['profile', 'customer', 'location', 'equipment', 'portalUser',
'status', 'client-sessions', 'client-info', 'alarm', 'service-metric',
'event', 'firmware', 'ping', 'all'],
default = "all")
parser.add_argument("--cmd", type=str, help="Operation to do, default is 'get'",
choices=['get', 'delete', 'child_of'],
default = "get")
parser.add_argument("--brief", type=str, help="Show output in brief mode?",
choices=["true", "false"],
default = "false")
reporting = Reporting(reports_root=os.getcwd() + "/reports/")
base = UnitTestBase("query-sdk", parser, reporting)
qtype = base.command_line_args.type
cmd = base.command_line_args.cmd
brief = False
if base.command_line_args.brief == "true":
brief = True
def get_profile(url, bearer, cust_id, object_id):
if (object_id == None or object_id.isdigit()):
return base.cloud.get_customer_profiles(url, bearer, cust_id, object_id)
else:
return [base.cloud.get_customer_profile_by_name(url, bearer, cust_id, object_id)]
if qtype == 'all' or qtype == 'profile':
# Get customer profiles
try:
if cmd == "get":
rv = get_profile(base.cloudSDK_url, base.bearer, base.customer_id, base.command_line_args.object_id)
print("Profiles for customer %s (%i pages):"%(base.customer_id, len(rv)))
#jobj = json.load(ssids)
for r in rv:
if brief:
for p in r['items']:
print("Profile id: %s name: %s type: %s"%(p['id'], p['name'], p['profileType']))
else:
print(json.dumps(r, indent=4, sort_keys=True))
if cmd == "delete":
delid = base.command_line_args.object_id;
if delid.isdigit():
rv = base.cloud.delete_profile(base.cloudSDK_url, base.bearer, base.command_line_args.object_id)
print("Delete profile for customer %s, id: %s results:"%(base.customer_id, base.command_line_args.object_id))
print(rv.json())
else:
# Query object by name to find its ID
targets = get_profile(base.cloudSDK_url, base.bearer, base.customer_id, base.command_line_args.object_id)
for me in targets:
rv = base.cloud.delete_profile(base.cloudSDK_url, base.bearer, str(me['id']))
print("Delete profile for customer %s, id: %s results:"%(base.customer_id, base.command_line_args.object_id))
print(rv.json())
if cmd == "child_of":
targets = get_profile(base.cloudSDK_url, base.bearer, base.customer_id, base.command_line_args.object_id)
for me in targets:
meid = me['id']
print("Profiles using profile: %s %s"%(meid, me['name']))
# Get all profiles and search
rv = get_profile(base.cloudSDK_url, base.bearer, base.customer_id, None)
#jobj = json.load(ssids)
for r in rv:
for p in r['items']:
#print("profile: %s %s, checking children..."%(p['id'], p['name']))
if 'childProfileIds' in p:
for child in p['childProfileIds']:
#print("profile: %s %s, checking child: %s my-id: %s"%(p['id'], p['name'], child, meid))
if child == meid:
print("Used-By: %s %s"%(p['id'], p['name']))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read customer profiles")
if qtype == 'all' or qtype == 'customer':
try:
rv = base.cloud.get_customer(base.cloudSDK_url, base.bearer, base.customer_id)
print("Customer %s:"%(base.customer_id))
#jobj = json.load(ssids)
print(json.dumps(rv, indent=4, sort_keys=True))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Customer %i"%(customer_id))
if qtype == 'all' or qtype == 'ping':
try:
rv = base.cloud.ping(base.cloudSDK_url, base.bearer)
print("Cloud Ping %s:"%(base.cloudSDK_url))
#jobj = json.load(ssids)
print(json.dumps(rv, indent=4, sort_keys=True))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Cloud Ping %i"%(base.cloudSDK_url))
if qtype == 'all' or qtype == 'firmware':
try:
rv = base.cloud.CloudSDK_images(base.command_line_args.model, base.cloudSDK_url, base.bearer)
print("Firmware for model:", base.command_line_args.model)
#jobj = json.load(ssids)
print(json.dumps(rv, indent=4, sort_keys=True))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Firmware")
if qtype == 'all' or qtype == 'location':
# Get location info
try:
# NOTE: Could also use base.customer_id to get single one that user may have specified.
rv = base.cloud.get_customer_locations(base.cloudSDK_url, base.bearer, base.customer_id)
print("Locations for customer %s:"%(base.customer_id))
#jobj = json.load(ssids)
print(json.dumps(rv, indent=4, sort_keys=True))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Customer %s locations"%(base.customer_id))
if qtype == 'all' or qtype == 'equipment':
# Get equipment info
try:
if cmd == "get":
rv = base.cloud.get_customer_equipment(base.customer_id)
print("Equipment for customer %s:"%(base.customer_id))
#jobj = json.load(ssids)
for e in rv:
if brief:
for eq in e['items']:
print("Equipment id: %s inventoryId: %s profileId: %s type: %s"%(eq['id'], eq['inventoryId'], eq['profileId'], eq['equipmentType']))
else:
print(json.dumps(e, indent=4, sort_keys=True))
if cmd == "delete":
delid = base.command_line_args.object_id;
rv = base.cloud.delete_equipment(base.cloudSDK_url, base.bearer, base.command_line_args.object_id)
print("Delete Equipment, id: %s results:"%(base.command_line_args.object_id))
print(rv.json())
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Customer %s equipment"%(base.customer_id))
if qtype == 'all' or qtype == 'portalUser':
# Get portalUser info
try:
rv = base.cloud.get_customer_portal_users(base.cloudSDK_url, base.bearer, base.customer_id)
print("PortalUsers for customer %s:"%(base.customer_id))
#jobj = json.load(ssids)
for e in rv:
print(json.dumps(e, indent=4, sort_keys=True))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Customer %s portalUsers"%(base.customer_id))
if qtype == 'all' or qtype == 'status':
# Get status info
try:
rv = base.cloud.get_customer_status(base.cloudSDK_url, base.bearer, base.customer_id)
print("Status for customer %s:"%(base.customer_id))
#jobj = json.load(ssids)
for e in rv:
print(json.dumps(e, indent=4, sort_keys=True))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Customer %s status"%(base.customer_id))
if qtype == 'all' or qtype == 'client-sessions':
# Get client sessions info
try:
rv = base.cloud.get_customer_client_sessions(base.cloudSDK_url, base.bearer, base.customer_id)
print("Sessions for customer %s:"%(base.customer_id))
#jobj = json.load(ssids)
for e in rv:
print(json.dumps(e, indent=4, sort_keys=True))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Customer %s sessions"%(base.customer_id))
if qtype == 'all' or qtype == 'client-info':
# Get clients info
try:
rv = base.cloud.get_customer_clients(base.cloudSDK_url, base.bearer, base.customer_id)
print("Clients for customer %s:"%(base.customer_id))
#jobj = json.load(ssids)
for e in rv:
print(json.dumps(e, indent=4, sort_keys=True))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Customer %s clients"%(base.customer_id))
if qtype == 'all' or qtype == 'alarm':
# Get alarms info
try:
rv = base.cloud.get_customer_alarms(base.cloudSDK_url, base.bearer, base.customer_id)
print("Alarms for customer %s:"%(base.customer_id))
#jobj = json.load(ssids)
for e in rv:
print(json.dumps(e, indent=4, sort_keys=True))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Customer %s alarms"%(base.customer_id))
if qtype == 'all' or qtype == 'service-metric':
# Get service metrics
try:
fromTime = "0"
toTime = "%i"%(0xFFFFFFFFFFFF) # something past now, units are msec
rv = base.cloud.get_customer_service_metrics(base.cloudSDK_url, base.bearer, base.customer_id, fromTime, toTime)
print("Service Metrics for customer %s:"%(base.customer_id))
for e in rv:
#jobj = json.load(ssids)
print(json.dumps(e, indent=4, sort_keys=True))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Customer %s service metrics"%(base.customer_id))
if qtype == 'all' or qtype == 'event':
# Get system events
try:
fromTime = "0"
toTime = "%i"%(0xFFFFFFFFFFFF) # something past now, units are msec
rv = base.cloud.get_customer_system_events(base.cloudSDK_url, base.bearer, base.customer_id, fromTime, toTime)
#print("System Events for customer %s:"%(base.customer_id))
#jobj = json.load(ssids)
for e in rv:
print(json.dumps(e, indent=4, sort_keys=True))
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
print("Failed to read Customer %s system events"%(base.customer_id))

View File

@@ -1,219 +0,0 @@
#!/usr/bin/python3 -u
# Example to set profile on NOLA-12 testbed:
# ./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8823 --ap-jumphost-password pumpkin77 \
# --ap-jumphost-tty /dev/ttyAP1 --testbed "NOLA-12" --lanforge-ip-address localhost --lanforge-port-number 8822 \
# --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build --skip-radius
# Example to set profile on NOLA-01 testbed
# ./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 \
# --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed "NOLA-01" --lanforge-ip-address localhost \
# --lanforge-port-number 8802 --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build \
# --skip-radius
import sys
sys.path.append(f'../tests')
from UnitTestBase import *
from cloudsdk import CreateAPProfiles
def main():
parser = argparse.ArgumentParser(description="SDK Set Profile", add_help=False)
parser.add_argument("--default-ap-profile", type=str,
help="Default AP profile to use as basis for creating new ones, typically: TipWlan-2-Radios or TipWlan-3-Radios",
required=True)
parser.add_argument("--skip-radius", dest="skip_radius", action='store_true',
help="Should we skip the RADIUS configs or not", default=False)
parser.add_argument("--skip-wpa", dest="skip_wpa", action='store_true',
help="Should we skip the WPA ssid or not", default=False)
parser.add_argument("--skip-wpa2", dest="skip_wpa2", action='store_true',
help="Should we skip the WPA2 ssid or not", default=False)
parser.add_argument("--skip-profiles", dest="skip_profiles", action='store_true',
help="Should we skip creating new ssid profiles?", default=False)
parser.add_argument("--cleanup-profile", dest="cleanup_profile", action='store_true',
help="Should we clean up profiles after creating them?", default=False)
parser.add_argument("--psk-5g-wpa2", dest="psk_5g_wpa2", type=str,
help="Allow over-riding the 5g-wpa2 PSK value.")
parser.add_argument("--psk-5g-wpa", dest="psk_5g_wpa", type=str,
help="Allow over-riding the 5g-wpa PSK value.")
parser.add_argument("--psk-2g-wpa2", dest="psk_2g_wpa2", type=str,
help="Allow over-riding the 2g-wpa2 PSK value.")
parser.add_argument("--psk-2g-wpa", dest="psk_2g_wpa", type=str,
help="Allow over-riding the 2g-wpa PSK value.")
parser.add_argument("--ssid-5g-wpa2", dest="ssid_5g_wpa2", type=str,
help="Allow over-riding the 5g-wpa2 SSID value.")
parser.add_argument("--ssid-5g-wpa", dest="ssid_5g_wpa", type=str,
help="Allow over-riding the 5g-wpa SSID value.")
parser.add_argument("--ssid-2g-wpa2", dest="ssid_2g_wpa2", type=str,
help="Allow over-riding the 2g-wpa2 SSID value.")
parser.add_argument("--ssid-2g-wpa", dest="ssid_2g_wpa", type=str,
help="Allow over-riding the 2g-wpa SSID value.")
parser.add_argument("--mode", dest="mode", choices=['bridge', 'nat', 'vlan'], type=str,
help="Mode of AP Profile [bridge/nat/vlan]", required=True)
parser.add_argument("--sleep-after-profile", dest="sleep", type=int,
help="Enter the sleep interval delay in ms between each profile push. Default is 0", required=False, default=0)
# Not implemented yet.
#parser.add_argument("--rf-mode", type=str,
# choices=["modeN", "modeAC", "modeGN", "modeX", "modeA", "modeB", "modeG", "modeAB"],
# help="Allow over-riding the 2g-wpa SSID value.")
reporting = Reporting(reports_root=os.getcwd() + "/reports/")
base = UnitTestBase("skd-set-profile", parser)
command_line_args = base.command_line_args
print(command_line_args.mode)
# cmd line takes precedence over env-vars.
cloudSDK_url = command_line_args.sdk_base_url # was os.getenv('CLOUD_SDK_URL')
local_dir = command_line_args.local_dir # was os.getenv('SANITY_LOG_DIR')
report_path = command_line_args.report_path # was os.getenv('SANITY_REPORT_DIR')
report_template = command_line_args.report_template # was os.getenv('REPORT_TEMPLATE')
## TestRail Information
tr_user = command_line_args.testrail_user_id # was os.getenv('TR_USER')
tr_pw = command_line_args.testrail_user_password # was os.getenv('TR_PWD')
milestoneId = command_line_args.milestone # was os.getenv('MILESTONE')
projectId = command_line_args.testrail_project # was os.getenv('PROJECT_ID')
testRunPrefix = command_line_args.testrail_run_prefix # os.getenv('TEST_RUN_PREFIX')
##Jfrog credentials
jfrog_user = command_line_args.jfrog_user_id # was os.getenv('JFROG_USER')
jfrog_pwd = command_line_args.jfrog_user_password # was os.getenv('JFROG_PWD')
##EAP Credentials
identity = command_line_args.eap_id # was os.getenv('EAP_IDENTITY')
ttls_password = command_line_args.ttls_password # was os.getenv('EAP_PWD')
## AP Credentials
ap_username = command_line_args.ap_username # was os.getenv('AP_USER')
##LANForge Information
lanforge_ip = command_line_args.lanforge_ip_address
lanforge_port = command_line_args.lanforge_port_number
lanforge_prefix = command_line_args.lanforge_prefix
build = command_line_args.build_id
logger = base.logger
hdlr = base.hdlr
if command_line_args.testbed == None:
print("ERROR: Must specify --testbed argument for this test.")
sys.exit(1)
client: TestRail_Client = TestRail_Client(command_line_args)
###Get Cloud Bearer Token
cloud: CloudSDK = CloudSDK(command_line_args)
bearer = cloud.get_bearer(cloudSDK_url, cloud_type)
cloud.assert_bad_response = True
model_id = command_line_args.model
equipment_id = command_line_args.equipment_id
print("equipment-id: %s" % (equipment_id))
if equipment_id == "-1":
eq_id = ap_ssh_ovsh_nodec(command_line_args, 'id')
print("EQ Id: %s" % (eq_id))
# Now, query equipment to find something that matches.
eq = cloud.get_customer_equipment(customer_id)
for item in eq:
for e in item['items']:
print(e['id'], " ", e['inventoryId'])
if e['inventoryId'].endswith("_%s" % (eq_id)):
print("Found equipment ID: %s inventoryId: %s" % (e['id'], e['inventoryId']))
equipment_id = str(e['id'])
if equipment_id == "-1":
print("ERROR: Could not find equipment-id.")
sys.exit(1)
###Get Current AP Firmware and upgrade
try:
ap_cli_info = ssh_cli_active_fw(command_line_args)
ap_cli_fw = ap_cli_info['active_fw']
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
ap_cli_info = "ERROR"
print("FAILED: Cannot Reach AP CLI.");
sys.exit(1)
fw_model = ap_cli_fw.partition("-")[0]
print('Current Active AP FW from CLI:', ap_cli_fw)
# Create Report Folder for Today
today = str(date.today())
try:
os.mkdir(report_path + today)
except OSError:
print("Creation of the directory %s failed" % report_path)
else:
print("Successfully created the directory %s " % report_path)
logger.info('Report data can be found here: ' + report_path + today)
# Get Bearer Token to make sure its valid (long tests can require re-auth)
bearer = cloud.get_bearer(cloudSDK_url, cloud_type)
radius_name = "%s-%s-%s" % (command_line_args.testbed, fw_model, "Radius")
sleep = command_line_args.sleep
sleep = sleep/1000
args = command_line_args
print("Profiles Created")
ap_object = CreateAPProfiles(args, cloud=cloud, client=client, fw_model=fw_model, sleep=sleep)
# Logic to create AP Profiles (Bridge Mode)
ap_object.set_ssid_psk_data(ssid_2g_wpa=args.ssid_2g_wpa,
ssid_5g_wpa=args.ssid_5g_wpa,
psk_2g_wpa=args.psk_2g_wpa,
psk_5g_wpa=args.psk_5g_wpa,
ssid_2g_wpa2=args.ssid_2g_wpa2,
ssid_5g_wpa2=args.ssid_5g_wpa2,
psk_2g_wpa2=args.psk_2g_wpa2,
psk_5g_wpa2=args.psk_5g_wpa2)
print(ap_object)
rid = client.get_run_id(test_run_name=args.testrail_run_prefix + fw_model + "_" + today + "_" + "ecw5410-2021-02-12-pending-e8bb466")
print("creating Profiles")
ssid_template = "TipWlan-Cloud-Wifi"
if not args.skip_profiles:
if not args.skip_radius:
# Radius Profile needs to be set here
radius_name = "Test-Radius-" + str(time.time()).split(".")[0]
radius_template = "templates/radius_profile_template.json"
ap_object.create_radius_profile(radius_name=radius_name, radius_template=radius_template, rid=rid, key=fw_model)
ap_object.create_ssid_profiles(ssid_template=ssid_template, skip_eap=args.skip_radius, skip_wpa=args.skip_wpa,
skip_wpa2=args.skip_wpa2, mode=args.mode)
print("Create AP with equipment-id: ", equipment_id)
time.sleep(sleep)
ap_object.create_ap_profile(eq_id=equipment_id, fw_model=fw_model, mode=args.mode)
ap_object.validate_changes(mode=args.mode)
if args.cleanup_profile:
time.sleep(5)
print("Removing profile...")
ap_object.cleanup_profile(equipment_id=equipment_id)
print("Profiles Created")
main()

View File

@@ -1,183 +0,0 @@
#!/usr/bin/python3 -u
# Example to upgrade firmware on NOLA-12 testbed:
"""
./sdk_upgrade_fw.py --testrail-user-id NONE --model wf188n --ap-jumphost-address localhost --ap-jumphost-port 8823 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed \"NOLA-12\" \
--sdk-base-url https://wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build --force-upgrade true
# Use specified firmware image, not just the latest.
./sdk_upgrade_fw.py --testrail-user-id NONE --model wf188n --ap-jumphost-address localhost --ap-jumphost-port 8823 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed \"NOLA-12\" \
--sdk-base-url https://wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build --ap-image wf188n-2021-02-01-pending-686c4df --verbose
# Example to upgrade fw on NOLA-01 testbed
./sdk_upgrade_fw.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 \
--ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed \"NOLA-01\" \
--sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build --verbose
"""
import sys
sys.path.append(f'../tests')
from UnitTestBase import *
from JfrogHelper import *
from cloudsdk import CreateAPProfiles
parser = argparse.ArgumentParser(description="SDK Upgrade Firmware", add_help=False)
parser.add_argument("--ap-image", type=str,
help="Specify an AP image to install. Will use latest found on jfrog if this is not specified.",
default=None)
base = UnitTestBase("sdk-upgrade-fw", parser)
command_line_args = base.command_line_args
# cmd line takes precedence over env-vars.
cloudSDK_url = command_line_args.sdk_base_url # was os.getenv('CLOUD_SDK_URL')
local_dir = command_line_args.local_dir # was os.getenv('SANITY_LOG_DIR')
report_path = command_line_args.report_path # was os.getenv('SANITY_REPORT_DIR')
report_template = command_line_args.report_template # was os.getenv('REPORT_TEMPLATE')
## TestRail Information
tr_user = command_line_args.testrail_user_id # was os.getenv('TR_USER')
tr_pw = command_line_args.testrail_user_password # was os.getenv('TR_PWD')
milestoneId = command_line_args.milestone # was os.getenv('MILESTONE')
projectId = command_line_args.testrail_project # was os.getenv('PROJECT_ID')
testRunPrefix = command_line_args.testrail_run_prefix # os.getenv('TEST_RUN_PREFIX')
##Jfrog credentials
jfrog_user = command_line_args.jfrog_user_id # was os.getenv('JFROG_USER')
jfrog_pwd = command_line_args.jfrog_user_password # was os.getenv('JFROG_PWD')
##EAP Credentials
identity = command_line_args.eap_id # was os.getenv('EAP_IDENTITY')
ttls_password = command_line_args.ttls_password # was os.getenv('EAP_PWD')
## AP Credentials
ap_username = command_line_args.ap_username # was os.getenv('AP_USER')
##LANForge Information
lanforge_ip = command_line_args.lanforge_ip_address
lanforge_port = command_line_args.lanforge_port_number
lanforge_prefix = command_line_args.lanforge_prefix
build = command_line_args.build_id
logger = base.logger
hdlr = base.hdlr
client: TestRail_Client = TestRail_Client(command_line_args)
rid = 0 # testrails run-id, not actually supported at the moment.
###Get Cloud Bearer Token
cloud: CloudSDK = CloudSDK(command_line_args)
bearer = cloud.get_bearer(cloudSDK_url, cloud_type)
cloud.assert_bad_response = True
model_id = command_line_args.model
equipment_id = command_line_args.equipment_id
print("equipment-id: %s"%(equipment_id))
if equipment_id == "-1":
eq_id = ap_ssh_ovsh_nodec(command_line_args, 'id')
print("EQ Id: %s"%(eq_id))
# Now, query equipment to find something that matches.
eq = cloud.get_customer_equipment(customer_id)
for item in eq:
for e in item['items']:
print(e['id'], " ", e['inventoryId'])
if e['inventoryId'].endswith("_%s"%(eq_id)):
print("Found equipment ID: %s inventoryId: %s"%(e['id'], e['inventoryId']))
equipment_id = str(e['id'])
if equipment_id == "-1":
print("ERROR: Could not find equipment-id.")
sys.exit(1)
###Get Current AP Firmware and upgrade
try:
ap_cli_info = ssh_cli_active_fw(command_line_args)
ap_cli_fw = ap_cli_info['active_fw']
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
ap_cli_info = "ERROR"
print("FAILED: Cannot Reach AP CLI.");
sys.exit(1)
fw_model = ap_cli_fw.partition("-")[0]
print('Current Active AP FW from CLI:', ap_cli_fw)
############################################################################
#################### Create Report #########################################
############################################################################
# Create Report Folder for Today
today = str(date.today())
try:
os.mkdir(report_path + today)
except OSError:
print("Creation of the directory %s failed" % report_path)
else:
print("Successfully created the directory %s " % report_path)
logger.info('Report data can be found here: ' + report_path + today)
###Dictionaries
ap_image = command_line_args.ap_image
############################################################################
#################### Jfrog Firmware Check ##################################
############################################################################
apModel = model_id
cloudModel = cloud_sdk_models[apModel]
build = command_line_args.build_id # ie, pending
if not ap_image:
# then get latest from jfrog
Build: GetBuild = GetBuild(jfrog_user, jfrog_pwd, build)
ap_image = Build.get_latest_image(apModel)
##Get Bearer Token to make sure its valid (long tests can require re-auth)
bearer = cloud.get_bearer(cloudSDK_url, cloud_type)
print("AP MODEL UNDER TEST IS", model_id)
try:
ap_cli_info = ssh_cli_active_fw(command_line_args)
ap_cli_fw = ap_cli_info['active_fw']
except Exception as ex:
print(ex)
logging.error(logging.traceback.format_exc())
ap_cli_info = "ERROR"
print("Cannot Reach AP CLI, will not test this variant");
sys.exit(1)
fw_model = ap_cli_fw.partition("-")[0]
print('Current Active AP FW from CLI:', ap_cli_fw)
###Find Latest FW for Current AP Model and Get FW ID
##Compare Latest and Current AP FW and Upgrade
report_data = None
key = None # model name I think, if we are doing reporting?
do_upgrade = cloud.should_upgrade_ap_fw(command_line_args.force_upgrade, command_line_args.skip_upgrade,
report_data, ap_image, fw_model, ap_cli_fw, logger, key)
cloudModel = cloud_sdk_models[model_id]
pf = cloud.do_upgrade_ap_fw(command_line_args, report_data, test_cases, client,
ap_image, cloudModel, model_id, jfrog_user, jfrog_pwd, rid,
customer_id, equipment_id, logger)
if pf:
sys.exit(0)
sys.exit(1)