mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 11:57:49 +00:00
Refactored dvlan in wpa3_eap
Signed-off-by: karthikaeyetea <karthika.subramani@candelatech.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa2_enterprise and vlan"
|
||||
pytest -m "dynamic_vlan_tests and wpa2_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
@@ -56,7 +56,7 @@ class TestDynamicVlanOverSsid5GWpa2(object):
|
||||
def test_dynamic_precedence_over_ssid_vlan_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa2_enterprise and vlan"
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa2_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -69,13 +69,12 @@ class TestDynamicVlanOverSsid5GWpa2(object):
|
||||
ttls_passwd = "passwordB"
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
|
||||
val = ""
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa2_enterprise and vlan"
|
||||
pytest -m "dynamic_vlan_tests and wpa2_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
@@ -57,7 +57,7 @@ class TestDynamicVlan5GWpa2(object):
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m " absence_of_radius_vlan_identifier and wpa2_enterprise and vlan"
|
||||
pytest -m "absence_of_radius_vlan_identifier and wpa2_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -72,11 +72,11 @@ class TestDynamicVlan5GWpa2(object):
|
||||
identity = "vlannotsentuser"
|
||||
val = ""
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap, d_vlan=True,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
@@ -109,10 +109,11 @@ class TestDynamicVlan5GWpa2(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_dynamic_invalid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5706")
|
||||
@allure.title("Test for invalid vlan identifier")
|
||||
def test_dynamic_invalid_vlan_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "invalidradiusvlan and wpa2_enterprise and vlan"
|
||||
pytest -m "invalidradiusvlan and wpa2_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -121,66 +122,51 @@ class TestDynamicVlan5GWpa2(object):
|
||||
extra_secu = []
|
||||
band = "fiveg"
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
vlan = [100]
|
||||
ttls_passwd = "passwordinvalidvlanuser"
|
||||
eap = "TTLS"
|
||||
identity = "invalidvlanuser"
|
||||
val = ""
|
||||
# upstream_port = get_test_library.upstream_port
|
||||
# print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
# print(get_test_library.dut_idx_mapping)
|
||||
# get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid = ssid_name,
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid = ssid_name,
|
||||
security = security, extra_securities = extra_secu, vlan_id = vlan,
|
||||
mode = mode, band = band, eap = eap, d_vlan = True, ttls_passwd = ttls_passwd,
|
||||
mode = mode, band = band, eap = eap, ttls_passwd = ttls_passwd,
|
||||
ieee80211w = 0, identity = identity, num_sta = 1, dut_data = setup_configuration)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = station_ip.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
|
||||
assert False, result
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print("station ip...", station_ip)
|
||||
print("ssid vlan ip...", eth_vlan_ip)
|
||||
print("upstream ip..", eth_ip)
|
||||
assert False, result
|
||||
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(station_ip))
|
||||
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 vlan")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@pytest.mark.periodic_reauthentication
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_radius_vlan_info_retained_after_periodic_reauthentication",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5707")
|
||||
@allure.title("Test for radius vlan information retained after periodic reauthentication")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "periodic_reauthentication and wpa2_enterprise and vlan"
|
||||
pytest -m "periodic_reauthentication and wpa2_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -194,30 +180,22 @@ class TestDynamicVlan5GWpa2(object):
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
|
||||
# upstream_port = get_test_library.upstream_port
|
||||
# print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
# print(get_test_library.dut_idx_mapping)
|
||||
# get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
|
||||
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid = ssid_name, security = security,
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid = ssid_name, security = security,
|
||||
extra_securities = extra_secu, vlan_id = vlan,
|
||||
mode = mode, band = band, eap = eap, d_vlan = True,
|
||||
mode = mode, band = band, eap = eap,
|
||||
ttls_passwd = ttls_passwd, ieee80211w = 0,
|
||||
identity = identity, num_sta = 1,
|
||||
dut_data = setup_configuration, cleanup=False)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
# sta_ip = station_ip
|
||||
|
||||
count = 0
|
||||
# print("station ip...", get_test_library.station_ip[station_names_fiveg[0]])
|
||||
# print("vlan ip...", eth_vlan_ip)
|
||||
# print("eth_vlan_ip..", eth_ip)
|
||||
eth_ssid_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_rad_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
@@ -225,55 +203,44 @@ class TestDynamicVlan5GWpa2(object):
|
||||
eth_vlan_ip_1 = eth_rad_vlan_ip.split('.')
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
assert False, result
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print(sta_ip_1)
|
||||
assert False, result
|
||||
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))
|
||||
break
|
||||
continue
|
||||
count = count + 1
|
||||
time.sleep(30)
|
||||
for u in get_test_library.json_get("/port/?fields=port+type,alias")['interfaces']:
|
||||
if list(u.values())[0]['port type'] not in ['Ethernet', 'WIFI-Radio', 'NA']:
|
||||
station_name = list(u.values())[0]['alias']
|
||||
get_test_library.admin_up_down([station_name], option="up")
|
||||
get_test_library.admin_up([station_name])
|
||||
|
||||
sta_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + station_name)["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")
|
||||
assert True, result
|
||||
elif count == 0:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@pytest.mark.absenceofvlanid
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_ssid_vlan_used_in_absence_of_radius_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5708")
|
||||
@allure.title("test for ssid vlan used in absence of radius vlan")
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "absenceofvlanid and wpa2_enterprise and vlan"
|
||||
pytest -m "absenceofvlanid and wpa2_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -287,18 +254,15 @@ class TestDynamicVlan5GWpa2(object):
|
||||
eap = "TTLS"
|
||||
identity = "vlannotsentuser"
|
||||
val = ""
|
||||
# upstream_port = get_test_library.upstream_port
|
||||
# print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
# print(get_test_library.dut_idx_mapping)
|
||||
# get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan, mode=mode, band=band, eap=eap,
|
||||
d_vlan=True, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
@@ -306,33 +270,20 @@ class TestDynamicVlan5GWpa2(object):
|
||||
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
print("station ip...", station_ip)
|
||||
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
|
||||
assert False, result
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
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(station_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_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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid configured vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
'''
|
||||
@pytest.mark.unsupported
|
||||
@@ -394,10 +345,11 @@ class TestDynamicVlan5GWpa2(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_outof_bound_vlanid",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5711")
|
||||
@allure.title("test for out of bound vlan identifier")
|
||||
def test_out_of_bound_vlanid_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "outofboundvlanid and wpa2_enterprise and vlan"
|
||||
pytest -m "outofboundvlanid and wpa2_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -410,45 +362,34 @@ class TestDynamicVlan5GWpa2(object):
|
||||
ttls_passwd = "passwordoutofboundvlanuser"
|
||||
eap = "TTLS"
|
||||
identity = "outofboundvlanuser"
|
||||
# upstream_port = get_test_library.upstream_port
|
||||
# print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
# print(get_test_library.dut_idx_mapping)
|
||||
# get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
if station_ip == "0.0.0.0":
|
||||
print("station ip...", station_ip)
|
||||
assert True
|
||||
allure.attach(name="station ip....", body=str(station_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_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")
|
||||
assert True, result
|
||||
|
||||
@pytest.mark.client_association_ap_with_dynamic_vlan
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_client_association_ap_with_dynamic_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5712")
|
||||
@allure.title("test for client association ap with dynamic vlan")
|
||||
def test_client_association_ap_with_dynamic_vlan_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa2_enterprise and vlan"
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa2_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -462,20 +403,17 @@ class TestDynamicVlan5GWpa2(object):
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
val = ""
|
||||
# upstream_port = get_test_library.upstream_port
|
||||
# print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
# print(get_test_library.dut_idx_mapping)
|
||||
# get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_ssid_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
@@ -486,44 +424,31 @@ class TestDynamicVlan5GWpa2(object):
|
||||
|
||||
sta_ip_1 = get_test_library.station_ip.split('.')
|
||||
eth_radius_vlan_ip_1 = eth_radius_vlan_ip.split('.')
|
||||
print("station ip...", station_ip)
|
||||
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
|
||||
assert False, result
|
||||
elif eth_radius_vlan_ip_1[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
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(station_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_radius_vlan_ip))
|
||||
allure.attach(name="Upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per radius vlan")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@pytest.mark.subsequent_user_for_same_user_account
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_subsequent_user_for_same_user_account",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5713")
|
||||
@allure.title("test for subsequent user for same user account")
|
||||
def test_subsequent_user_for_same_user_account_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa2_enterprise and vlan"
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa2_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -537,33 +462,26 @@ class TestDynamicVlan5GWpa2(object):
|
||||
eap = "TTLS"
|
||||
identity = "userA"
|
||||
val = ""
|
||||
# upstream_port = get_test_library.upstream_port
|
||||
# print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
# print(get_test_library.dut_idx_mapping)
|
||||
# get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
for i in range(0, 2):
|
||||
station_list.append(get_test_library.fiveg_prefix + str(i))
|
||||
print(station_list)
|
||||
print([station_list[0]])
|
||||
|
||||
for m in range(0, len(station_list)):
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration, cleanup=False)
|
||||
get_test_library.admin_up_down([station_list[m]], option="up")
|
||||
sta_ip.append(get_test_library.station_ip[station_list[m]])
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
get_test_library.admin_up([station_list[m]])
|
||||
sta_ip.append(station_ip)
|
||||
if sta_ip[m] == "0.0.0.0":
|
||||
allure.attach("station didn't recieved ip..")
|
||||
assert False
|
||||
print(sta_ip)
|
||||
assert False, result
|
||||
time.sleep(30)
|
||||
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
@@ -573,35 +491,26 @@ class TestDynamicVlan5GWpa2(object):
|
||||
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[0])))
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@pytest.mark.subsequent_user_for_different_user_account
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_subsequent_user_for_different_user_account_vlan",
|
||||
@allure.testcase(name="test_subsequent_user_for_different_user_account",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5714")
|
||||
@allure.title("test for subsequent user for different user account")
|
||||
def test_subsequent_user_for_different_user_account_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa2_enterprise and vlan"
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa2_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -611,16 +520,10 @@ class TestDynamicVlan5GWpa2(object):
|
||||
band = "fiveg"
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
ttls_passwd = "passwordA"
|
||||
eap = "TTLS"
|
||||
identity = "userA"
|
||||
val = ""
|
||||
# upstream_port = get_test_library.upstream_port
|
||||
# print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
# print(get_test_library.dut_idx_mapping)
|
||||
# get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
@@ -630,14 +533,16 @@ class TestDynamicVlan5GWpa2(object):
|
||||
station_list.append(get_test_library.fiveg_prefix + str(i))
|
||||
|
||||
for user_id, user_pass, sta in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(station_list))):
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan[sta],
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, passkey="[BLANK]",
|
||||
security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band, vlan_id=vlan[sta],
|
||||
station_name=[station_list[sta]], key_mgmt="WPA-EAP",
|
||||
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(get_test_library.station_ip[station_list[sta]])
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
sta_ip.append(station_ip)
|
||||
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[sta]))["interface"]["ip"]
|
||||
@@ -649,26 +554,16 @@ class TestDynamicVlan5GWpa2(object):
|
||||
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...", get_test_library.station_ip[station_list[sta]])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
assert False, result
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print(f"{station_list[sta]} ip not assigned as per radius vlan")
|
||||
assert False
|
||||
get_test_library.admin_up_down([station_list[sta]], option="up")
|
||||
assert False, result
|
||||
get_test_library.admin_up([station_list[sta]])
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa2_enterprise and vlan"
|
||||
pytest -m "dynamic_vlan_tests and wpa2_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
@@ -56,7 +56,7 @@ class TestDynamicVlanOverSsid2GWpa2(object):
|
||||
def test_dynamic_precedence_over_ssid_vlan_2g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa2_enterprise and vlan"
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa2_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -74,14 +74,13 @@ class TestDynamicVlanOverSsid2GWpa2(object):
|
||||
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1, dut_data=setup_configuration)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_ssid_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
eth_radius_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
@@ -90,7 +89,7 @@ class TestDynamicVlanOverSsid2GWpa2(object):
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
eth_vlan_ip_1 = eth_radius_vlan_ip.split('.')
|
||||
logging.info(f"station ip...{sta_ip_1}\neth.{vlan[0]}...{eth_ssid_vlan_ip}\neth.{vlan[1]}...{eth_radius_vlan_ip}"
|
||||
f"\neth_upstream_ip...{eth_ip}")
|
||||
f"\neth_upstream_ip...{eth_ip}")
|
||||
if sta_ip_1[0] == "0":
|
||||
assert False, result
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa2_enterprise and vlan"
|
||||
pytest -m "dynamic_vlan_tests and wpa2_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
@@ -57,7 +57,7 @@ class TestDynamicVlan2GWpa2(object):
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier_2g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m " absence_of_radius_vlan_identifier and wpa2_enterprise and vlan"
|
||||
pytest -m "absence_of_radius_vlan_identifier and wpa2_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -72,11 +72,11 @@ class TestDynamicVlan2GWpa2(object):
|
||||
identity = "vlannotsentuser"
|
||||
val = ""
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name,
|
||||
security=security, extra_securities=extra_secu,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration)
|
||||
|
||||
@@ -88,13 +88,12 @@ class TestDynamicVlan2GWpa2(object):
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
print(sta_ip_1)
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
logging.info(f"station ip...{sta_ip_1}\neth.{vlan[0]}...{eth_vlan_ip}\neth_upstream_ip...{eth_ip}")
|
||||
if sta_ip_1[0] == "0":
|
||||
assert False, result
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
assert False, result
|
||||
logging.info(f"station ip...{sta_ip_1}\neth.{vlan[0]}...{eth_vlan_ip}\neth_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
|
||||
@@ -110,10 +109,11 @@ class TestDynamicVlan2GWpa2(object):
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_dynamic_invalid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5706")
|
||||
@allure.title("Test for invalid vlan identifier")
|
||||
def test_dynamic_invalid_vlan_2g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "invalidradiusvlan and wpa2_enterprise and vlan"
|
||||
pytest -m "invalidradiusvlan and wpa2_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -127,19 +127,15 @@ class TestDynamicVlan2GWpa2(object):
|
||||
eap = "TTLS"
|
||||
identity = "invalidvlanuser"
|
||||
val = ""
|
||||
# upstream_port = get_test_library.upstream_port
|
||||
# print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
# print(get_test_library.dut_idx_mapping)
|
||||
# get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
get_test_library.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
passes, result, station_ip = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name,
|
||||
security=security, extra_securities=extra_secu,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration)
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid = ssid_name,
|
||||
security = security, extra_securities = extra_secu, vlan_id = vlan,
|
||||
mode = mode, band = band, eap = eap, ttls_passwd = ttls_passwd,
|
||||
ieee80211w = 0, identity = identity, num_sta = 1, dut_data = setup_configuration)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
@@ -148,41 +144,29 @@ class TestDynamicVlan2GWpa2(object):
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didn't recieved ip..")
|
||||
assert False
|
||||
assert False, result
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print("station ip...", station_ip)
|
||||
print("ssid vlan ip...", eth_vlan_ip)
|
||||
print("upstream ip..", eth_ip)
|
||||
assert False, result
|
||||
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(station_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_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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@pytest.mark.periodic_reauthentication
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_radius_vlan_info_retained_after_periodic_reauthentication",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5707")
|
||||
@allure.title("Test for radius vlan information retained after periodic reauthentication")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication_2g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "periodic_reauthentication and wpa2_enterprise and vlan"
|
||||
pytest -m "periodic_reauthentication and wpa2_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -195,83 +179,67 @@ class TestDynamicVlan2GWpa2(object):
|
||||
ttls_passwd = "passwordB"
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
# upstream_port = get_test_library.upstream_port
|
||||
# print(upstream_port)
|
||||
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
# print(get_test_library.dut_idx_mapping)
|
||||
# get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
passes, result, station_ip = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name,
|
||||
security=security, extra_securities=extra_secu,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration, cleanup=False)
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid = ssid_name, security = security,
|
||||
extra_securities = extra_secu, vlan_id = vlan,
|
||||
mode = mode, band = band, eap = eap,
|
||||
ttls_passwd = ttls_passwd, ieee80211w = 0,
|
||||
identity = identity, num_sta = 1,
|
||||
dut_data = setup_configuration, cleanup=False)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
sta_ip = station_ip
|
||||
|
||||
count = 0
|
||||
# print("station ip...", station_ip)
|
||||
# print("vlan ip...", eth_vlan_ip)
|
||||
# print("eth_vlan_ip..", eth_ip)
|
||||
eth_ssid_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_rad_vlan_ip = get_test_library.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('.')
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
assert False, result
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print(sta_ip_1)
|
||||
assert False, result
|
||||
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))
|
||||
break
|
||||
continue
|
||||
count = count + 1
|
||||
time.sleep(30)
|
||||
for u in get_test_library.json_get("/port/?fields=port+type,alias")['interfaces']:
|
||||
if list(u.values())[0]['port type'] not in ['Ethernet', 'WIFI-Radio', 'NA']:
|
||||
station_name = (u.values())[0]['alias']
|
||||
get_test_library.admin_up_down(station_name, option="up")
|
||||
station_name = list(u.values())[0]['alias']
|
||||
get_test_library.admin_up([station_name])
|
||||
|
||||
sta_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + station_name)["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")
|
||||
assert True, result
|
||||
elif count == 0:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@pytest.mark.absenceofvlanid
|
||||
@pytest.mark.wpa2_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_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
@allure.title("test for ssid vlan used in absence of radius vlan")
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "absenceofvlanid and wpa2_enterprise and vlan"
|
||||
pytest -m "absenceofvlanid and wpa2_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -285,19 +253,15 @@ class TestDynamicVlan2GWpa2(object):
|
||||
eap = "TTLS"
|
||||
identity = "vlannotsentuser"
|
||||
val = ""
|
||||
upstream_port = get_test_library.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
print(get_test_library.dut_idx_mapping)
|
||||
get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
passes, result, station_ip = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name,
|
||||
security=security, extra_securities=extra_secu,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration)
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan, mode=mode, band=band, eap=eap,
|
||||
d_vlan=True, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
@@ -305,33 +269,20 @@ class TestDynamicVlan2GWpa2(object):
|
||||
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
print("station ip...", station_ip)
|
||||
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
|
||||
assert False, result
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
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(station_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_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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid configured vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
'''
|
||||
@pytest.mark.unsupported
|
||||
@@ -393,10 +344,11 @@ class TestDynamicVlan2GWpa2(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_2g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
@allure.title("test for out of bound vlan identifier")
|
||||
def test_out_of_bound_vlanid_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "outofboundvlanid and wpa2_enterprise and vlan"
|
||||
pytest -m "outofboundvlanid and wpa2_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -409,44 +361,34 @@ class TestDynamicVlan2GWpa2(object):
|
||||
ttls_passwd = "passwordoutofboundvlanuser"
|
||||
eap = "TTLS"
|
||||
identity = "outofboundvlanuser"
|
||||
upstream_port = get_test_library.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
print(get_test_library.dut_idx_mapping)
|
||||
get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
passes, result, station_ip = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name,
|
||||
security=security, extra_securities=extra_secu,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration)
|
||||
|
||||
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
if station_ip == "0.0.0.0":
|
||||
print("station ip...", station_ip)
|
||||
assert True
|
||||
allure.attach(name="station ip....", body=str(station_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_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")
|
||||
assert True, result
|
||||
|
||||
@pytest.mark.client_association_ap_with_dynamic_vlan
|
||||
@pytest.mark.wpa2_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_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
@allure.title("test for client association ap with dynamic vlan")
|
||||
def test_client_association_ap_with_dynamic_vlan_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa2_enterprise and vlan"
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa2_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -460,18 +402,15 @@ class TestDynamicVlan2GWpa2(object):
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
val = ""
|
||||
upstream_port = get_test_library.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
print(get_test_library.dut_idx_mapping)
|
||||
get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
passes, result, station_ip = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name,
|
||||
security=security, extra_securities=extra_secu,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration)
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
|
||||
eth_ssid_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
@@ -481,46 +420,33 @@ class TestDynamicVlan2GWpa2(object):
|
||||
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
sta_ip_1 = get_test_library.station_ip.split('.')
|
||||
eth_radius_vlan_ip_1 = eth_radius_vlan_ip.split('.')
|
||||
print("station ip...", station_ip)
|
||||
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
|
||||
assert False, result
|
||||
elif eth_radius_vlan_ip_1[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
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(station_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_radius_vlan_ip))
|
||||
allure.attach(name="Upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per radius vlan")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@pytest.mark.subsequent_user_for_same_user_account
|
||||
@pytest.mark.wpa2_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_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
@allure.title("test for subsequent user for same user account")
|
||||
def test_subsequent_user_for_same_user_account_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa2_enterprise and vlan"
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa2_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
@@ -534,32 +460,26 @@ class TestDynamicVlan2GWpa2(object):
|
||||
eap = "TTLS"
|
||||
identity = "userA"
|
||||
val = ""
|
||||
upstream_port = get_test_library.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
print(get_test_library.dut_idx_mapping)
|
||||
get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
for i in range(0, 2):
|
||||
station_list.append(get_test_library.twog_prefix + str(i))
|
||||
print(station_list)
|
||||
print([station_list[0]])
|
||||
station_list.append(get_test_library.fiveg_prefix + str(i))
|
||||
|
||||
for m in range(0, len(station_list)):
|
||||
passes, result, station_ip = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name,
|
||||
security=security, extra_securities=extra_secu,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration, cleanup=False)
|
||||
get_test_library.admin_up_down([station_list[m]], option="up")
|
||||
sta_ip.append(get_test_library.station_ip[station_list[m]])
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration, cleanup=False)
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
get_test_library.admin_up([station_list[m]])
|
||||
sta_ip.append(station_ip)
|
||||
if sta_ip[m] == "0.0.0.0":
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
print(sta_ip)
|
||||
assert False, result
|
||||
time.sleep(30)
|
||||
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
@@ -569,54 +489,39 @@ class TestDynamicVlan2GWpa2(object):
|
||||
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[0])))
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@pytest.mark.subsequent_user_for_different_user_account
|
||||
@pytest.mark.wpa2_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_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
@allure.title("test for subsequent user for different user account")
|
||||
def test_subsequent_user_for_different_user_account_5g_wpa2(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa2_enterprise and vlan"
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa2_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
val = ""
|
||||
security = "wpa2"
|
||||
extra_secu = []
|
||||
band = "twog"
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
ttls_passwd = "passwordB"
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
upstream_port = get_test_library.upstream_port
|
||||
print(upstream_port)
|
||||
val = ""
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
print(get_test_library.dut_idx_mapping)
|
||||
get_test_library.reset_scenario()
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
@@ -626,13 +531,15 @@ class TestDynamicVlan2GWpa2(object):
|
||||
station_list.append(get_test_library.twog_prefix + str(i))
|
||||
|
||||
for user_id, user_pass, sta in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(station_list))):
|
||||
passes, result, station_ip = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan[sta],
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, passkey="[BLANK]",
|
||||
security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band, vlan_id=vlan[sta],
|
||||
station_name=[station_list[sta]], key_mgmt="WPA-EAP",
|
||||
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)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
sta_ip.append(station_ip)
|
||||
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
@@ -645,26 +552,16 @@ class TestDynamicVlan2GWpa2(object):
|
||||
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...", station_ip)
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
assert False, result
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print(f"{station_list[sta]} ip not assigned as per radius vlan")
|
||||
assert False
|
||||
get_test_library.admin_up_down([station_list[sta]], option="up")
|
||||
assert False, result
|
||||
get_test_library.admin_up([station_list[sta]])
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa3_enterprise and vlan"
|
||||
pytest -m "dynamic_vlan_tests 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
|
||||
import importlib
|
||||
import logging
|
||||
|
||||
pytestmark = [pytest.mark.ow_regression_lf,
|
||||
pytest.mark.ow_dvlan_tests_lf,
|
||||
pytest.mark.wpa3_enterprise,
|
||||
pytest.mark.fiveg]
|
||||
lf_library = importlib.import_module("configuration")
|
||||
DYNAMIC_VLAN_RADIUS_SERVER_DATA = lf_library.DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA = lf_library.DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.dynamic_vlan_tests,
|
||||
pytest.mark.vlan]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
@@ -31,7 +32,10 @@ setup_params_general = {
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
# @allure.suite("regression")
|
||||
@allure.parent_suite("OpenWifi Dynamic Vlan Test")
|
||||
@allure.suite("WPA3 Enterprise Security")
|
||||
@allure.sub_suite("5 GHz Band")
|
||||
@allure.feature("VLAN MODE wpa3_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_configuration',
|
||||
@@ -47,67 +51,54 @@ class TestDynamicVlanOverSsid5GWpa3(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_dynamic_precedence_over_ssid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-6096")
|
||||
def test_dynamic_precedence_over_ssid_vlan_5g_wpa3(self, lf_tools, get_ap_logs, get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
@allure.title("Test for dynamic precedence over ssid")
|
||||
def test_dynamic_precedence_over_ssid_vlan_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa3_enterprise and vlan"
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa3_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = [100,200]
|
||||
ttls_passwd = "passwordB"
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
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)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
|
||||
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] +
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_ssid_vlan_ip = get_test_library.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] +
|
||||
eth_radius_vlan_ip = get_test_library.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] +
|
||||
eth_ip = get_test_library.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('.')
|
||||
sta_ip_1 = station_ip.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)
|
||||
logging.info(f"station ip...{sta_ip_1}\neth.{vlan[0]}...{eth_ssid_vlan_ip}\neth.{vlan[1]}...{eth_radius_vlan_ip}"
|
||||
f"\neth_upstream_ip...{eth_ip}")
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
assert False, result
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
assert False, result
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa3_enterprise and vlan"
|
||||
pytest -m "dynamic_vlan_tests 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
|
||||
import importlib
|
||||
import logging
|
||||
|
||||
pytestmark = [pytest.mark.ow_regression_lf,
|
||||
pytest.mark.ow_dvlan_tests_lf,
|
||||
pytest.mark.wpa3_enterprise,
|
||||
pytest.mark.fiveg]
|
||||
lf_library = importlib.import_module("configuration")
|
||||
DYNAMIC_VLAN_RADIUS_SERVER_DATA = lf_library.DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA = lf_library.DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.dynamic_vlan_tests,
|
||||
pytest.mark.vlan]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
@@ -32,7 +33,10 @@ setup_params_general = {
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
# @allure.suite("regression")
|
||||
@allure.parent_suite("OpenWifi Dynamic Vlan Test")
|
||||
@allure.suite("WPA3 Enterprise Security")
|
||||
@allure.sub_suite("5 GHz Band")
|
||||
@allure.feature("VLAN MODE wpa3_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_configuration',
|
||||
@@ -48,283 +52,236 @@ class TestDynamicVlan5GWpa3(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_ssid_vlan_in_the_absence_of_radius_vlan_identifier",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-6095")
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier_5g_wpa3(self, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m " absence_of_radius_vlan_identifier and wpa3_enterprise and vlan"
|
||||
pytest -m " absence_of_radius_vlan_identifier and wpa3_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "fiveg"
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
vlan = [100]
|
||||
ttls_passwd = "passwordvlannotsentuser"
|
||||
eap = "TTLS"
|
||||
identity = "vlannotsentuser"
|
||||
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)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"]
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
eth_ip = get_test_library.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)
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
# eth_ip_1 = eth_ip.split('.')
|
||||
logging.info(f"station ip...{sta_ip_1}\neth.{vlan[0]}...{eth_vlan_ip}\neth_upstream_ip...{eth_ip}")
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
assert False, result
|
||||
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)
|
||||
assert False, result
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@pytest.mark.invalidradiusvlan
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_dynamic_invalid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-6097")
|
||||
def test_dynamic_invalid_vlan_5g_wpa3(self, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
@allure.title("Test for invalid vlan identifier")
|
||||
def test_dynamic_invalid_vlan_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "invalidradiusvlan and wpa3_enterprise and vlan"
|
||||
pytest -m "invalidradiusvlan and wpa3_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "fiveg"
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
vlan = [100]
|
||||
ttls_passwd = "passwordinvalidvlanuser"
|
||||
eap = "TTLS"
|
||||
identity = "invalidvlanuser"
|
||||
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])
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
get_test_library.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_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)
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid = ssid_name,
|
||||
security = security, extra_securities = extra_secu, vlan_id = vlan,
|
||||
mode = mode, band = band, eap = eap, ttls_passwd = ttls_passwd,
|
||||
ieee80211w = 0, identity = identity, num_sta = 1, dut_data = setup_configuration)
|
||||
|
||||
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] +
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.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('.')
|
||||
sta_ip_1 = station_ip.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
|
||||
assert False, result
|
||||
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)
|
||||
assert False, result
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@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-6098")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication_5g_wpa3(self, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
@allure.title("Test for radius vlan information retained after periodic reauthentication")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "periodic_reauthentication and wpa3_enterprise and vlan"
|
||||
pytest -m "periodic_reauthentication and wpa3_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "fiveg"
|
||||
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)
|
||||
ttls_passwd = "passwordB"
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
|
||||
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)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
get_test_library.add_vlan(vlan_ids=vlan)
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid = ssid_name, security = security,
|
||||
extra_securities = extra_secu, vlan_id = vlan,
|
||||
mode = mode, band = band, eap = eap, d_vlan = True,
|
||||
ttls_passwd = ttls_passwd, ieee80211w = 0,
|
||||
identity = identity, num_sta = 1,
|
||||
dut_data = setup_configuration, cleanup=False)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
sta_ip = lf_test.station_ip[station_names_fiveg[0]]
|
||||
# sta_ip = station_ip
|
||||
|
||||
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] +
|
||||
eth_ssid_vlan_ip = get_test_library.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] +
|
||||
eth_rad_vlan_ip = get_test_library.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('.')
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
assert False, result
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print(sta_ip_1)
|
||||
assert False, result
|
||||
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))
|
||||
break
|
||||
continue
|
||||
count = count + 1
|
||||
time.sleep(30)
|
||||
lf_tools.admin_up_down([station_names_fiveg[0]], option="up")
|
||||
for u in get_test_library.json_get("/port/?fields=port+type,alias")['interfaces']:
|
||||
if list(u.values())[0]['port type'] not in ['Ethernet', 'WIFI-Radio', 'NA']:
|
||||
station_name = list(u.values())[0]['alias']
|
||||
get_test_library.admin_up([station_name])
|
||||
|
||||
sta_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + station_names_fiveg[0])["interface"]["ip"]
|
||||
sta_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + station_name)["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")
|
||||
assert True, result
|
||||
elif count == 0:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@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-6100")
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan_5g_wpa3(self, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
@allure.title("test for ssid vlan used in absence of radius vlan")
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "absenceofvlanid and wpa3_enterprise and vlan"
|
||||
pytest -m "absenceofvlanid and wpa3_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "fiveg"
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
vlan = [100]
|
||||
ttls_passwd = "passwordvlannotsentuser"
|
||||
eap = "TTLS"
|
||||
identity = "vlannotsentuser"
|
||||
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])
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
get_test_library.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)
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan, mode=mode, band=band, eap=eap,
|
||||
d_vlan=True, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration)
|
||||
|
||||
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] +
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.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('.')
|
||||
sta_ip_1 = station_ip.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
|
||||
assert False, result
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid configured vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
'''
|
||||
@pytest.mark.unsupported
|
||||
@@ -386,265 +343,225 @@ class TestDynamicVlan5GWpa3(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_outof_bound_vlanid",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-6103")
|
||||
def test_out_of_bound_vlanid_5g_wpa3(self, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
@allure.title("test for out of bound vlan identifier")
|
||||
def test_out_of_bound_vlanid_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "outofboundvlanid and wpa3_enterprise and vlan"
|
||||
pytest -m "outofboundvlanid and wpa3_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "fiveg"
|
||||
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])
|
||||
vlan = [100]
|
||||
ttls_passwd = "passwordoutofboundvlanuser"
|
||||
eap = "TTLS"
|
||||
identity = "outofboundvlanuser"
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
get_test_library.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] +
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.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")
|
||||
if station_ip == "0.0.0.0":
|
||||
assert True, result
|
||||
|
||||
@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-6104")
|
||||
def test_client_association_ap_with_dynamic_vlan_5g_wpa3(self, lf_tools, get_ap_logs, get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
@allure.title("test for client association ap with dynamic vlan")
|
||||
def test_client_association_ap_with_dynamic_vlan_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa3_enterprise and vlan"
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa3_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "fiveg"
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
ttls_passwd = "passwordB"
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
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)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
get_test_library.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)
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_ssid_vlan_ip = get_test_library.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] +
|
||||
eth_radius_vlan_ip = get_test_library.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] +
|
||||
eth_ip = get_test_library.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('.')
|
||||
sta_ip_1 = get_test_library.station_ip.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
|
||||
assert False, result
|
||||
elif eth_radius_vlan_ip_1[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@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-6105")
|
||||
def test_subsequent_user_for_same_user_account_5g_wpa3(self, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
@allure.title("test for subsequent user for same user account")
|
||||
def test_subsequent_user_for_same_user_account_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa3_enterprise and vlan"
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa3_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "fiveg"
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
vlan = [100]
|
||||
ttls_passwd = "passwordA"
|
||||
eap = "TTLS"
|
||||
identity = "userA"
|
||||
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])
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
get_test_library.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]])
|
||||
station_list.append(get_test_library.fiveg_prefix + str(i))
|
||||
|
||||
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]])
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,d_vlan=True,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration, cleanup=False)
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
get_test_library.admin_up([station_list[m]])
|
||||
sta_ip.append(station_ip)
|
||||
if sta_ip[m] == "0.0.0.0":
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
print(sta_ip)
|
||||
assert False, result
|
||||
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] +
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@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-6106")
|
||||
def test_subsequent_user_for_different_user_account_5g_wpa3(self, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
@allure.title("test for subsequent user for different user account")
|
||||
def test_subsequent_user_for_different_user_account_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa3_enterprise and vlan"
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa3_enterprise and vlan and fiveg"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "fiveg"
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
eap = "TTLS"
|
||||
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)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
get_test_library.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))
|
||||
station_list.append(get_test_library.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],
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, passkey="[BLANK]",
|
||||
security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band, 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]])
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
sta_ip.append(station_ip)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
eth_vlan_ip = get_test_library.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] +
|
||||
eth_ip = get_test_library.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)
|
||||
assert False, result
|
||||
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")
|
||||
assert True, result
|
||||
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")
|
||||
assert False, result
|
||||
get_test_library.admin_up([station_list[sta]])
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa3_enterprise and vlan"
|
||||
pytest -m "dynamic_vlan_tests 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
|
||||
import importlib
|
||||
import logging
|
||||
|
||||
pytestmark = [pytest.mark.ow_regression_lf,
|
||||
pytest.mark.ow_dvlan_tests_lf,
|
||||
pytest.mark.wpa3_enterprise,
|
||||
pytest.mark.twog]
|
||||
lf_library = importlib.import_module("configuration")
|
||||
DYNAMIC_VLAN_RADIUS_SERVER_DATA = lf_library.DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA = lf_library.DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.dynamic_vlan_tests,
|
||||
pytest.mark.vlan]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
@@ -31,7 +32,10 @@ setup_params_general = {
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
# @allure.suite("regression")
|
||||
@allure.parent_suite("OpenWifi Dynamic Vlan Test")
|
||||
@allure.suite("WPA3 Enterprise Security")
|
||||
@allure.sub_suite("2.4 GHz Band")
|
||||
@allure.feature("VLAN MODE wpa3_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_configuration',
|
||||
@@ -47,67 +51,54 @@ class TestDynamicVlanOverSsid2GWpa3(object):
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_dynamic_precedence_over_ssid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-6096")
|
||||
def test_dynamic_precedence_over_ssid_vlan_2g_wpa3(self, lf_tools,get_ap_logs,get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
@allure.title("Test for dynamic precedence over ssid")
|
||||
def test_dynamic_precedence_over_ssid_vlan_2g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa3_enterprise and vlan"
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa3_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "twog"
|
||||
vlan = [100,200]
|
||||
ttls_passwd = "passwordB"
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
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)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
|
||||
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)
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1, dut_data=setup_configuration)
|
||||
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_ssid_vlan_ip = get_test_library.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] +
|
||||
eth_radius_vlan_ip = get_test_library.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] +
|
||||
eth_ip = get_test_library.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('.')
|
||||
sta_ip_1 = station_ip.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)
|
||||
logging.info(f"station ip...{sta_ip_1}\neth.{vlan[0]}...{eth_ssid_vlan_ip}\neth.{vlan[1]}...{eth_radius_vlan_ip}"
|
||||
f"\neth_upstream_ip...{eth_ip}")
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
assert False, result
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
assert False, result
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa3_enterprise and vlan"
|
||||
pytest -m "dynamic_vlan_tests 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
|
||||
import importlib
|
||||
import logging
|
||||
|
||||
pytestmark = [pytest.mark.ow_regression_lf,
|
||||
pytest.mark.ow_dvlan_tests_lf,
|
||||
pytest.mark.wpa3_enterprise,
|
||||
pytest.mark.twog]
|
||||
lf_library = importlib.import_module("configuration")
|
||||
DYNAMIC_VLAN_RADIUS_SERVER_DATA = lf_library.DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA = lf_library.DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.dynamic_vlan_tests,
|
||||
pytest.mark.vlan]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
@@ -32,7 +33,10 @@ setup_params_general = {
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
# @allure.suite("regression")
|
||||
@allure.parent_suite("OpenWifi Dynamic Vlan Test")
|
||||
@allure.suite("WPA3 Enterprise Security")
|
||||
@allure.sub_suite("2.4 GHz Band")
|
||||
@allure.feature("VLAN MODE wpa3_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_configuration',
|
||||
@@ -48,283 +52,236 @@ class TestDynamicVlan2GWpa3(object):
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_ssid_vlan_in_the_absence_of_radius_vlan_identifier",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-6095")
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier_2g_wpa3(self, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
@allure.title("Test for ssid vlan in the absence of radius vlan identifier")
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier_2g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m " absence_of_radius_vlan_identifier and wpa3_enterprise and vlan"
|
||||
pytest -m " absence_of_radius_vlan_identifier and wpa3_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "twog"
|
||||
vlan = [100]
|
||||
ttls_passwd = "passwordvlannotsentuser"
|
||||
eap = "TTLS"
|
||||
identity = "vlannotsentuser"
|
||||
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)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"]
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name,
|
||||
security=security, extra_securities=extra_secu,
|
||||
vlan_id=vlan, mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration)
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
eth_ip = get_test_library.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)
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
# eth_ip_1 = eth_ip.split('.')
|
||||
logging.info(f"station ip...{sta_ip_1}\neth.{vlan[0]}...{eth_vlan_ip}\neth_upstream_ip...{eth_ip}")
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
assert False, result
|
||||
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)
|
||||
assert False, result
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@pytest.mark.invalidradiusvlan
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_dynamic_invalid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-6097")
|
||||
def test_dynamic_invalid_vlan_2g_wpa3(self, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
@allure.title("Test for invalid vlan identifier")
|
||||
def test_dynamic_invalid_vlan_2g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "invalidradiusvlan and wpa3_enterprise and vlan"
|
||||
pytest -m "invalidradiusvlan and wpa3_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "twog"
|
||||
vlan = [100]
|
||||
ttls_passwd = "passwordinvalidvlanuser"
|
||||
eap = "TTLS"
|
||||
identity = "invalidvlanuser"
|
||||
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])
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
get_test_library.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_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)
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid = ssid_name,
|
||||
security = security, extra_securities = extra_secu, vlan_id = vlan,
|
||||
mode = mode, band = band, eap = eap, ttls_passwd = ttls_passwd,
|
||||
ieee80211w = 0, identity = identity, num_sta = 1, dut_data = setup_configuration)
|
||||
|
||||
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] +
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.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('.')
|
||||
sta_ip_1 = station_ip.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
|
||||
assert False, result
|
||||
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)
|
||||
assert False, result
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@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-6098")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication_2g_wpa3(self, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
@allure.title("Test for radius vlan information retained after periodic reauthentication")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication_2g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "periodic_reauthentication and wpa3_enterprise and vlan"
|
||||
pytest -m "periodic_reauthentication and wpa3_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "twog"
|
||||
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)
|
||||
ttls_passwd = "passwordB"
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
|
||||
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)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid = ssid_name, security = security,
|
||||
extra_securities = extra_secu, vlan_id = vlan,
|
||||
mode = mode, band = band, eap = eap,
|
||||
ttls_passwd = ttls_passwd, ieee80211w = 0,
|
||||
identity = identity, num_sta = 1,
|
||||
dut_data = setup_configuration, cleanup=False)
|
||||
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_ip = get_test_library.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] +
|
||||
eth_ssid_vlan_ip = get_test_library.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] +
|
||||
eth_rad_vlan_ip = get_test_library.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('.')
|
||||
sta_ip_1 = station_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
assert False, result
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print(sta_ip_1)
|
||||
assert False, result
|
||||
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))
|
||||
break
|
||||
continue
|
||||
count = count + 1
|
||||
time.sleep(30)
|
||||
lf_tools.admin_up_down([station_names_twog[0]], option="up")
|
||||
for u in get_test_library.json_get("/port/?fields=port+type,alias")['interfaces']:
|
||||
if list(u.values())[0]['port type'] not in ['Ethernet', 'WIFI-Radio', 'NA']:
|
||||
station_name = list(u.values())[0]['alias']
|
||||
get_test_library.admin_up([station_name])
|
||||
|
||||
sta_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + station_names_twog[0])["interface"]["ip"]
|
||||
sta_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + station_name)["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")
|
||||
assert True, result
|
||||
elif count == 0:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@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-6100")
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan_2g_wpa3(self, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
@allure.title("test for ssid vlan used in absence of radius vlan")
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "absenceofvlanid and wpa3_enterprise and vlan"
|
||||
pytest -m "absenceofvlanid and wpa3_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "twog"
|
||||
vlan = [100]
|
||||
ttls_passwd = "passwordvlannotsentuser"
|
||||
eap = "TTLS"
|
||||
identity = "vlannotsentuser"
|
||||
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])
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
|
||||
|
||||
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)
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan, mode=mode, band=band, eap=eap,
|
||||
d_vlan=True, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
|
||||
num_sta=1, dut_data=setup_configuration)
|
||||
|
||||
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] +
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.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('.')
|
||||
sta_ip_1 = station_ip.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
|
||||
assert False, result
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid configured vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
'''
|
||||
@pytest.mark.unsupported
|
||||
@@ -336,7 +293,7 @@ class TestDynamicVlan2GWpa3(object):
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "unsupported and wpa3_enterprise and vlan"
|
||||
pytest -m "unsupported and wpa3_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
@@ -350,7 +307,7 @@ class TestDynamicVlan2GWpa3(object):
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa3", 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",
|
||||
@@ -386,265 +343,224 @@ class TestDynamicVlan2GWpa3(object):
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_outof_bound_vlanid",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-6103")
|
||||
def test_out_of_bound_vlanid_2g_wpa3(self, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
@allure.title("test for out of bound vlan identifier")
|
||||
def test_out_of_bound_vlanid_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "outofboundvlanid and wpa3_enterprise and vlan"
|
||||
pytest -m "outofboundvlanid and wpa3_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
ssid_name = 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])
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "twog"
|
||||
vlan = [100]
|
||||
ttls_passwd = "passwordoutofboundvlanuser"
|
||||
eap = "TTLS"
|
||||
identity = "outofboundvlanuser"
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
|
||||
|
||||
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] +
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.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")
|
||||
if station_ip == "0.0.0.0":
|
||||
assert True, result
|
||||
|
||||
@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-6104")
|
||||
def test_client_association_ap_with_dynamic_vlan_2g_wpa3(self, lf_tools, get_ap_logs, get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
@allure.title("test for client association ap with dynamic vlan")
|
||||
def test_client_association_ap_with_dynamic_vlan_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa3_enterprise and vlan"
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa3_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "twog"
|
||||
vlan = [100, 200]
|
||||
ttls_passwd = "passwordB"
|
||||
eap = "TTLS"
|
||||
identity = "userB"
|
||||
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)
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
|
||||
|
||||
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)
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration)
|
||||
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
eth_ssid_vlan_ip = get_test_library.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] +
|
||||
eth_radius_vlan_ip = get_test_library.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] +
|
||||
eth_ip = get_test_library.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('.')
|
||||
sta_ip_1 = get_test_library.station_ip.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
|
||||
assert False, result
|
||||
elif eth_radius_vlan_ip_1[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@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-6105")
|
||||
def test_subsequent_user_for_same_user_account_2g_wpa3(self, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
@allure.title("test for subsequent user for same user account")
|
||||
def test_subsequent_user_for_same_user_account_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa3_enterprise and vlan"
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa3_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "twog"
|
||||
vlan = [100]
|
||||
ttls_passwd = "passwordA"
|
||||
eap = "TTLS"
|
||||
identity = "userA"
|
||||
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])
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
|
||||
|
||||
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]])
|
||||
station_list.append(get_test_library.fiveg_prefix + str(i))
|
||||
|
||||
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]])
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
|
||||
extra_securities=extra_secu, vlan_id=vlan,
|
||||
mode=mode, band=band, eap=eap,
|
||||
ttls_passwd=ttls_passwd, ieee80211w=0,
|
||||
identity=identity, num_sta=1,
|
||||
dut_data=setup_configuration, cleanup=False)
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
get_test_library.admin_up([station_list[m]])
|
||||
sta_ip.append(station_ip)
|
||||
if sta_ip[m] == "0.0.0.0":
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
print(sta_ip)
|
||||
assert False, result
|
||||
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] +
|
||||
eth_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_ip = get_test_library.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")
|
||||
assert True, result
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
assert False, result
|
||||
|
||||
@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-6106")
|
||||
def test_subsequent_user_for_different_user_account_2g_wpa3(self, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
@allure.title("test for subsequent user for different user account")
|
||||
def test_subsequent_user_for_different_user_account_5g_wpa3(self, get_test_library, get_dut_logs_per_test_case,
|
||||
get_test_device_logs, num_stations, setup_configuration):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa3_enterprise and vlan"
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa3_enterprise and vlan and twog"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
ssid_name = profile_data[0]["ssid_name"]
|
||||
security = "wpa3"
|
||||
extra_secu = []
|
||||
band = "twog"
|
||||
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)
|
||||
eap = "TTLS"
|
||||
val = ""
|
||||
port_resources = list(get_test_library.lanforge_data['wan_ports'].keys())[0].split('.')
|
||||
|
||||
|
||||
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))
|
||||
station_list.append(get_test_library.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",
|
||||
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, passkey="[BLANK]",
|
||||
security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band, vlan_id=vlan[sta],
|
||||
station_name=[station_list[sta]], key_mgmt="WPA-EAP",
|
||||
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]])
|
||||
station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
|
||||
sta_ip.append(station_ip)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
eth_vlan_ip = get_test_library.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] +
|
||||
eth_ip = get_test_library.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)
|
||||
assert False, result
|
||||
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")
|
||||
assert True, result
|
||||
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")
|
||||
assert False, result
|
||||
get_test_library.admin_up([station_list[sta]])
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user