From 62c0f531adebd689700281e093cc8c9ff02b041d Mon Sep 17 00:00:00 2001 From: shivamcandela Date: Thu, 22 Jul 2021 12:37:54 +0530 Subject: [PATCH] wifi capacity test adjustments Signed-off-by: shivamcandela --- libs/apnos/apnos.py | 49 +- libs/lanforge/lf_tests.py | 42 +- libs/lanforge/lf_tools.py | 60 +- tests/e2e/basic/conftest.py | 61 +- .../test_nat_mode.py | 38 +- .../wpa2_personal/test_nat_mode.py | 42 +- .../wifi_capacity_test/test_bridge_mode.py | 824 ++++------------- .../wifi_capacity_test/test_nat_mode.py | 825 ++++------------- .../wifi_capacity_test/test_vlan_mode.py | 826 ++++-------------- 9 files changed, 625 insertions(+), 2142 deletions(-) diff --git a/libs/apnos/apnos.py b/libs/apnos/apnos.py index 100121284..d32f10a37 100644 --- a/libs/apnos/apnos.py +++ b/libs/apnos/apnos.py @@ -81,18 +81,38 @@ class APNOS: return output # Method to get the iwinfo status of AP using AP-CLI/ JUMPHOST-CLI - def iwinfo_status(self): + def get_bssid_band_mapping(self): client = self.ssh_cli_connect() cmd = 'iwinfo' if self.mode: cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ f"cmd --value \"{cmd}\" " stdin, stdout, stderr = client.exec_command(cmd) - output = stdout.read() + data = stdout.read() client.close() - allure.attach(name="iwinfo Output Msg: ", body=str(output)) + allure.attach(name="iwinfo Output Msg: ", body=str(data)) allure.attach(name="iwinfo config Err Msg: ", body=str(stderr)) - return output + data = str(data).replace(" ", "").split("\\r\\n") + band_info = [] + for i in data: + tmp = [] + if i.__contains__("AccessPoint"): + bssid = i.replace("AccessPoint:", "") + tmp.append(bssid.casefold()) + elif i.__contains__("MasterChannel"): + if i.split(":")[2].__contains__("2.4"): + tmp.append("2G") + else: + tmp.append("5G") + else: + tmp = [] + if tmp != []: + band_info.append(tmp) + bssi_band_mapping = {} + for i in range(len(band_info)): + if (i % 2) == 0: + bssi_band_mapping[band_info[i][0]] = band_info[i+1][0] + return bssi_band_mapping # Method to get the vif_config of AP using AP-CLI/ JUMPHOST-CLI def get_vif_config(self): @@ -362,15 +382,20 @@ class APNOS: if __name__ == '__main__': obj = { 'jumphost': True, - 'ip': "localhost", + 'ip': "10.28.3.100", 'username': "lanforge", 'password': "pumpkin77", - 'port': 8803, - 'jumphost_tty': '/dev/ttyAP2' + 'port': 22, + 'jumphost_tty': '/dev/ttyAP1' } var = APNOS(credentials=obj) - r = var.get_ssid_info() - print(r) - print(var.get_ssid_info()) - print(var.get_manager_state()) - print(var.get_vlan()) \ No newline at end of file + abc = var.get_bssid_band_mapping() + + + # lst.remove("") + print(abc) + # r = var.get_ssid_info() + # print(r) + # print(var.get_ssid_info()) + # print(var.get_manager_state()) + # print(var.get_vlan()) \ No newline at end of file diff --git a/libs/lanforge/lf_tests.py b/libs/lanforge/lf_tests.py index 494ff8a20..76efaa78f 100644 --- a/libs/lanforge/lf_tests.py +++ b/libs/lanforge/lf_tests.py @@ -283,7 +283,7 @@ class RunTest: return True def dataplane(self, station_name=None, mode="BRIDGE", vlan_id=100, download_rate="85%", dut_name="TIP", - upload_rate="85%", duration="1m", instance_name="test_demo", raw_lines=None): + upload_rate="0", duration="15s", instance_name="test_demo", raw_lines=None): if mode == "BRIDGE": self.client_connect.upstream_port = self.upstream_port elif mode == "NAT": @@ -292,13 +292,14 @@ class RunTest: self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id) if raw_lines is None: - raw_lines = [['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types: UDP;TCP'], + raw_lines = [['pkts: 60, 142, 256, 512, 1024, MTU, 4000'], ['directions: DUT Transmit;DUT Receive'], + ['traffic_types: UDP;TCP'], ["show_3s: 1"], ["show_ll_graphs: 1"], ["show_log: 1"]] self.dataplane_obj = DataplaneTest(lf_host=self.lanforge_ip, lf_port=self.lanforge_port, ssh_port=self.lf_ssh_port, - local_path=self.local_report_path, + local_lf_report_dir=self.local_report_path, lf_user="lanforge", lf_password="lanforge", instance_name=instance_name, @@ -323,13 +324,13 @@ class RunTest: return self.dataplane_obj def dualbandperformancetest(self, ssid_5G="[BLANK]", ssid_2G="[BLANK]", mode="BRIDGE", vlan_id=100, dut_name="TIP", - instance_name="test_demo"): + instance_name="test_demo", dut_5g="", dut_2g=""): if mode == "BRIDGE": - self.client_connect.upstream_port = self.upstream_port + self.upstream_port = self.upstream_port elif mode == "NAT": - self.client_connect.upstream_port = self.upstream_port + self.upstream_port = self.upstream_port else: - self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id) + self.upstream_port = self.upstream_port + "." + str(vlan_id) self.dualbandptest_obj = ApAutoTest(lf_host=self.lanforge_ip, lf_port=self.lanforge_port, @@ -339,27 +340,30 @@ class RunTest: config_name="dbp_config", upstream="1.1." + self.upstream_port, pull_report=True, - dut5_0=dut_name + ' ' + ssid_5G, - dut2_0=dut_name + ' ' + ssid_2G, + dut5_0=dut_5g, + dut2_0=dut_2g, load_old_cfg=False, - max_stations_2=1, - max_stations_5=1, - max_stations_dual=2, - radio2=[["1.1.wiphy0"]], - radio5=[["1.1.wiphy1"]], + local_lf_report_dir=self.local_report_path, + max_stations_2=64, + max_stations_5=64, + max_stations_dual=124, + radio2=[self.twog_radios], + radio5=[self.fiveg_radios], sets=[['Basic Client Connectivity', '0'], ['Multi Band Performance', '1'], ['Throughput vs Pkt Size', '0'], ['Capacity', '0'], + ['Skip 2.4Ghz Tests', '1'], + ['Skip 5Ghz Tests', '1'], ['Stability', '0'], ['Band-Steering', '0'], ['Multi-Station Throughput vs Pkt Size', '0'], ['Long-Term', '0']] ) self.dualbandptest_obj.setup() self.dualbandptest_obj.run() - report_name = self.dataplane_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() + report_name = self.dualbandptest_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() return self.dualbandptest_obj diff --git a/libs/lanforge/lf_tools.py b/libs/lanforge/lf_tools.py index cce1e4fff..fde2c4d4a 100644 --- a/libs/lanforge/lf_tools.py +++ b/libs/lanforge/lf_tools.py @@ -1,3 +1,6 @@ +import re + +import allure from create_chamberview import CreateChamberview from create_chamberview_dut import DUT import time @@ -29,7 +32,7 @@ class ChamberView: self.scenario_name = "TIP-" + self.testbed self.debug = debug self.exit_on_error = False - + self.dut_idx_mapping = {} self.raw_line = [ ["profile_link " + self.upstream_resources + " upstream-dhcp 1 NA NA " + self.upstream_port.split(".") [2] + ",AUTO -1 NA"], @@ -80,19 +83,34 @@ class ChamberView: self.CreateChamberview.sync_cv() return self.CreateChamberview, self.scenario_name - def add_stations(self, band="twog", num_stations=50, dut="NA"): - if band == "twog": + def add_stations(self, band="2G", num_stations=50, dut="NA", ssid_name=[]): + idx = 0 + print(self.dut_idx_mapping) + for i in self.dut_idx_mapping: + if self.dut_idx_mapping[i][0] == ssid_name and self.dut_idx_mapping[i][3] == band: + idx = i + max_stations = 0 + print(idx) + if band == "2G": + max_stations = 64 * len(self.twog_radios) radio = ",".join(self.twog_radios) if len(self.twog_radios) == 1: radio = radio + ",AUTO" # self.eap_connect.sta_prefix = self.twog_prefix - if band == "fiveg": + if band == "5G": + max_stations = 64 * len(self.twog_radios) radio = ",".join(self.fiveg_radios) if len(self.fiveg_radios) == 1: radio = radio + ",AUTO" - # self.eap_connect.sta_prefix = self.fiveg_prefix - - station_data = ["profile_link 1.1 STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-1'" + " NA " + radio] + if band == "ax": + max_stations = len(self.twog_radios) + radio = ",".join(self.fiveg_radios) + if len(self.fiveg_radios) == 1: + radio = radio + ",AUTO" + # self.eap_connect.sta_prefix = self.fiveg_prefix + if num_stations != "max": + max_stations = num_stations + station_data = ["profile_link 1.1 STA-AUTO " + str(max_stations) + " 'DUT: " + dut + " Radio-" + str(int(idx)+1) + "'" + " NA " + radio] self.raw_line.append(station_data) @@ -147,3 +165,31 @@ class ChamberView: return "empty" else: return df + + def attach_report_graphs(self, report_name=None, pdf_name="WIFI Capacity Test PDF Report"): + relevant_path = "../reports/" + report_name + "/" + entries = os.listdir("../reports/" + report_name + '/') + pdf = False + for i in entries: + if ".pdf" in i: + pdf = i + if pdf: + allure.attach.file(source=relevant_path + pdf, + name=pdf_name) + + included_extensions = ['png'] + file_names = [fn for fn in os.listdir(relevant_path) + if any(fn.endswith(ext) for ext in included_extensions)] + + a = [item for item in file_names if 'kpi' not in item] + a = [item for item in a if 'print' not in item] + a = [item for item in a if 'logo' not in item] + a = [item for item in a if 'Logo' not in item] + a = [item for item in a if 'candela' not in item] + + a.sort() + for i in a: + allure.attach.file(source=relevant_path + i, + name=i, + attachment_type="image/png", extension=None) + diff --git a/tests/e2e/basic/conftest.py b/tests/e2e/basic/conftest.py index da719e185..101122e25 100644 --- a/tests/e2e/basic/conftest.py +++ b/tests/e2e/basic/conftest.py @@ -200,33 +200,27 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment if mode == "wpa2_personal": for j in profile_data["ssid"][mode]: # print(j) + if mode in get_markers.keys() and get_markers[mode]: try: - if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list( - j["appliedRadios"]): + if j["appliedRadios"].__contains__("2G"): lf_dut_data.append(j) - creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j) - test_cases["wpa2_personal_2g"] = True - allure.attach(body=str(creates_profile), - name="SSID Profile Created") + if j["appliedRadios"].__contains__("5G"): + lf_dut_data.append(j) + for i in range(len(j["appliedRadios"])): + j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU") + j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL") + j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz") + j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz") + creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j) + test_cases["wpa2_personal_2g"] = True + allure.attach(body=str(creates_profile), + name="SSID Profile Created") except Exception as e: print(e) test_cases["wpa2_personal_2g"] = False allure.attach(body=str(e), name="SSID Profile Creation Failed") - try: - if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list( - j["appliedRadios"]): - lf_dut_data.append(j) - creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j) - test_cases["wpa2_personal_5g"] = True - allure.attach(body=str(creates_profile), - name="SSID Profile Created") - except Exception as e: - print(e) - test_cases["wpa2_personal_5g"] = False - allure.attach(body=str(e), - name="SSID Profile Creation Failed") if mode == "wpa_wpa2_personal_mixed": for j in profile_data["ssid"][mode]: @@ -531,11 +525,14 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment print("failed to create AP Profile") ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/") + # ssid_names = [] + # for i in instantiate_profile.profile_creation_ids["ssid"]: + # ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i)) + # ssid_names.sort() ssid_names = [] - for i in instantiate_profile.profile_creation_ids["ssid"]: - ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i)) + for i in lf_dut_data: + ssid_names.append(i["ssid_name"]) ssid_names.sort() - # This loop will check the VIF Config with cloud profile vif_config = [] test_cases['vifc'] = False @@ -573,30 +570,46 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment ssid_info = ap_ssh.get_ssid_info() ssid_data = [] print(ssid_info) + band_mapping = ap_ssh.get_bssid_band_mapping() + print(band_mapping) + idx_mapping = {} for i in range(0, len(ssid_info)): if ssid_info[i][1] == "OPEN": ssid_info[i].append("") if ssid_info[i][1] == "OPEN": ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=OPEN" + " password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]] + idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]], ssid_info[i][0]] + if ssid_info[i][1] == "WPA": ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA" + " password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]] + idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]], + ssid_info[i][0]] if ssid_info[i][1] == "WPA2": ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA2" + " password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]] + idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]], + ssid_info[i][0]] if ssid_info[i][1] == "WPA3_PERSONAL": ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA3" + " password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]] + idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]], + ssid_info[i][0]] + if ssid_info[i][1] == "WPA | WPA2": ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA|WPA2" + " password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]] + idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]], + ssid_info[i][0]] + if ssid_info[i][1] == "EAP-TTLS": ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=EAP-TTLS" + " password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]] - + idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]], + ssid_info[i][0]] ssid_data.append(ssid) - + lf_tools.dut_idx_mapping = idx_mapping # Add bssid password and security from iwinfo data # Format SSID Data in the below format # ssid_data = [ diff --git a/tests/e2e/basic/performance_tests/dataplane_throughput_test/test_nat_mode.py b/tests/e2e/basic/performance_tests/dataplane_throughput_test/test_nat_mode.py index 922d94cf8..283871b2e 100644 --- a/tests/e2e/basic/performance_tests/dataplane_throughput_test/test_nat_mode.py +++ b/tests/e2e/basic/performance_tests/dataplane_throughput_test/test_nat_mode.py @@ -8,7 +8,8 @@ import os import pytest import allure -pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, pytest.mark.nat, pytest.mark.usefixtures("setup_test_run")] +pytestmark = [pytest.mark.performance, pytest.mark.performance_release, pytest.mark.dataplane_throughput_test, + pytest.mark.nat, pytest.mark.usefixtures("setup_test_run")] setup_params_general = { "mode": "NAT", @@ -34,11 +35,12 @@ class TestDataplaneThroughputNAT(object): """Dataplane THroughput nat Mode pytest -m "dataplane_throughput_test and nat" """ + @pytest.mark.wpa2_personal @pytest.mark.twog - def test_client_wpa2_personal_2g(self, get_vif_state, - lf_test, station_names_twog, create_lanforge_chamberview_dut, - get_configuration): + def test_tcp_upd_2g_band(self, get_vif_state, lf_tools, + lf_test, station_names_twog, create_lanforge_chamberview_dut, + get_configuration): """Dataplane THroughput nat Mode pytest -m "dataplane_throughput_test and nat and wpa2_personal and twog" """ @@ -62,15 +64,7 @@ class TestDataplaneThroughputNAT(object): instance_name="TIP_DPT_DPT_WPA2_2G_NAT", vlan_id=vlan, dut_name=dut_name) report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/" + report_name + '/') - 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_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 2.4G") lf_test.Client_disconnect(station_name=station_names_twog) assert station else: @@ -78,8 +72,8 @@ class TestDataplaneThroughputNAT(object): @pytest.mark.wpa2_personal @pytest.mark.fiveg - def test_client_wpa2_personal_5g(self, get_vif_state, - lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration): + def test_tcp_upd_5g_band(self, get_vif_state, lf_tools, + lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration): """Dataplane THroughput nat Mode pytest -m "dataplane_throughput_test and nat and wpa2_personal and fiveg" """ @@ -99,19 +93,13 @@ class TestDataplaneThroughputNAT(object): station_name=station_names_fiveg, vlan_id=vlan) if station: - dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_DPT_DPT_WPA2_5G_NAT", - vlan_id=vlan, dut_name=dut_name) + dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, + instance_name="TIP_DPT_DPT_WPA2_5G_NAT", + vlan_id=vlan, dut_name=dut_name) report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] - entries = os.listdir("../reports/"+report_name + '/') - 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") + lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 5G") 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/dual_band_performance_test/wpa2_personal/test_nat_mode.py b/tests/e2e/basic/performance_tests/dual_band_performance_test/wpa2_personal/test_nat_mode.py index c91135faf..7ad7aac11 100644 --- a/tests/e2e/basic/performance_tests/dual_band_performance_test/wpa2_personal/test_nat_mode.py +++ b/tests/e2e/basic/performance_tests/dual_band_performance_test/wpa2_personal/test_nat_mode.py @@ -9,16 +9,15 @@ import os import allure import pytest -pytestmark = [pytest.mark.performance,pytest.mark.dual_band_test, pytest.mark.nat, - pytest.mark.usefixtures("setup_test_run")] +pytestmark = [pytest.mark.performance, pytest.mark.dual_band_test, pytest.mark.nat, pytest.mark.performance_release]#, +# pytest.mark.usefixtures("setup_test_run")] setup_params_general = { "mode": "NAT", "ssid_modes": { "wpa2_personal": [ - {"ssid_name": "ssid_wpa2p_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"}, - {"ssid_name": "ssid_wpa2p_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], - "security_key": "something"}]}, + {"ssid_name": "ssid_wpa2p_2g", "appliedRadios": ["2G", "5G"], "security_key": "something"} + ]}, "rf": {}, "radius": False } @@ -33,37 +32,40 @@ setup_params_general = { indirect=True, scope="class" ) - @pytest.mark.usefixtures("setup_profiles") class TestDualbandPerformanceNat(object): - """ pytest -m "performance and dual_band_test and nat and wpa2_personal and twog and fiveg" """ + @pytest.mark.wpa2_personal @pytest.mark.twog @pytest.mark.fiveg - def test_client_wpa2_personal(self,get_vif_state,create_lanforge_chamberview_dut,lf_test,get_configuration): + def test_client_wpa2_personal(self, get_vif_state, lf_tools, + create_lanforge_chamberview_dut, lf_test, get_configuration): profile_data = setup_params_general["ssid_modes"]["wpa2_personal"] ssid_2G = profile_data[0]["ssid_name"] - ssid_5G = profile_data[1]["ssid_name"] + ssid_5G = profile_data[0]["ssid_name"] dut_name = create_lanforge_chamberview_dut mode = "NAT" vlan = 1 + print(lf_tools.dut_idx_mapping) + dut_5g = "" + dut_2g = "" + for i in lf_tools.dut_idx_mapping: + if lf_tools.dut_idx_mapping[i][3] == "5G": + dut_5g = dut_name + ' ' + lf_tools.dut_idx_mapping[i][0] + ' ' + lf_tools.dut_idx_mapping[i][4] + print(dut_5g) + if lf_tools.dut_idx_mapping[i][3] == "2G": + dut_2g = dut_name + ' ' + lf_tools.dut_idx_mapping[i][0] + ' ' + lf_tools.dut_idx_mapping[i][4] + print(dut_2g) if ssid_2G and ssid_5G not in get_vif_state: allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state)) pytest.xfail("SSID's NOT AVAILABLE IN VIF STATE") dbpt_obj = lf_test.dualbandperformancetest(mode=mode, ssid_2G=ssid_2G, ssid_5G=ssid_5G, - instance_name="dbp_instance_wpa2p_nat", - vlan_id=vlan, dut_name=dut_name) + instance_name="dbp_instance_wpa2p_nat_p", + vlan_id=vlan, dut_5g=dut_5g, dut_2g=dut_2g) report_name = dbpt_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"] + "_dualbandperfomance") - + lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dual Band Performance Test") + assert True 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 160148d89..4ba8bb515 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 @@ -11,11 +11,12 @@ import allure pytestmark = [pytest.mark.performance, pytest.mark.wifi_capacity_test, pytest.mark.bridge] # """pytest.mark.usefixtures("setup_test_run")"""] + setup_params_general_dual_band = { "mode": "BRIDGE", "ssid_modes": { "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz", "is5GHz"], "security_key": "something"} + {"ssid_name": "ssid_wpa2_dual_band", "appliedRadios": ["2G", "5G"], "security_key": "something"} ] }, "rf": {}, @@ -41,7 +42,7 @@ class TestWifiCapacityBridgeModeDualBand(object): """ @pytest.mark.tcp_download - def test_client_wpa2_bridge_tcp_dl(self, get_vif_state, lf_tools, + def test_client_wpa2_bridge_tcp_dl(self, get_vif_state, lf_tools, setup_profiles, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test Bridge mode @@ -49,61 +50,22 @@ class TestWifiCapacityBridgeModeDualBand(object): """ profile_data = setup_params_general_dual_band["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") + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="TCP-IPv4", duration="60000") - wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_twog[0], - instance_name="test_wct_wpa2_bridge_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) + + lf_tools.attach_report_graphs(report_name=report_name) print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) assert True @pytest.mark.udp_download @@ -115,67 +77,23 @@ class TestWifiCapacityBridgeModeDualBand(object): """ profile_data = setup_params_general_dual_band["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_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.tcp_bidirectional def test_client_wpa2_bridge_tcp_bidirectional(self, get_vif_state, lf_tools, @@ -186,67 +104,23 @@ class TestWifiCapacityBridgeModeDualBand(object): """ profile_data = setup_params_general_dual_band["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_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_bidirectional def test_client_wpa2_bridge_udp_bidirectional(self, get_vif_state, lf_tools, @@ -257,74 +131,30 @@ class TestWifiCapacityBridgeModeDualBand(object): """ profile_data = setup_params_general_dual_band["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_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True setup_params_general_2G = { "mode": "BRIDGE", "ssid_modes": { "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz", "is5GHz"], "security_key": "something"} + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"} ] }, "rf": {}, @@ -342,7 +172,6 @@ setup_params_general_2G = { @pytest.mark.usefixtures("setup_profiles") @pytest.mark.wpa2_personal @pytest.mark.twog -@pytest.mark.fiveg @pytest.mark.fiveg_band class TestWifiCapacityBridgeMode2G(object): """ Wifi Capacity Test Bridge mode @@ -350,7 +179,7 @@ class TestWifiCapacityBridgeMode2G(object): """ @pytest.mark.tcp_download - def test_client_wpa2_bridge_tcp_dl(self, get_vif_state, + def test_client_wpa2_bridge_tcp_dl(self, get_vif_state, lf_tools, setup_profiles, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test Bridge mode @@ -358,70 +187,25 @@ class TestWifiCapacityBridgeMode2G(object): """ profile_data = setup_params_general_2G["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_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_download - def test_client_wpa2_bridge_udp_dl(self, get_vif_state, + def test_client_wpa2_bridge_udp_dl(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test Bridge mode @@ -429,70 +213,25 @@ class TestWifiCapacityBridgeMode2G(object): """ profile_data = setup_params_general_2G["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_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.tcp_bidirectional - def test_client_wpa2_bridge_tcp_bidirectional(self, get_vif_state, + def test_client_wpa2_bridge_tcp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test Bridge mode @@ -500,70 +239,25 @@ class TestWifiCapacityBridgeMode2G(object): """ profile_data = setup_params_general_2G["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_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_bidirectional - def test_client_wpa2_bridge_udp_bidirectional(self, get_vif_state, + def test_client_wpa2_bridge_udp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test Bridge mode @@ -571,74 +265,29 @@ class TestWifiCapacityBridgeMode2G(object): """ profile_data = setup_params_general_2G["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_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True setup_params_general_5G = { "mode": "BRIDGE", "ssid_modes": { "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz", "is5GHz"], "security_key": "something"} + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is5GHz"], "security_key": "something"} ] }, "rf": {}, @@ -655,16 +304,15 @@ setup_params_general_5G = { ) @pytest.mark.usefixtures("setup_profiles") @pytest.mark.wpa2_personal -@pytest.mark.twog @pytest.mark.fiveg -@pytest.mark.twog_band +@pytest.mark.fiveg_band class TestWifiCapacityBridgeMode5G(object): """ Wifi Capacity Test Bridge mode pytest -m "wifi_capacity_test and bridge" """ @pytest.mark.tcp_download - def test_client_wpa2_bridge_tcp_dl(self, get_vif_state, + def test_client_wpa2_bridge_tcp_dl(self, get_vif_state, lf_tools, setup_profiles, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test Bridge mode @@ -672,70 +320,25 @@ class TestWifiCapacityBridgeMode5G(object): """ profile_data = setup_params_general_5G["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_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_download - def test_client_wpa2_bridge_udp_dl(self, get_vif_state, + def test_client_wpa2_bridge_udp_dl(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test Bridge mode @@ -743,70 +346,25 @@ class TestWifiCapacityBridgeMode5G(object): """ profile_data = setup_params_general_5G["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_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.tcp_bidirectional - def test_client_wpa2_bridge_tcp_bidirectional(self, get_vif_state, + def test_client_wpa2_bridge_tcp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test Bridge mode @@ -814,70 +372,25 @@ class TestWifiCapacityBridgeMode5G(object): """ profile_data = setup_params_general_5G["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_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_bidirectional - def test_client_wpa2_bridge_udp_bidirectional(self, get_vif_state, + def test_client_wpa2_bridge_udp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test Bridge mode @@ -885,64 +398,19 @@ class TestWifiCapacityBridgeMode5G(object): """ profile_data = setup_params_general_5G["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_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True 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 01f3defdc..447f9de20 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 @@ -11,11 +11,12 @@ import allure pytestmark = [pytest.mark.performance, pytest.mark.wifi_capacity_test, pytest.mark.nat] # """pytest.mark.usefixtures("setup_test_run")"""] + setup_params_general_dual_band = { "mode": "NAT", "ssid_modes": { "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz", "is5GHz"], "security_key": "something"} + {"ssid_name": "ssid_wpa2_dual_band", "appliedRadios": ["2G", "5G"], "security_key": "something"} ] }, "rf": {}, @@ -35,13 +36,14 @@ setup_params_general_dual_band = { @pytest.mark.twog @pytest.mark.fiveg @pytest.mark.dual_band +@pytest.mark.performance_release class TestWifiCapacityNATModeDualBand(object): """ Wifi Capacity Test NAT mode pytest -m "wifi_capacity_test and NAT" """ @pytest.mark.tcp_download - def test_client_wpa2_NAT_tcp_dl(self, get_vif_state, lf_tools, + def test_client_wpa2_NAT_tcp_dl(self, get_vif_state, lf_tools, setup_profiles, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test NAT mode @@ -49,61 +51,22 @@ class TestWifiCapacityNATModeDualBand(object): """ profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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") + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="TCP-IPv4", duration="60000") - wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_twog[0], - instance_name="test_wct_wpa2_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) + + lf_tools.attach_report_graphs(report_name=report_name) print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) assert True @pytest.mark.udp_download @@ -115,67 +78,23 @@ class TestWifiCapacityNATModeDualBand(object): """ profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.tcp_bidirectional def test_client_wpa2_NAT_tcp_bidirectional(self, get_vif_state, lf_tools, @@ -186,67 +105,23 @@ class TestWifiCapacityNATModeDualBand(object): """ profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_bidirectional def test_client_wpa2_NAT_udp_bidirectional(self, get_vif_state, lf_tools, @@ -257,74 +132,30 @@ class TestWifiCapacityNATModeDualBand(object): """ profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True setup_params_general_2G = { "mode": "NAT", "ssid_modes": { "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz", "is5GHz"], "security_key": "something"} + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"} ] }, "rf": {}, @@ -342,7 +173,6 @@ setup_params_general_2G = { @pytest.mark.usefixtures("setup_profiles") @pytest.mark.wpa2_personal @pytest.mark.twog -@pytest.mark.fiveg @pytest.mark.fiveg_band class TestWifiCapacityNATMode2G(object): """ Wifi Capacity Test NAT mode @@ -350,7 +180,7 @@ class TestWifiCapacityNATMode2G(object): """ @pytest.mark.tcp_download - def test_client_wpa2_NAT_tcp_dl(self, get_vif_state, + def test_client_wpa2_NAT_tcp_dl(self, get_vif_state, lf_tools, setup_profiles, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test NAT mode @@ -358,70 +188,25 @@ class TestWifiCapacityNATMode2G(object): """ profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_download - def test_client_wpa2_NAT_udp_dl(self, get_vif_state, + def test_client_wpa2_NAT_udp_dl(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test NAT mode @@ -429,70 +214,25 @@ class TestWifiCapacityNATMode2G(object): """ profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.tcp_bidirectional - def test_client_wpa2_NAT_tcp_bidirectional(self, get_vif_state, + def test_client_wpa2_NAT_tcp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test NAT mode @@ -500,70 +240,25 @@ class TestWifiCapacityNATMode2G(object): """ profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_bidirectional - def test_client_wpa2_NAT_udp_bidirectional(self, get_vif_state, + def test_client_wpa2_NAT_udp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test NAT mode @@ -571,74 +266,29 @@ class TestWifiCapacityNATMode2G(object): """ profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True setup_params_general_5G = { "mode": "NAT", "ssid_modes": { "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz", "is5GHz"], "security_key": "something"} + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is5GHz"], "security_key": "something"} ] }, "rf": {}, @@ -655,16 +305,15 @@ setup_params_general_5G = { ) @pytest.mark.usefixtures("setup_profiles") @pytest.mark.wpa2_personal -@pytest.mark.twog @pytest.mark.fiveg -@pytest.mark.twog_band +@pytest.mark.fiveg_band class TestWifiCapacityNATMode5G(object): """ Wifi Capacity Test NAT mode pytest -m "wifi_capacity_test and NAT" """ @pytest.mark.tcp_download - def test_client_wpa2_NAT_tcp_dl(self, get_vif_state, + def test_client_wpa2_NAT_tcp_dl(self, get_vif_state, lf_tools, setup_profiles, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test NAT mode @@ -672,70 +321,25 @@ class TestWifiCapacityNATMode5G(object): """ profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_download - def test_client_wpa2_NAT_udp_dl(self, get_vif_state, + def test_client_wpa2_NAT_udp_dl(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test NAT mode @@ -743,70 +347,25 @@ class TestWifiCapacityNATMode5G(object): """ profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.tcp_bidirectional - def test_client_wpa2_NAT_tcp_bidirectional(self, get_vif_state, + def test_client_wpa2_NAT_tcp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test NAT mode @@ -814,70 +373,25 @@ class TestWifiCapacityNATMode5G(object): """ profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_bidirectional - def test_client_wpa2_NAT_udp_bidirectional(self, get_vif_state, + def test_client_wpa2_NAT_udp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test NAT mode @@ -885,64 +399,19 @@ class TestWifiCapacityNATMode5G(object): """ profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "NAT" - 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_NAT_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphss(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True diff --git a/tests/e2e/basic/performance_tests/wifi_capacity_test/test_vlan_mode.py b/tests/e2e/basic/performance_tests/wifi_capacity_test/test_vlan_mode.py index 9f165baf7..832e4250a 100644 --- a/tests/e2e/basic/performance_tests/wifi_capacity_test/test_vlan_mode.py +++ b/tests/e2e/basic/performance_tests/wifi_capacity_test/test_vlan_mode.py @@ -1,7 +1,7 @@ """ Performance Test: Wifi Capacity Test : VLAN Mode - pytest -m "wifi_capacity_test and VLAN" + pytest -m "wifi_capacity_test and vlan" """ import os @@ -11,11 +11,12 @@ import allure pytestmark = [pytest.mark.performance, pytest.mark.wifi_capacity_test, pytest.mark.vlan] # """pytest.mark.usefixtures("setup_test_run")"""] + setup_params_general_dual_band = { "mode": "VLAN", "ssid_modes": { "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz", "is5GHz"], "security_key": "something"} + {"ssid_name": "ssid_wpa2_dual_band", "appliedRadios": ["2G", "5G"], "security_key": "something"} ] }, "rf": {}, @@ -41,7 +42,7 @@ class TestWifiCapacityVLANModeDualBand(object): """ @pytest.mark.tcp_download - def test_client_wpa2_VLAN_tcp_dl(self, get_vif_state, lf_tools, + def test_client_wpa2_VLAN_tcp_dl(self, get_vif_state, lf_tools, setup_profiles, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test VLAN mode @@ -49,61 +50,22 @@ class TestWifiCapacityVLANModeDualBand(object): """ profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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") + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="TCP-IPv4", duration="60000") - wct_obj = lf_test.wifi_capacity(stations="1.1.%s" % station_names_twog[0], - instance_name="test_wct_wpa2_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) + + lf_tools.attach_report_graphs(report_name=report_name) print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) assert True @pytest.mark.udp_download @@ -115,67 +77,23 @@ class TestWifiCapacityVLANModeDualBand(object): """ profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_udp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.tcp_bidirectional def test_client_wpa2_VLAN_tcp_bidirectional(self, get_vif_state, lf_tools, @@ -186,67 +104,23 @@ class TestWifiCapacityVLANModeDualBand(object): """ profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_tcp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_bidirectional def test_client_wpa2_VLAN_udp_bidirectional(self, get_vif_state, lf_tools, @@ -257,74 +131,30 @@ class TestWifiCapacityVLANModeDualBand(object): """ profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_udp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True setup_params_general_2G = { "mode": "VLAN", "ssid_modes": { "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz", "is5GHz"], "security_key": "something"} + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"} ] }, "rf": {}, @@ -342,7 +172,6 @@ setup_params_general_2G = { @pytest.mark.usefixtures("setup_profiles") @pytest.mark.wpa2_personal @pytest.mark.twog -@pytest.mark.fiveg @pytest.mark.fiveg_band class TestWifiCapacityVLANMode2G(object): """ Wifi Capacity Test VLAN mode @@ -350,7 +179,7 @@ class TestWifiCapacityVLANMode2G(object): """ @pytest.mark.tcp_download - def test_client_wpa2_VLAN_tcp_dl(self, get_vif_state, + def test_client_wpa2_VLAN_tcp_dl(self, get_vif_state, lf_tools, setup_profiles, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test VLAN mode @@ -358,70 +187,25 @@ class TestWifiCapacityVLANMode2G(object): """ profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_download - def test_client_wpa2_VLAN_udp_dl(self, get_vif_state, + def test_client_wpa2_VLAN_udp_dl(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test VLAN mode @@ -429,70 +213,25 @@ class TestWifiCapacityVLANMode2G(object): """ profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_udp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.tcp_bidirectional - def test_client_wpa2_VLAN_tcp_bidirectional(self, get_vif_state, + def test_client_wpa2_VLAN_tcp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test VLAN mode @@ -500,70 +239,25 @@ class TestWifiCapacityVLANMode2G(object): """ profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_tcp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_bidirectional - def test_client_wpa2_VLAN_udp_bidirectional(self, get_vif_state, + def test_client_wpa2_VLAN_udp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test VLAN mode @@ -571,74 +265,29 @@ class TestWifiCapacityVLANMode2G(object): """ profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_udp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True setup_params_general_5G = { "mode": "VLAN", "ssid_modes": { "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz", "is5GHz"], "security_key": "something"} + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is5GHz"], "security_key": "something"} ] }, "rf": {}, @@ -655,16 +304,15 @@ setup_params_general_5G = { ) @pytest.mark.usefixtures("setup_profiles") @pytest.mark.wpa2_personal -@pytest.mark.twog @pytest.mark.fiveg -@pytest.mark.twog_band +@pytest.mark.fiveg_band class TestWifiCapacityVLANMode5G(object): """ Wifi Capacity Test VLAN mode pytest -m "wifi_capacity_test and VLAN" """ @pytest.mark.tcp_download - def test_client_wpa2_VLAN_tcp_dl(self, get_vif_state, + def test_client_wpa2_VLAN_tcp_dl(self, get_vif_state, lf_tools, setup_profiles, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test VLAN mode @@ -672,70 +320,25 @@ class TestWifiCapacityVLANMode5G(object): """ profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_tcp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_download - def test_client_wpa2_VLAN_udp_dl(self, get_vif_state, + def test_client_wpa2_VLAN_udp_dl(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test VLAN mode @@ -743,70 +346,25 @@ class TestWifiCapacityVLANMode5G(object): """ profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_udp_dl", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="0", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.tcp_bidirectional - def test_client_wpa2_VLAN_tcp_bidirectional(self, get_vif_state, + def test_client_wpa2_VLAN_tcp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test VLAN mode @@ -814,70 +372,25 @@ class TestWifiCapacityVLANMode5G(object): """ profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_tcp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True @pytest.mark.udp_bidirectional - def test_client_wpa2_VLAN_udp_bidirectional(self, get_vif_state, + def test_client_wpa2_VLAN_udp_bidirectional(self, get_vif_state, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration): """ Wifi Capacity Test VLAN mode @@ -885,64 +398,19 @@ class TestWifiCapacityVLANMode5G(object): """ profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] - security = "wpa2" mode = "VLAN" - 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_VLAN_2g", 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"] + "_wifi_capacity_test") - allure.attach.file(source="../reports/" + report_name + "/chart-0.png", - name=get_configuration["access_point"][0]["model"] + "Realtime bps", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-2.png", - name=get_configuration["access_point"][0]["model"] + \ - "Total PDU Received vs NUmber of Stations Active", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-3.png", - name=get_configuration["access_point"][0]["model"] + "Port Reset Totals", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-4.png", - name=get_configuration["access_point"][0]["model"] + "Station Connect Time", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-5.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined bps - 60 Second Running Average", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-6.png", - name=get_configuration["access_point"][0]["model"] + \ - "Combined Received Bytes", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-7.png", - name=get_configuration["access_point"][0]["model"] + \ - "Station Maximums", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-8.png", - name=get_configuration["access_point"][0]["model"] + \ - "RF Stats for Station", - attachment_type="image/png", extension=None) - allure.attach.file(source="../reports/" + report_name + "/chart-9.png", - name=get_configuration["access_point"][0]["model"] + \ - "Link Rate for Stations", - attachment_type="image/png", extension=None) - print("Test Completed... Cleaning up Stations") - lf_test.Client_disconnect(station_name=station_names_twog) - assert station - else: - assert False + lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name) + lf_tools.Chamber_View() + wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_VLAN_udp_bi", mode=mode, vlan_id=vlan, + download_rate="1Gbps", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + print("Test Completed... Cleaning up Stations") + assert True