From 474bd9dc775c3ea888f9b5d12dfdae7deeba8c09 Mon Sep 17 00:00:00 2001 From: Tarun <110225541+tarun-candela@users.noreply.github.com> Date: Fri, 10 Mar 2023 11:21:04 +0530 Subject: [PATCH] modified client-isolation test cases (#783) Signed-off-by: tarun-candela --- .../client_isolation/test_client_isolation.py | 1595 ++++------------- 1 file changed, 313 insertions(+), 1282 deletions(-) diff --git a/tests/e2e/basic/validation_of_operating_modes/client_isolation/test_client_isolation.py b/tests/e2e/basic/validation_of_operating_modes/client_isolation/test_client_isolation.py index 8b3e4cd7c..c3cc6cad6 100644 --- a/tests/e2e/basic/validation_of_operating_modes/client_isolation/test_client_isolation.py +++ b/tests/e2e/basic/validation_of_operating_modes/client_isolation/test_client_isolation.py @@ -3,10 +3,8 @@ pytest -m client_isolation """ -import time import allure import pytest -from tabulate import tabulate pytestmark = [pytest.mark.ow_regression_lf, pytest.mark.client_isolation, pytest.mark.bridge] @@ -67,7 +65,6 @@ class TestClientIsolationEnabled(object): pytest -m "client_isolation and ci_enabled and bridge" """ @pytest.mark.wpa2_personal - @pytest.mark.hi @pytest.mark.fiveg @pytest.mark.ci_enabled_in_5g_ssid @allure.title("Verify the connectivity of 2 clients connected to the different SSID by enabling the client " @@ -76,74 +73,29 @@ class TestClientIsolationEnabled(object): def test_client_isolation_enabled_ssid_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][2] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid1_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][3] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid2_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_5g_radios[0] - station_name = get_test_library.fiveg_prefix - sta = [] - for i in range(2): - sta.append(station_name + str(i)) - print(sta) + band = "fiveg" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][2])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][3])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name, station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name, station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=sta,side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names",value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0], sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("Test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=None, + band_5g=band, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456,side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between two " - "5g stations, when isolation enabled in different 5g ssids."+"\n\n"+str(table)) - print("Test failed,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, Stations are able to ping each other, when" - "isolation enabled in different 5g ssids." +"\n\n"+str(table)) - - print("Test pass, traffic ran between two stations when isolation enabled in both 5g ssids.") - assert True - else: - print("Layer3 not ran properly.") + assert True, description @pytest.mark.wpa2_personal - @pytest.mark.hi @pytest.mark.twog @pytest.mark.ci_enabled_in_2g_ssid @allure.title("Run traffic between eth2 port (AP) and station (with client isolation enabled) -2.4GHz") @@ -151,62 +103,25 @@ class TestClientIsolationEnabled(object): def test_client_isolation_enabled_with_2g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid1_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_2g_radios[0] - station_list = get_test_library.twog_prefix + band = "twog" - allure.attach(name="station_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][0])) - station_result = get_test_library.client_connect_using_radio(ssid=ssid_name, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=[station_list]) - result = get_test_library.json_get(_req_url="port/1/1/%s" % (station_list)) - get_test_library.allure_report_table_format(dict_data=result["interface"], key="Station_port_data",value="VALUE", - name="%s info" % (station_list)) - - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[station_list], side_b="") - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [station_list,"eth2"], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"], rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"], rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not station_result: - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name, ssid2=None, + passkey=security_key, + security=security, mode=mode, band_2g=band, + band_5g=None, + dut_data=setup_configuration, num_sta=1, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between 2g station " - "and eth-port, when isolation enabled in 2g ssid."+"\n\n"+str(table)) - print("Test failed,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, 2g station able to ping eth-port, when" - "isolation enabled in 2g ssid."+"\n\n"+str(table)) - print("Test pass, traffic ran between eth2 and station when isolation enabled in one 2g ssid.") - assert True - else: - print("Layer3 not ran properly.") - + assert True, description # clients_connected to different ssid, enabling isolation in both(2.4GH) @@ -219,72 +134,27 @@ class TestClientIsolationEnabled(object): def test_client_isolation_enabled_ssids_2g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid1_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid2_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_2g_radios[0] - station_name = get_test_library.twog_prefix - sta = [] - for i in range(2): - sta.append(station_name + str(i)) - print(sta) + band = "twog" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][0])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][1])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name, station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name, station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[1])) - - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0], sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("Test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=band, + band_5g=None, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between two " - "stations, when isolation enabled in different 2g ssids."+"\n\n"+str(table)) - print("Test failed,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, Stations are able to ping each other, when" - "isolation enabled in different 2g ssids."+"\n\n"+str(table)) - print("Test pass, traffic ran between two stations when isolation enabled in both 2g ssids.") - assert True - else: - print("Layer3 not ran properly.") + assert True, description # Running traffic between eth2 to station with client-isolation enabled in (5GH) ssid @@ -296,62 +166,25 @@ class TestClientIsolationEnabled(object): def test_client_isolation_enabled_with_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][2] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid1_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - station_list = "sta100" security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_5g_radios[0] - station_list = get_test_library.fiveg_prefix + band ="fiveg" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][2])) - station_result = get_test_library.client_connect_using_radio(ssid=ssid_name, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=[station_list]) - result = get_test_library.json_get(_req_url="port/1/1/%s" % (station_list)) - get_test_library.allure_report_table_format(dict_data=result["interface"], key="Station_port_data",value="VALUE", - name="%s info" % (station_list)) - - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[station_list], side_b="") - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [station_list,"eth2"], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not station_result: - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name, ssid2=None, + passkey=security_key, + security=security, mode=mode, band_2g=None, + band_5g=band, + dut_data=setup_configuration, num_sta=1, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between 5g station" - " and eth-port, when isolation enabled in 5g ssid."+"\n\n"+str(table)) - print("Test failed,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, 5g station able to ping eth-port, when isolation" - " enabled in 5g ssid."+"\n\n"+str(table)) - print("Test pass, traffic ran between eth2 and station when isolation enabled in one 5g ssid.") - assert True - else: - print("Layer3 not ran properly.") + assert True, description setup_params_general1 = { @@ -419,72 +252,27 @@ class TestClientIsolationDisabled(object): def test_client_isolation_disabled_ssids_2g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][0] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid1_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][1] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid2_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_2g_radios[0] - station_name = get_test_library.twog_prefix - sta = [] - for i in range(2): - sta.append(station_name + str(i)) - print(sta) + band = "twog" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][0])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][1])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0], sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=band, + band_5g=None, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between two " - "stations, when isolation disabled in different 2g ssids."+"\n\n"+str(table)) - print("Test failed,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, Stations are able to ping each other, when" - "isolation disabled in different 2g ssids."+"\n\n"+str(table)) - print("Test pass, traffic ran between two stations when isolation disabled in both 2g ssids.") - assert True - else: - print("Layer3 not ran properly.") + assert True, description @pytest.mark.wpa2_personal @pytest.mark.twog @@ -494,60 +282,25 @@ class TestClientIsolationDisabled(object): def test_client_isolation_disabled_with_2g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][0] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid1_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_2g_radios[0] - station_list = get_test_library.twog_prefix + band = "twog" - allure.attach(name="station_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][0])) - station_result = get_test_library.client_connect_using_radio(ssid=ssid_name, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=[station_list]) - result = get_test_library.json_get(_req_url="port/1/1/%s" % (station_list)) - get_test_library.allure_report_table_format(dict_data=result["interface"], key="Station_port_data",value="VALUE", - name="%s info" % (station_list)) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[station_list], side_b="") - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [station_list,"eth2"], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not station_result: - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name, ssid2=None, + passkey=security_key, + security=security, mode=mode, band_2g=band, + band_5g=None, + dut_data=setup_configuration, num_sta=1, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between 2g station " - "and eth-port, when isolation disabled in 2g ssid."+"\n\n"+str(table)) - print("Test failed,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, 2g station able to ping eth-port, when" - "isolation disabled in 2g ssid."+"\n\n"+str(table)) - print("Test pass, traffic ran between eth2 and station when isolation disabled in one 2g ssid.") - assert True - else: - print("Layer3 not ran properly.") + assert True, description # clients_connected to different ssid, disabling isolation in both(5GH) @pytest.mark.wpa2_personal @@ -559,71 +312,27 @@ class TestClientIsolationDisabled(object): def test_client_isolation_disabled_ssid_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][2] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid1_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][3] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid2_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_5g_radios[0] - station_name = get_test_library.fiveg_prefix - sta = [] - for i in range(2): - sta.append(station_name + str(i)) - print(sta) + band = "fiveg" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][2])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][3])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name, station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name, station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0], sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=None, + band_5g=band, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between 5g station" - " and eth-port, when isolation disabled in 5g ssid."+"\n\n"+str(table)) - print("Test failed,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, Stations are able to ping each other, when" - "isolation disabled in different 5g ssids."+"\n\n"+str(table)) - print("Test pass, traffic ran between two stations when isolation disabled in both 5g ssids.") - assert True - else: - print("Layer3 not ran properly.") + assert True, description # Running traffic between eth2 to station with client-isolation disabled in (5GH) ssid @pytest.mark.wpa2_personal @@ -634,60 +343,25 @@ class TestClientIsolationDisabled(object): def test_client_isolation_disabled_with_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][2] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid1_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_5g_radios[0] - station_list = get_test_library.fiveg_prefix + band = "fiveg" - allure.attach(name="station_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][2])) - station_result = get_test_library.client_connect_using_radio(ssid=ssid_name, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=[station_list]) - result = get_test_library.json_get(_req_url="port/1/1/%s" % (station_list)) - get_test_library.allure_report_table_format(dict_data=result["interface"], key="Station_port_data",value="VALUE", - name="%s info" % (station_list)) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[station_list], side_b="") - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [station_list,"eth2"], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not station_result: - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name, ssid2=None, + passkey=security_key, + security=security, mode=mode, band_2g=None, + band_5g=band, + dut_data=setup_configuration, num_sta=1, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between 5g station" - " and eth-port, when isolation disabled in 5g ssid."+"\n\n"+str(table)) - print("Test failed,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, 5g station able to ping eth-port, when isolation" - " disabled in 5g ssid."+"\n\n"+str(table)) - print("Test pass, traffic ran between eth2 and stations when isolation disabled in one 5g ssid.") - assert True - else: - print("Layer3 not ran properly.") + assert True, description setup_params_general2 = { @@ -753,66 +427,25 @@ class TestClientIsolationSameSSID(object): def test_cleint_isolation_enabled_same_ssid_2g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][0] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_2g_radios[0] - station_name = get_test_library.twog_prefix - sta = [] - for i in range(2): - sta.append(station_name + str(i)) - print(sta) + band = "twog" - allure.attach(name="station_ssid_config-info", body=str(setup_params_general2["ssid_modes"]["wpa2_personal"][0])) - station_result = get_test_library.client_connect_using_radio(ssid=ssid_name, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=sta) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0], sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not station_result: - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name, ssid2=ssid_name, + passkey=security_key, + security=security, mode=mode, band_2g=band, + band_5g=None, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result",body="TEST PASS, Rx drop has 100% when isolation enabled in ssid."+"\n\n"+str(table)) - print("Test PASS,Rx drop has 100%") - assert True - else: - allure.attach(name="Test Result", body="TEST FAILED, Stations should not ping each other, when " - "isolation enabled in same ssid"+"\n\n"+str(table)) - print("Test fail, traffic ran between two stations when isolation enabled in both 2g same-ssid.") - assert False - else: - print("Layer3 not ran properly.") + assert True, description # clients_connected to same ssid, disabled isolation(2.4GH) @pytest.mark.wpa2_personal @@ -824,67 +457,25 @@ class TestClientIsolationSameSSID(object): def test_cleint_isolation_disabled_same_ssid_2g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][1] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_2g_radios[0] - station_name = get_test_library.twog_prefix - sta = [] - for i in range(2): - sta.append(station_name + str(i)) - print(sta) + band = "twog" - allure.attach(name="station_ssid_config-info", body=str(setup_params_general2["ssid_modes"]["wpa2_personal"][1])) - station_result = get_test_library.client_connect_using_radio(ssid=ssid_name, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=sta) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0], sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not station_result: - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name, ssid2=ssid_name, + passkey=security_key, + security=security, mode=mode, band_2g=band, + band_5g=None, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% when isolation " - "disabled in same ssid"+"\n\n"+str(table)) - print("Test failed,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, Stations are able to ping each other, when " - "isolation disabled in ssid."+"\n\n"+str(table)) - print("Test pass, traffic ran between two stations when isolation disabled in both 2g same-ssid.") - assert True - else: - print("Layer3 not ran properly.") + assert True, description # clients_connected to same ssid, enabled isolation(5GHZ) @pytest.mark.wpa2_personal @@ -895,66 +486,25 @@ class TestClientIsolationSameSSID(object): def test_cleint_isolation_enabled_same_ssid_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][2] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_5g_radios[0] - station_name = get_test_library.fiveg_prefix - sta = [] - for i in range(2): - sta.append(station_name + str(i)) - print(sta) + band = "fiveg" - allure.attach(name="station_ssid_config-info", body=str(setup_params_general2["ssid_modes"]["wpa2_personal"][2])) - station_result = get_test_library.client_connect_using_radio(ssid=ssid_name, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=sta) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0], sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not station_result: - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name, ssid2=ssid_name, + passkey=security_key, + security=security, mode=mode, band_2g=None, + band_5g=band, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST PASS, Rx drop has 100% when isolation enabled in ssid"+"\n\n"+str(table)) - print("Test PASS,Rx drop has 100%") - assert True - else: - allure.attach(name="Test Result", body="TEST FAILED, Stations are should not ping each other, when" - "isolation enabled in ssid."+"\n\n"+str(table)) - print("Test FAIL, traffic ran between two stations when isolation enabled in both 5g same-ssid.") - assert False - else: - print("Layer3 not ran properly.") + assert True, description @pytest.mark.wpa2_personal @pytest.mark.fiveg @@ -964,67 +514,25 @@ class TestClientIsolationSameSSID(object): def test_cleint_isolation_disabled_same_ssid_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][3] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_5g_radios[0] - station_name = get_test_library.fiveg_prefix - sta = [] - for i in range(2): - sta.append(station_name + str(i)) - print(sta) + band = "fiveg" - allure.attach(name="station_ssid_config-info", body=str(setup_params_general2["ssid_modes"]["wpa2_personal"][3])) - station_result = get_test_library.client_connect_using_radio(ssid=ssid_name, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=sta) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0], sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not station_result: - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name, ssid2=ssid_name, + passkey=security_key, + security=security, mode=mode, band_2g=None, + band_5g=band, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% when isolation " - "disabled in ssid."+"\n\n"+str(table)) - print("TEST FAIL,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, Stations able to ping each other, when isolation" - "disabled in ssid."+"\n\n"+str(table)) - print("TEST PASS, traffic ran between two stations when isolation disabled in both 5g same-ssid.") - assert True - else: - print("Layer3 not ran properly.") + assert True, description setup_params_general3 = { @@ -1032,28 +540,28 @@ setup_params_general3 = { "ssid_modes": { "wpa2_personal": [ { - "ssid_name": "ci_enabled_wpa2_ssid1_2g", + "ssid_name": "ci_enabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security": "psk2", "security_key": "OpenWifi", "isolate-clients": True }, { - "ssid_name": "ci_disabled_wpa2_ssid2_2g", + "ssid_name": "ci_disabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security": "psk2", "security_key": "OpenWifi", "isolate-clients": False }, { - "ssid_name": "ci_enabled_wpa2_ssid1_5g", + "ssid_name": "ci_enabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security": "psk2", "security_key": "OpenWifi", "isolate-clients": True }, { - "ssid_name": "ci_disabled_wpa2_ssid2_5g", + "ssid_name": "ci_disabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security": "psk2", "security_key": "OpenWifi", @@ -1093,74 +601,27 @@ class TestClientIsolationDifferentSSID(object): def test_client_isoaltion_enabled_ssid_2g_disabled_ssid_2g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][1] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_2g_radios[0] - station_name = get_test_library.twog_prefix - sta = [] - for i in range(2): - sta.append(station_name + str(i)) - print(sta) + band = "twog" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][0])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][1])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[sta[0]], side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0],sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=band, + band_5g=None, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% when isolation " - "enabled in one 2g ssid & disabled in another 2g ssid."+"\n\n"+str(table)) - print("Test failed,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, Two 2g stations are able to ping each other, " - "when isolation enabled in one 2g ssid & disabled in another 2g ssid."+"\n\n"+str(table)) - print("Test pass, traffic ran between two stations when isolation enabled in one 2g ssid disabled " - "in another.") - assert True - else: - print("Layer3 not ran properly.") + assert True, description # clients_connected to different ssid,enabling isolation in ssid (5GH)& isolation disabled in ssid (5GHZ) @@ -1174,78 +635,32 @@ class TestClientIsolationDifferentSSID(object): def test_client_isoaltion_enabled_ssid_5g_disabled_ssid_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][2] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][3] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name = get_test_library.wave2_5g_radios[0] - station_name = get_test_library.fiveg_prefix - sta = [] - for i in range(2): - sta.append(station_name + str(i)) - print(sta) - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][2])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][3])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name, - station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[sta[0]], side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) + band = "fiveg" - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0],sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=None, + band_5g=band, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: - allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% when isolation " - "enabled in one 5g ssid & disabled in another 5g ssid."+"\n\n"+str(table)) - print("Test failed,Rx drop should not be 100%") - assert False - else: - allure.attach(name="Test Result", body="TEST PASS, Two 5g stations are able to ping each other, " - "when isolation enabled in one 5g ssid & disabled in another 5g ssid."+"\n\n"+str(table)) - print("Test pass, traffic ran between two stations when isolation enabled in one 5g and disabled " - "in another.") - assert True - else: - print("Layer3 not ran properly.") + assert True, description # run traffic from 2g to 5g @pytest.mark.wpa2_personal - @pytest.mark.fiveg @pytest.mark.twog + @pytest.mark.fiveg @pytest.mark.ci_enabled_2g_and_5g_traffic_2g_to_5g @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is enabled" " in 2G SSID and 5G SSID (run traffic from 2G client to 5G client)") @@ -1253,79 +668,31 @@ class TestClientIsolationDifferentSSID(object): def test_client_isolation_enabled_ssid2g_and_ssid5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][2] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name1 = get_test_library.wave2_2g_radios[0] - radio_name2 = get_test_library.wave2_5g_radios[0] - station_name1 = get_test_library.twog_prefix - station_name2 = get_test_library.fiveg_prefix - sta = [] - for i in range(1): - sta.append(station_name1 + str(i)) - sta.append(station_name2 + str(i)) - print(sta) + band_2g = "twog" + band_5g = "fiveg" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][0])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][2])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name1, station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name2, station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="0 (zero)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=0, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[sta[0]], side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0], sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, passkey=security_key, + security=security, mode=mode, band_2g=band_2g, band_5g=band_5g, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=0, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["bps rx a"] == 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] != 0: - allure.attach(name="Test Result",body="TEST PASS, The 5g station Received rx bytes per second is %s" % (rx_data[f"{cx_list[0]}"]["bps rx b"]) + - " after traffic ran from 2g to 5g"+"\n\n"+str(table)) - print("Test pass, traffic ran between 2g to 5g stations when isolation enabled in 2g and 5g ssid.") - assert True - else: - allure.attach(name="Test Result", body="TEST FAILED, Due to the 5g station not received rx bytes, " - "after traffic ran from 2g to 5g"+"\n\n"+str(table)) - print("Test failed, bps rx b received none") - assert False - else: - print("Layer3 not ran properly.") + assert True, description # run traffic from 2g to 5g @pytest.mark.wpa2_personal - @pytest.mark.fiveg @pytest.mark.twog + @pytest.mark.fiveg @pytest.mark.ci_disable_2g_and_5g_traffic_2g_to_5g @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is disabled" " in 2G SSID and 5G SSID (run traffic from 2G client to 5G client)") @@ -1333,81 +700,34 @@ class TestClientIsolationDifferentSSID(object): def test_client_isolation_disabled_ssid2g_and_ssid5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][1] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][3] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name1 = get_test_library.wave2_2g_radios[0] - radio_name2 = get_test_library.wave2_5g_radios[0] - station_name1 = get_test_library.twog_prefix - station_name2 = get_test_library.fiveg_prefix - sta = [] - for i in range(1): - sta.append(station_name1 + str(i)) - sta.append(station_name2 + str(i)) - print(sta) + band_2g = "twog" + band_5g = "fiveg" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][1])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][3])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name1, station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name2, station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="0 (zero)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=0, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[sta[0]], side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0],sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=band_2g, + band_5g=band_5g, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=0, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["bps rx a"] == 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] != 0: - allure.attach(name="Test Result", - body="TEST PASS, The 5g station Received rx bytes per second is %s" % ( - rx_data[f"{cx_list[0]}"]["bps rx b"]) + " after traffic ran from 2g to 5g"+"\n\n"+str(table)) - print("Test pass, traffic ran between 2g to 5g stations when isolation disabled in 2g and 5g ssid.") - assert True - else: - allure.attach(name="Test Result", body="TEST FAILED, Due to the 5g station not received rx bytes, " - "after traffic ran from 2g to 5g"+"\n\n"+str(table)) - print("Test failed, bps rx b received none") - assert False - else: - print("Layer3 not ran properly.") + assert True, description # clients_connected to different ssid, enabling isolation in both (2GHz) & (5GHz) ssid # run traffic from 5g to 2g @pytest.mark.wpa2_personal - @pytest.mark.fiveg @pytest.mark.twog + @pytest.mark.fiveg @pytest.mark.ci_enabled_2g_and_5g_traffic_5g_to_2g @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is enabled" " in 2G SSID and 5G SSID (run traffic from 5G client to 2G client)") @@ -1415,81 +735,33 @@ class TestClientIsolationDifferentSSID(object): def test_client_isolation_enabled_ssid_2gandssid_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][2] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name1 = get_test_library.wave2_2g_radios[0] - radio_name2 = get_test_library.wave2_5g_radios[0] - station_name1 = get_test_library.twog_prefix - station_name2 = get_test_library.fiveg_prefix - sta = [] - for i in range(1): - sta.append(station_name1 + str(i)) - sta.append(station_name2 + str(i)) - print(sta) + band_2g = "twog" + band_5g = "fiveg" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][0])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][2])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name1, station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name2, station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="0 (zero)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=0, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[sta[0]],side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0],sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=band_2g, + band_5g=band_5g, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=0, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["bps rx a"] != 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] == 0: - allure.attach(name="Test Result", - body="TEST PASS, The 2g station Received rx bytes per second is %s" % ( - rx_data[f"{cx_list[0]}"]["bps rx a"]) + " after traffic ran from 5g to 2g"+"\n\n"+str(table)) - print("Test pass, traffic ran between 5g to 2g stations when isolation enabled in 2g and 5g ssid.") - assert True - else: - allure.attach(name="Test Result", body="TEST FAILED, Due to the 2g station not received rx bytes, " - "after traffic ran from 5g to 2g"+"\n\n"+str(table)) - print("Test failed, bps rx -a received none") - assert False - else: - print("Layer3 not ran properly.") + assert True, description # clients_connected to different ssid, disabled isolation in both (2GHz) & (5GHz) ssid # run traffic from 5g to 2g @pytest.mark.wpa2_personal - @pytest.mark.fiveg @pytest.mark.twog + @pytest.mark.fiveg @pytest.mark.ci_disable_2g_and_5g_traffic_5g_to_2g @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is disabled" " in 2G SSID and 5G SSID (run traffic from 5G client to 2G client)") @@ -1497,75 +769,28 @@ class TestClientIsolationDifferentSSID(object): def test_client_isolation_disabled_ssid_2gandssid_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][1] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][3] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name1 = get_test_library.wave2_2g_radios[0] - radio_name2 = get_test_library.wave2_5g_radios[0] - station_name1 = get_test_library.twog_prefix - station_name2 = get_test_library.fiveg_prefix - sta = [] - for i in range(1): - sta.append(station_name1 + str(i)) - sta.append(station_name2 + str(i)) - print(sta) + band_2g = "twog" + band_5g = "fiveg" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][1])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][3])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name1, station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name2, station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="0 (zero)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=0, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[sta[0]],side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0],sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=band_2g, + band_5g=band_5g, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=0, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["bps rx a"] != 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] == 0: - allure.attach(name="Test Result", - body="TEST PASS, The 2g station Received rx bytes per second is %s" % ( - rx_data[f"{cx_list[0]}"]["bps rx a"]) + " after traffic ran from 5g to 2g"+"\n\n"+str(table)) - print("Test pass, traffic ran between 5g to 2g stations when isolation disabled in 2g and 5g ssid.") - assert True - else: - allure.attach(name="Test Result", body="TEST FAILED, Due to the 2g station not received rx bytes, " - "after traffic ran from 5g to 2g"+"\n\n"+str(table)) - print("Test failed, bps rx -a received none") - assert False - else: - print("Layer3 not ran properly.") + assert True, description # run traffic from 2g to 5g @pytest.mark.wpa2_personal @@ -1577,76 +802,28 @@ class TestClientIsolationDifferentSSID(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10614", name="WIFI-10614") def test_client_isolation_enabled_ssids_2gdisabled_ssid_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][3] + profile_data ={"ssid_name": "ci_disabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name1 = get_test_library.wave2_2g_radios[0] - radio_name2 = get_test_library.wave2_5g_radios[0] - station_name1 = get_test_library.twog_prefix - station_name2 = get_test_library.fiveg_prefix - sta = [] - for i in range(1): - sta.append(station_name1 + str(i)) - sta.append(station_name2 + str(i)) - print(sta) + band_2g = "twog" + band_5g = "fiveg" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][0])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][3])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name1, station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name2, station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="0 (zero)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=0, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[sta[0]],side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0],sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=band_2g, + band_5g=band_5g, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=0, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["bps rx a"] == 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] != 0: - allure.attach(name="Test Result", - body="TEST PASS, The 5g station Received rx bytes per second is %s" % ( - rx_data[f"{cx_list[0]}"]["bps rx b"]) + " after traffic ran from 2g to 5g"+"\n\n"+str(table)) - print("Test pass, traffic ran between 2g to 5g stations when isolation enabled in 2g and disabled " - "5g ssid.") - assert True - else: - allure.attach(name="Test Result", body="TEST FAILED, Due to the 5g station not received rx bytes, " - "after traffic ran from 2g to 5g"+"\n\n"+str(table)) - print("Test failed, bps rx b received none") - assert False - else: - print("Layer3 not ran properly.") + assert True, description # run traffic from 5g to 2g @pytest.mark.wpa2_personal @@ -1659,78 +836,28 @@ class TestClientIsolationDifferentSSID(object): def test_client_isolation_disabled_ssid_2genabled_ssid_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][1] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][2] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name1 = get_test_library.wave2_2g_radios[0] - radio_name2 = get_test_library.wave2_5g_radios[0] - station_name1 = get_test_library.twog_prefix - station_name2 = get_test_library.fiveg_prefix - sta = [] - for i in range(1): - sta.append(station_name1 + str(i)) - sta.append(station_name2 + str(i)) - print(sta) + band_2g = "twog" + band_5g = "fiveg" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][1])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][2])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name1, - station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name2, - station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="0 (zero)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=0, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[sta[0]], side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0],sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=band_2g, + band_5g=band_5g, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=0, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["bps rx a"] != 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] == 0: - allure.attach(name="Test Result", - body="TEST PASS, The 2g station Received rx bytes per second is %s" % ( - rx_data[f"{cx_list[0]}"]["bps rx a"]) + " after traffic ran from 5g to 2g"+"\n\n"+str(table)) - print("Test pass, traffic ran between 5g to 2g stations when isolation disabled in 2g and enabled " - "5g ssid.") - assert True - else: - allure.attach(name="Test Result", body="TEST FAILED, Due to the 2g station not received rx bytes, " - "after traffic ran from 5g to 2g"+"\n\n"+str(table)) - print("Test failed, bps rx a received none") - assert False - else: - print("Layer3 not ran properly.") + assert True, description # clients_connected to different ssid,enabled isolation in (2GHz)ssid & isolation disabled in (5GH)ssid @@ -1745,76 +872,28 @@ class TestClientIsolationDifferentSSID(object): def test_client_isolation_enabled_ssids_2g_disabled_ssid_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][3] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name1 = get_test_library.wave2_2g_radios[0] - radio_name2 = get_test_library.wave2_5g_radios[0] - station_name1 = get_test_library.twog_prefix - station_name2 = get_test_library.fiveg_prefix - sta = [] - for i in range(1): - sta.append(station_name1 + str(i)) - sta.append(station_name2 + str(i)) - print(sta) + band_2g = "twog" + band_5g = "fiveg" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][0])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][3])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name1, station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name2, station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="0 (zero)") - allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=0, side_a_max_rate=0, - side_b_min_rate=6291456, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[sta[0]],side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0],sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=band_2g, + band_5g=band_5g, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=0, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["bps rx a"] != 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] == 0: - allure.attach(name="Test Result", - body="TEST PASS, The 2g station Received rx bytes per second is %s" % ( - rx_data[f"{cx_list[0]}"]["bps rx a"]) + " after traffic ran from 5g to 2g"+"\n\n"+str(table)) - print("Test pass, traffic ran between 5g to 2g stations when isolation disabled in 2g and enabled " - "5g ssid.") - assert True - else: - allure.attach(name="Test Result", body="TEST FAILED, Due to the 2g station not received rx bytes, " - "after traffic ran from 5g to 2g"+"\n\n"+str(table)) - print("Test failed, bps rx a received none") - assert False - else: - print("Layer3 not ran properly.") + assert True, description # clients_connected to different ssid,disabled isolation in ssid (2GHz)& isolation enabled in ssid(5GH) # run traffic from 2g to 5g @@ -1828,73 +907,25 @@ class TestClientIsolationDifferentSSID(object): def test_client_isolation_disabled_ssid_2g_enabled_ssid_5g(self, setup_configuration, get_test_library, num_stations, get_test_device_logs, get_dut_logs_per_test_case, check_connectivity): - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][1] + profile_data = {"ssid_name": "ci_disabled_wpa2_ssid_2g", "appliedRadios": ["2G"], "security_key": "OpenWifi"} ssid_name1 = profile_data["ssid_name"] - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][2] + profile_data = {"ssid_name": "ci_enabled_wpa2_ssid_5g", "appliedRadios": ["5G"], "security_key": "OpenWifi"} ssid_name2 = profile_data["ssid_name"] security_key = profile_data["security_key"] security = "wpa2" mode = "BRIDGE" - radio_name1 = get_test_library.wave2_2g_radios[0] - radio_name2 = get_test_library.wave2_5g_radios[0] - station_name1 = get_test_library.twog_prefix - station_name2 = get_test_library.fiveg_prefix - sta = [] - for i in range(1): - sta.append(station_name1 + str(i)) - sta.append(station_name2 + str(i)) - print(sta) + band_2g = "twog" + band_5g = "fiveg" - allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][1])) - allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][2])) - station_result1 = get_test_library.client_connect_using_radio(ssid=ssid_name1, passkey=security_key, - security=security, mode=mode, radio=radio_name1, station_name=[sta[0]]) - station_result2 = get_test_library.client_connect_using_radio(ssid=ssid_name2, passkey=security_key, - security=security, mode=mode, radio=radio_name2, station_name=[sta[1]]) - sta_data1 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[0])) - sta_data2 = get_test_library.json_get(_req_url="port/1/1/%s" % (sta[1])) - get_test_library.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[0])) - get_test_library.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", - name="%s info" % (sta[1])) - allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") - allure.attach(name="Min Tx rate -B", body="0 (zero)") - layer3_restult = get_test_library.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, - side_b_min_rate=0, side_b_max_rate=0, - traffic_type="lf_udp", sta_list=[sta[0]],side_b=sta[1]) - print("waiting 30 sec for getting cx_list data...") - time.sleep(30) - - cx_list = get_test_library.get_cx_list() - rx_data = get_test_library.json_get(_req_url=f"cx/{cx_list[0]}") - get_test_library.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", - value="VALUE", name="cx_data") - get_test_library.l3_cleanup() - table_data = {"Station Name": [sta[0],sta[1]], - "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], - "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} - table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) - print(table) - - if not (station_result1 and station_result2): - allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") - print("Test failed due to station has no ip") - assert False + result, description = get_test_library.client_isolation(ssid1=ssid_name1, ssid2=ssid_name2, + passkey=security_key, + security=security, mode=mode, band_2g=band_2g, + band_5g=band_5g, + dut_data=setup_configuration, num_sta=2, + side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=0, side_b_max_rate=0, + sniff_radio=True) + if not result: + assert False, description else: - print("Station creation passed. Successful.") - if layer3_restult is None: - print("Layer3 traffic ran.") - if rx_data[f"{cx_list[0]}"]["bps rx a"] == 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] != 0: - allure.attach(name="Test Result", - body="TEST PASS, The 5g station Received rx bytes per second is %s" % ( - rx_data[f"{cx_list[0]}"]["bps rx b"]) + " after traffic ran from 2g to 5g"+"\n\n"+str(table)) - print("Test pass, traffic ran between 2g to 5g stations when isolation disabled in 2g and enabled " - "5g ssid.") - assert True - else: - allure.attach(name="Test Result", body="TEST FAILED, Due to the 5g station not received rx bytes, " - "after traffic ran from 2g to 5g"+"\n\n"+str(table)) - print("Test failed, bps rx b received none") - assert False - else: - print("Layer3 not ran properly.") \ No newline at end of file + assert True, description