diff --git a/libs/lanforge/lf_tests.py b/libs/lanforge/lf_tests.py index aec25c031..898d1fdba 100644 --- a/libs/lanforge/lf_tests.py +++ b/libs/lanforge/lf_tests.py @@ -50,6 +50,7 @@ class RunTest: self.lf_ssh_port = lanforge_data["ssh_port"] self.staConnect = None self.dataplane_obj = None + self.wificapacity_obj = None self.influx_params = influx_params self.influxdb = RecordInflux(_lfjson_host=self.lanforge_ip, _lfjson_port=self.lanforge_port, @@ -200,28 +201,50 @@ class RunTest: self.eap_connect.cleanup(station_name) return self.eap_connect.passes() - def wifi_capacity(self, ssid="[BLANK]", paswd="[BLANK]", security="open", mode="BRIDGE", band="twog", - instance_name="wct_instance"): - '''SINGLE WIFI CAPACITY using lf_wifi_capacity.py''' - self.wfc_test = WiFiCapacityTest(lfclient_host=self.lanforge_ip, lf_port=self.lanforge_port, - lf_user="lanforge", lf_password="lanforge", instance_name=instance_name, - config_name="wifi_config", upstream=self.upstream_port, batch_size="1", - loop_iter="1", protocol="UDP-IPv4", duration="3000", pull_report=False, - load_old_cfg=False, upload_rate="10Mbps", download_rate="1Gbps", - sort="interleave", stations="1.1.sta0000,1.1.sta0001", create_stations=True, - radio=["wiphy0"], security=security, paswd=paswd, ssid=ssid, enables=[], - disables=[], raw_lines=[], raw_lines_file="", sets=[]) + def wifi_capacity(self, mode="BRIDGE", vlan_id=100, instance_name="wct_instance", stations=None): + if mode == "BRIDGE": + self.client_connect.upstream_port = self.upstream_port + elif mode == "NAT": + self.client_connect.upstream_port = self.upstream_port + elif mode == "VLAN": + self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id) + self.wificapacity_obj = WiFiCapacityTest(lfclient_host=self.lanforge_ip, + lf_port=self.lanforge_port, + lf_user="lanforge", + lf_password="lanforge", + report_dir=self.local_report_path, + instance_name=instance_name, + config_name="wifi_config", + upstream="1.1." + self.upstream_port, + batch_size="1", + loop_iter="1", + protocol="UDP-IPv4", + duration="3000", + pull_report=True, + load_old_cfg=False, + upload_rate="10Mbps", + download_rate="1Gbps", + sort="interleave", + stations=stations, + create_stations=False, + radio=None, + security=None, + paswd=None, + ssid=None, + enables=[], + disables=[], + raw_lines=[], + raw_lines_file="", + sets=[]) - if band == "twog": - self.wfc_test.radio = self.twog_radios[0] - if band == "fiveg": - self.wfc_test.radio = self.fiveg_radios[0] + self.wificapacity_obj.setup() + self.wificapacity_obj.run() + report_name = self.wificapacity_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + influx = CSVtoInflux(influxdb=self.influxdb, _influx_tag=self.influx_params["influx_tag"], + target_csv=self.local_report_path + report_name + "/kpi.csv") + influx.post_to_influx() - self.wfc_test.setup() - self.wfc_test.run() - - result = True - return result + return self.wificapacity_obj def Client_Connect(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", mode="BRIDGE", band="twog", vlan_id=100, diff --git a/tests/e2e/basic/performance_tests/throughput_benchmark/throughput_vs_various_pkt_sizes/wpa2_security/test_nat_mode.py b/tests/e2e/basic/performance_tests/throughput_benchmark/throughput_vs_various_pkt_sizes/wpa2_security/test_nat_mode.py index 39b1b53f0..779f30093 100644 --- a/tests/e2e/basic/performance_tests/throughput_benchmark/throughput_vs_various_pkt_sizes/wpa2_security/test_nat_mode.py +++ b/tests/e2e/basic/performance_tests/throughput_benchmark/throughput_vs_various_pkt_sizes/wpa2_security/test_nat_mode.py @@ -1,14 +1,14 @@ """ - Performance Test: Throughput vs Various Pkt Size Test: nat Mode - pytest -m "throughput_vs_pkt and nat" + Performance Test: Wifi Capacity Test : Nat Mode + pytest -m "wifi_capacity_test and nat" """ import os import pytest import allure -pytestmark = [pytest.mark.throughput_vs_pkt, pytest.mark.nat, pytest.mark.wpa2, +pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.nat, pytest.mark.usefixtures("setup_test_run")] setup_params_general = { @@ -18,7 +18,6 @@ setup_params_general = { {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], "security_key": "something"}]}, - "rf": {}, "radius": False } @@ -32,44 +31,36 @@ setup_params_general = { scope="class" ) @pytest.mark.usefixtures("setup_profiles") -class TestThroughputVsPktNatAWpa22G(object): - """Throughput vs Various Pkt Size Test nat mode - pytest -m "throughput_vs_pkt and nat" +class TestWifiCapacityNatMode(object): + """ Wifi Capacity Test Nat Mode + pytest -m "wifi_capacity_test and nat" """ @pytest.mark.wpa2_personal @pytest.mark.twog - @pytest.mark.pkt60 - def test_client_wpa2_personal_pkt_60_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and twog" + def test_client_wpa2_nat_2g(self, get_vif_state, + lf_test, station_names_twog, create_lanforge_chamberview_dut, + get_configuration): + """ Wifi Capacity Test Nat Mode + pytest -m "wifi_capacity_test and nat and wpa2_personal and twog" """ profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] security = "wpa2" mode = "NAT" + security_key = profile_data["security_key"] band = "twog" vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 60'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] if ssid_name not in get_vif_state: allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, mode=mode, band=band, station_name=station_names_twog, vlan_id=vlan) - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_twog[0], + instance_name="test_wct_wpa2_nat", mode=mode, vlan_id=vlan) + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] entries = os.listdir("../reports/" + report_name + '/') pdf = False for i in entries: @@ -84,248 +75,13 @@ class TestThroughputVsPktNatAWpa22G(object): else: assert False - @pytest.mark.wpa2_personal - @pytest.mark.twog - @pytest.mark.pkt142 - def test_client_wpa2_personal_pkt_142_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and twog" - """ - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "NAT" - band = "twog" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 142'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_twog, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.twog - @pytest.mark.pkt256 - def test_client_wpa2_personal_pkt_256_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and twog" - """ - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "NAT" - band = "twog" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 256'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_twog, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.twog - @pytest.mark.pkt512 - def test_client_wpa2_personal_pkt_512_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and twog" - """ - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "NAT" - band = "twog" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 512'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_twog, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.twog - @pytest.mark.pkt1024 - def test_client_wpa2_personal_pkt_1024_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and twog" - """ - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "NAT" - band = "twog" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 1024'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_twog, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.twog - @pytest.mark.pktMTU - def test_client_wpa2_personal_pkt_MTU_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and twog" - """ - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "NAT" - band = "twog" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: MTU'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_twog, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False - - -setup_params_5g = { +setup_params_general_5g = { "mode": "NAT", "ssid_modes": { - "wpa2_personal": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, - {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], - "security_key": "something"}]}, + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}]}, "rf": {}, "radius": False } @@ -334,284 +90,41 @@ setup_params_5g = { @allure.feature("NAT MODE CLIENT CONNECTIVITY") @pytest.mark.parametrize( 'setup_profiles', - [setup_params_5g], + [setup_params_general_5g], indirect=True, scope="class" ) @pytest.mark.usefixtures("setup_profiles") -class TestThroughputVsPktNatWpa25G(object): - """Throughput vs Various Pkt Size Test nat mode - pytest -m "throughput_vs_pkt and nat" +class TestWifiCapacityNatMode5g(object): + """ Wifi Capacity Test Nat mode + pytest -m "wifi_capacity_test and Nat" """ @pytest.mark.wpa2_personal @pytest.mark.fiveg - @pytest.mark.pkt60 - def test_client_wpa2_personal_pkt_60_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and fiveg" + def test_client_wpa2_nat_5gg(self, get_vif_state, + lf_test, station_names_fiveg, create_lanforge_chamberview_dut, + get_configuration): + """ Wifi Capacity Test Nat mode + pytest -m "wifi_capacity_test and nat and wpa2_personal and fiveg" """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] + profile_data = setup_params_general_5g["ssid_modes"]["wpa2_personal"][1] ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] security = "wpa2" mode = "NAT" + security_key = profile_data["security_key"] band = "fiveg" vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 60'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] if ssid_name not in get_vif_state: allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, mode=mode, band=band, station_name=station_names_fiveg, vlan_id=vlan) - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_fiveg) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.pkt142 - def test_client_wpa2_personal_pkt_142_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and fiveg" - """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "NAT" - band = "fiveg" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 142'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_fiveg) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.pkt256 - def test_client_wpa2_personal_pkt_256_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and fiveg" - """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "NAT" - band = "fiveg" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 256'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_fiveg) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.pkt512 - def test_client_wpa2_personal_pkt_512_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and fiveg" - """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "NAT" - band = "fiveg" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 512'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_fiveg) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.pkt1024 - def test_client_wpa2_personal_pkt_1024_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and fiveg" - """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "NAT" - band = "fiveg" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 1024'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_fiveg) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.pktMTU - def test_client_wpa2_personal_pkt_MTU_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes nat Mode - pytest -m "throughput_vs_pkt and nat and wpa2_personal and fiveg" - """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "NAT" - band = "fiveg" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: MTU'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_fiveg[0], + instance_name="test_wct_wpa2_nat", mode=mode, vlan_id=vlan) + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] entries = os.listdir("../reports/" + report_name + '/') pdf = False for i in entries: diff --git a/tests/e2e/basic/performance_tests/throughput_benchmark/throughput_vs_various_pkt_sizes/wpa2_security/test_vlan_mode.py b/tests/e2e/basic/performance_tests/throughput_benchmark/throughput_vs_various_pkt_sizes/wpa2_security/test_vlan_mode.py index f9084791e..e1079fd91 100644 --- a/tests/e2e/basic/performance_tests/throughput_benchmark/throughput_vs_various_pkt_sizes/wpa2_security/test_vlan_mode.py +++ b/tests/e2e/basic/performance_tests/throughput_benchmark/throughput_vs_various_pkt_sizes/wpa2_security/test_vlan_mode.py @@ -1,14 +1,14 @@ """ - Performance Test: Throughput vs Various Pkt Size Test: VLAN MODE - pytest -m "throughput_vs_pkt and vlan" + Performance Test: Wifi Capacity Test : Vlan Mode + pytest -m "wifi_capacity_test and vlan" """ import os import pytest import allure -pytestmark = [pytest.mark.throughput_vs_pkt, pytest.mark.vlan, pytest.mark.wpa2, +pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.vlan, pytest.mark.usefixtures("setup_test_run")] setup_params_general = { @@ -18,13 +18,12 @@ setup_params_general = { {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], "security_key": "something"}]}, - "rf": {}, "radius": False } -@allure.feature("VLAN MODE CLIENT CONNECTIVITY") +@allure.feature("NAT MODE CLIENT CONNECTIVITY") @pytest.mark.parametrize( 'setup_profiles', [setup_params_general], @@ -32,91 +31,36 @@ setup_params_general = { scope="class" ) @pytest.mark.usefixtures("setup_profiles") -class TestThroughputVsPktVlanWpa22G(object): - """Throughput vs Various Pkt Size Test vlan mode - pytest -m "throughput_vs_pkt and vlan" +class TestWifiCapacityVlanMode(object): + """ Wifi Capacity Test Vlan Mode + pytest -m "wifi_capacity_test and vlan" """ @pytest.mark.wpa2_personal @pytest.mark.twog - @pytest.mark.pkt60 - def test_client_wpa2_personal_vlan_pkt_60_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and twog" + def test_client_wpa2_vlan_2g(self, get_vif_state, + lf_test, station_names_twog, create_lanforge_chamberview_dut, + get_configuration): + """ Wifi Capacity Test Vlan Mode + pytest -m "wifi_capacity_test and vlan and wpa2_personal and twog" """ profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] security = "wpa2" mode = "VLAN" - band = "twog" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 60'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, - mode=mode, band=band, - station_name=station_names_twog, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.twog - @pytest.mark.pkt142 - def test_client_wpa2_personal_vlan_pkt_142_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and twog" - """ - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - security = "wpa2" - mode = "VLAN" band = "twog" vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 142'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] if ssid_name not in get_vif_state: allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, mode=mode, band=band, station_name=station_names_twog, vlan_id=vlan) - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_twog[0], + instance_name="test_wct_wpa2_vlan", mode=mode, vlan_id=vlan) + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] entries = os.listdir("../reports/" + report_name + '/') pdf = False for i in entries: @@ -131,196 +75,7 @@ class TestThroughputVsPktVlanWpa22G(object): else: assert False - @pytest.mark.wpa2_personal - @pytest.mark.twog - @pytest.mark.pkt256 - def test_client_wpa2_personal_vlan_pkt_256_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and twog" - """ - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "VLAN" - band = "twog" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 256'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_twog, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.twog - @pytest.mark.pkt512 - def test_client_wpa2_personal_vlan_pkt_512_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and twog" - """ - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "VLAN" - band = "twog" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 512'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_twog, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.twog - @pytest.mark.pkt1024 - def test_client_wpa2_personal_vlan_pkt_1024_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and twog" - """ - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "VLAN" - band = "twog" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 1024'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_twog, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.twog - @pytest.mark.pktMTU - def test_client_wpa2_personal_vlan_pkt_MTU_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and twog" - """ - profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "VLAN" - band = "twog" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: MTU'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_twog, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_2G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False - - -setup_params_5g = { +setup_params_general_5g = { "mode": "VLAN", "ssid_modes": { "wpa2_personal": [ @@ -335,284 +90,41 @@ setup_params_5g = { @allure.feature("VLAN MODE CLIENT CONNECTIVITY") @pytest.mark.parametrize( 'setup_profiles', - [setup_params_5g], + [setup_params_general_5g], indirect=True, scope="class" ) @pytest.mark.usefixtures("setup_profiles") -class TestThroughputVsPktVlan5G(object): - """Throughput vs Various Pkt Size Test vlan mode - pytest -m "throughput_vs_pkt and vlan" +class TestWifiCapacityVlanMode5g(object): + """ Wifi Capacity Test Vlan mode + pytest -m "wifi_capacity_test and vlan" """ @pytest.mark.wpa2_personal @pytest.mark.fiveg - @pytest.mark.pkt60 - def test_client_wpa2_personal_vlan_pkt_60_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and fiveg" + def test_client_wpa2_vlan_5g(self, get_vif_state, + lf_test, station_names_fiveg, create_lanforge_chamberview_dut, + get_configuration): + """ Wifi Capacity Test Vlan mode + pytest -m "wifi_capacity_test and vlan and wpa2_personal and fiveg" """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] + profile_data = setup_params_general_5g["ssid_modes"]["wpa2_personal"][1] ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] security = "wpa2" mode = "VLAN" + security_key = profile_data["security_key"] band = "fiveg" vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 60'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] if ssid_name not in get_vif_state: allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, mode=mode, band=band, station_name=station_names_fiveg, vlan_id=vlan) - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_fiveg) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.pkt142 - def test_client_wpa2_personal_vlan_pkt_142_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and fiveg" - """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "VLAN" - band = "fiveg" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 142'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_fiveg) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.pkt256 - def test_client_wpa2_personal_vlan_pkt_256_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and fiveg" - """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "VLAN" - band = "fiveg" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 256'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_fiveg) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.pkt512 - def test_client_wpa2_personal_vlan_pkt_512_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and fiveg" - """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "VLAN" - band = "fiveg" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 512'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_fiveg) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.pkt1024 - def test_client_wpa2_personal_vlan_pkt_1024_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and fiveg" - """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "VLAN" - band = "fiveg" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: 1024'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - pdf = False - for i in entries: - if ".pdf" in i: - pdf = i - if pdf: - allure.attach.file(source="../reports/" + report_name + "/" + pdf, - name=get_configuration["access_point"][0]["model"] + "_dataplane") - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_fiveg) - assert station - else: - assert False - - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.pktMTU - def test_client_wpa2_personal_vlan_pkt_MTU_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, - get_configuration): - """Throughput Vs Pkt Sizes VLAN MODE - pytest -m "throughput_vs_pkt and vlan and wpa2_personal and fiveg" - """ - profile_data = setup_params_5g["ssid_modes"]["wpa2_personal"][1] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - security = "wpa2" - mode = "VLAN" - band = "fiveg" - vlan = 1 - dut_name = create_lanforge_chamberview_dut - raw_lines = [['pkts: MTU'], - ['directions: DUT Transmit;DUT Receive'], - ['traffic_types: UDP;TCP'], ["show_3s: 1"], - ["show_ll_graphs: 1"], ["show_log: 1"]] - if ssid_name not in get_vif_state: - allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) - pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") - station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, - mode=mode, band=band, - station_name=station_names_fiveg, vlan_id=vlan) - - if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, - instance_name="TIP_PERF_DPT_WPA2_5G", - vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines) - report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_fiveg[0], + instance_name="test_wct_wpa2_vlan", mode=mode, vlan_id=vlan) + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] entries = os.listdir("../reports/" + report_name + '/') pdf = False for i in entries: diff --git a/tests/e2e/basic/performance_tests/wifi_capacity_test/test_bridge_mode.py b/tests/e2e/basic/performance_tests/wifi_capacity_test/test_bridge_mode.py index 35d2f5494..e84997118 100644 --- a/tests/e2e/basic/performance_tests/wifi_capacity_test/test_bridge_mode.py +++ b/tests/e2e/basic/performance_tests/wifi_capacity_test/test_bridge_mode.py @@ -1,66 +1,140 @@ -# """ -# Performance : Wifi Capacity Test : Bridge Mode -# -# """ -# -# import pytest -# import allure -# -# pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.bridge] -# -# setup_params_general = { -# "mode": "BRIDGE", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], -# "security_key": "something"}]}, -# "rf": {}, -# "radius": False -# } -# -# -# @pytest.mark.basic -# @allure.feature("BRIDGE MODE CLIENT CONNECTIVITY") -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# class TestWifiCapacityBridgeMode(object): -# -# @pytest.mark.wpa2_personal -# @pytest.mark.twog -# def test_client_wpa2_personal_2g(self, lf_test, station_names_twog, create_lanforge_chamberview_dut, -# get_configuration): -# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# security = "wpa2" -# mode = "BRIDGE" -# band = "twog" -# vlan = 1 -# dut_name = create_lanforge_chamberview_dut -# PASS = lf_test.wifi_capacity(ssid=profile_data["ssid_name"], paswd=profile_data["security_key"], -# security="wpa2", mode="BRIDGE", band="twog", -# instance_name="wct_instance", ) -# assert PASS -# -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# def test_client_wpa2_personal_2g(self, lf_test, station_names_twog, create_lanforge_chamberview_dut, -# get_configuration): -# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# security = "wpa2" -# mode = "BRIDGE" -# band = "fiveg" -# vlan = 1 -# dut_name = create_lanforge_chamberview_dut -# PASS = lf_test.wifi_capacity(ssid=profile_data["ssid_name"], paswd=profile_data["security_key"], -# security=security, mode=mode, band=band, -# instance_name="wct_instance", ) -# assert PASS +""" + + Performance Test: Wifi Capacity Test : Bridge Mode + pytest -m "wifi_capacity_test and bridge" + +""" +import os +import pytest +import allure + +pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.bridge, + pytest.mark.usefixtures("setup_test_run")] + +setup_params_general = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}]}, + "rf": {}, + "radius": False +} + + +@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestWifiCapacityBridgeMode(object): + """ Wifi Capacity Test Bridge mode + pytest -m "wifi_capacity_test and bridge" + """ + + @pytest.mark.wpa2_personal + @pytest.mark.twog + def test_client_wpa2_bridge_2g(self, get_vif_state, + lf_test, station_names_twog, create_lanforge_chamberview_dut, + get_configuration): + """ Wifi Capacity Test Bridge mode + pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog" + """ + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security = "wpa2" + mode = "BRIDGE" + security_key = profile_data["security_key"] + band = "twog" + vlan = 1 + if ssid_name not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, + mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + if station: + wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_twog[0], + instance_name="test_wct_wpa2_bridge", mode=mode, vlan_id=vlan) + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + entries = os.listdir("../reports/" + report_name + '/') + pdf = False + for i in entries: + if ".pdf" in i: + pdf = i + if pdf: + allure.attach.file(source="../reports/" + report_name + "/" + pdf, + name=get_configuration["access_point"][0]["model"] + "_dataplane") + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + assert station + else: + assert False + +setup_params_general_5g = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}]}, + "rf": {}, + "radius": False +} + + +@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general_5g], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestWifiCapacityBridgeMode5g(object): + """ Wifi Capacity Test Bridge mode + pytest -m "wifi_capacity_test and bridge" + """ + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + def test_client_wpa2_bridge_5gg(self, get_vif_state, + lf_test, station_names_fiveg, create_lanforge_chamberview_dut, + get_configuration): + """ Wifi Capacity Test Bridge mode + pytest -m "wifi_capacity_test and bridge and wpa2_personal and fiveg" + """ + profile_data = setup_params_general_5g["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security = "wpa2" + mode = "BRIDGE" + security_key = profile_data["security_key"] + band = "fiveg" + vlan = 1 + if ssid_name not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, + mode=mode, band=band, + station_name=station_names_fiveg, vlan_id=vlan) + if station: + wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_fiveg[0], + instance_name="test_wct_wpa2_bridge", mode=mode, vlan_id=vlan) + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + entries = os.listdir("../reports/" + report_name + '/') + pdf = False + for i in entries: + if ".pdf" in i: + pdf = i + if pdf: + allure.attach.file(source="../reports/" + report_name + "/" + pdf, + name=get_configuration["access_point"][0]["model"] + "_dataplane") + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_fiveg) + assert station + else: + assert False diff --git a/tests/e2e/basic/performance_tests/wifi_capacity_test/test_nat_mode.py b/tests/e2e/basic/performance_tests/wifi_capacity_test/test_nat_mode.py index a5715234b..08a494373 100644 --- a/tests/e2e/basic/performance_tests/wifi_capacity_test/test_nat_mode.py +++ b/tests/e2e/basic/performance_tests/wifi_capacity_test/test_nat_mode.py @@ -1,66 +1,143 @@ -# """ -# Performance : Wifi Capacity Test : NAT Mode -# -# """ -# -# import pytest -# import allure -# -# pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.nat] -# -# setup_params_general = { -# "mode": "NAT", -# "ssid_modes": { -# "wpa2_personal": [ -# {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, -# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], -# "security_key": "something"}]}, -# "rf": {}, -# "radius": False -# } -# -# -# @pytest.mark.basic -# @allure.feature("NAT MODE CLIENT CONNECTIVITY") -# @pytest.mark.parametrize( -# 'setup_profiles', -# [setup_params_general], -# indirect=True, -# scope="class" -# ) -# @pytest.mark.usefixtures("setup_profiles") -# class TestWifiCapacityNATMode(object): -# -# @pytest.mark.wpa2_personal -# @pytest.mark.twog -# def test_client_wpa2_personal_2g(self, lf_test, station_names_twog, create_lanforge_chamberview_dut, -# get_configuration): -# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# security = "wpa2" -# mode = "NAT" -# band = "twog" -# vlan = 1 -# dut_name = create_lanforge_chamberview_dut -# PASS = lf_test.wifi_capacity(ssid=profile_data["ssid_name"], paswd=profile_data["security_key"], -# security="wpa2", mode="NAT", band="twog", -# instance_name="wct_instance", ) -# assert PASS -# -# @pytest.mark.wpa2_personal -# @pytest.mark.fiveg -# def test_client_wpa2_personal_2g(self, lf_test, station_names_twog, create_lanforge_chamberview_dut, -# get_configuration): -# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] -# ssid_name = profile_data["ssid_name"] -# security_key = profile_data["security_key"] -# security = "wpa2" -# mode = "NAT" -# band = "fiveg" -# vlan = 1 -# dut_name = create_lanforge_chamberview_dut -# PASS = lf_test.wifi_capacity(ssid=profile_data["ssid_name"], paswd=profile_data["security_key"], -# security=security, mode=mode, band=band, -# instance_name="wct_instance", ) -# assert PASS +""" + + Performance Test: Wifi Capacity Test : Nat Mode + pytest -m "wifi_capacity_test and nat" + +""" +import os +import pytest +import allure + +pytestmark = [pytest.mark.wifi_capacity_test, pytest.mark.nat, + pytest.mark.usefixtures("setup_test_run")] + +setup_params_general = { + "mode": "NAT", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}]}, + "rf": {}, + "radius": False +} + + +@allure.feature("NAT MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestWifiCapacityNatMode(object): + """ Wifi Capacity Test Nat mode + pytest -m "wifi_capacity_test and nat" + """ + + @pytest.mark.wpa2_personal + @pytest.mark.twog + def test_client_open_pkt_60_2g(self, get_vif_state, + lf_test, station_names_twog, create_lanforge_chamberview_dut, + get_configuration): + """ Wifi Capacity Test Nat mode + pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog" + """ + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security = "wpa2" + mode = "BRIDGE" + security_key = profile_data["security_key"] + band = "twog" + vlan = 1 + if ssid_name not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, + mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + if station: + wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_twog[0], + instance_name="test_wct_wpa2_bridge", mode=mode, vlan_id=vlan) + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + entries = os.listdir("../reports/" + report_name + '/') + pdf = False + for i in entries: + if ".pdf" in i: + pdf = i + if pdf: + allure.attach.file(source="../reports/" + report_name + "/" + pdf, + name=get_configuration["access_point"][0]["model"] + "_dataplane") + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + assert station + else: + assert False + + +setup_params_general_5g = { + "mode": "NAT", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], + "security_key": "something"}]}, + "rf": {}, + "radius": False +} + + +@allure.feature("NAT MODE CLIENT CONNECTIVITY") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general_5g], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestWifiCapacityNatMode5g(object): + """ Wifi Capacity Test Nat mode + pytest -m "wifi_capacity_test and bridge" + """ + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + def test_client_open_pkt_60_5g(self, get_vif_state, + lf_test, station_names_fiveg, create_lanforge_chamberview_dut, + get_configuration): + """ Wifi Capacity Test Nat mode + pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog" + """ + profile_data = setup_params_general_5g["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security = "wpa2" + mode = "BRIDGE" + security_key = profile_data["security_key"] + band = "fiveg" + vlan = 1 + if ssid_name not in get_vif_state: + allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) + pytest.xfail("SSID NOT AVAILABLE IN VIF STATE") + station = lf_test.Client_Connect(ssid=ssid_name, security=security, passkey=security_key, + mode=mode, band=band, + station_name=station_names_fiveg, vlan_id=vlan) + if station: + wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_fiveg[0], + instance_name="test_wct_wpa2_bridge", mode=mode, vlan_id=vlan) + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + entries = os.listdir("../reports/" + report_name + '/') + pdf = False + for i in entries: + if ".pdf" in i: + pdf = i + if pdf: + allure.attach.file(source="../reports/" + report_name + "/" + pdf, + name=get_configuration["access_point"][0]["model"] + "_dataplane") + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_fiveg) + assert station + else: + assert False + +