Merge branch 'master' into WIFI-6155

This commit is contained in:
Shivam Thakur
2021-12-13 22:38:52 +05:30
committed by GitHub
6 changed files with 615 additions and 8 deletions

View File

@@ -164,7 +164,7 @@ class RunTest:
station_name=[], key_mgmt="WPA-EAP",
pairwise="NA", group="NA", wpa_psk="DEFAULT",
ttls_passwd="nolastart", ieee80211w=1,
wep_key="NA", ca_cert="NA", eap="TTLS", identity="nolaradius"):
wep_key="NA", ca_cert="NA", eap="TTLS", identity="nolaradius",cleanup=True):
self.eap_connect = TTLSTest(host=self.lanforge_ip, port=self.lanforge_port,
sta_list=station_name, vap=False, _debug_on=self.debug)
@@ -244,6 +244,7 @@ class RunTest:
cx_data = cx_data + str(j) + " : " + str(i[j]) + "\n"
cx_data = cx_data + "\n"
allure.attach(name="cx_data", body=str(cx_data))
if cleanup:
self.eap_connect.cleanup(station_name)
return self.eap_connect.passes()

View File

@@ -600,6 +600,24 @@ RADIUS_ACCOUNTING_DATA = {
"pk_password": "whatever"
}
RATE_LIMITING_RADIUS_SERVER_DATA = {
"ip": "18.189.85.200",
"port": 1812,
"secret": "testing123",
"user": "user",
"password": "password",
"pk_password": "whatever"
}
RATE_LIMITING_RADIUS_ACCOUNTING_DATA = {
"ip": "18.189.85.200",
"port": 1813,
"secret": "testing123",
"user": "user",
"password": "password",
"pk_password": "whatever"
}
PASSPOINT_RADIUS_SERVER_DATA = {
"ip": "52.234.179.191",
"port": 11812,

View File

@@ -50,6 +50,8 @@ from configuration import CONFIGURATION
from configuration import open_flow
from configuration import RADIUS_SERVER_DATA
from configuration import RADIUS_ACCOUNTING_DATA
from configuration import RATE_LIMITING_RADIUS_SERVER_DATA
from configuration import RATE_LIMITING_RADIUS_ACCOUNTING_DATA
from lanforge.scp_util import SCP_File
from testrails.testrail_api import APIClient
from testrails.reporting import Reporting
@@ -225,6 +227,16 @@ def radius_accounting_info():
"""yields the radius accounting information from lab info file"""
yield RADIUS_ACCOUNTING_DATA
@pytest.fixture(scope="session")
def rate_radius_info():
"""yields the radius server information from lab info file"""
yield RATE_LIMITING_RADIUS_SERVER_DATA
@pytest.fixture(scope="session")
def rate_radius_accounting_info():
"""yields the radius accounting information from lab info file"""
yield RATE_LIMITING_RADIUS_ACCOUNTING_DATA
@pytest.fixture(scope="session")
def get_configuration(testbed, request):

View File

@@ -0,0 +1,557 @@
"""
Rate LImiting with radius Bridge Mode Scenario
"""
import allure
import pytest
from configuration import RATE_LIMITING_RADIUS_SERVER_DATA
from configuration import RATE_LIMITING_RADIUS_ACCOUNTING_DATA
pytestmark = [pytest.mark.regression, pytest.mark.rate_limiting_with_radius, pytest.mark.bridge]
setup_params_general = {
"mode": "BRIDGE",
"ssid_modes": {
"wpa2_enterprise": [
{"ssid_name": "ssid_wpa2_2g_br",
"appliedRadios": ["2G"],
"security_key": "something",
"rate-limit": {
"ingress-rate": 50,
"egress-rate": 50
},
"radius_auth_data": RATE_LIMITING_RADIUS_SERVER_DATA,
"radius_acc_data" : RATE_LIMITING_RADIUS_ACCOUNTING_DATA
},
{"ssid_name": "ssid_wpa2_5g_br",
"appliedRadios": ["5G"],
"security_key": "something",
"rate-limit": {
"ingress-rate": 50,
"egress-rate": 50
},
"radius_auth_data": RATE_LIMITING_RADIUS_SERVER_DATA,
"radius_acc_data" : RATE_LIMITING_RADIUS_ACCOUNTING_DATA
}
]
},
"rf": {},
"radius": False
}
@allure.feature("Bridge MODE Rate Limiting with radius server")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestRateLimitingWithRadiusBridge(object):
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
@pytest.mark.twog_upload_per_ssid
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5849", name="WIFI-5849")
def test_radius_server_2g_upload_per_ssid(self, lf_test, lf_tools, rate_radius_info, rate_radius_accounting_info, station_names_twog):
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"
print("authentication", rate_radius_info)
print("accounting",rate_radius_accounting_info )
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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="Test_Radius_2g_up_per_ssid", 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]
lf_tools.attach_report_graphs(report_name=report_name)
print("Test Completed... Cleaning up Stations")
assert True
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
@pytest.mark.twog_download_perssid_persta
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5850", name="WIFI-5850")
def test_radius_server_2g_download_perssid_persta(self, lf_test, lf_tools, rate_radius_info, rate_radius_accounting_info,
station_names_twog):
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"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_2g_down_perssid_persta", mode=mode, vlan_id=vlan,
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]
lf_tools.attach_report_graphs(report_name=report_name)
print("Test Completed... Cleaning up Stations")
assert True
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
@pytest.mark.twog_upload_persta_perclient
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5851", name="WIFI-5851")
def test_radius_server_2g_upload_persta_perclient_rate(self, lf_test, lf_tools, rate_radius_info, rate_radius_accounting_info,
station_names_twog):
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"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_2g_up_per_per_client", mode=mode, vlan_id=vlan,
download_rate="0bps", batch_size="1",
upload_rate="2.488Gbps", protocol="TCP-IPv4", duration="60000", raw_lines=raw_lines)
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.wpa2_enterprise
@pytest.mark.twog
@pytest.mark.twog_upload_download_persta_perclient
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5852", name="WIFI-5852")
def test_radius_server_2g_upload_download_persta_perclient_rate(self, lf_test, lf_tools, rate_radius_info,
rate_radius_accounting_info,
station_names_twog):
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"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_2g_up_down_per_per_client", mode=mode, vlan_id=vlan,
download_rate="1Gbps", 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]
lf_tools.attach_report_graphs(report_name=report_name)
print("Test Completed... Cleaning up Stations")
assert True
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
@pytest.mark.fiveg_download_per_ssid
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5853", name="WIFI-5853")
def test_radius_server_fiveg_per_ssid_download(self, lf_test, lf_tools, rate_radius_info, rate_radius_accounting_info,
station_names_fiveg):
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"][1]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
vlan = 1
security = "wpa2"
band = "fiveg"
eap = "TTLS"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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_fiveg, 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="Test_Radius_5g_down_per_ssid", mode=mode, vlan_id=vlan,
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]
lf_tools.attach_report_graphs(report_name=report_name)
print("Test Completed... Cleaning up Stations")
assert True
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
@pytest.mark.fiveg_upload_per_ssid
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5854", name="WIFI-5854")
def test_radius_server_fiveg_per_ssid_upload(self, lf_test, lf_tools, rate_radius_info, rate_radius_accounting_info,
station_names_fiveg):
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"][1]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
vlan = 1
security = "wpa2"
band = "fiveg"
eap = "TTLS"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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_fiveg, ieee80211w=0, vlan_id=vlan, cleanup=False)
print(passes)
if passes:
raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_5g_up_per_ssid", 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]
lf_tools.attach_report_graphs(report_name=report_name)
print("Test Completed... Cleaning up Stations")
assert True
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
@pytest.mark.fiveg_download_per_ssid_per_client
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5855", name="WIFI-5855")
def test_radius_server_fiveg_per_ssid_perclient_download(self, lf_test, lf_tools, rate_radius_info, rate_radius_accounting_info,
station_names_fiveg):
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"][1]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
vlan = 1
security = "wpa2"
band = "fiveg"
eap = "TTLS"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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_fiveg, ieee80211w=0, vlan_id=vlan, cleanup=False)
print(passes)
if passes:
raw_lines = [["dl_rate_sel: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_5g_down_per_ssid_perclient", mode=mode, vlan_id=vlan,
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]
lf_tools.attach_report_graphs(report_name=report_name)
print("Test Completed... Cleaning up Stations")
assert True
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
@pytest.mark.fiveg_upstream_per_ssid_per_client
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5856", name="WIFI-5856")
def test_radius_server_fiveg_per_ssid_perclient_upstream(self, lf_test, lf_tools, rate_radius_info,
rate_radius_accounting_info,
station_names_fiveg):
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"][1]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
vlan = 1
security = "wpa2"
band = "fiveg"
eap = "TTLS"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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_fiveg, ieee80211w=0, vlan_id=vlan, cleanup=False)
print(passes)
if passes:
raw_lines = [["dl_rate_sel: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_5g_upstream_per_ssid_perclient", 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]
lf_tools.attach_report_graphs(report_name=report_name)
print("Test Completed... Cleaning up Stations")
assert True
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
@pytest.mark.fiveg_upstream__downstream_per_ssid_per_client
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5857", name="WIFI-5857")
def test_radius_server_fiveg_per_ssid_perclient_upstream_downstream(self, lf_test, lf_tools, rate_radius_info,
rate_radius_accounting_info,
station_names_fiveg):
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"][1]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
vlan = 1
security = "wpa2"
band = "fiveg"
eap = "TTLS"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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_fiveg, ieee80211w=0, vlan_id=vlan, cleanup=False)
print(passes)
if passes:
raw_lines = [["dl_rate_sel: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Download Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_5g_upstream_downstream_per_ssid_perclient", mode=mode,
vlan_id=vlan,
download_rate="1Gbps", 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]
lf_tools.attach_report_graphs(report_name=report_name)
print("Test Completed... Cleaning up Stations")
assert True
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
@pytest.mark.twog_per_ssid
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5858", name="WIFI-5858")
def test_radius_server_2g_per_ssid(self, lf_test, lf_tools, rate_radius_info, rate_radius_accounting_info,
station_names_twog):
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"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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: Total Download Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_2g_per_ssid", mode=mode, vlan_id=vlan,
download_rate="0bps", batch_size="1",
upload_rate="1Gbps", protocol="TCP and UDP IPv4", duration="60000",
raw_lines=raw_lines)
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.wpa2_enterprise
@pytest.mark.fiveg
@pytest.mark.fiveg_per_ssid
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5860", name="WIFI-5860")
def test_radius_server_fiveg_per_ssid(self, lf_test, lf_tools, rate_radius_info, rate_radius_accounting_info,
station_names_fiveg):
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"][1]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
vlan = 1
security = "wpa2"
band = "fiveg"
eap = "TTLS"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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_fiveg, ieee80211w=0, vlan_id=vlan, cleanup=False)
print(passes)
if passes:
raw_lines = [["dl_rate_sel: Total Download Rate:"], ["ul_rate_sel: Per-Station Upload Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_5g_per_ssid", mode=mode, vlan_id=vlan,
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]
lf_tools.attach_report_graphs(report_name=report_name)
print("Test Completed... Cleaning up Stations")
assert True
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
@pytest.mark.twog_per_ssid_per_client
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5862", name="WIFI-5862")
def test_radius_server_2g_per_ssid_per_client(self, lf_test, lf_tools, rate_radius_info, rate_radius_accounting_info,
station_names_twog):
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"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Upload Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_2g_per_ssid_per_client", mode=mode, vlan_id=vlan,
download_rate="1Gbps", batch_size="1",
upload_rate="1Gbps", protocol="TCP and UDP IPv4", duration="60000",
raw_lines=raw_lines)
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.wpa2_enterprise
@pytest.mark.fiveg
@pytest.mark.fiveg_per_ssid_per_client
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5864", name="WIFI-5864")
def test_radius_server_fiveg_per_ssid_per_client(self, lf_test, lf_tools, rate_radius_info, rate_radius_accounting_info,
station_names_fiveg):
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"][1]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
vlan = 1
security = "wpa2"
band = "fiveg"
eap = "TTLS"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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_fiveg, ieee80211w=0, vlan_id=vlan, cleanup=False)
print(passes)
if passes:
raw_lines = [["dl_rate_sel: Per-Station Download Rate:"], ["ul_rate_sel: Per-Station Upload Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_5g_per_ssid_per_client", mode=mode, vlan_id=vlan,
download_rate="1Gbps", batch_size="1",
upload_rate="0bps", protocol="TCP and UDP IPv4", duration="60000",
raw_lines=raw_lines)
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.wpa2_enterprise
@pytest.mark.twog
@pytest.mark.twog_per_ssid_down
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5868", name="WIFI-5868")
def test_radius_server_2g_per_ssid_downstream(self, lf_test, lf_tools, rate_radius_info,
rate_radius_accounting_info,
station_names_twog):
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"
print("authentication", rate_radius_info)
print("accounting", rate_radius_accounting_info)
ttls_passwd = rate_radius_info["password"]
identity = rate_radius_info['user']
allure.attach(name="ssid-rates", 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: Total Upload Rate:"]]
wct_obj = lf_test.wifi_capacity(instance_name="Test_Radius_2g", mode=mode, vlan_id=vlan,
download_rate="1Gbps", batch_size="1",
upload_rate="0bps", protocol="TCP and UDP IPv4", duration="60000",
raw_lines=raw_lines)
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

View File

@@ -364,8 +364,10 @@ class Fixtures_2x:
print(1, instantiate_profile_obj.sdk_client)
vlan_id, mode = 0, 0
parameter = dict(param)
print("parameter", parameter)
test_cases = {}
profile_data = {}
var = ""
if parameter['mode'] not in ["BRIDGE", "NAT", "VLAN"]:
print("Invalid Mode: ", parameter['mode'])
@@ -392,6 +394,7 @@ class Fixtures_2x:
data = parameter["ssid_modes"][i][j]
profile_data["ssid"][i].append(data)
lf_dut_data = []
for mode in profile_data['ssid']:
if mode == "open":
for j in profile_data["ssid"][mode]:
@@ -425,6 +428,7 @@ class Fixtures_2x:
test_cases["wpa_2g"] = False
if mode == "wpa2_personal":
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
if j["appliedRadios"].__contains__("2G"):
@@ -486,6 +490,13 @@ class Fixtures_2x:
# EAP SSID Modes
if mode == "wpa2_enterprise":
for j in profile_data["ssid"][mode]:
if "radius_auth_data" in j:
print("yes")
var = True
else:
print("no")
var = False
if mode in get_markers.keys() and get_markers[mode]:
try:
if j["appliedRadios"].__contains__("2G"):
@@ -494,6 +505,14 @@ class Fixtures_2x:
lf_dut_data.append(j)
j["appliedRadios"] = list(set(j["appliedRadios"]))
j['security'] = 'wpa2'
if var :
RADIUS_SERVER_DATA = j["radius_auth_data"]
RADIUS_ACCOUNTING_DATA = j['radius_acc_data']
creates_profile = instantiate_profile_obj.add_ssid(ssid_data=j, radius=True,
radius_auth_data=RADIUS_SERVER_DATA,
radius_accounting_data=RADIUS_ACCOUNTING_DATA)
test_cases["wpa_2g"] = True
else:
RADIUS_SERVER_DATA = radius_info
RADIUS_ACCOUNTING_DATA = radius_accounting_info
creates_profile = instantiate_profile_obj.add_ssid(ssid_data=j, radius=True,