mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-01 03:17:54 +00:00
dataplane test reporting updated: integrated pdf with allure
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
@@ -31,7 +31,7 @@ from lf_dataplane_test import DataplaneTest
|
||||
|
||||
class RunTest:
|
||||
|
||||
def __init__(self, lanforge_data=None, debug=False):
|
||||
def __init__(self, lanforge_data=None, local_report_path="../reports/", debug=False):
|
||||
self.lanforge_ip = lanforge_data["ip"]
|
||||
self.lanforge_port = lanforge_data["port"]
|
||||
self.twog_radios = lanforge_data["2.4G-Radio"]
|
||||
@@ -42,10 +42,15 @@ class RunTest:
|
||||
self.fiveg_prefix = lanforge_data["5G-Station-Name"]
|
||||
self.ax_prefix = lanforge_data["AX-Station-Name"]
|
||||
self.debug = debug
|
||||
self.lf_ssh_port = lanforge_data["ssh_port"]
|
||||
self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=debug)
|
||||
self.dataplane_obj = None
|
||||
self.local_report_path = local_report_path
|
||||
if not os.path.exists(self.local_report_path):
|
||||
os.mkdir(self.local_report_path)
|
||||
|
||||
def Client_Connectivity(self, ssid="[BLANK]", passkey="[BLANK]", security="open", extra_securities=[], station_name=[],
|
||||
def Client_Connectivity(self, ssid="[BLANK]", passkey="[BLANK]", security="open", extra_securities=[],
|
||||
station_name=[],
|
||||
mode="BRIDGE", vlan_id=1, band="twog"):
|
||||
'''SINGLE CLIENT CONNECTIVITY using test_connect2.py'''
|
||||
self.staConnect.sta_mode = 0
|
||||
@@ -175,9 +180,8 @@ class RunTest:
|
||||
self.client_dis.station_profile.cleanup(station_name)
|
||||
return True
|
||||
|
||||
def dataplane(self, station_name=None, mode="BRIDGE", vlan_id=100, download_rate="85%", dut_name="TIP",
|
||||
def dataplane(self, station_name=None, mode="BRIDGE", vlan_id=100, download_rate="85%", dut_name="TIP",
|
||||
upload_rate="85%", duration="1m", instance_name="test_demo"):
|
||||
print(station_name)
|
||||
if mode == "BRIDGE":
|
||||
self.client_connect.upstream_port = self.upstream_port
|
||||
elif mode == "NAT":
|
||||
@@ -186,27 +190,29 @@ class RunTest:
|
||||
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
|
||||
self.dataplane_obj = DataplaneTest(lf_host=self.lanforge_ip,
|
||||
lf_port=self.lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name=instance_name,
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + self.upstream_port,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed=download_rate,
|
||||
upload_speed=upload_rate,
|
||||
duration=duration,
|
||||
dut=dut_name,
|
||||
station="1.1." + station_name[0],
|
||||
raw_lines=['pkts: Custom;60;142;256;512;1024;MTU',
|
||||
'directions: DUT Transmit;DUT Receive',
|
||||
'traffic_types: UDP;TCP', "show_3s: 1",
|
||||
"show_ll_graphs: 1","show_log: 1"],
|
||||
)
|
||||
lf_port=self.lanforge_port,
|
||||
ssh_port=self.lf_ssh_port,
|
||||
local_path=self.local_report_path,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name=instance_name,
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + self.upstream_port,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed=download_rate,
|
||||
upload_speed=upload_rate,
|
||||
duration=duration,
|
||||
dut=dut_name,
|
||||
station="1.1." + station_name[0],
|
||||
raw_lines=['pkts: Custom;60;142;256;512;1024;MTU',
|
||||
'directions: DUT Transmit;DUT Receive',
|
||||
'traffic_types: UDP;TCP', "show_3s: 1",
|
||||
"show_ll_graphs: 1", "show_log: 1"],
|
||||
)
|
||||
self.dataplane_obj.setup()
|
||||
self.dataplane_obj.run()
|
||||
return True
|
||||
return self.dataplane_obj
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
@@ -216,11 +222,11 @@ if __name__ == '__main__':
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "eth1",
|
||||
"upstream": "1.1.eth1",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
obj = RunTest(lanforge_data=lanforge_data, debug=False)
|
||||
# print(obj.eap_connect.json_get("port/1/1/sta0000?fields=ap,ip"))
|
||||
obj.EAP_Connect(station_name=["sta0000", "sta0001"], eap="TTLS", ssid="testing_radius")
|
||||
# obj.EAP_Connect(station_name=["sta0000", "sta0001"], eap="TTLS", ssid="testing_radius")
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# import files in the current directory
|
||||
"""
|
||||
Pytest fixtures: High level Resource Management and base setup fixtures
|
||||
"""
|
||||
import datetime
|
||||
import sys
|
||||
import os
|
||||
@@ -27,10 +29,8 @@ if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
from apnos.apnos import APNOS
|
||||
from controller.controller import Controller
|
||||
from controller.controller import ProfileUtility
|
||||
from controller.controller import FirmwareUtility
|
||||
import pytest
|
||||
import logging
|
||||
from cv_test_manager import cv_test
|
||||
from configuration import CONFIGURATION
|
||||
from configuration import RADIUS_SERVER_DATA
|
||||
@@ -42,6 +42,7 @@ from sta_connect2 import StaConnect2
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
"""pytest addoption function: contains ini objects and options"""
|
||||
parser.addini("tr_url", "Test Rail URL")
|
||||
parser.addini("tr_prefix", "Test Rail Prefix (Generally Testbed_name_)")
|
||||
parser.addini("tr_user", "Testrail Username")
|
||||
@@ -133,11 +134,13 @@ Test session base fixture
|
||||
# To be depreciated as testrails will go
|
||||
@pytest.fixture(scope="session")
|
||||
def test_cases():
|
||||
"""Yields the test cases from configuration.py: will be depreciated"""
|
||||
yield TEST_CASES
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def testbed(request):
|
||||
"""yields the testbed option selection"""
|
||||
var = request.config.getoption("--testbed")
|
||||
allure.attach(body=str(var),
|
||||
name="Testbed Selected : ")
|
||||
@@ -146,40 +149,45 @@ def testbed(request):
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def should_upload_firmware(request):
|
||||
"""yields the --force-upload option for firmware upload selection"""
|
||||
yield request.config.getoption("--force-upload")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def should_upgrade_firmware(request):
|
||||
"""yields the --force-upgrade option for firmware upgrade selection"""
|
||||
yield request.config.getoption("--force-upgrade")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def exit_on_fail(request):
|
||||
"""yields the --exit-on-fail option for exiting the test case if it fails without teardown"""
|
||||
yield request.config.getoption("--exit-on-fail")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def radius_info():
|
||||
"""yields the radius server information from lab info file"""
|
||||
allure.attach(body=str(RADIUS_SERVER_DATA), name="Radius server Info: ")
|
||||
yield RADIUS_SERVER_DATA
|
||||
|
||||
|
||||
# Get Configuration data f
|
||||
@pytest.fixture(scope="session")
|
||||
def get_configuration(testbed):
|
||||
"""yields the selected testbed information from lab info file (configuration.py)"""
|
||||
allure.attach(body=str(testbed), name="Testbed Selected: ")
|
||||
yield CONFIGURATION[testbed]
|
||||
|
||||
|
||||
# APNOS Library
|
||||
@pytest.fixture(scope="session")
|
||||
def get_apnos():
|
||||
"""yields the LIBRARY for APNOS, Reduces the use of imports across files"""
|
||||
yield APNOS
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_equipment_id(setup_controller, testbed, get_configuration):
|
||||
"""yields the equipment-id of the AP by checking the serial number"""
|
||||
equipment_id_list = []
|
||||
for i in get_configuration['access_point']:
|
||||
equipment_id_list.append(setup_controller.get_equipment_id(
|
||||
@@ -187,10 +195,9 @@ def get_equipment_id(setup_controller, testbed, get_configuration):
|
||||
yield equipment_id_list
|
||||
|
||||
|
||||
# APNOS SETUP
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_access_point(testbed, get_apnos, get_configuration):
|
||||
# Used to add openwrtctl.py in case of serial console mode
|
||||
"""setup the access point connectivity"""
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
if access_point_info["jumphost"]:
|
||||
allure.attach(name="added openwrtctl.py to :",
|
||||
@@ -206,6 +213,7 @@ def instantiate_access_point(testbed, get_apnos, get_configuration):
|
||||
# Controller Fixture
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_controller(request, get_configuration, instantiate_access_point):
|
||||
"""sets up the controller connection and yields the sdk_client object"""
|
||||
try:
|
||||
sdk_client = Controller(controller_data=get_configuration["controller"])
|
||||
allure.attach(body=str(get_configuration["controller"]), name="Controller Instantiated: ")
|
||||
@@ -225,6 +233,7 @@ def setup_controller(request, get_configuration, instantiate_access_point):
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_firmware(setup_controller, get_configuration):
|
||||
"""sets up firmware utility and yields the object for firmware upgrade"""
|
||||
firmware_client_obj = []
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
firmware_client = FirmwareUtility(sdk_client=setup_controller,
|
||||
@@ -236,6 +245,7 @@ def instantiate_firmware(setup_controller, get_configuration):
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_latest_firmware(instantiate_firmware):
|
||||
"""yields the list of firmware version"""
|
||||
fw_version_list = []
|
||||
try:
|
||||
|
||||
@@ -252,6 +262,7 @@ def get_latest_firmware(instantiate_firmware):
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def upload_firmware(should_upload_firmware, instantiate_firmware):
|
||||
"""yields the firmware_id that is uploaded to cloud"""
|
||||
firmware_id_list = []
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
firmware_id = instantiate_firmware[i].upload_fw_on_cloud(force_upload=should_upload_firmware)
|
||||
@@ -262,6 +273,7 @@ def upload_firmware(should_upload_firmware, instantiate_firmware):
|
||||
@pytest.fixture(scope="session")
|
||||
def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware,
|
||||
should_upgrade_firmware):
|
||||
"""yields the status of upgrade of firmware. waits for 300 sec after each upgrade request"""
|
||||
status_list = []
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
if request.config.getoption("--skip-upgrade"):
|
||||
@@ -287,6 +299,7 @@ def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_f
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_cloud(setup_controller, get_equipment_id):
|
||||
"""yields the active version of firmware on cloud"""
|
||||
ap_fw_list = []
|
||||
for i in get_equipment_id:
|
||||
ap_fw_list.append(setup_controller.get_ap_firmware_old_method(equipment_id=i))
|
||||
@@ -295,6 +308,7 @@ def check_ap_firmware_cloud(setup_controller, get_equipment_id):
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_ssh(get_configuration):
|
||||
"""yields the active version of firmware on ap"""
|
||||
active_fw_list = []
|
||||
try:
|
||||
for access_point in get_configuration['access_point']:
|
||||
@@ -309,6 +323,7 @@ def check_ap_firmware_ssh(get_configuration):
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_test_run(setup_controller, upgrade_firmware, check_ap_firmware_cloud, check_ap_firmware_ssh):
|
||||
"""used to upgrade the firmware on AP and should be called on each test case on a module level"""
|
||||
if check_ap_firmware_ssh == check_ap_firmware_cloud:
|
||||
yield True
|
||||
else:
|
||||
@@ -322,6 +337,7 @@ Instantiate Reporting
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def update_report(request, testbed, get_configuration):
|
||||
"""used to update the test report on testrail/allure"""
|
||||
if request.config.getoption("--skip-testrail"):
|
||||
tr_client = Reporting()
|
||||
else:
|
||||
@@ -348,6 +364,7 @@ FRAMEWORK MARKER LOGIC
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_security_flags():
|
||||
"""used to get the essential markers on security and band"""
|
||||
# Add more classifications as we go
|
||||
security = ["open", "wpa", "wep", "wpa2_personal", "wpa3_personal", "wpa3_personal_mixed",
|
||||
"wpa_wpa2_enterprise_mixed",
|
||||
@@ -358,6 +375,7 @@ def get_security_flags():
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_markers(request, get_security_flags):
|
||||
"""used to get the markers on the selected test case class, used in setup_profiles"""
|
||||
session = request.node
|
||||
markers = list()
|
||||
security = get_security_flags
|
||||
@@ -379,6 +397,7 @@ def get_markers(request, get_security_flags):
|
||||
# Will be availabe as a test case
|
||||
@pytest.fixture(scope="function")
|
||||
def test_access_point(testbed, get_apnos, get_configuration):
|
||||
"""used to check the manager status of AP, should be used as a setup to verify if ap can reach cloud"""
|
||||
mgr_status = []
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(access_point_info)
|
||||
@@ -391,13 +410,10 @@ def test_access_point(testbed, get_apnos, get_configuration):
|
||||
yield mgr_status
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def client_connectivity():
|
||||
yield StaConnect2
|
||||
|
||||
|
||||
# Not used anymore, needs to depreciate it
|
||||
@pytest.fixture(scope="session")
|
||||
def get_lanforge_data(get_configuration):
|
||||
"""depreciate it"""
|
||||
lanforge_data = {}
|
||||
if get_configuration['traffic_generator']['name'] == 'lanforge':
|
||||
lanforge_data = {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
@@ -6,11 +8,6 @@ pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, py
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
@@ -31,9 +28,44 @@ setup_params_general = {
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDataplaneThroughputBridge(object):
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
get_configuration):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, setup_profiles, lf_test, station_names_fiveg, create_lanforge_chamberview_dut):
|
||||
def test_client_wpa2_personal_5g(self, lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
@@ -47,11 +79,19 @@ class TestDataplaneThroughputBridge(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/"+report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf, name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
@@ -6,11 +7,6 @@ pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, py
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
@@ -31,9 +27,45 @@ setup_params_general = {
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDataplaneThroughputNAT(object):
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, setup_profiles, lf_test, station_names_twog, get_configuration,
|
||||
create_lanforge_chamberview_dut):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, setup_profiles, lf_test, station_names_fiveg, create_lanforge_chamberview_dut):
|
||||
def test_client_wpa2_personal_5g(self, setup_profiles, lf_test, station_names_fiveg, get_configuration,
|
||||
create_lanforge_chamberview_dut):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
@@ -47,11 +79,20 @@ class TestDataplaneThroughputNAT(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
@@ -6,11 +8,6 @@ pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, py
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
@@ -21,6 +18,7 @@ setup_params_general = {
|
||||
|
||||
|
||||
@pytest.mark.basic
|
||||
@pytest.mark.shivam
|
||||
@allure.feature("VLAN MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
@@ -31,9 +29,45 @@ setup_params_general = {
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDataplaneThroughputVLAN(object):
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, setup_profiles, lf_test, station_names_twog, get_configuration,
|
||||
create_lanforge_chamberview_dut):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, setup_profiles, lf_test, station_names_fiveg, create_lanforge_chamberview_dut):
|
||||
def test_client_wpa2_personal_5g(self, setup_profiles, lf_test, station_names_fiveg, get_configuration,
|
||||
create_lanforge_chamberview_dut):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
@@ -47,8 +81,18 @@ class TestDataplaneThroughputVLAN(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
assert station
|
||||
|
||||
@@ -10,10 +10,12 @@ pytestmark = [pytest.mark.usefixtures("setup_test_run"), pytest.mark.test_resour
|
||||
|
||||
@allure.testcase(name="Test Resources", url="")
|
||||
class TestResources(object):
|
||||
"""Test Case Class: Test cases to cover resource Connectivity"""
|
||||
|
||||
@pytest.mark.test_cloud_controller
|
||||
@allure.testcase(name="test_controller_connectivity", url="")
|
||||
def test_controller_connectivity(self, setup_controller, update_report, test_cases):
|
||||
"""Test case to verify cloud Controller Connectivity"""
|
||||
if setup_controller.bearer:
|
||||
allure.attach(name="Controller Connectivity Success", body="")
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
@@ -28,6 +30,7 @@ class TestResources(object):
|
||||
@pytest.mark.test_access_points_connectivity
|
||||
@allure.testcase(name="test_access_points_connectivity", url="")
|
||||
def test_access_points_connectivity(self, test_access_point, update_report, test_cases):
|
||||
"""Test case to verify Access Points Connectivity"""
|
||||
flag = True
|
||||
for i in test_access_point:
|
||||
if "ACTIVE" not in i:
|
||||
@@ -50,7 +53,7 @@ class TestResources(object):
|
||||
@pytest.mark.traffic_generator_connectivity
|
||||
@allure.testcase(name="test_traffic_generator_connectivity", url="")
|
||||
def test_traffic_generator_connectivity(self, traffic_generator_connectivity, update_report, test_cases):
|
||||
|
||||
"""Test case to verify Traffic Generator Connectivity"""
|
||||
if traffic_generator_connectivity is False:
|
||||
allure.attach(name="Access Point Connectivity Success", body=str(traffic_generator_connectivity))
|
||||
update_report.update_testrail(case_id=test_cases["cloud_connection"],
|
||||
@@ -65,4 +68,3 @@ class TestResources(object):
|
||||
msg='Manager status is Active')
|
||||
|
||||
assert traffic_generator_connectivity
|
||||
|
||||
|
||||
Reference in New Issue
Block a user