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 6d1886aac..cb30552fe 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 @@ -580,6 +580,7 @@ class TestRateLimitingWithRadiusBridge(object): eap = "TTLS" ttls_passwd = 'password' identity = 'user1' + configured = 10 allure.attach(name="Max-Upload-User1", body=str(profile_data["rate-limit"])) passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, mode=mode, band=band, @@ -594,13 +595,19 @@ class TestRateLimitingWithRadiusBridge(object): 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) + 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") - assert True + 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 - + assert False, "EAP Connect Failed" @pytest.mark.wpa2_enterprise @pytest.mark.twog @@ -620,6 +627,7 @@ class TestRateLimitingWithRadiusBridge(object): eap = "TTLS" ttls_passwd = 'password' identity = 'user1' + configured = 10 allure.attach(name="Max-Download-User1", body=str(profile_data["rate-limit"])) passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, mode=mode, band=band, @@ -629,14 +637,68 @@ 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="1Gbps", batch_size="1", - upload_rate="0bps", protocol="TCP-IPv4", duration="60000", + 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) + 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") - assert True + 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 + assert False, "EAP Connect Failed" + + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + @pytest.mark.max_upload_user2 + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-7620", name="WIFI-7620") + def test_radius_server_ratelimit_maxupload_groupuser2_2g(self, lf_test, lf_tools, station_names_twog): + """ + Test: check max-upload ratelimit of group - user2 + pytest -m "wpa2_enterprise and twog and max_upload_user2" + """ + 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 = 'user2' + configured = 20 + allure.attach(name="Max-Upload-User2", 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_user1", 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) + 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" \ No newline at end of file