From f9ba44baff989cc570d4ece0110f6eaadbd43a25 Mon Sep 17 00:00:00 2001 From: Anil Kumar Tegala <80811302+anil-tegala@users.noreply.github.com> Date: Tue, 14 Jun 2022 09:47:37 +0530 Subject: [PATCH] ratelimiting with radius max-upload of group user3 added (#539) Signed-off-by: anil-tegala --- .../test_radius_limiting.py | 52 ++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting_with_radius/test_radius_limiting.py b/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting_with_radius/test_radius_limiting.py index 1e8b9ea8f..8e240f10e 100644 --- a/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting_with_radius/test_radius_limiting.py +++ b/tests/e2e/basic/validation_of_operating_modes/bridge_mode/rate_limiting_with_radius/test_radius_limiting.py @@ -638,8 +638,8 @@ class TestRateLimitingWithRadiusBridge(object): if passes: raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Total Download Rate:"]] wct_obj = lf_test.wifi_capacity(instance_name="Ratelimit_Radius_group_user1", mode=mode, vlan_id=vlan, - download_rate="0bps", batch_size="1", - upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000", + download_rate="1Gbps", batch_size="1", + upload_rate="0bps", protocol="TCP-IPv4", duration="60000", raw_lines=raw_lines) report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] @@ -751,5 +751,53 @@ class TestRateLimitingWithRadiusBridge(object): 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 + @pytest.mark.max_upload_user3 + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7622", name="WIFI-7622") + def test_radius_server_ratelimit_maxupload_groupuser3_2g(self, lf_test, lf_tools, station_names_twog): + """ + Test: check max-download ratelimit of group - user3 + pytest -m "wpa2_enterprise and twog and max_upload_user3" + """ + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"][0] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + security = "wpa2" + band = "twog" + eap = "TTLS" + ttls_passwd = 'password' + identity = 'user3' + configured = 50 + allure.attach(name="Max-Upload-User3", body=str(profile_data["rate-limit"])) + passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, + mode=mode, band=band, + eap=eap, ttls_passwd=ttls_passwd, identity=identity, + station_name=station_names_twog, ieee80211w=0, vlan_id=vlan, cleanup=False) + print(passes) + if passes: + raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Total Download Rate:"]] + wct_obj = lf_test.wifi_capacity(instance_name="Ratelimit_Radius_group_user3", mode=mode, vlan_id=vlan, + download_rate="0bps", batch_size="1", + upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000", + raw_lines=raw_lines) + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + 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" \ No newline at end of file