Modified Max SSID testcases according to new infra.

Signed-off-by: jitendracandela <jitendra.kushavah@candelatech.com>
This commit is contained in:
jitendracandela
2024-04-29 16:29:42 +05:30
parent 9d08e0d7da
commit 94c36eb62f
3 changed files with 404 additions and 284 deletions

View File

@@ -509,7 +509,8 @@ class tip_2x:
a["encryption"] = temp_data[dut][j][1]
a["password"] = temp_data[dut][j][2]
a["band"] = temp_data[dut][j][3]
a["bssid"] = temp_data[dut][j][4]
if len(temp_data[dut][j]) == 5:
a["bssid"] = temp_data[dut][j][4]
ret_val[dut]["ssid_data"][j] = a
temp = ret_val[dut]["radio_data"].copy()
for j in temp:

View File

@@ -2,6 +2,30 @@ import allure
import pytest
import logging
def separate_band_and_encryption(markers: list, target_object) -> list:
"""
['2G', 'wpa2_personal'] -> [['2G', 'wpa2_personal']]
['2G', 'wpa2_personal', 'open'] -> [['2G', 'open'], ['2G', 'wpa2_personal']]
['5G', 'wpa2_personal', '2G', 'open'] -> [['2G', 'open'], ['2G', 'wpa2_personal'],
['5G', 'open'], ['5G', 'wpa2_personal']]
"""
bands = []
encryption = []
for marker in markers:
if marker in target_object.supported_bands:
bands.append(marker)
elif marker in target_object.supported_encryption:
encryption.append(marker)
combinations = []
for band in bands:
for enc in encryption:
combinations.append([band, enc])
return combinations
@pytest.fixture(scope="class")
def setup_configuration(request, get_markers, get_target_object, run_lf):
# Predefined selected markers and selected configuration
@@ -11,7 +35,9 @@ def setup_configuration(request, get_markers, get_target_object, run_lf):
requested_combination = []
for key in get_markers:
if get_markers[key]:
requested_combination.append(get_markers[key])
combinations = separate_band_and_encryption(markers=get_markers[key], target_object=get_target_object)
for comb in combinations:
requested_combination.append(comb)
# Method to setup the basic configuration
data = {}
@@ -19,4 +45,4 @@ def setup_configuration(request, get_markers, get_target_object, run_lf):
data = get_target_object.setup_basic_configuration(configuration=configuration,
requested_combination=requested_combination)
logging.info("dut_data after config applied: " + str(data))
yield data
yield data

View File

@@ -2,16 +2,318 @@
Config AP with maximum no.of SSIDs Test: Bridge Mode
pytest -m max_ssid
"""
import logging
import time
import allure
import pytest
from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA
from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
import tabulate
pytestmark = [pytest.mark.max_ssid, pytest.mark.bridge]
pytestmark = [pytest.mark.max_ssid, pytest.mark.bridge, pytest.mark.open, pytest.mark.wpa, pytest.mark.wpa2_personal,
pytest.mark.wpa3_personal]
setup_params_general = {
def get_radio_availabilities(num_stations_2g: int = 0, num_stations_5g: int = 0, test_lib=None) -> tuple:
"""
Get how many 2G/5G stations to be created on which radios.
Note: Same radio can not be used to create 2G and 5G stations at the same time.
"""
message = None
requested_num_stations_2g = num_stations_2g
requested_num_stations_5g = num_stations_5g
radio_dict_2g = {}
radio_dict_5g = {}
dict_all_radios_2g = {
"wave2_2g_radios": test_lib.wave2_2g_radios,
"wave1_radios": test_lib.wave1_radios,
"mtk_radios": test_lib.mtk_radios,
"ax200_radios": test_lib.ax200_radios,
"ax210_radios": test_lib.ax210_radios
}
dict_all_radios_5g = {
"wave2_5g_radios": test_lib.wave2_5g_radios,
"wave1_radios": test_lib.wave1_radios,
"mtk_radios": test_lib.mtk_radios,
"ax200_radios": test_lib.ax200_radios,
"ax210_radios": test_lib.ax210_radios
}
max_station_per_radio = {
"wave2_2g_radios": 64,
"wave2_5g_radios": 64,
"wave1_radios": 64,
"mtk_radios": 19,
"ax200_radios": 1,
"ax210_radios": 1
}
for i in range(2):
if num_stations_2g > num_stations_5g:
for keys in dict_all_radios_2g:
if num_stations_2g == 0:
break
max_station = max_station_per_radio[keys]
if len(dict_all_radios_2g[keys]) > 0:
diff = max_station - num_stations_2g
for port_name in dict_all_radios_2g[keys]:
if port_name in radio_dict_5g:
continue
if diff >= 0:
radio_dict_2g[port_name] = num_stations_2g
num_stations_2g = 0
break
else:
radio_dict_2g[port_name] = max_station
num_stations_2g -= max_station
diff = max_station - num_stations_2g
if num_stations_2g != 0:
if i == 0:
message = f"Not enough radios available for connecting {requested_num_stations_2g} 2g clients!"
break
else:
for keys in dict_all_radios_5g:
if num_stations_5g == 0:
break
max_station = max_station_per_radio[keys]
if len(dict_all_radios_5g[keys]) > 0:
diff = max_station - num_stations_5g
for port_name in dict_all_radios_5g[keys]:
if port_name in radio_dict_2g:
continue
if diff >= 0:
radio_dict_5g[port_name] = num_stations_5g
num_stations_5g = 0
break
else:
radio_dict_5g[port_name] = max_station
num_stations_5g -= max_station
diff = max_station - num_stations_5g
if num_stations_5g != 0:
if i == 0:
message = f"Not enough radios available for connecting {requested_num_stations_5g} 5g clients!"
break
if num_stations_2g != 0 or num_stations_5g != 0:
logging.info(f"Radio-2G-Stations dict : {num_stations_2g}")
logging.info(f"Radio-5G-Stations dict : {num_stations_5g}")
if message is None:
message = (f"Not enough radios available for connecting {requested_num_stations_2g} 2g clients and "
f"{requested_num_stations_5g} 5g clients simultaneously!")
logging.info(message)
pytest.skip(message)
return radio_dict_2g, radio_dict_5g
def max_ssid(setup_params_general: dict, test_lib=None) -> None:
test_lib.pre_cleanup()
ssid_2g_list = []
ssid_5g_list = []
for mode, ssids in setup_params_general["ssid_modes"].items():
for ssid in ssids:
ssid_dict = {
'ssid_name': ssid["ssid_name"],
'mode': mode.split("_")[0],
'password': ssid.get("security_key", "[BLANK]"),
}
if "2G" in ssid["appliedRadios"]:
ssid_2g_list.append(ssid_dict)
elif "5G" in ssid["appliedRadios"]:
ssid_5g_list.append(ssid_dict)
no_of_sta_2g = len(ssid_2g_list)
no_of_sta_5g = len(ssid_5g_list)
sta_names_2g = [f"sta_2g_{i + 1}" for i in range(no_of_sta_2g)]
sta_names_5g = [f"sta_5g_{i + 1}" for i in range(no_of_sta_5g)]
radio_dict_2g, radio_dict_5g = get_radio_availabilities(num_stations_2g=no_of_sta_2g,
num_stations_5g=no_of_sta_5g,
test_lib=test_lib)
if len(radio_dict_2g) > 0:
logging.info(f"Radio-Stations dict : {radio_dict_2g}")
if len(radio_dict_5g) > 0:
logging.info(f"Radio-Stations dict : {radio_dict_5g}")
if no_of_sta_2g > 0:
logging.info(f"A total of {no_of_sta_2g} 2G stations will be created for {no_of_sta_2g} SSIDs, "
f"i.e., one 2G stations on each SSID.")
if no_of_sta_5g > 0:
logging.info(f"A total of {no_of_sta_5g} 5G stations will be created for {no_of_sta_5g} SSIDs, "
f"i.e., one 5G stations on each SSID.")
sta_got_ip = []
radio = None
timeout_sec = 100 if no_of_sta_2g <= 8 and no_of_sta_5g <= 8 else 15
for i in range(no_of_sta_2g):
logging.info(f"Creating a 2G station on {ssid_2g_list[i]['ssid_name']} ssid...")
for _radio in radio_dict_2g:
radio = _radio
if radio_dict_2g[radio] == 1:
del radio_dict_2g[radio]
else:
radio_dict_2g[radio] -= 1
break
sta_got_ip.append(test_lib.client_connect_using_radio(ssid=ssid_2g_list[i]['ssid_name'],
security=ssid_2g_list[i]['mode'],
passkey=ssid_2g_list[i]['password'],
mode="BRIDGE",
radio=radio,
station_name=[sta_names_2g[i]],
attach_station_data=False,
attach_port_info=False,
timeout_sec=timeout_sec))
for i in range(no_of_sta_5g):
logging.info(f"Creating a 5G station on {ssid_5g_list[i]['ssid_name']} ssid...")
for _radio in radio_dict_5g:
radio = _radio
if radio_dict_5g[radio] == 1:
del radio_dict_5g[radio]
else:
radio_dict_5g[radio] -= 1
break
sta_got_ip.append(test_lib.client_connect_using_radio(ssid=ssid_5g_list[i]['ssid_name'],
security=ssid_5g_list[i]['mode'],
passkey=ssid_5g_list[i]['password'],
mode="BRIDGE",
radio=radio,
station_name=[sta_names_5g[i]],
attach_station_data=False,
attach_port_info=False,
timeout_sec=timeout_sec))
logging.info("Fetching port info after all stations created")
port_data = test_lib.json_get(_req_url="port?fields=ip")
port_info = {key: value for d in port_data["interfaces"] for key, value in d.items()}
test_lib.allure_report_table_format(dict_data=port_info, key="Port Names", value="ip",
name="Port info after creating all stations")
logging.info("Adding Station Data to the report")
dict_table_sta = {}
start_sta, end_sta = 1, 0
for index, sta in enumerate(sta_names_2g):
end_sta += 1
result = test_lib.json_get(_req_url="port/1/1/%s" % sta)
if "Key" not in dict_table_sta:
dict_table_sta["Key"] = list(result["interface"].keys())
dict_table_sta[f"Value ({sta})"] = list(result["interface"].values())
if end_sta - start_sta == 3 or index == len(sta_names_2g) - 1:
data_table_sta = tabulate.tabulate(dict_table_sta, headers='keys', tablefmt='fancy_grid')
logging.info(f"2G-Stations Data ({start_sta}-{end_sta}): \n{data_table_sta}\n")
allure.attach(name=f"2G-Stations Data ({start_sta}-{end_sta})", body=str(data_table_sta))
start_sta = end_sta + 1
dict_table_sta.clear()
start_sta, end_sta = 1, 0
for index, sta in enumerate(sta_names_5g):
end_sta += 1
result = test_lib.json_get(_req_url="port/1/1/%s" % sta)
if "Key" not in dict_table_sta:
dict_table_sta["Key"] = list(result["interface"].keys())
dict_table_sta[f"Value ({sta})"] = list(result["interface"].values())
if end_sta - start_sta == 3 or index == len(sta_names_5g) - 1:
data_table_sta = tabulate.tabulate(dict_table_sta, headers='keys', tablefmt='fancy_grid')
logging.info(f"5G-Stations Data ({start_sta}-{end_sta}): \n{data_table_sta}\n")
allure.attach(name=f"5G-Stations Data ({start_sta}-{end_sta})", body=str(data_table_sta))
start_sta = end_sta + 1
dict_table_sta.clear()
if no_of_sta_2g > 8 or no_of_sta_5g > 8:
if True in sta_got_ip:
logging.info("Some/All stations got the IP when more than 8 SSIDs were configured on a single band!")
pytest.fail("Some/All stations got the IP when more than 8 SSIDs were configured on a single band!")
else:
logging.info("As expected, None of the stations got the IP when more than 8 SSIDs were configured "
"on a single band!")
test_lib.pre_cleanup()
return
if False in sta_got_ip:
logging.info("Some/All Stations didn't get IP address")
pytest.fail("Some/All Stations didn't get IP address")
logging.info("All Stations got IP address")
logging.info("Creating Layer3 traffic on stations...")
for sta in sta_names_2g + sta_names_5g:
test_lib.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0,
side_b_min_rate=6291456, side_b_max_rate=0,
traffic_type="lf_tcp", sta_list=[sta], side_b="",
start_cx=True, prefix=f"t-")
logging.info(f"CX with TCP traffic created between endpoint-a = {sta} and endpoint-b = upstream port.")
time.sleep(2)
test_lib.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0,
side_b_min_rate=6291456, side_b_max_rate=0,
traffic_type="lf_udp", sta_list=[sta], side_b="",
start_cx=True, prefix=f"u-")
logging.info(f"CX with UDP traffic created between endpoint-a = {sta} and endpoint-b = upstream port.")
time.sleep(2)
logging.info("Running Layer3 traffic for 40 sec ...")
time.sleep(40)
logging.info("Fetching CX data and adding it to the report...")
cx_list = test_lib.get_cx_list()
dict_table_cx_tcp = {}
dict_table_cx_udp = {}
pass_fail_data = []
overall_test = True
start_tcp, start_udp = 1, 1
end_tcp, end_udp = 0, 0
for i in range(len(cx_list)):
cx_data = test_lib.json_get(_req_url=f"cx/{cx_list[i]}")
cx_name = f"{cx_list[i].split('-')[1]}"
if "L3 CX Column" not in dict_table_cx_tcp:
dict_table_cx_tcp["L3 CX Column"] = list(cx_data[f"{cx_list[i]}"].keys())
if "L3 CX Column" not in dict_table_cx_udp:
dict_table_cx_udp["L3 CX Column"] = list(cx_data[f"{cx_list[i]}"].keys())
if "TCP" in cx_data[f"{cx_list[i]}"]['type']:
end_tcp += 1
dict_table_cx_tcp[f"values ({cx_name})"] = list(cx_data[f"{cx_list[i]}"].values())
else:
end_udp += 1
dict_table_cx_udp[f"values ({cx_name})"] = list(cx_data[f"{cx_list[i]}"].values())
if cx_data[cx_list[i]]['bps rx a'] != 0 and cx_data[cx_list[i]]['bps rx a'] != 0:
res = True
else:
overall_test = False
res = False
pass_fail_data.append(
[f"{cx_list[i][:-2]}", f"{cx_data[cx_list[i]]['bps rx a']}", f"{cx_data[cx_list[i]]['bps rx b']}", res])
# attach l3 cx data to allure
if end_tcp - start_tcp == 3 or (i == len(cx_list) - 1 and start_tcp <= end_tcp):
data_table_cx_tcp = tabulate.tabulate(dict_table_cx_tcp, headers='keys', tablefmt='fancy_grid')
logging.info(f"L3 cross-connects Data (TCP) ({start_tcp} - {end_tcp}): \n{data_table_cx_tcp}\n")
allure.attach(name=f"L3 cross-connects Data (TCP) ({start_tcp} - {end_tcp})", body=str(data_table_cx_tcp))
start_tcp = end_tcp + 1
dict_table_cx_tcp.clear()
if end_udp - start_udp == 3 or (i == len(cx_list) - 1 and start_udp <= end_udp):
data_table_cx_udp = tabulate.tabulate(dict_table_cx_udp, headers='keys', tablefmt='fancy_grid')
logging.info(f"L3 cross-connects Data (UDP) ({start_udp} - {end_udp}): \n{data_table_cx_udp}\n")
allure.attach(name=f"L3 cross-connects Data (UDP) ({start_udp} - {end_udp})", body=str(data_table_cx_udp))
start_udp = end_udp + 1
dict_table_cx_udp.clear()
logging.info("Attaching pass/fail data to the report...")
result_table = tabulate.tabulate(pass_fail_data,
headers=["Data Path", "Tx Rate (bps)", "Rx Rate (bps)", "Pass/Fail"],
tablefmt='fancy_grid')
logging.info(f"Test Result Table: \n{result_table}\n")
allure.attach(name="Test Result Table", body=str(result_table))
test_lib.pre_cleanup()
if overall_test is False:
pytest.fail("DataPath check failed, Traffic didn't reported on some endpoints")
logging.info("All Traffic reported on all endpoints, test successful!")
setup_params_general0 = {
"mode": "BRIDGE",
"ssid_modes": {
"open": [
@@ -35,56 +337,28 @@ setup_params_general = {
}
@allure.parent_suite("Max-SSID Tests")
@allure.suite("Bridge Mode")
@allure.sub_suite("Only 2.4GHz Band")
@pytest.mark.parametrize(
'setup_configuration',
[setup_params_general],
[setup_params_general0],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_configuration")
class TestMaxEightSsid2G(object):
"""Config AP with maximum no.of SSIDs Test Bridge mode
pytest -m "max_ssid and bridge"
"""
@allure.title("8-SSIDs")
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7678", name="WIFI-7678")
@pytest.mark.open
@pytest.mark.wpa
@pytest.mark.wpa2_personal
@pytest.mark.wpa3_personal
@pytest.mark.eight_ssid_2g
@pytest.mark.twog
def test_max_eight_ssid_2g(self, lf_test, station_names_twog, get_configuration):
"""Max-SSID Bridge Mode
pytest -m "max_ssid and twog"
@pytest.mark.eight_ssid_2g
def test_max_eight_ssid_2g(self, get_test_library, get_dut_logs_per_test_case, setup_configuration,
get_test_device_logs, check_connectivity):
"""
scan_ssid = True
mode = "BRIDGE"
band = "twog"
vlan = 1
count_security, sta_count = 0, 0
pass_list = []
security_key = "something"
security_list = ["open", "wpa", "wpa2", "wpa3"]
sta_list = []
for i in setup_params_general["ssid_modes"]:
for j in range(len(setup_params_general["ssid_modes"][i])):
profile_data = setup_params_general["ssid_modes"][i][j]
ssid_name = profile_data["ssid_name"]
security = security_list[count_security]
station_names = station_names_twog[0] + str(int(station_names_twog[0][-1]) + sta_count)
passes = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, mode=mode,
band=band, station_name=[station_names], vlan_id=vlan, scan_ssid=scan_ssid)
scan_ssid = False
pass_list.append(passes)
sta_list.append(station_names)
sta_count += 1
count_security += 1
fail_list = list(filter(lambda x : x == False, pass_list))
if len(fail_list) == 0:
lf_test.layer3_traffic(ssid_num=len(pass_list), band="2.4 Ghz", station_name=sta_list)
assert True
else:
assert False
Unique Marker: max_ssid and bridge and eight_ssid_2g
"""
max_ssid(setup_params_general=setup_params_general0, test_lib=get_test_library)
setup_params_general1 = {
@@ -111,6 +385,9 @@ setup_params_general1 = {
}
@allure.parent_suite("Max-SSID Tests")
@allure.suite("Bridge Mode")
@allure.sub_suite("Only 5GHz Band")
@pytest.mark.parametrize(
'setup_configuration',
[setup_params_general1],
@@ -119,48 +396,17 @@ setup_params_general1 = {
)
@pytest.mark.usefixtures("setup_configuration")
class TestMaxEightSsid5G(object):
"""Config AP with maximum no.of SSIDs Test Bridge mode
pytest -m "max_ssid and bridge"
"""
@allure.title("8-SSIDs")
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7678", name="WIFI-7678")
@pytest.mark.open
@pytest.mark.wpa
@pytest.mark.wpa2_personal
@pytest.mark.wpa3_personal
@pytest.mark.eight_ssid_5g
@pytest.mark.fiveg
def test_max_eight_ssid_5g(self, lf_test, station_names_fiveg, get_configuration):
"""Max-SSID Bridge Mode
pytest -m "max_ssid and fiveg"
@pytest.mark.eight_ssid_5g
def test_max_eight_ssid_5g(self, get_test_library, get_dut_logs_per_test_case, setup_configuration,
get_test_device_logs, check_connectivity):
"""
scan_ssid = True
mode = "BRIDGE"
band = "fiveg"
vlan = 1
count_security, sta_count = 0, 0
pass_list = []
security_key = "something"
security_list = ["open", "wpa", "wpa2", "wpa3"]
sta_list = []
for i in setup_params_general1["ssid_modes"]:
for j in range(len(setup_params_general1["ssid_modes"][i])):
profile_data = setup_params_general1["ssid_modes"][i][j]
ssid_name = profile_data["ssid_name"]
security = security_list[count_security]
station_names = station_names_fiveg[0] + str(int(station_names_fiveg[0][-1]) + sta_count)
passes = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, mode=mode,
band=band, station_name=[station_names], vlan_id=vlan, scan_ssid=scan_ssid)
scan_ssid = False
pass_list.append(passes)
sta_list.append(station_names)
sta_count += 1
count_security += 1
fail_list = list(filter(lambda x : x == False, pass_list))
if len(fail_list) == 0:
lf_test.layer3_traffic(ssid_num=len(pass_list), band="5 Ghz", station_name=sta_list)
assert True
else:
assert False
Unique Marker: max_ssid and bridge and eight_ssid_5g
"""
max_ssid(setup_params_general=setup_params_general1, test_lib=get_test_library)
setup_params_general2 = {
@@ -188,6 +434,9 @@ setup_params_general2 = {
}
@allure.parent_suite("Max-SSID Tests")
@allure.suite("Bridge Mode")
@allure.sub_suite("Only 2.4GHz Band")
@pytest.mark.parametrize(
'setup_configuration',
[setup_params_general2],
@@ -196,57 +445,17 @@ setup_params_general2 = {
)
@pytest.mark.usefixtures("setup_configuration")
class TestMoreThanEightSsid2G(object):
"""Config AP with maximum no.of SSIDs Test Bridge mode
pytest -m "max_ssid and bridge"
"""
@allure.title("Trying more than 8-SSIDs")
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7678", name="WIFI-7678")
@pytest.mark.open
@pytest.mark.wpa
@pytest.mark.wpa2_personal
@pytest.mark.wpa3_personal
@pytest.mark.more_than_eight_ssid_2g
@pytest.mark.twog
def test_more_than_eight_ssid_2g(self, lf_test, station_names_twog, get_configuration):
"""Max-SSID Bridge Mode
pytest -m "max_ssid and twog"
@pytest.mark.more_than_eight_ssid_2g
def test_more_than_eight_ssid_2g(self, get_test_library, get_dut_logs_per_test_case, setup_configuration,
get_test_device_logs, check_connectivity):
"""
scan_ssid = True
mode = "BRIDGE"
band = "twog"
vlan = 1
count_security, sta_count = 0, 0
pass_list = []
security_key = "something"
security_list = ["open", "wpa", "wpa2", "wpa3"]
sta_list = []
for i in setup_params_general2["ssid_modes"]:
for j in range(len(setup_params_general2["ssid_modes"][i])):
profile_data = setup_params_general2["ssid_modes"][i][j]
ssid_name = profile_data["ssid_name"]
security = security_list[count_security]
station_names = station_names_twog[0] + str(int(station_names_twog[0][-1]) + sta_count)
passes = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, mode=mode,
band=band, station_name=[station_names], vlan_id=vlan, scan_ssid=scan_ssid)
scan_ssid = False
pass_list.append(passes)
sta_list.append(station_names)
sta_count += 1
count_security += 1
fail_list = list(filter(lambda x : x == False, pass_list))
if len(fail_list) == len(pass_list):
lf_test.Client_disconnect(sta_list)
allure.attach(name="Definition",
body="Max-SSID test intends to verify stability of Wi-Fi device " \
"where the AP is configured with max no.of SSIDs with different security modes.")
allure.attach(name="Procedure",
body=f"This test case definition states that we need to push the basic bridge mode config on the "
f"AP to be tested by configuring it with maximum {len(pass_list)} SSIDs in {band} radio. "
f"Create client on each SSIDs and run Layer-3 traffic. Pass/ fail criteria: "
f"The client created should not get associated to the AP")
# lf_test.layer3_traffic(ssid_num=len(pass_list), band="2.4 Ghz", station_name=sta_list)
assert True
else:
assert False
Unique Marker: max_ssid and bridge and more_than_eight_ssid_2g
"""
max_ssid(setup_params_general=setup_params_general2, test_lib=get_test_library)
setup_params_general3 = {
@@ -274,6 +483,9 @@ setup_params_general3 = {
}
@allure.parent_suite("Max-SSID Tests")
@allure.suite("Bridge Mode")
@allure.sub_suite("Only 5GHz Band")
@pytest.mark.parametrize(
'setup_configuration',
[setup_params_general3],
@@ -282,57 +494,17 @@ setup_params_general3 = {
)
@pytest.mark.usefixtures("setup_configuration")
class TestMoreThanEightSsid5G(object):
"""Config AP with maximum no.of SSIDs Test Bridge mode
pytest -m "max_ssid and bridge"
"""
@allure.title("Trying more than 8-SSIDs")
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7678", name="WIFI-7678")
@pytest.mark.open
@pytest.mark.wpa
@pytest.mark.wpa2_personal
@pytest.mark.wpa3_personal
@pytest.mark.more_than_eight_ssid_5g
@pytest.mark.fiveg
def test_more_than_eight_ssid_5g(self, lf_test, station_names_fiveg, get_configuration):
"""Max-SSID Bridge Mode
pytest -m "max_ssid and fiveg"
@pytest.mark.more_than_eight_ssid_5g
def test_more_than_eight_ssid_5g(self, get_test_library, get_dut_logs_per_test_case, setup_configuration,
get_test_device_logs, check_connectivity):
"""
scan_ssid = True
mode = "BRIDGE"
band = "fiveg"
vlan = 1
count_security, sta_count = 0, 0
pass_list = []
security_key = "something"
security_list = ["open", "wpa", "wpa2", "wpa3"]
sta_list = []
for i in setup_params_general3["ssid_modes"]:
for j in range(len(setup_params_general3["ssid_modes"][i])):
profile_data = setup_params_general3["ssid_modes"][i][j]
ssid_name = profile_data["ssid_name"]
security = security_list[count_security]
station_names = station_names_fiveg[0] + str(int(station_names_fiveg[0][-1]) + sta_count)
passes = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, mode=mode,
band=band, station_name=[station_names], vlan_id=vlan, scan_ssid=scan_ssid)
scan_ssid = False
pass_list.append(passes)
sta_list.append(station_names)
sta_count += 1
count_security += 1
fail_list = list(filter(lambda x : x == False, pass_list))
if len(fail_list) == len(pass_list):
lf_test.Client_disconnect(sta_list)
allure.attach(name="Definition",
body="Max-SSID test intends to verify stability of Wi-Fi device " \
"where the AP is configured with max no.of SSIDs with different security modes.")
allure.attach(name="Procedure",
body=f"This test case definition states that we need to push the basic bridge mode config on the "
f"AP to be tested by configuring it with maximum {len(pass_list)} SSIDs in {band} radio. "
f"Create client on each SSIDs and run Layer-3 traffic. Pass/ fail criteria: "
f"The client created should not get associated to the AP")
# lf_test.layer3_traffic(ssid_num=len(pass_list), band="5 Ghz", station_name=sta_list)
assert True
else:
assert False
Unique Marker: max_ssid and bridge and more_than_eight_ssid_5g
"""
max_ssid(setup_params_general=setup_params_general3, test_lib=get_test_library)
setup_params_general4 = {
@@ -365,6 +537,9 @@ setup_params_general4 = {
}
@allure.parent_suite("Max-SSID Tests")
@allure.suite("Bridge Mode")
@allure.sub_suite("Both 2.4GHz and 5GHz Band")
@pytest.mark.parametrize(
'setup_configuration',
[setup_params_general4],
@@ -373,56 +548,18 @@ setup_params_general4 = {
)
@pytest.mark.usefixtures("setup_configuration")
class TestMaxSixteenSsid(object):
"""Config AP with maximum no.of SSIDs Test Bridge mode
pytest -m "max_ssid and bridge"
"""
@allure.title("16-SSIDs")
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7678", name="WIFI-7678")
@pytest.mark.open
@pytest.mark.wpa
@pytest.mark.wpa2_personal
@pytest.mark.wpa3_personal
@pytest.mark.sixteen_ssid_2g_5g
@pytest.mark.twog
@pytest.mark.fiveg
def test_max_sixteen_2g_5g(self, lf_test, station_names_twog, station_names_fiveg, get_configuration):
"""Max-SSID Bridge Mode
pytest -m "max_ssid and twog and fiveg"
@pytest.mark.sixteen_ssid_2g_5g
def test_max_sixteen_2g_5g(self, get_test_library, get_dut_logs_per_test_case, setup_configuration,
get_test_device_logs, check_connectivity):
"""
scan_ssid = True
mode = "BRIDGE"
band_name = (lambda bnd: '2G' if bnd == 'twog' else '5G')
vlan = 1
count_security, sta_count = 0, 0
pass_list = []
security_key = "something"
security_list = ["open", "wpa", "wpa2", "wpa3"]
sta_list = []
for i in setup_params_general4["ssid_modes"]:
for j in range(len(setup_params_general4["ssid_modes"][i])):
profile_data = setup_params_general4["ssid_modes"][i][j]
ssid_name = profile_data["ssid_name"]
security = security_list[count_security]
if profile_data["appliedRadios"] == ['2G']:
band = 'twog'
sta_name = station_names_twog
elif profile_data["appliedRadios"] == ['5G']:
band = 'fiveg'
sta_name = station_names_fiveg
station_names = band_name(band) + sta_name[0] + str(int(sta_name[0][-1]) + sta_count)
passes = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, mode=mode,
band=band, station_name=[station_names], vlan_id=vlan,
scan_ssid=scan_ssid)
scan_ssid = False
pass_list.append(passes)
sta_list.append(station_names)
sta_count += 1
count_security += 1
fail_list = list(filter(lambda x: x == False, pass_list))
if len(fail_list) == 0:
lf_test.layer3_traffic(ssid_num=len(pass_list), band="2.4 Ghz and 5 Ghz", station_name=sta_list)
assert True
else:
assert False
Unique Marker: max_ssid and bridge and sixteen_ssid_2g_5g
"""
max_ssid(setup_params_general=setup_params_general4, test_lib=get_test_library)
setup_params_general5 = {
@@ -457,6 +594,9 @@ setup_params_general5 = {
}
@allure.parent_suite("Max-SSID Tests")
@allure.suite("Bridge Mode")
@allure.sub_suite("Both 2.4GHz and 5GHz Band")
@pytest.mark.parametrize(
'setup_configuration',
[setup_params_general5],
@@ -465,62 +605,15 @@ setup_params_general5 = {
)
@pytest.mark.usefixtures("setup_configuration")
class TestMoreThanSixteenSsid(object):
"""Config AP with maximum no.of SSIDs Test Bridge mode
pytest -m "max_ssid and bridge"
"""
@allure.title("Trying more than 16-SSIDs")
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7678", name="WIFI-7678")
@pytest.mark.open
@pytest.mark.wpa
@pytest.mark.wpa2_personal
@pytest.mark.wpa3_personal
@pytest.mark.more_than_sixteen_ssid_2g_5g
@pytest.mark.twog
@pytest.mark.fiveg
def test_more_than_sixteen_2g_5g(self, lf_test, station_names_twog, station_names_fiveg, get_configuration):
"""Max-SSID Bridge Mode
pytest -m "max_ssid and twog and fiveg"
@pytest.mark.more_than_sixteen_ssid_2g_5g
def test_more_than_sixteen_2g_5g(self, get_test_library, get_dut_logs_per_test_case, setup_configuration,
get_test_device_logs, check_connectivity):
"""
scan_ssid = True
mode = "BRIDGE"
band_name = (lambda bnd: '2G' if bnd == 'twog' else '5G')
vlan = 1
count_security, sta_count = 0, 0
pass_list = []
security_key = "something"
security_list = ["open", "wpa", "wpa2", "wpa3"]
sta_list = []
for i in setup_params_general5["ssid_modes"]:
for j in range(len(setup_params_general5["ssid_modes"][i])):
profile_data = setup_params_general5["ssid_modes"][i][j]
ssid_name = profile_data["ssid_name"]
security = security_list[count_security]
if profile_data["appliedRadios"] == ['2G']:
band = 'twog'
sta_name = station_names_twog
elif profile_data["appliedRadios"] == ['5G']:
band = 'fiveg'
sta_name = station_names_fiveg
station_names = band_name(band) + sta_name[0] + str(int(sta_name[0][-1]) + sta_count)
passes = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, mode=mode,
band=band, station_name=[station_names], vlan_id=vlan,
scan_ssid=scan_ssid)
scan_ssid = False
pass_list.append(passes)
sta_list.append(station_names)
sta_count += 1
count_security += 1
fail_list = list(filter(lambda x: x == False, pass_list))
if len(fail_list) == len(pass_list):
lf_test.Client_disconnect(sta_list)
allure.attach(name="Definition",
body="Max-SSID test intends to verify stability of Wi-Fi device " \
"where the AP is configured with max no.of SSIDs with different security modes.")
allure.attach(name="Procedure",
body=f"This test case definition states that we need to push the basic bridge mode config on the "
f"AP to be tested by configuring it with maximum {len(pass_list)} SSIDs in 2.4 Ghz and 5 Ghz radio. "
f"Create client on each SSIDs and run Layer-3 traffic. Pass/ fail criteria: "
f"The client created should not get associated to the AP")
# lf_test.layer3_traffic(ssid_num=len(pass_list), band="2.4 Ghz and 5 Ghz", station_name=sta_list)
assert True
else:
assert False
Unique Marker: max_ssid and bridge and more_than_sixteen_ssid_2g_5g
"""
max_ssid(setup_params_general=setup_params_general5, test_lib=get_test_library)