mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 11:57:49 +00:00
Wifi 7846 DVLAN (#514)
* getting RADIUS_SERVER_DATA and RADIUS_ACCOUNTING_DATA from lab_info for wpa3_enterprise Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * Created testcases for WAP3_eap security Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * renamed files Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * changed key_mgmt param value Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * getting RADIUS_SERVER_DATA and RADIUS_ACCOUNTING_DATA from lab_info for wpa3_enterprise Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * Created testcases for WAP3_eap security Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * renamed files Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * changed key_mgmt param value Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * changed key_mgmt param value Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * Changed class and function names Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * added station_ip for dvlan in eap_connect Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com> * Removed duplicated downlink_mu_mimo function Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com>
This commit is contained in:
@@ -369,6 +369,9 @@ class RunTest:
|
||||
# sta_url = self.eap_connect.get_station_url(sta_name)
|
||||
# station_info = self.eap_connect.json_get(sta_url)
|
||||
station_info = self.eap_connect.json_get("port/1/1/" + sta_name)
|
||||
if d_vlan:
|
||||
if "ip" in station_info["interface"].keys():
|
||||
self.station_ip[sta_name] = station_info["interface"]["ip"]
|
||||
|
||||
dict_data = station_info["interface"]
|
||||
dict_table["After"] = list(dict_data.values())
|
||||
@@ -1204,87 +1207,6 @@ class RunTest:
|
||||
print(f"Lanforge-radio Country changed {_country_num}")
|
||||
self.local_realm.json_post("/cli-json/set_wifi_radio", _data=data)
|
||||
|
||||
def downlink_mu_mimo(self, radios_2g=[], radios_5g=[], radios_ax=[], dut_name="TIP", dut_5g="", dut_2g="", mode="BRIDGE", vlan_id=1, skip_2g=True, skip_5g=False):
|
||||
raw_line = []
|
||||
skip_twog = '1' if skip_2g else '0'
|
||||
skip_fiveg = '1' if skip_5g else '0'
|
||||
sniff_radio = 'wiphy6'
|
||||
channel = 149 if skip_2g else 11
|
||||
upstream_port = self.upstream_port
|
||||
|
||||
sets = [['Calibrate Attenuators', '0'], ['Receiver Sensitivity', '0'], ['Maximum Connection', '0'],
|
||||
['Maximum Throughput', '0'], ['Airtime Fairness', '0'], ['Range Versus Rate', '0'],
|
||||
['Spatial Consistency', '0'],
|
||||
['Multiple STAs Performance', '0'], ['Multiple Assoc Stability', '0'], ['Downlink MU-MIMO', '1'],
|
||||
['AP Coexistence', '0'], ['Long Term Stability', '0'], ['Skip 2.4Ghz Tests', f'{skip_twog}'],
|
||||
['Skip 5Ghz Tests', f'{skip_fiveg}'], ['2.4Ghz Channel', 'AUTO'], ['5Ghz Channel', 'AUTO']]
|
||||
for i in range(6):
|
||||
if i == 0 or i == 2:
|
||||
raw_line.append([f'radio-{i}: {radios_5g[0] if i == 0 else radios_5g[1]}'])
|
||||
if i == 1 or i == 3:
|
||||
raw_line.append([f'radio-{i}: {radios_2g[0] if i == 1 else radios_2g[1]}'])
|
||||
if i == 4 or i == 5:
|
||||
raw_line.append([f'radio-{i}: {radios_ax[0] if i == 4 else radios_ax[1]}'])
|
||||
|
||||
if len(raw_line) != 6:
|
||||
raw_line = [['radio-0: 1.1.5 wiphy1'], ['radio-1: 1.1.4 wiphy0'], ['radio-2: 1.1.7 wiphy3'],
|
||||
['radio-3: 1.1.6 wiphy2'], ['radio-4: 1.1.8 wiphy4'], ['radio-5: 1.1.9 wiphy5']]
|
||||
instance_name = "tr398-instance-{}".format(str(random.randint(0, 100000)))
|
||||
|
||||
if not os.path.exists("mu-mimo-config.txt"):
|
||||
with open("mu-mimo-config.txt", "wt") as f:
|
||||
for i in raw_line:
|
||||
f.write(str(i[0]) + "\n")
|
||||
f.close()
|
||||
|
||||
if mode == "BRIDGE" or mode == "NAT":
|
||||
upstream_port = self.upstream_port
|
||||
else:
|
||||
upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
print("Upstream Port: ", self.upstream_port)
|
||||
|
||||
self.pcap_obj = LfPcap(host=self.lanforge_ip, port=self.lanforge_port)
|
||||
self.cvtest_obj = TR398Test(lf_host=self.lanforge_ip,
|
||||
lf_port=self.lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name=instance_name,
|
||||
config_name="cv_dflt_cfg",
|
||||
upstream="1.1." + upstream_port,
|
||||
pull_report=True,
|
||||
local_lf_report_dir=self.local_report_path,
|
||||
load_old_cfg=False,
|
||||
dut2=dut_2g,
|
||||
dut5=dut_5g,
|
||||
raw_lines_file="mu-mimo-config.txt",
|
||||
enables=[],
|
||||
disables=[],
|
||||
raw_lines=[],
|
||||
sets=sets,
|
||||
test_rig=dut_name
|
||||
)
|
||||
self.cvtest_obj.setup()
|
||||
t1 = threading.Thread(target=self.cvtest_obj.run)
|
||||
t1.start()
|
||||
# t2 = threading.Thread(target=self.pcap_obj.sniff_packets, args=(sniff_radio, "mu-mimo", channel, 60))
|
||||
# if t1.is_alive():
|
||||
# time.sleep(180)
|
||||
# t2.start()
|
||||
while t1.is_alive():
|
||||
time.sleep(1)
|
||||
if os.path.exists("mu-mimo-config.txt"):
|
||||
os.remove("mu-mimo-config.txt")
|
||||
|
||||
report_name = self.cvtest_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
influx = CSVtoInflux(influx_host=self.influx_params["influx_host"],
|
||||
influx_port=self.influx_params["influx_port"],
|
||||
influx_org=self.influx_params["influx_org"],
|
||||
influx_token=self.influx_params["influx_token"],
|
||||
influx_bucket=self.influx_params["influx_bucket"],
|
||||
path=report_name)
|
||||
influx.glob()
|
||||
return self.cvtest_obj
|
||||
|
||||
def scan_ssid(self, radio=""):
|
||||
'''This method for scan ssid data'''
|
||||
list_data = []
|
||||
|
||||
@@ -37,14 +37,14 @@ setup_params_general = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlan(object):
|
||||
class TestDynamicVlanOverSsid5GWpa2(object):
|
||||
|
||||
@pytest.mark.dynamic_precedence_over_ssid
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_dynamic_precedence_over_ssid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5705")
|
||||
def test_dynamic_precedence_over_ssid_vlan(self, get_vif_state, lf_tools,get_ap_logs,get_lf_logs,
|
||||
def test_dynamic_precedence_over_ssid_vlan_5g_wpa2(self, get_vif_state, lf_tools,get_ap_logs,get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
@@ -39,14 +39,14 @@ setup_params_general = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlan(object):
|
||||
class TestDynamicVlan5GWpa2(object):
|
||||
|
||||
@pytest.mark.absence_of_radius_vlan_identifier
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_ssid_vlan_in_the_absence_of_radius_vlan_identifier",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5704")
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier_5g_wpa2(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
@@ -114,7 +114,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_dynamic_invalid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5706")
|
||||
def test_dynamic_invalid_vlan(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
def test_dynamic_invalid_vlan_5g_wpa2(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
@@ -179,7 +179,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_radius_vlan_info_retained_after_periodic_reauthentication",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5707")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication_5g_wpa2(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
@@ -263,7 +263,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_ssid_vlan_used_in_absence_of_radius_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5708")
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan_5g_wpa2(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
@@ -384,7 +384,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_outof_bound_vlanid",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5711")
|
||||
def test_out_of_bound_vlanid(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
def test_out_of_bound_vlanid_5g_wpa2(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
@@ -430,7 +430,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_client_association_ap_with_dynamic_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5712")
|
||||
def test_client_association_ap_with_dynamic_vlan(self, get_vif_state, lf_tools, get_ap_logs, get_lf_logs,
|
||||
def test_client_association_ap_with_dynamic_vlan_5g_wpa2(self, get_vif_state, lf_tools, get_ap_logs, get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
@@ -500,7 +500,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_subsequent_user_for_same_user_account",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5713")
|
||||
def test_subsequent_user_for_same_user_account(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
def test_subsequent_user_for_same_user_account_5g_wpa2(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
@@ -575,7 +575,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_subsequent_user_for_different_user_account_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5714")
|
||||
def test_subsequent_user_for_different_user_account(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
def test_subsequent_user_for_different_user_account_5g_wpa2(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
@@ -37,14 +37,14 @@ setup_params_general = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlan(object):
|
||||
class TestDynamicVlanOverSsid2GWpa2(object):
|
||||
|
||||
@pytest.mark.dynamic_precedence_over_ssid
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_dynamic_precedence_over_ssid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5705")
|
||||
def test_dynamic_precedence_over_ssid_vlan(self, get_vif_state, lf_tools,get_ap_logs,get_lf_logs,
|
||||
def test_dynamic_precedence_over_ssid_vlan_2g_wpa2(self, get_vif_state, lf_tools,get_ap_logs,get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
@@ -39,14 +39,14 @@ setup_params_general = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlan(object):
|
||||
class TestDynamicVlan2GWpa2(object):
|
||||
|
||||
@pytest.mark.absence_of_radius_vlan_identifier
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_ssid_vlan_in_the_absence_of_radius_vlan_identifier",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5704")
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier_2g_wpa2(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
@@ -114,7 +114,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_dynamic_invalid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5706")
|
||||
def test_dynamic_invalid_vlan(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
def test_dynamic_invalid_vlan_2g_wpa2(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
@@ -179,7 +179,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_radius_vlan_info_retained_after_periodic_reauthentication",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5707")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication_2g_wpa2(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
@@ -263,7 +263,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_ssid_vlan_used_in_absence_of_radius_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5708")
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan_2g_wpa2(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
@@ -384,7 +384,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_outof_bound_vlanid",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5711")
|
||||
def test_out_of_bound_vlanid(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
def test_out_of_bound_vlanid_2g_wpa2(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
@@ -430,7 +430,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_client_association_ap_with_dynamic_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5712")
|
||||
def test_client_association_ap_with_dynamic_vlan(self, get_vif_state, lf_tools, get_ap_logs, get_lf_logs,
|
||||
def test_client_association_ap_with_dynamic_vlan_2g_wpa2(self, get_vif_state, lf_tools, get_ap_logs, get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
@@ -500,7 +500,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_subsequent_user_for_same_user_account",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5713")
|
||||
def test_subsequent_user_for_same_user_account(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
def test_subsequent_user_for_same_user_account_2g_wpa2(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
@@ -575,7 +575,7 @@ class TestDynamicVlan(object):
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_subsequent_user_for_different_user_account_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5714")
|
||||
def test_subsequent_user_for_different_user_account(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
def test_subsequent_user_for_different_user_account_2g_wpa2(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
@@ -0,0 +1,110 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa3_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import allure
|
||||
import pytest
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa3_enterprise, pytest.mark.vlan,pytest.mark.fiveg]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3e_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "something",
|
||||
"radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA,
|
||||
"radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA,
|
||||
"vlan": 100
|
||||
}]},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
@allure.feature("VLAN MODE wpa3_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlanOverSsid5GWpa3(object):
|
||||
|
||||
@pytest.mark.dynamic_precedence_over_ssid
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_dynamic_precedence_over_ssid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5705")
|
||||
def test_dynamic_precedence_over_ssid_vlan_5g_wpa3(self, get_vif_state, lf_tools, get_ap_logs, get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100,200]
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan[0],
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True)
|
||||
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_radius_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("vlan ip...", eth_radius_vlan_ip)
|
||||
print("eth_upstream_ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per dynamic vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
@@ -0,0 +1,648 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa3_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import allure
|
||||
import pytest
|
||||
import time
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa3_enterprise, pytest.mark.vlan,
|
||||
pytest.mark.fiveg]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3e_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "something",
|
||||
"radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA,
|
||||
"radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA,
|
||||
"vlan": 100
|
||||
}]},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
@allure.feature("VLAN MODE wpa3_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlan5GWpa3(object):
|
||||
|
||||
@pytest.mark.absence_of_radius_vlan_identifier
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_ssid_vlan_in_the_absence_of_radius_vlan_identifier",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5704")
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier_5g_wpa3(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m " absence_of_radius_vlan_identifier and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan_id])
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="fiveg",
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordvlannotsentuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"]
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
print(sta_ip_1)
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
# eth_ip_1 = eth_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("upstream ip...", eth_ip)
|
||||
print("ssid configured vlan ip", eth_vlan_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
elif i == j:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.invalidradiusvlan
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_dynamic_invalid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5706")
|
||||
def test_dynamic_invalid_vlan_5g_wpa3(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "invalidradiusvlan and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan_id])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan_id,
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordinvalidvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("ssid vlan ip...", eth_vlan_ip)
|
||||
print("upstream ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.periodic_reauthentication
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_radius_vlan_info_retained_after_periodic_reauthentication",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5707")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication_5g_wpa3(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "periodic_reauthentication and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan[1],
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True, cleanup=False)
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
sta_ip = lf_test.station_ip[station_names_fiveg[0]]
|
||||
|
||||
count = 0
|
||||
# print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
# print("vlan ip...", eth_vlan_ip)
|
||||
# print("eth_vlan_ip..", eth_ip)
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_rad_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_rad_vlan_ip.split('.')
|
||||
sta_ip_1 = sta_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print(sta_ip_1)
|
||||
for k in range(0, 2):
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
break
|
||||
else:
|
||||
if count == 2:
|
||||
break # allure.attach(name="station ip",body=str(sta_ip))
|
||||
continue
|
||||
count = count + 1
|
||||
time.sleep(30)
|
||||
lf_tools.admin_up_down([station_names_fiveg[0]], option="up")
|
||||
|
||||
sta_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + station_names_fiveg[0])["interface"]["ip"]
|
||||
sta_ip_1 = sta_ip.split('.')
|
||||
print(sta_ip)
|
||||
allure.attach(name="station ip....", body=str(sta_ip))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_rad_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if count == 2:
|
||||
assert True
|
||||
print("Station ip assigned as per dynamic vlan")
|
||||
elif count == 0:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.absenceofvlanid
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_ssid_vlan_used_in_absence_of_radius_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5708")
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan_5g_wpa3(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "absenceofvlanid and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan,
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordvlannotsentuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("ssid configured vlan ip...", eth_vlan_ip)
|
||||
print("upstream ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid configured vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid configured vlan")
|
||||
assert False
|
||||
|
||||
'''
|
||||
@pytest.mark.unsupported
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_dynamic_unsupported_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5710")
|
||||
def test_dynamic_unsupported_vlan(self, get_vif_state, lf_tools,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "unsupported and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=100,
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordinvalidvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="vlan ip....", body=str(eth_vlan_ip))
|
||||
print("Station ip not assigned as per vlan")
|
||||
assert False
|
||||
else:
|
||||
assert True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="vlan ip....", body=str(eth_vlan_ip))
|
||||
allure.attach(name="vlan ip....", body=str(eth_ip))
|
||||
print("Station ip assigned as per vlan")
|
||||
'''
|
||||
|
||||
@pytest.mark.outofboundvlanid
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_outof_bound_vlanid",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5711")
|
||||
def test_out_of_bound_vlanid_5g_wpa3(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "outofboundvlanid and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan,
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordoutofboundvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="outofboundvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
if lf_test.station_ip[station_names_fiveg[0]] == "0.0.0.0":
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
assert True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
allure.attach(name="out of bound vlan id..", body=str(7000))
|
||||
print("Test Passsed...Client Connection failed")
|
||||
|
||||
@pytest.mark.client_association_ap_with_dynamic_vlan
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_client_association_ap_with_dynamic_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5712")
|
||||
def test_client_association_ap_with_dynamic_vlan_5g_wpa3(self, get_vif_state, lf_tools, get_ap_logs, get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan[0],
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True)
|
||||
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
eth_radius_vlan_ip_1 = eth_radius_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("radius vlan ip...", eth_radius_vlan_ip)
|
||||
print("eth_upstream_ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_radius_vlan_ip_1[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
|
||||
for i, j in zip(sta_ip_1[0:2], eth_radius_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip))
|
||||
allure.attach(name="Upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.subsequent_user_for_same_user_account
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_subsequent_user_for_same_user_account",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5713")
|
||||
def test_subsequent_user_for_same_user_account_5g_wpa3(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
for i in range(0, 2):
|
||||
station_list.append(lf_tools.fiveg_prefix + str(i))
|
||||
print(station_list)
|
||||
print([station_list[0]])
|
||||
|
||||
for m in range(0, len(station_list)):
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=100,
|
||||
station_name=[station_list[m]], key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordA", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userA", d_vlan=True, cleanup=False)
|
||||
lf_tools.admin_up_down([station_list[m]], option="up")
|
||||
sta_ip.append(lf_test.station_ip[station_list[m]])
|
||||
if sta_ip[m] == "0.0.0.0":
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
print(sta_ip)
|
||||
time.sleep(30)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
for n in range(0, len(station_list)):
|
||||
sta_ip_1 = sta_ip[n].split('.')
|
||||
print("station ip...", sta_ip[n])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(sta_ip[n]))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.subsequent_user_for_different_user_account
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_subsequent_user_for_different_user_account_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5714")
|
||||
def test_subsequent_user_for_different_user_account_5g_wpa3(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
dynamic_vlan_user = ["userA", "userB"]
|
||||
dynamic_vlan_pass = ["passwordA", "passwordB"]
|
||||
for i in range(0, 2):
|
||||
station_list.append(lf_tools.fiveg_prefix + str(i))
|
||||
|
||||
for user_id, user_pass, sta in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(station_list))):
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan[sta],
|
||||
station_name=[station_list[sta]], key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd=user_pass, ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity=user_id, d_vlan=True, cleanup=False)
|
||||
|
||||
sta_ip.append(lf_test.station_ip[station_list[sta]])
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[sta]))["interface"]["ip"]
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
print(sta_ip)
|
||||
sta_ip_1 = sta_ip[sta].split('.')
|
||||
if sta_ip_1 == "0.0.0.0":
|
||||
allure.attach("station didn't received ip..")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_list[sta]])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(sta_ip[sta]))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[sta])))
|
||||
allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print(f"{station_list[sta]} ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print(f"{station_list[sta]} ip not assigned as per radius vlan")
|
||||
assert False
|
||||
lf_tools.admin_up_down([station_list[sta]], option="up")
|
||||
time.sleep(5)
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa3_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import allure
|
||||
import pytest
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa3_enterprise, pytest.mark.vlan,pytest.mark.twog]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3e_2g", "appliedRadios": ["2G"],
|
||||
"security_key": "something",
|
||||
"radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA,
|
||||
"radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA,
|
||||
"vlan": 100
|
||||
}]},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
@allure.feature("VLAN MODE wpa3_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlanOverSsid2GWpa3(object):
|
||||
|
||||
@pytest.mark.dynamic_precedence_over_ssid
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_dynamic_precedence_over_ssid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5705")
|
||||
def test_dynamic_precedence_over_ssid_vlan_2g_wpa3(self, get_vif_state, lf_tools,get_ap_logs,get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100,200]
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan[0],
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True)
|
||||
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_radius_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("vlan ip...", eth_radius_vlan_ip)
|
||||
print("eth_upstream_ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per dynamic vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
@@ -0,0 +1,648 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa3_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import allure
|
||||
import pytest
|
||||
import time
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa3_enterprise, pytest.mark.vlan,
|
||||
pytest.mark.twog]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3e_2g", "appliedRadios": ["2G"],
|
||||
"security_key": "something",
|
||||
"radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA,
|
||||
"radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA,
|
||||
"vlan": 100
|
||||
}]},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
@allure.feature("VLAN MODE wpa3_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlan2GWpa3(object):
|
||||
|
||||
@pytest.mark.absence_of_radius_vlan_identifier
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_ssid_vlan_in_the_absence_of_radius_vlan_identifier",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5704")
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier_2g_wpa3(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m " absence_of_radius_vlan_identifier and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan_id])
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="twog",
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordvlannotsentuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"]
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
print(sta_ip_1)
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
# eth_ip_1 = eth_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("upstream ip...", eth_ip)
|
||||
print("ssid configured vlan ip", eth_vlan_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
elif i == j:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.invalidradiusvlan
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_dynamic_invalid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5706")
|
||||
def test_dynamic_invalid_vlan_2g_wpa3(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "invalidradiusvlan and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan_id])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan_id,
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordinvalidvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("ssid vlan ip...", eth_vlan_ip)
|
||||
print("upstream ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.periodic_reauthentication
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_radius_vlan_info_retained_after_periodic_reauthentication",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5707")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication_2g_wpa3(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "periodic_reauthentication and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan[1],
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True, cleanup=False)
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
sta_ip = lf_test.station_ip[station_names_twog[0]]
|
||||
|
||||
count = 0
|
||||
# print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
# print("vlan ip...", eth_vlan_ip)
|
||||
# print("eth_vlan_ip..", eth_ip)
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_rad_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_rad_vlan_ip.split('.')
|
||||
sta_ip_1 = sta_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print(sta_ip_1)
|
||||
for k in range(0, 2):
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
break
|
||||
else:
|
||||
if count == 2:
|
||||
break # allure.attach(name="station ip",body=str(sta_ip))
|
||||
continue
|
||||
count = count + 1
|
||||
time.sleep(30)
|
||||
lf_tools.admin_up_down([station_names_twog[0]], option="up")
|
||||
|
||||
sta_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + station_names_twog[0])["interface"]["ip"]
|
||||
sta_ip_1 = sta_ip.split('.')
|
||||
print(sta_ip)
|
||||
allure.attach(name="station ip....", body=str(sta_ip))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_rad_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if count == 2:
|
||||
assert True
|
||||
print("Station ip assigned as per dynamic vlan")
|
||||
elif count == 0:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.absenceofvlanid
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_ssid_vlan_used_in_absence_of_radius_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5708")
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan_2g_wpa3(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "absenceofvlanid and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan,
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordvlannotsentuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("ssid configured vlan ip...", eth_vlan_ip)
|
||||
print("upstream ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid configured vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid configured vlan")
|
||||
assert False
|
||||
|
||||
'''
|
||||
@pytest.mark.unsupported
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_dynamic_unsupported_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5710")
|
||||
def test_dynamic_unsupported_vlan(self, get_vif_state, lf_tools,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "unsupported and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=100,
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordinvalidvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="vlan ip....", body=str(eth_vlan_ip))
|
||||
print("Station ip not assigned as per vlan")
|
||||
assert False
|
||||
else:
|
||||
assert True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="vlan ip....", body=str(eth_vlan_ip))
|
||||
allure.attach(name="vlan ip....", body=str(eth_ip))
|
||||
print("Station ip assigned as per vlan")
|
||||
'''
|
||||
|
||||
@pytest.mark.outofboundvlanid
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_outof_bound_vlanid",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5711")
|
||||
def test_out_of_bound_vlanid_2g_wpa3(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "outofboundvlanid and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan,
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordoutofboundvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="outofboundvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
if lf_test.station_ip[station_names_twog[0]] == "0.0.0.0":
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
assert True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
allure.attach(name="out of bound vlan id..", body=str(7000))
|
||||
print("Test Passsed...Client Connection failed")
|
||||
|
||||
@pytest.mark.client_association_ap_with_dynamic_vlan
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_client_association_ap_with_dynamic_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5712")
|
||||
def test_client_association_ap_with_dynamic_vlan_2g_wpa3(self, get_vif_state, lf_tools, get_ap_logs, get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan[0],
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True)
|
||||
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
eth_radius_vlan_ip_1 = eth_radius_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("radius vlan ip...", eth_radius_vlan_ip)
|
||||
print("eth_upstream_ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_radius_vlan_ip_1[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
|
||||
for i, j in zip(sta_ip_1[0:2], eth_radius_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip))
|
||||
allure.attach(name="Upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.subsequent_user_for_same_user_account
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_subsequent_user_for_same_user_account",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5713")
|
||||
def test_subsequent_user_for_same_user_account_2g_wpa3(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
for i in range(0, 2):
|
||||
station_list.append(lf_tools.twog_prefix + str(i))
|
||||
print(station_list)
|
||||
print([station_list[0]])
|
||||
|
||||
for m in range(0, len(station_list)):
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=100,
|
||||
station_name=[station_list[m]], key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordA", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userA", d_vlan=True, cleanup=False)
|
||||
lf_tools.admin_up_down([station_list[m]], option="up")
|
||||
sta_ip.append(lf_test.station_ip[station_list[m]])
|
||||
if sta_ip[m] == "0.0.0.0":
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
print(sta_ip)
|
||||
time.sleep(30)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
for n in range(0, len(station_list)):
|
||||
sta_ip_1 = sta_ip[n].split('.')
|
||||
print("station ip...", sta_ip[n])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(sta_ip[n]))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.subsequent_user_for_different_user_account
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_subsequent_user_for_different_user_account_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5714")
|
||||
def test_subsequent_user_for_different_user_account_2g_wpa3(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa3_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
val = ""
|
||||
vlan = [100, 200]
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
dynamic_vlan_user = ["userA", "userB"]
|
||||
dynamic_vlan_pass = ["passwordA", "passwordB"]
|
||||
for i in range(0, 2):
|
||||
station_list.append(lf_tools.twog_prefix + str(i))
|
||||
|
||||
for user_id, user_pass, sta in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(station_list))):
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa3", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan[sta],
|
||||
station_name=[station_list[sta]], key_mgmt="WPA-EAP-SHA256",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd=user_pass, ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity=user_id, d_vlan=True, cleanup=False)
|
||||
|
||||
sta_ip.append(lf_test.station_ip[station_list[sta]])
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[sta]))["interface"]["ip"]
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
print(sta_ip)
|
||||
sta_ip_1 = sta_ip[sta].split('.')
|
||||
if sta_ip_1 == "0.0.0.0":
|
||||
allure.attach("station didn't received ip..")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_list[sta]])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(sta_ip[sta]))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print(f"{station_list[sta]} ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print(f"{station_list[sta]} ip not assigned as per radius vlan")
|
||||
assert False
|
||||
lf_tools.admin_up_down([station_list[sta]], option="up")
|
||||
time.sleep(5)
|
||||
|
||||
@@ -547,6 +547,11 @@ class Fixtures_2x:
|
||||
print(e)
|
||||
test_cases["wpa2_personal"] = False
|
||||
if mode == "wpa3_enterprise":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
if "radius_auth_data" in j:
|
||||
var = True
|
||||
else:
|
||||
var = False
|
||||
for j in profile_data["ssid"][mode]:
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
@@ -556,12 +561,20 @@ class Fixtures_2x:
|
||||
lf_dut_data.append(j)
|
||||
j["appliedRadios"] = list(set(j["appliedRadios"]))
|
||||
j['security'] = 'wpa3'
|
||||
RADIUS_SERVER_DATA = radius_info
|
||||
RADIUS_ACCOUNTING_DATA = radius_accounting_info
|
||||
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["wpa3_eap"] = True
|
||||
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,
|
||||
radius_auth_data=RADIUS_SERVER_DATA,
|
||||
radius_accounting_data=RADIUS_ACCOUNTING_DATA)
|
||||
test_cases["wpa3_eap"] = True
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_eap"] = False
|
||||
|
||||
Reference in New Issue
Block a user