mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 03:48:09 +00:00
Sanity fixes
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
@@ -282,10 +282,10 @@ class RunTest:
|
||||
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"],
|
||||
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()
|
||||
|
||||
@@ -25,10 +25,10 @@ CONFIGURATION = {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "localhost", # localhost,
|
||||
"port": 8802, # 8802,
|
||||
"ssh_port": 8804,
|
||||
"2.4G-Radio": ["wiphy4"],
|
||||
"5G-Radio": ["wiphy5"],
|
||||
"port": 8801, # 8802,
|
||||
"ssh_port": 8802,
|
||||
"2.4G-Radio": ["wiphy0", "wiphy4"],
|
||||
"5G-Radio": ["wiphy0", "wiphy5"],
|
||||
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
|
||||
"upstream": "1.1.eth2",
|
||||
"upstream_subnet": "10.28.2.1/24",
|
||||
@@ -67,8 +67,8 @@ CONFIGURATION = {
|
||||
"ip": "localhost",
|
||||
"port": 8801,
|
||||
"ssh_port": 8802,
|
||||
"2.4G-Radio": ["wiphy4"],
|
||||
"5G-Radio": ["wiphy5"],
|
||||
"2.4G-Radio": ["wiphy0", "wiphy4"],
|
||||
"5G-Radio": ["wiphy0", "wiphy5"],
|
||||
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
|
||||
"upstream": "1.1.eth2",
|
||||
"upstream_subnet": "10.28.2.1/24",
|
||||
|
||||
@@ -7,9 +7,10 @@ import os
|
||||
import time
|
||||
import allure
|
||||
import logging
|
||||
|
||||
if "logs" not in os.listdir():
|
||||
os.mkdir("logs/")
|
||||
logging.basicConfig(level=logging.INFO, filename="logs/"+'{:%Y-%m-%d-%H-%M-%S}.log'.format(datetime.datetime.now()))
|
||||
logging.basicConfig(level=logging.INFO, filename="logs/" + '{:%Y-%m-%d-%H-%M-%S}.log'.format(datetime.datetime.now()))
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
os.path.realpath(__file__)
|
||||
@@ -290,11 +291,21 @@ 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, should_upload_firmware):
|
||||
should_upgrade_firmware, should_upload_firmware, get_apnos, get_configuration):
|
||||
"""yields the status of upgrade of firmware. waits for 300 sec after each upgrade request"""
|
||||
print(should_upgrade_firmware, should_upload_firmware)
|
||||
status_list = []
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
active_fw_list = []
|
||||
try:
|
||||
for access_point in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(access_point)
|
||||
active_fw = ap_ssh.get_active_firmware()
|
||||
active_fw_list.append(active_fw)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
active_fw_list = []
|
||||
print(active_fw_list, get_latest_firmware)
|
||||
if get_latest_firmware != active_fw_list:
|
||||
if request.config.getoption("--skip-upgrade"):
|
||||
status = "skip-upgrade"
|
||||
status_list.append(status)
|
||||
@@ -308,7 +319,8 @@ def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_f
|
||||
else:
|
||||
if should_upgrade_firmware:
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i], force_upload=False,
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i],
|
||||
force_upload=should_upload_firmware,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
allure.attach(name="Firmware Upgrade Request", body=str(status))
|
||||
status_list.append(status)
|
||||
@@ -346,6 +358,7 @@ def check_ap_firmware_ssh(get_configuration):
|
||||
def setup_test_run(setup_controller, upgrade_firmware, get_configuration, get_equipment_id, get_latest_firmware,
|
||||
get_apnos):
|
||||
"""used to upgrade the firmware on AP and should be called on each test case on a module level"""
|
||||
|
||||
active_fw_list = []
|
||||
try:
|
||||
for access_point in get_configuration['access_point']:
|
||||
@@ -355,6 +368,7 @@ def setup_test_run(setup_controller, upgrade_firmware, get_configuration, get_eq
|
||||
except Exception as e:
|
||||
print(e)
|
||||
active_fw_list = []
|
||||
print(active_fw_list, get_latest_firmware)
|
||||
if active_fw_list == get_latest_firmware:
|
||||
yield True
|
||||
else:
|
||||
@@ -492,7 +506,6 @@ def traffic_generator_connectivity(testbed, get_configuration):
|
||||
yield True
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_lanforge_chamberview_dut(get_configuration, testbed):
|
||||
""" Create a DUT on LANforge"""
|
||||
@@ -561,3 +574,6 @@ def setup_influx(request, testbed, get_configuration):
|
||||
"influx_tag": [testbed, get_configuration["access_point"][0]["model"]],
|
||||
}
|
||||
yield influx_params
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -653,7 +653,9 @@ def num_stations(request):
|
||||
@pytest.fixture(scope="class")
|
||||
def get_vif_state(get_apnos, get_configuration):
|
||||
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
|
||||
vif_config = list(ap_ssh.get_vif_config_ssids())
|
||||
vif_state = list(ap_ssh.get_vif_state_ssids())
|
||||
vif_state.sort()
|
||||
vif_config.sort()
|
||||
allure.attach(name="vif_state", body=str(vif_state))
|
||||
yield vif_state
|
||||
|
||||
@@ -59,7 +59,7 @@ class TestDataplaneThroughputBridge(object):
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
instance_name="TIP_DPT_DPT_WPA2_2G_BRIDGE",
|
||||
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 + '/')
|
||||
@@ -99,7 +99,7 @@ class TestDataplaneThroughputBridge(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
dp_obj = 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_DPT_DPT_WPA2_5G_BRIDGE",
|
||||
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 + '/')
|
||||
|
||||
@@ -59,7 +59,7 @@ class TestDataplaneThroughputNAT(object):
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
instance_name="TIP_DPT_DPT_WPA2_2G_NAT",
|
||||
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 + '/')
|
||||
@@ -99,7 +99,7 @@ class TestDataplaneThroughputNAT(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
dp_obj = 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_DPT_DPT_WPA2_5G_NAT",
|
||||
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 + '/')
|
||||
|
||||
@@ -59,7 +59,7 @@ class TestDataplaneThroughputVLAN(object):
|
||||
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
instance_name="TIP_DPT_DPT_WPA2_2G_VLAN",
|
||||
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 + '/')
|
||||
@@ -99,8 +99,8 @@ class TestDataplaneThroughputVLAN(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
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)
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="TIP_DPT_DPT_WPA2_5G_VLAN", 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
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.firmware, pytest.mark.sanity, pytest.mark.sanity_light]
|
||||
pytestmark = [pytest.mark.firmware, pytest.mark.sanity, pytest.mark.sanity_light, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
|
||||
@allure.testcase("firmware upgrade from Cloud")
|
||||
@@ -43,8 +43,12 @@ class TestFirmware(object):
|
||||
assert PASS
|
||||
|
||||
@pytest.mark.check_active_firmware_cloud
|
||||
def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, update_report, test_cases):
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
def test_active_version_cloud(self, get_latest_firmware, get_equipment_id, setup_controller,
|
||||
update_report, test_cases):
|
||||
ap_fw_list = []
|
||||
for i in get_equipment_id:
|
||||
ap_fw_list.append(setup_controller.get_ap_firmware_old_method(equipment_id=i))
|
||||
if get_latest_firmware != ap_fw_list:
|
||||
update_report.update_testrail(case_id=test_cases["cloud_fw"],
|
||||
status_id=5,
|
||||
msg='CLOUDSDK reporting incorrect firmware version.')
|
||||
@@ -53,10 +57,11 @@ class TestFirmware(object):
|
||||
status_id=1,
|
||||
msg='CLOUDSDK reporting correct firmware version.')
|
||||
|
||||
assert get_latest_firmware == check_ap_firmware_cloud
|
||||
assert get_latest_firmware == ap_fw_list
|
||||
|
||||
|
||||
@pytest.mark.firmware_ap
|
||||
|
||||
def test_ap_firmware(get_configuration, get_apnos, get_latest_firmware, update_report,
|
||||
test_cases):
|
||||
"""yields the active version of firmware on ap"""
|
||||
@@ -79,3 +84,7 @@ def test_ap_firmware(get_configuration, get_apnos, get_latest_firmware, update_r
|
||||
msg='Cannot reach AP after upgrade to check CLI - re-test required')
|
||||
|
||||
assert active_fw_list == get_latest_firmware
|
||||
|
||||
@pytest.mark.shivam
|
||||
def test_abc(setup_controller):
|
||||
assert True
|
||||
@@ -3,7 +3,8 @@ import pytest
|
||||
|
||||
mode = "NAT"
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.nat, pytest.mark.enterprise, pytest.mark.ttls,
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.nat,
|
||||
pytest.mark.enterprise, pytest.mark.ttls,
|
||||
pytest.mark.sanity]
|
||||
|
||||
setup_params_enterprise = {
|
||||
@@ -397,9 +398,8 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, exit_on_fail, test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
|
||||
@@ -3,7 +3,8 @@ import pytest
|
||||
|
||||
mode = "VLAN"
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.vlan, pytest.mark.enterprise, pytest.mark.ttls,
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.vlan,
|
||||
pytest.mark.enterprise, pytest.mark.ttls,
|
||||
pytest.mark.sanity]
|
||||
|
||||
setup_params_enterprise = {
|
||||
|
||||
Reference in New Issue
Block a user