diff --git a/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting_with_radius/test_rate_limiting_with_radius.py b/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting_with_radius/test_rate_limiting_with_radius.py index 2fd9431f70..2810a74884 100644 --- a/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting_with_radius/test_rate_limiting_with_radius.py +++ b/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting_with_radius/test_rate_limiting_with_radius.py @@ -203,6 +203,7 @@ def test_radius_server_2g_upload_persta_perclient_rate(self, get_test_library, g eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -215,13 +216,19 @@ def test_radius_server_2g_upload_persta_perclient_rate(self, get_test_library, g assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_2g_up_perssid_persta", mode=mode, + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_2g_up_perssid_persta", mode=mode, download_rate="0Gbps", batch_size="1", upload_rate="2.488Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[1][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" - assert True @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -247,6 +254,8 @@ def test_radius_server_2g_upload_download_persta_perclient_rate(self, get_test_l eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured_up = 10 + configured_dw = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -259,13 +268,22 @@ def test_radius_server_2g_upload_download_persta_perclient_rate(self, get_test_l assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_2g_up_down_per_per_client", mode=mode, + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_2g_up_down_per_per_client", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved_up = float("{:.2f}".format(kpi_data[1][0])) + achieved_dw = float("{:.2f}".format(kpi_data[0][0])) + if achieved_up >= configured_up: + assert False, f"Expected Throughput should be less than {configured_up} Mbps" + elif achieved_dw >= configured_dw: + assert False, f"Expected Throughput should be less than {configured_dw} Mbps" + else: + assert True - assert True @pytest.mark.wpa2_enterprise @pytest.mark.fiveg @@ -291,6 +309,7 @@ def test_radius_server_fiveg_per_ssid_download(self, get_test_library, get_dut_l eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -303,13 +322,20 @@ def test_radius_server_fiveg_per_ssid_download(self, get_test_library, get_dut_l assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Total Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_5g_down_per_ssid", mode=mode, + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_5g_down_per_ssid", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="0Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[0][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" + - assert True @pytest.mark.wpa2_enterprise @pytest.mark.fiveg @@ -335,6 +361,7 @@ def test_radius_server_fiveg_per_ssid_upload(self, get_test_library, get_dut_log eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -347,13 +374,19 @@ def test_radius_server_fiveg_per_ssid_upload(self, get_test_library, get_dut_log assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_5g_up_per_ssid", mode=mode, + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_5g_up_per_ssid", mode=mode, download_rate="0Gbps", batch_size="1", upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[1][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" - assert True @pytest.mark.wpa2_enterprise @pytest.mark.fiveg @@ -379,6 +412,7 @@ def test_radius_server_fiveg_per_ssid_perclient_download(self, get_test_library, eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -391,13 +425,18 @@ def test_radius_server_fiveg_per_ssid_perclient_download(self, get_test_library, assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_5g_down_per_ssid_perclient", mode=mode, + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_5g_down_per_ssid_perclient", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="0Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - assert True + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[0][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" @pytest.mark.wpa2_enterprise @pytest.mark.fiveg @@ -423,6 +462,7 @@ def test_radius_server_fiveg_per_ssid_perclient_upstream(self, get_test_library, eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -435,13 +475,18 @@ def test_radius_server_fiveg_per_ssid_perclient_upstream(self, get_test_library, assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_5g_upstream_per_ssid_perclient", mode=mode, + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_5g_upstream_per_ssid_perclient", mode=mode, download_rate="0Gbps", batch_size="1", upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - assert True + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[1][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" @pytest.mark.wpa2_enterprise @pytest.mark.fiveg @@ -470,6 +515,8 @@ def test_radius_server_fiveg_per_ssid_perclient_upstream_downstream(self, get_te eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured_up = 10 + configured_dw = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -482,14 +529,22 @@ def test_radius_server_fiveg_per_ssid_perclient_upstream_downstream(self, get_te assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_5g_upstream_downstream_per_ssid_perclient", + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_5g_upstream_downstream_per_ssid_perclient", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - assert True + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved_up = float("{:.2f}".format(kpi_data[1][0])) + achieved_dw = float("{:.2f}".format(kpi_data[0][0])) + if achieved_up >= configured_up: + assert False, f"Expected Throughput should be less than {configured_up} Mbps" + elif achieved_dw >= configured_dw: + assert False, f"Expected Throughput should be less than {configured_dw} Mbps" + else: + assert True @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -515,6 +570,7 @@ def test_radius_server_2g_per_ssid(self, get_test_library, get_dut_logs_per_test eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -527,14 +583,20 @@ def test_radius_server_2g_per_ssid(self, get_test_library, get_dut_logs_per_test assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Total Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_2g_per_ssid", + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_2g_per_ssid", mode=mode, download_rate="0Gbps", batch_size="1", upload_rate="1Gbps", protocol="TCP and UDP IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[1][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" - assert True @pytest.mark.wpa2_enterprise @pytest.mark.fiveg @@ -560,6 +622,7 @@ def test_radius_server_fiveg_per_ssid(self, get_test_library, get_dut_logs_per_t eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -572,14 +635,20 @@ def test_radius_server_fiveg_per_ssid(self, get_test_library, get_dut_logs_per_t assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Station Upload Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_5g_per_ssid", + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_5g_per_ssid", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="0Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[0][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" - assert True @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -605,6 +674,8 @@ def test_radius_server_2g_per_ssid_per_client(self, get_test_library, get_dut_lo eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured_up = 10 + configured_dw = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -617,14 +688,22 @@ def test_radius_server_2g_per_ssid_per_client(self, get_test_library, get_dut_lo assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Upload Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_2g_per_ssid_per_client", + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_2g_per_ssid_per_client", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="1Gbps", protocol="TCP and UDP IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - assert True + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved_up = float("{:.2f}".format(kpi_data[1][0])) + achieved_dw = float("{:.2f}".format(kpi_data[0][0])) + if achieved_up >= configured_up: + assert False, f"Expected Throughput should be less than {configured_up} Mbps" + elif achieved_dw >= configured_dw: + assert False, f"Expected Throughput should be less than {configured_dw} Mbps" + else: + assert True @pytest.mark.wpa2_enterprise @pytest.mark.fiveg @@ -650,6 +729,7 @@ def test_radius_server_fiveg_per_ssid_per_client(self, get_test_library, get_dut eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -662,14 +742,19 @@ def test_radius_server_fiveg_per_ssid_per_client(self, get_test_library, get_dut assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Upload Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_5g_per_ssid_per_client", + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_5g_per_ssid_per_client", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="0Gbps", protocol="TCP and UDP IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - assert True + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[0][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -695,6 +780,7 @@ def test_radius_server_2g_per_ssid_downstream(self, get_test_library, get_dut_lo eap = "TTLS" ttls_passwd = "password" identity = "bandwidth10m" + configured = 10 allure.attach(name="ssid-rates", body=str(profile_data["rate-limit"])) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, @@ -707,14 +793,19 @@ def test_radius_server_2g_per_ssid_downstream(self, get_test_library, get_dut_lo assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Total Upload Rate:"]] - get_test_library.wifi_capacity(instance_name="Test_Radius_2g", + obj = get_test_library.wifi_capacity(instance_name="Test_Radius_2g", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="0Gbps", protocol="TCP and UDP IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - assert True + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[0][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" @pytest.mark.twog @pytest.mark.max_upload_user1 @@ -744,8 +835,8 @@ def test_radius_server_ratelimit_maxupload_groupuser1_2g(self, get_test_library, eap = "TTLS" ttls_passwd = 'password' identity = 'user1' - configured = 10 - allure.attach(name="Max-Upload-User1", body=str(profile_data["rate-limit"])) + configured = 20 + allure.attach(name="Max-Upload-User1", body=str(20)) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, mode=mode, band=band, eap=eap, @@ -757,27 +848,20 @@ def test_radius_server_ratelimit_maxupload_groupuser1_2g(self, get_test_library, assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Total Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user1", + obj = get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user1", mode=mode, download_rate="0Gbps", batch_size="1", upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[1][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" - # kpi_data = lf_tools.read_kpi_file(column_name=["short-description", "numeric-score"], dir_name=report_name) - # print(kpi_data) - # achieved = float("{:.2f}".format(kpi_data[1][1])) - # allure.attach(name="Check PASS/FAIL information", body=f"Configured WISPr Bandwidth for Max Upload for " - # f"user1: {configured} Mbps \nAchieved throughput " - # f"via Test: {achieved} Mbps") - # lf_tools.attach_report_graphs(report_name=report_name) - # print("Test Completed... Cleaning up Stations") - # if float(achieved) != float(0) and (achieved <= configured): - # assert True - # else: - # assert False, f"Expected Throughput should be less than {configured} Mbps" - # else: - # assert False, "EAP Connect Failed" @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -807,8 +891,8 @@ def test_radius_server_ratelimit_maxdownload_groupuser1_2g(self, get_test_librar eap = "TTLS" ttls_passwd = 'password' identity = 'user1' - configured = 10 - allure.attach(name="Max-Download-User1", body=str(profile_data["rate-limit"])) + configured = 30 + allure.attach(name="Max-Download-User1", body=str(30)) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, mode=mode, band=band, eap=eap, @@ -820,27 +904,19 @@ def test_radius_server_ratelimit_maxdownload_groupuser1_2g(self, get_test_librar assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Total Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user1", + obj = get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user1", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="0Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - # kpi_data = lf_tools.read_kpi_file(column_name=["short-description", "numeric-score"], dir_name=report_name) - # print(kpi_data) - # achieved = float("{:.2f}".format(kpi_data[0][1])) - # allure.attach(name="Check PASS/FAIL information", body=f"Configured WISPr Bandwidth for Max Download for " - # f"user1: {configured} Mbps \nAchieved throughput " - # f"via Test: {achieved} Mbps") - # lf_tools.attach_report_graphs(report_name=report_name) - # print("Test Completed... Cleaning up Stations") - # if float(achieved) != float(0) and (achieved <= configured): - # assert True - # else: - # assert False, f"Expected Throughput should be less than {configured} Mbps" - # else: - # assert False, "EAP Connect Failed" + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[0][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -870,8 +946,8 @@ def test_radius_server_ratelimit_maxupload_groupuser2_2g(self, get_test_library, eap = "TTLS" ttls_passwd = 'password' identity = 'user2' - configured = 20 - allure.attach(name="Max-Upload-User2", body=str(profile_data["rate-limit"])) + configured = 60 + allure.attach(name="Max-Upload-User2", body=str(60)) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, mode=mode, band=band, eap=eap, @@ -883,27 +959,19 @@ def test_radius_server_ratelimit_maxupload_groupuser2_2g(self, get_test_library, assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Total Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user2", + obj = get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user2", mode=mode, download_rate="0Gbps", batch_size="1", upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - # kpi_data = lf_tools.read_kpi_file(column_name=["short-description", "numeric-score"], dir_name=report_name) - # print(kpi_data) - # achieved = float("{:.2f}".format(kpi_data[1][1])) - # allure.attach(name="Check PASS/FAIL information", body=f"Configured WISPr Bandwidth for Max Upload for " - # f"user2: {configured} Mbps \nAchieved throughput " - # f"via Test: {achieved} Mbps") - # lf_tools.attach_report_graphs(report_name=report_name) - # print("Test Completed... Cleaning up Stations") - # if float(achieved) != float(0) and (achieved <= configured): - # assert True - # else: - # assert False, f"Expected Throughput should be less than {configured} Mbps" - # else: - # assert False, "EAP Connect Failed" + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[1][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -933,7 +1001,8 @@ def test_radius_server_ratelimit_maxdownload_groupuser2_2g(self, get_test_librar eap = "TTLS" ttls_passwd = 'password' identity = 'user2' - configured = 20 + configured = 50 + allure.attach(name="Max-Download-User2", body=str(50)) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, mode=mode, band=band, eap=eap, @@ -946,27 +1015,19 @@ def test_radius_server_ratelimit_maxdownload_groupuser2_2g(self, get_test_librar allure.attach(name="Max-Download-User2", body=str(profile_data["rate-limit"])) if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Total Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user2", + obj = get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user2", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="0Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - # kpi_data = lf_tools.read_kpi_file(column_name=["short-description", "numeric-score"], dir_name=report_name) - # print(kpi_data) - # achieved = float("{:.2f}".format(kpi_data[0][1])) - # allure.attach(name="Check PASS/FAIL information", body=f"Configured WISPr Bandwidth for Max Upload for " - # f"user2: {configured} Mbps \nAchieved throughput " - # f"via Test: {achieved} Mbps") - # lf_tools.attach_report_graphs(report_name=report_name) - # print("Test Completed... Cleaning up Stations") - # if float(achieved) != float(0) and (achieved <= configured): - # assert True - # else: - # assert False, f"Expected Throughput should be less than {configured} Mbps" - # else: - # assert False, "EAP Connect Failed" + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[0][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -996,8 +1057,8 @@ def test_radius_server_ratelimit_maxupload_groupuser3_2g(self, get_test_library, eap = "TTLS" ttls_passwd = 'password' identity = 'user3' - configured = 10 - allure.attach(name="Max-Upload-User3", body=str(profile_data["rate-limit"])) + configured = 50 + allure.attach(name="Max-Upload-User3", body=str(50)) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, mode=mode, band=band, eap=eap, @@ -1009,26 +1070,20 @@ def test_radius_server_ratelimit_maxupload_groupuser3_2g(self, get_test_library, assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Total Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user2", + obj = get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user2", mode=mode, download_rate="0Gbps", batch_size="1", upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - # kpi_data = lf_tools.read_kpi_file(column_name=["short-description", "numeric-score"], dir_name=report_name) - # print(kpi_data) - # achieved = float("{:.2f}".format(kpi_data[1][1])) - # allure.attach(name="Check PASS/FAIL information", body=f"Configured WISPr Bandwidth for Max Upload for " - # f"user3: {configured} Mbps \nAchieved throughput " - # f"via Test: {achieved} Mbps") - # lf_tools.attach_report_graphs(report_name=report_name) - # print("Test Completed... Cleaning up Stations") - # if float(achieved) != float(0) and (achieved <= configured): - # assert True - # else: - # assert False, f"Expected Throughput should be less than {configured} Mbps" - # else: - # assert False, "EAP Connect Failed" + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[1][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" + @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -1058,8 +1113,8 @@ def test_radius_server_ratelimit_maxdownload_groupuser3_2g(self, get_test_librar eap = "TTLS" ttls_passwd = 'password' identity = 'user3' - configured = 50 - allure.attach(name="Max-Download-User3", body=str(profile_data["rate-limit"])) + configured = 10 + allure.attach(name="Max-Download-User3", body=str(10)) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, mode=mode, band=band, eap=eap, @@ -1071,27 +1126,19 @@ def test_radius_server_ratelimit_maxdownload_groupuser3_2g(self, get_test_librar assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Total Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user3", + obj = get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user3", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="0Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - # kpi_data = lf_tools.read_kpi_file(column_name=["short-description", "numeric-score"], dir_name=report_name) - # print(kpi_data) - # achieved = float("{:.2f}".format(kpi_data[0][1])) - # allure.attach(name="Check PASS/FAIL information", body=f"Configured WISPr Bandwidth for Max Download for " - # f"user1: {configured} Mbps \nAchieved throughput " - # f"via Test: {achieved} Mbps") - # lf_tools.attach_report_graphs(report_name=report_name) - # print("Test Completed... Cleaning up Stations") - # if float(achieved) != float(0) and (achieved <= configured): - # assert True - # else: - # assert False, f"Expected Throughput should be less than {configured} Mbps" - # else: - # assert False, "EAP Connect Failed" + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[0][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -1121,8 +1168,8 @@ def test_radius_server_ratelimit_maxupload_groupuser4_2g(self, get_test_library, eap = "TTLS" ttls_passwd = 'password' identity = 'user4' - configured = 50 - allure.attach(name="Max-Upload-User4", body=str(profile_data["rate-limit"])) + configured = 10 + allure.attach(name="Max-Upload-User4", body=str(10)) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, mode=mode, band=band, eap=eap, @@ -1134,27 +1181,19 @@ def test_radius_server_ratelimit_maxupload_groupuser4_2g(self, get_test_library, assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Total Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user4", + obj = get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user4", mode=mode, download_rate="0Gbps", batch_size="1", upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - # kpi_data = lf_tools.read_kpi_file(column_name=["short-description", "numeric-score"], dir_name=report_name) - # print(kpi_data) - # achieved = float("{:.2f}".format(kpi_data[1][1])) - # allure.attach(name="Check PASS/FAIL information", body=f"Configured WISPr Bandwidth for Max Upload for " - # f"user4: {configured} Mbps \nAchieved throughput " - # f"via Test: {achieved} Mbps") - # lf_tools.attach_report_graphs(report_name=report_name) - # print("Test Completed... Cleaning up Stations") - # if float(achieved) != float(0) and (achieved <= configured): - # assert True - # else: - # assert False, f"Expected Throughput should be less than {configured} Mbps" - # else: - # assert False, "EAP Connect Failed" + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[1][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps" @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -1184,8 +1223,8 @@ def test_radius_server_ratelimit_maxdownload_groupuser4_2g(self, get_test_librar eap = "TTLS" ttls_passwd = 'password' identity = 'user4' - configured = 10 - allure.attach(name="Max-Download-User4", body=str(profile_data["rate-limit"])) + configured = 50 + allure.attach(name="Max-Download-User4", body=str(50)) get_test_library.pre_cleanup() passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security, mode=mode, band=band, eap=eap, @@ -1197,24 +1236,16 @@ def test_radius_server_ratelimit_maxdownload_groupuser4_2g(self, get_test_librar assert passes == "PASS", result if passes == "PASS": raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Total Download Rate:"]] - get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user4", + obj = get_test_library.wifi_capacity(instance_name="Ratelimit_Radius_group_user4", mode=mode, download_rate="1Gbps", batch_size="1", upload_rate="0Gbps", protocol="TCP-IPv4", duration="60000", move_to_influx=False, dut_data=setup_configuration, ssid_name=ssid_name, add_stations=False, raw_lines=raw_lines) - - # kpi_data = lf_tools.read_kpi_file(column_name=["short-description", "numeric-score"], dir_name=report_name) - # print(kpi_data) - # achieved = float("{:.2f}".format(kpi_data[0][1])) - # allure.attach(name="Check PASS/FAIL information", body=f"Configured WISPr Bandwidth for Max Download for " - # f"user4: {configured} Mbps \nAchieved throughput " - # f"via Test: {achieved} Mbps") - # lf_tools.attach_report_graphs(report_name=report_name) - # print("Test Completed... Cleaning up Stations") - # if float(achieved) != float(0) and (achieved <= configured): - # assert True - # else: - # assert False, f"Expected Throughput should be less than {configured} Mbps" - # else: - # assert False, "EAP Connect Failed" + report_name = obj[0].report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + "/" + kpi_data = get_test_library.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + achieved = float("{:.2f}".format(kpi_data[0][0])) + if achieved <= configured: + assert True + else: + assert False, f"Expected Throughput should be less than {configured} Mbps"