mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-01 19:37:54 +00:00
* WIFI-6052: Initial commit to allow use to run test cases from static ssid configured in AP mentioned in configuration.py Signed-off-by: shivamcandela <shivam.thakur@candelatech.com> * WIFI-6052 Adjusted the test cases to run with lf only Signed-off-by: shivamcandela <shivam.thakur@candelatech.com> * Added the error fix happened due to merge conflict resolution Signed-off-by: shivam <shivam.thakur@candelatech.com> * fixed advanced tests to support lf only Signed-off-by: shivam <shivam.thakur@candelatech.com> * added run_lf to create lanforge chamberview dut Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * added run_lf to setup profiles Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * removed chamber view dut from all function Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * changed bps to Mbps in lf_tools function - read_csv_individual_station_throughput Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * added test procedure and pass fail to report Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * added attach station data to allure function Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * added Non-mesh functionality Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * added 2g roam test Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * added definition, procedure and pass fail criteria for all test cases Signed-off-by: jitendracandela <jitendra.kushavah@candelatech.com> * attach_station data to allure and wait for ip Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * station data query and non mesh configuration Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * comments to all testcases Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * adding attenuator data to allure attach Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * added 5g test case Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * resolved merge conflicts Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * added run-lf to lf_test fixture Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * remove xy file Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> * remove reg marker Signed-off-by: Nikita Yadav <nikita.yadav@candelatech.com> Co-authored-by: Nikita Yadav <nikita.yadav@candelatech.com> Co-authored-by: jitendracandela <jitendra.kushavah@candelatech.com>
146 lines
4.8 KiB
Python
146 lines
4.8 KiB
Python
import json
|
|
import os
|
|
import sys
|
|
|
|
sys.path.append(
|
|
os.path.dirname(
|
|
os.path.realpath(__file__)
|
|
)
|
|
)
|
|
if "libs" not in sys.path:
|
|
sys.path.append(f'../libs')
|
|
|
|
from controller.controller_1x.controller import ProfileUtility
|
|
from controller.controller_2x.controller import UProfileUtility
|
|
import time
|
|
from lanforge.lf_tools import ChamberView
|
|
import pytest
|
|
import allure
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def instantiate_profile(request):
|
|
if request.config.getoption("1.x"):
|
|
yield ProfileUtility
|
|
else:
|
|
yield UProfileUtility
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def create_lanforge_chamberview(lf_tools):
|
|
scenario_object, scenario_name = lf_tools.Chamber_View()
|
|
return scenario_name
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def create_lanforge_chamberview_dut(lf_tools, run_lf):
|
|
if not run_lf:
|
|
dut_object, dut_name = lf_tools.Create_Dut()
|
|
return dut_name
|
|
return ""
|
|
|
|
|
|
@pytest.fixture(scope="class")
|
|
def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtures_ver, reset_scenario_lf,
|
|
instantiate_profile, get_markers, create_lanforge_chamberview_dut, lf_tools, run_lf,
|
|
get_security_flags, get_configuration, radius_info, get_apnos, radius_accounting_info):
|
|
param = dict(request.param)
|
|
|
|
# VLAN Setup
|
|
if request.param["mode"] == "VLAN":
|
|
|
|
vlan_list = list()
|
|
refactored_vlan_list = list()
|
|
ssid_modes = request.param["ssid_modes"].keys()
|
|
for mode in ssid_modes:
|
|
for ssid in range(len(request.param["ssid_modes"][mode])):
|
|
if "vlan" in request.param["ssid_modes"][mode][ssid]:
|
|
vlan_list.append(request.param["ssid_modes"][mode][ssid]["vlan"])
|
|
else:
|
|
pass
|
|
if vlan_list:
|
|
[refactored_vlan_list.append(x) for x in vlan_list if x not in refactored_vlan_list]
|
|
vlan_list = refactored_vlan_list
|
|
for i in range(len(vlan_list)):
|
|
if vlan_list[i] > 4095 or vlan_list[i] < 1:
|
|
vlan_list.pop(i)
|
|
if request.param["mode"] == "VLAN":
|
|
lf_tools.reset_scenario()
|
|
lf_tools.add_vlan(vlan_ids=vlan_list)
|
|
|
|
# call this, if 1.x
|
|
return_var = fixtures_ver.setup_profiles(request, param, setup_controller, testbed, get_equipment_ref,
|
|
instantiate_profile,
|
|
get_markers, create_lanforge_chamberview_dut, lf_tools,
|
|
get_security_flags, get_configuration, radius_info, get_apnos,
|
|
radius_accounting_info, run_lf=run_lf)
|
|
|
|
yield return_var
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def station_names_twog(request, get_configuration):
|
|
station_names = []
|
|
for i in range(0, int(request.config.getini("num_stations"))):
|
|
station_names.append(get_configuration["traffic_generator"]["details"]["2.4G-Station-Name"] + "0" + str(i))
|
|
yield station_names
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def station_names_fiveg(request, get_configuration):
|
|
station_names = []
|
|
for i in range(0, int(request.config.getini("num_stations"))):
|
|
station_names.append(get_configuration["traffic_generator"]["details"]["5G-Station-Name"] + "0" + str(i))
|
|
yield station_names
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def station_names_ax(request, get_configuration):
|
|
station_names = []
|
|
for i in range(0, int(request.config.getini("num_stations"))):
|
|
station_names.append(get_configuration["traffic_generator"]["details"]["AX-Station-Name"] + "0" + str(i))
|
|
yield station_names
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def num_stations(request):
|
|
num_sta = int(request.config.getini("num_stations"))
|
|
yield num_sta
|
|
|
|
|
|
@pytest.fixture(scope="class")
|
|
def get_vif_state(get_apnos, get_configuration, request, lf_tools, run_lf):
|
|
if request.config.getoption("1.x"):
|
|
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/", sdk="1.x")
|
|
vif_state = list(ap_ssh.get_vif_state_ssids())
|
|
vif_state.sort()
|
|
yield vif_state
|
|
else:
|
|
yield lf_tools.ssid_list
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def dfs_start(fixtures_ver, get_apnos, get_configuration):
|
|
dfs_start = fixtures_ver.dfs(get_apnos, get_configuration)
|
|
yield dfs_start
|
|
|
|
|
|
@pytest.fixture(scope="class")
|
|
def get_vlan_list(get_apnos, get_configuration):
|
|
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
|
|
vlan_list = list(ap_ssh.get_vlan())
|
|
vlan_list.sort()
|
|
yield vlan_list
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def reset_scenario_lf(request, lf_tools, run_lf):
|
|
if not run_lf:
|
|
lf_tools.reset_scenario()
|
|
def teardown_session():
|
|
lf_tools.reset_scenario()
|
|
|
|
request.addfinalizer(teardown_session)
|
|
yield ""
|
|
|