diff --git a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/test_dfs_20_bridge.py b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/test_dfs_20_bridge.py index cbcb47efe..8d77bbe78 100644 --- a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/test_dfs_20_bridge.py +++ b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/test_dfs_20_bridge.py @@ -30,70 +30,37 @@ setup_params_general1 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general1], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-52") +@pytest.mark.usefixtures("setup_configuration") class TestDFSChannel52Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6472", name="WIFI-6472") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_52_bw_20 - def test_dfs_channel_52_bw_20(self, get_lanforge_library, station_names_fiveg): + @pytest.mark.jkkk + @allure.title("Test for Channel 52 and bandwidth 20") + def test_dfs_channel_52_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + get_target_object, + num_stations, setup_configuration): profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general1["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = get_lanforge_library.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - # channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # print("channel before dfs: ", channel1) - # if channel1 == str(channel): - # dfs_start.dfs() - # time.sleep(15) - # else: - # print("Station not connected to applied channel") - # allure.attach(name="log Data", body="Station not connected to applied channel") - # assert False - # channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # log = dfs_start.dfs_logread() - # if channel1 != channel2: - # print(log) - # print("channel after dfs: ", channel2) - # allure.attach(name="log Data", body=log) - # else: - # print(log) - # print("dfs not happened") - # allure.attach(name="log Data", body=log) - # dfs_fail = False - # dfs_start.reboot() - # time.sleep(200) - # count = 0 - # while True: - # connected, latest, active = dfs_start.get_ucentral_status() - # if connected is True: - # print("status is connected after reboot: ", connected) - # break - # else: - # count = count + 1 - # if count > 5: - # break - # time.sleep(5) - # if count > 5: - # assert False, "AP is disconnected" - # if not dfs_fail: - # assert False + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() + time.sleep(200) setup_params_general2 = { @@ -118,70 +85,35 @@ setup_params_general2 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general2], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-100") class TestDFSChannel100Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6473", name="WIFI-6473") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_100_bw_20 - def test_dfs_channel_100_bw_20(self, get_lanforge_library, station_names_fiveg): + @allure.title("Test for Channel 100 and bandwidth 20") + def test_dfs_channel_100_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general2["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = get_lanforge_library.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - # print("station", station) - # channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # print("channel before dfs: ", channel1) - # if channel1 == str(channel): - # dfs_start.dfs() - # time.sleep(15) - # else: - # print("Station not connected to applied channel") - # allure.attach(name="log Data", body="Station not connected to applied channel") - # assert False - # channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # log = dfs_start.dfs_logread() - # if channel1 != channel2: - # print(log) - # print("channel after dfs: ", channel2) - # allure.attach(name="log Data", body=log) - # else: - # print(log) - # print("dfs not happened") - # allure.attach(name="log Data", body=log) - # dfs_fail = False - # dfs_start.reboot() - # time.sleep(200) - # count = 0 - # while True: - # connected, latest, active = dfs_start.get_ucentral_status() - # if connected is True: - # print("status is connected after reboot: ", connected) - # break - # else: - # count = count + 1 - # if count > 5: - # break - # time.sleep(5) - # if count > 5: - # assert False, "AP is disconnected" - # if not dfs_fail: - # assert False + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() + time.sleep(200) setup_params_general3 = { @@ -206,19 +138,24 @@ setup_params_general3 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general3], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-104") class TestDFSChannel104Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6474", name="WIFI-6474") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_104_bw_20 - def test_dfs_channel_104_bw_20(self, get_lanforge_library, station_names_fiveg): + @allure.title("Test for Channel 104 and bandwidth 20") + def test_dfs_channel_104_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] @@ -226,50 +163,11 @@ class TestDFSChannel104Bw20(object): security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = get_lanforge_library.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - # print("station", station) - # channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # print("channel before dfs: ", channel1) - # if channel1 == str(channel): - # dfs_start.dfs() - # time.sleep(15) - # else: - # print("Station not connected to applied channel") - # allure.attach(name="log Data", body="Station not connected to applied channel") - # assert False - # channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # log = dfs_start.dfs_logread() - # if channel1 != channel2: - # print(log) - # print("channel after dfs: ", channel2) - # allure.attach(name="log Data", body=log) - # else: - # print(log) - # print("dfs not happened") - # allure.attach(name="log Data", body=log) - # dfs_fail = False - # dfs_start.reboot() - # time.sleep(200) - # count = 0 - # while True: - # connected, latest, active = dfs_start.get_ucentral_status() - # if connected is True: - # print("status is connected after reboot: ", connected) - # break - # else: - # count = count + 1 - # if count > 5: - # break - # time.sleep(5) - # if count > 5: - # assert False, "AP is disconnected" - # if not dfs_fail: - # assert False + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() + time.sleep(200) setup_params_general4 = { @@ -294,63 +192,35 @@ setup_params_general4 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general4], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-56") class TestDFSChannel56Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6475", name="WIFI-6475") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_56_bw_20 - def test_dfs_channel_56_bw_20(self, get_lanforge_library, station_names_fiveg): + @allure.title("Test for Channel 56 and bandwidth 20") + def test_dfs_channel_56_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general4["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general4["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = get_lanforge_library.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - # print("station", station) - # channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # print("channel before dfs: ", channel1) - # if channel1 == str(channel): - # dfs_start.dfs() - # time.sleep(15) - # else: - # print("Station not connected to applied channel") - # allure.attach(name="log Data", body="Station not connected to applied channel") - # assert False - # channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # log = dfs_start.dfs_logread() - # if channel1 != channel2: - # print(log) - # print("channel after dfs: ", channel2) - # allure.attach(name="log Data", body=log) - # else: - # print(log) - # print("dfs not happened") - # allure.attach(name="log Data", body=log) - # dfs_fail = False - # dfs_start.reboot() - # time.sleep(200) - # while True: - # connected, latest, active = dfs_start.get_ucentral_status() - # if connected is True: - # print("status is connected after reboot: ", connected) - # break - # time.sleep(1) - # if not dfs_fail: - # assert False + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() + time.sleep(200) setup_params_general5 = { @@ -375,70 +245,35 @@ setup_params_general5 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general5], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-60") class TestDFSChannel60Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6476", name="WIFI-6476") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_60_bw_20 - def test_dfs_channel_60_bw_20(self, get_lanforge_library, station_names_fiveg): + @allure.title("Test for Channel 60 and bandwidth 20") + def test_dfs_channel_60_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general5["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general5["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = get_lanforge_library.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - # channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # print("channel before dfs: ", channel1) - # if channel1 == str(channel): - # dfs_start.dfs() - # time.sleep(15) - # else: - # print("Station not connected to applied channel") - # allure.attach(name="log Data", body="Station not connected to applied channel") - # assert False - # channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # log = dfs_start.dfs_logread() - # if channel1 != channel2: - # print(log) - # print("channel after dfs: ", channel2) - # allure.attach(name="log Data", body=log) - # else: - # print(log) - # print("dfs not happened") - # allure.attach(name="log Data", body=log) - # dfs_fail = False - # dfs_start.reboot() - # time.sleep(200) - # count = 0 - # while True: - # connected, latest, active = dfs_start.get_ucentral_status() - # if connected is True: - # print("status is connected after reboot: ", connected) - # break - # else: - # count = count + 1 - # if count > 5: - # break - # time.sleep(5) - # if count > 5: - # assert False, "AP is disconnected" - # if not dfs_fail: - # assert False + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() + time.sleep(200) setup_params_general6 = { @@ -463,63 +298,35 @@ setup_params_general6 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general6], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-64") class TestDFSChannel64Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6477", name="WIFI-6477") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_64_bw_20 - def test_dfs_channel_64_bw_20(self, get_lanforge_library, station_names_fiveg): + @allure.title("Test for Channel 64 and bandwidth 20") + def test_dfs_channel_64_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general6["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general6["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = get_lanforge_library.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - # channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # print("channel before dfs: ", channel1) - # if channel1 == str(channel): - # dfs_start.dfs() - # time.sleep(15) - # else: - # print("Station not connected to applied channel") - # allure.attach(name="log Data", body="Station not connected to applied channel") - # assert False - # channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # log = dfs_start.dfs_logread() - # if channel1 != channel2: - # print(log) - # print("channel after dfs: ", channel2) - # allure.attach(name="log Data", body=log) - # else: - # print(log) - # print("dfs not happened") - # allure.attach(name="log Data", body=log) - # dfs_fail = False - # dfs_start.reboot() - # time.sleep(200) - # while True: - # connected, latest, active = dfs_start.get_ucentral_status() - # if connected is True: - # print("status is connected after reboot: ", connected) - # break - # time.sleep(1) - # if not dfs_fail: - # assert False + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() + time.sleep(200) setup_params_general7 = { @@ -544,70 +351,35 @@ setup_params_general7 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general7], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-108") class TestDFSChannel108Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6478", name="WIFI-6478") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_108_bw_20 - def test_dfs_channel_108_bw_20(self, get_lanforge_library, station_names_fiveg): + @allure.title("Test for Channel 108 and bandwidth 20") + def test_dfs_channel_108_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general7["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general7["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = get_lanforge_library.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - # print("station", station) - # channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # print("channel before dfs: ", channel1) - # if channel1 == str(channel): - # dfs_start.dfs() - # time.sleep(15) - # else: - # print("Station not connected to applied channel") - # allure.attach(name="log Data", body="Station not connected to applied channel") - # assert False - # channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # log = dfs_start.dfs_logread() - # if channel1 != channel2: - # print(log) - # print("channel after dfs: ", channel2) - # allure.attach(name="log Data", body=log) - # else: - # print(log) - # print("dfs not happened") - # allure.attach(name="log Data", body=log) - # dfs_fail = False - # dfs_start.reboot() - # time.sleep(200) - # count = 0 - # while True: - # connected, latest, active = dfs_start.get_ucentral_status() - # if connected is True: - # print("status is connected after reboot: ", connected) - # break - # else: - # count = count + 1 - # if count > 5: - # break - # time.sleep(5) - # if count > 5: - # assert False, "AP is disconnected" - # if not dfs_fail: - # assert False + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() + time.sleep(200) setup_params_general8 = { @@ -632,146 +404,37 @@ setup_params_general8 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general8], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-112") class TestDFSChannel112Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6479", name="WIFI-6479") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_112_bw_20 - def test_dfs_channel_112_bw_20(self, get_lanforge_library, station_names_fiveg): + @allure.title("Test for Channel 112 and bandwidth 20") + def test_dfs_channel_112_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general8["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general8["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = get_lanforge_library.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - # channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # print("channel before dfs: ", channel1) - # if channel1 == str(channel): - # dfs_start.dfs() - # time.sleep(15) - # else: - # print("Station not connected to applied channel") - # allure.attach(name="log Data", body="Station not connected to applied channel") - # assert False - # channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # log = dfs_start.dfs_logread() - # if channel1 != channel2: - # print(log) - # print("channel after dfs: ", channel2) - # allure.attach(name="log Data", body=log) - # else: - # print(log) - # print("dfs not happened") - # allure.attach(name="log Data", body=log) - # dfs_fail = False - # dfs_start.reboot() - # time.sleep(200) - # count = 0 - # while True: - # connected, latest, active = dfs_start.get_ucentral_status() - # if connected is True: - # print("status is connected after reboot: ", connected) - # break - # else: - # count = count + 1 - # if count > 5: - # break - # time.sleep(5) - # if count > 5: - # assert False, "AP is disconnected" - # if not dfs_fail: - # assert False + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() + time.sleep(200) -# setup_params_general9 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 124, -# "channel_bandwidth": 20 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general9], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel124Bw20(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6480", name="WIFI-6480") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_124_bw_20 -# def test_dfs_channel_124_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general9["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general9["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False - setup_params_general10 = { "mode": "BRIDGE", "ssid_modes": { @@ -794,72 +457,35 @@ setup_params_general10 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general10], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-132") class TestDFSChannel132Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6481", name="WIFI-6481") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_132_bw_20 - def test_dfs_channel_132_bw_20(self, get_lanforge_library, station_names_fiveg): + @allure.title("Test for Channel 132 and bandwidth 20") + def test_dfs_channel_132_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general10["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general10["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = get_lanforge_library.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - print("station", station) - - # channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # print("channel before dfs: ", channel1) - # if channel1 == str(channel): - # dfs_start.dfs() - # time.sleep(15) - # else: - # print("Station not connected to applied channel") - # allure.attach(name="log Data", body="Station not connected to applied channel") - # assert False - # channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # log = dfs_start.dfs_logread() - # if channel1 != channel2: - # print(log) - # print("channel after dfs: ", channel2) - # allure.attach(name="log Data", body=log) - # else: - # print(log) - # print("dfs not happened") - # allure.attach(name="log Data", body=log) - # dfs_fail = False - # dfs_start.reboot() - # time.sleep(200) - # count = 0 - # while True: - # connected, latest, active = dfs_start.get_ucentral_status() - # if connected is True: - # print("status is connected after reboot: ", connected) - # break - # else: - # count = count + 1 - # if count > 5: - # break - # time.sleep(5) - # if count > 5: - # assert False, "AP is disconnected" - # if not dfs_fail: - # assert False + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() + time.sleep(200) setup_params_general11 = { @@ -884,75 +510,35 @@ setup_params_general11 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general11], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-136") class TestDFSChannel136Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6482", name="WIFI-6482") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_136_bw_20 - def test_dfs_channel_136_bw_20(self, get_lanforge_library, station_names_fiveg): + @allure.title("Test for Channel 136 and bandwidth 20") + def test_dfs_channel_136_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general11["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general11["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = get_lanforge_library.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - # var = get_station_data() - # {"1.1.wlan0": {"channel" : 52}, "1.1.wlan1": } - # if var["channel"] - # get_cx_data() - # - print("station", station) - # channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # print("channel before dfs: ", channel1) - # if channel1 == str(channel): - # dfs_start.dfs() - # time.sleep(15) - # else: - # print("Station not connected to applied channel") - # allure.attach(name="log Data", body="Station not connected to applied channel") - # assert False - # channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - # log = dfs_start.dfs_logread() - # if channel1 != channel2: - # print(log) - # print("channel after dfs: ", channel2) - # allure.attach(name="log Data", body=log) - # else: - # print(log) - # print("dfs not happened") - # allure.attach(name="log Data", body=log) - # dfs_fail = False - # dfs_start.reboot() - # time.sleep(200) - # count = 0 - # while True: - # connected, latest, active = dfs_start.get_ucentral_status() - # if connected is True: - # print("status is connected after reboot: ", connected) - # break - # else: - # count = count + 1 - # if count > 5: - # break - # time.sleep(5) - # if count > 5: - # assert False, "AP is disconnected" - # if not dfs_fail: - # assert False + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() + time.sleep(200) setup_params_general12 = { @@ -977,70 +563,34 @@ setup_params_general12 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general12], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-140") class TestDFSChannel140Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6483", name="WIFI-6483") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_140_bw_20 - def test_dfs_channel_140_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() + @allure.title("Test for Channel 140 and bandwidth 20") + def test_dfs_channel_140_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general12["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general12["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = lf_test.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() time.sleep(200) - count = 0 - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - else: - count = count + 1 - if count > 5: - break - time.sleep(5) - if count > 5: - assert False, "AP is disconnected" - if not dfs_fail: - assert False setup_params_general13 = { @@ -1065,67 +615,31 @@ setup_params_general13 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general13], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(20 MHz)") +@allure.sub_suite("Channel-144") class TestDFSChannel144Bw20(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6484", name="WIFI-6484") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_144_bw_20 - def test_dfs_channel_144_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() + @allure.title("Test for Channel 144 and bandwidth 20") + def test_dfs_channel_144_bw_20(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general13["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general13["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = lf_test.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() time.sleep(200) - count = 0 - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - else: - count = count + 1 - if count > 5: - break - time.sleep(5) - if count > 5: - assert False, "AP is disconnected" - if not dfs_fail: - assert False diff --git a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py index 64428bc08..0160f5075 100644 --- a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py +++ b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py @@ -27,72 +27,38 @@ setup_params_general1 = { }, "radius": False } + + @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general1], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") - +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(40 MHz)") +@allure.sub_suite("Channel-52") class TestDFSChannel52Bw40(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6209", name="WIFI-6209") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_52_bw_40 - def test_dfs_channel_52_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() + @allure.title("Test for Channel 52 and bandwidth 40") + def test_dfs_channel_52_bw_40(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general1["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = lf_test.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() time.sleep(200) - count = 0 - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - else: - count = count + 1 - if count > 5: - break - time.sleep(5) - if count > 5: - assert False, "AP is disconnected" - if not dfs_fail: - assert False + setup_params_general2 = { "mode": "BRIDGE", @@ -113,220 +79,39 @@ setup_params_general2 = { }, "radius": False } + + @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general2], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") - +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(40 MHz)") +@allure.sub_suite("Channel-100") class TestDFSChannel100Bw40(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6310", name="WIFI-6310") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_100_bw_40 - def test_dfs_channel_100_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() + @allure.title("Test for Channel 100 and bandwidth 40") + def test_dfs_channel_100_bw_40(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general2["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = lf_test.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() time.sleep(200) - count = 0 - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - else: - count = count + 1 - if count > 5: - break - time.sleep(5) - if count > 5: - assert False, "AP is disconnected" - if not dfs_fail: - assert False -# setup_params_general3 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 104, -# "channel_bandwidth": 40 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general3], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel104Bw40(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6312", name="WIFI-6312") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_104_bw_40 -# def test_dfs_channel_104_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general3["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False - -# setup_params_general4 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 56, -# "channel_bandwidth": 40 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general4], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel56Bw40(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6314", name="WIFI-6314") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_56_bw_40 -# def test_dfs_channel_56_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general4["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general4["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False setup_params_general5 = { "mode": "BRIDGE", @@ -347,146 +132,38 @@ setup_params_general5 = { }, "radius": False } + + @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general5], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") - +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(40 MHz)") +@allure.sub_suite("Channel-60") class TestDFSChannel60Bw40(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6315", name="WIFI-6315") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_60_bw_40 - def test_dfs_channel_60_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() + @allure.title("Test for Channel 60 and bandwidth 40") + def test_dfs_channel_60_bw_40(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general5["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general5["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = lf_test.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() time.sleep(200) - count = 0 - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - else: - count = count + 1 - if count > 5: - break - time.sleep(5) - if count > 5: - assert False, "AP is disconnected" - if not dfs_fail: - assert False -# setup_params_general6 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 64, -# "channel_bandwidth": 40 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general6], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel64Bw40(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6316", name="WIFI-6316") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_64_bw_40 -# def test_dfs_channel_64_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general6["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general6["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False setup_params_general7 = { "mode": "BRIDGE", @@ -507,294 +184,38 @@ setup_params_general7 = { }, "radius": False } + + @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general7], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") - +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(40 MHz)") +@allure.sub_suite("Channel-108") class TestDFSChannel108Bw40(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6317", name="WIFI-6317") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_108_bw_40 - def test_dfs_channel_108_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() + @allure.title("Test for Channel 108 and bandwidth 40") + def test_dfs_channel_108_bw_40(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general7["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general7["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = lf_test.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() time.sleep(200) - count = 0 - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - else: - count = count + 1 - if count > 5: - break - time.sleep(5) - if count > 5: - assert False, "AP is disconnected" - if not dfs_fail: - assert False -# setup_params_general8 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 120, -# "channel_bandwidth": 40 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general8], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel120Bw40(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6318", name="WIFI-6318") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_120_bw_40 -# def test_dfs_channel_120_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general8["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general8["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False - -# setup_params_general9 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 124, -# "channel_bandwidth": 40 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general9], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel124Bw40(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6319", name="WIFI-6319") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_124_bw_40 -# def test_dfs_channel_124_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general9["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general9["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False - -# setup_params_general10 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 128, -# "channel_bandwidth": 40 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general10], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel128Bw40(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6320", name="WIFI-6320") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_128_bw_40 -# def test_dfs_channel_128_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general10["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general10["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False setup_params_general11 = { "mode": "BRIDGE", @@ -816,217 +237,34 @@ setup_params_general11 = { }, "radius": False } + + @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general11], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") - +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(40 MHz)") +@allure.sub_suite("Channel-132") class TestDFSChannel132Bw40(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6321", name="WIFI-6321") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_132_bw_40 - def test_dfs_channel_132_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() + @allure.title("Test for Channel 132 and bandwidth 40") + def test_dfs_channel_132_bw_40(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general11["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general11["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = lf_test.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() time.sleep(200) - count = 0 - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - else: - count = count + 1 - if count > 5: - break - time.sleep(5) - if count > 5: - assert False, "AP is disconnected" - if not dfs_fail: - assert False - -# setup_params_general12 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 140, -# "channel_bandwidth": 40 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general12], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel140Bw40(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6321", name="WIFI-6321") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_140_bw_40 -# def test_dfs_channel_140_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general12["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general12["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False - -# setup_params_general13 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 144, -# "channel_bandwidth": 40 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general13], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel144Bw40(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6322", name="WIFI-6322") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_144_bw_40 -# def test_dfs_channel_144_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general13["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general13["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False \ No newline at end of file diff --git a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py index 30f9af740..9a4ceca68 100644 --- a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py +++ b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py @@ -31,70 +31,34 @@ setup_params_general1 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general1], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(80 MHz)") +@allure.sub_suite("Channel-52") class TestDFSChannel52Bw80(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6376", name="WIFI-6376") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_52_bw_80 - def test_dfs_channel_52_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() + @allure.title("Test for Channel 52 and bandwidth 80") + def test_dfs_channel_52_bw_80(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general1["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = lf_test.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() time.sleep(200) - count = 0 - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - else: - count = count + 1 - if count > 5: - break - time.sleep(5) - if count > 5: - assert False, "AP is disconnected" - if not dfs_fail: - assert False setup_params_general2 = { @@ -119,664 +83,37 @@ setup_params_general2 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general2], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(80 MHz)") +@allure.sub_suite("Channel-100") class TestDFSChannel100Bw80(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6311", name="WIFI-6311") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_100_bw_80 - def test_dfs_channel_100_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() + @allure.title("Test for Channel 100 and bandwidth 80") + def test_dfs_channel_100_bw_80(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general2["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = lf_test.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() time.sleep(200) - count = 0 - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - else: - count = count + 1 - if count > 5: - break - time.sleep(5) - if count > 5: - assert False, "AP is disconnected" - if not dfs_fail: - assert False -# setup_params_general3 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 104, -# "channel_bandwidth": 80 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general3], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel104Bw80(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6313", name="WIFI-6313") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_104_bw_80 -# def test_dfs_channel_104_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general3["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False -# -# setup_params_general4 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 56, -# "channel_bandwidth": 80 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general4], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel56Bw80(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6377", name="WIFI-6377") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_56_bw_80 -# def test_dfs_channel_56_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general4["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general4["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False -# -# setup_params_general5 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 60, -# "channel_bandwidth": 80 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general5], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel60Bw80(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6378", name="WIFI-6378") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_60_bw_80 -# def test_dfs_channel_60_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general5["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general5["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False -# -# setup_params_general6 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 64, -# "channel_bandwidth": 80 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general6], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel64Bw80(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6379", name="WIFI-6379") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_64_bw_80 -# def test_dfs_channel_64_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general6["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general6["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False -# -# setup_params_general7 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 108, -# "channel_bandwidth": 80 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general7], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel108Bw80(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6380", name="WIFI-6380") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_108_bw_80 -# def test_dfs_channel_108_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general7["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general7["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False -# -# setup_params_general8 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 120, -# "channel_bandwidth": 80 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general8], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel120Bw80(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6381", name="WIFI-6381") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_120_bw_80 -# def test_dfs_channel_120_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general8["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general8["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False -# -# setup_params_general9 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 124, -# "channel_bandwidth": 80 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general9], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel124Bw80(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6382", name="WIFI-6382") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_124_bw_80 -# def test_dfs_channel_124_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general9["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general9["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False -# -# setup_params_general10 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 128, -# "channel_bandwidth": 80 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general10], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel128Bw80(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6383", name="WIFI-6383") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_128_bw_80 -# def test_dfs_channel_128_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general10["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general10["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False - setup_params_general11 = { "mode": "BRIDGE", "ssid_modes": { @@ -799,215 +136,32 @@ setup_params_general11 = { @pytest.mark.parametrize( - 'setup_profiles', + 'setup_configuration', [setup_params_general11], indirect=True, scope="class" ) -@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.usefixtures("setup_configuration") +@pytest.mark.usefixtures("setup_configuration") +@allure.parent_suite("OpenWifi DFS Test") +@allure.suite("BRIDGE Mode(80 MHz)") +@allure.sub_suite("Channel-132") class TestDFSChannel132Bw80(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6384", name="WIFI-6384") @pytest.mark.wpa2_personal @pytest.mark.fiveg @pytest.mark.dfs_channel_132_bw_80 - def test_dfs_channel_132_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() + @allure.title("Test for Channel 132 and bandwidth 80") + def test_dfs_channel_132_bw_80(self, get_test_library, get_dut_logs_per_test_case, get_test_device_logs, + num_stations, setup_configuration, get_target_object): profile_data = setup_params_general11["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general11["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - station = lf_test.Client_Connect(ssid=ssid_name, security=security, - passkey=security_key, mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - print("station", station) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() + get_test_library.dfs_test(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + num_sta=1, dut_data=setup_configuration, tip_2x_obj=get_target_object) + get_target_object.reboot() time.sleep(200) - count = 0 - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - else: - count = count + 1 - if count > 5: - break - time.sleep(5) - if count > 5: - assert False, "AP is disconnected" - if not dfs_fail: - assert False - -# setup_params_general12 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 140, -# "channel_bandwidth": 80 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general12], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel140Bw80(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6385", name="WIFI-6385") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_140_bw_80 -# def test_dfs_channel_140_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general12["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general12["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False -# -# setup_params_general13 = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} -# ] -# }, -# "dfs": { -# "channel": 144, -# "channel_bandwidth": 80 -# }, -# "rf": {}, -# "radius": False -# } -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general13], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# -# class TestDFSChannel144Bw80(object): -# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6386", name="WIFI-6386") -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# @pytest.mark.dfs_channel_144_bw_80 -# def test_dfs_channel_144_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): -# lf_tools.reset_scenario() -# profile_data = setup_params_general13["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# channel = setup_params_general13["dfs"]["channel"] -# security = "wpa2" -# band = "fiveg" -# mode = "BRIDGE" -# vlan = 1 -# dfs_fail = True -# print("station_names_fiveg :", station_names_fiveg) -# station = lf_test.Client_Connect(ssid=ssid_name, security=security, -# passkey=security_key, mode=mode, band=band, -# station_name=station_names_fiveg, vlan_id=vlan) -# print("station", station) -# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# print("channel before dfs: ", channel1) -# if channel1 == str(channel): -# dfs_start.dfs() -# time.sleep(15) -# else: -# print("Station not connected to applied channel") -# allure.attach(name="log Data", body="Station not connected to applied channel") -# assert False -# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") -# log = dfs_start.dfs_logread() -# if channel1 != channel2: -# print(log) -# print("channel after dfs: ", channel2) -# allure.attach(name="log Data", body=log) -# else: -# print(log) -# print("dfs not happened") -# allure.attach(name="log Data", body=log) -# dfs_fail = False -# dfs_start.reboot() -# time.sleep(200) -# while True: -# connected, latest, active = dfs_start.get_ucentral_status() -# if connected is True: -# print("status is connected after reboot: ", connected) -# break -# time.sleep(1) -# if not dfs_fail: -# assert False