mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2026-03-20 03:41:54 +00:00
Merge branch 'master' into WIFI-6472
This commit is contained in:
@@ -57,9 +57,6 @@ runs:
|
||||
cat << EOF >> "${{ inputs.results_path }}/environment.properties"
|
||||
|
||||
Tests.CommitId=${{ github.sha }}
|
||||
CiRun.Id=${{ github.run_id }}
|
||||
CiRun.Number=${{ github.run_number }}
|
||||
CiRun.Url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
EOF
|
||||
|
||||
- name: generate Allure report
|
||||
|
||||
10
.github/workflows/quali.yml
vendored
10
.github/workflows/quali.yml
vendored
@@ -68,11 +68,11 @@ jobs:
|
||||
- name: set variables
|
||||
id: vars
|
||||
run: |
|
||||
echo ::set-output name=openwifi::$(echo "${{ github.event.inputs.openwifi_revision || 'v2.4.0-RC3' }}")
|
||||
echo ::set-output name=gw::$(echo "${{ github.event.inputs.openwifi_gw_revision || 'v2.4.0-RC3' }}")
|
||||
echo ::set-output name=sec::$(echo "${{ github.event.inputs.openwifi_sec_revision || 'v2.4.0-RC2' }}")
|
||||
echo ::set-output name=fms::$(echo "${{ github.event.inputs.openwifi_fms_revision || 'v2.4.0-RC2' }}")
|
||||
echo ::set-output name=ui::$(echo "${{ github.event.inputs.openwifi_ui_revision || 'v2.4.0-RC2' }}")
|
||||
echo ::set-output name=openwifi::$(echo "${{ github.event.inputs.openwifi_revision || 'v2.4.0' }}")
|
||||
echo ::set-output name=gw::$(echo "${{ github.event.inputs.openwifi_gw_revision || 'v2.4.0' }}")
|
||||
echo ::set-output name=sec::$(echo "${{ github.event.inputs.openwifi_sec_revision || 'v2.4.0' }}")
|
||||
echo ::set-output name=fms::$(echo "${{ github.event.inputs.openwifi_fms_revision || 'v2.4.0' }}")
|
||||
echo ::set-output name=ui::$(echo "${{ github.event.inputs.openwifi_ui_revision || 'v2.4.0' }}")
|
||||
echo ::set-output name=ap_models::$(echo "${{ github.event.inputs.ap_models || 'edgecore_ecw5410,edgecore_eap101,tp-link_ec420-g1,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c,hfcl_ion4' }}")
|
||||
echo ::set-output name=ap_version::$(echo "${{ github.event.inputs.ap_version || 'next-latest' }}")
|
||||
echo ::set-output name=marker_expression::$(echo "${{ github.event.inputs.marker_expression || 'uc_sanity' }}")
|
||||
|
||||
@@ -21,6 +21,8 @@ def __wait_for_status(session, res_id, field, target_status):
|
||||
if status == target_status:
|
||||
break
|
||||
|
||||
print(f'current reservation status: {status}')
|
||||
|
||||
if timer >= TIMEOUT:
|
||||
raise RuntimeError(f'waiting for reservation to reach status {target_status} timed out')
|
||||
|
||||
|
||||
@@ -62,6 +62,22 @@ owprovui:
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
|
||||
owls:
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
|
||||
owlsui:
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
|
||||
rttys:
|
||||
nodeSelector:
|
||||
env: tests
|
||||
|
||||
@@ -36,8 +36,10 @@ class APNOS:
|
||||
self.password = credentials['password'] # if mode=1, enter jumphost password else ap password
|
||||
self.port = credentials['port'] # if mode=1, enter jumphost ssh port else ap ssh port
|
||||
self.mode = credentials['jumphost'] # 1 for jumphost, 0 for direct ssh
|
||||
|
||||
if 'mode' in credentials:
|
||||
self.type = credentials['mode']
|
||||
|
||||
if self.mode:
|
||||
self.tty = credentials['jumphost_tty'] # /dev/ttyAP1
|
||||
# kill minicom instance
|
||||
|
||||
@@ -165,7 +165,7 @@ class RunTest:
|
||||
station_name=[], key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="nolastart", ieee80211w=1,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="nolaradius",cleanup=True):
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="nolaradius",d_vlan=False,cleanup=True):
|
||||
self.eap_connect = TTLSTest(host=self.lanforge_ip, port=self.lanforge_port,
|
||||
sta_list=station_name, vap=False, _debug_on=self.debug)
|
||||
|
||||
@@ -209,15 +209,21 @@ class RunTest:
|
||||
self.eap_connect.sta_list = station_name
|
||||
self.eap_connect.build(extra_securities=extra_securities)
|
||||
self.eap_connect.start(station_name, True, True)
|
||||
if d_vlan:
|
||||
self.station_ip = {}
|
||||
for sta_name in station_name:
|
||||
# try:
|
||||
station_data_str = ""
|
||||
# sta_url = self.eap_connect.get_station_url(sta_name)
|
||||
# station_info = self.eap_connect.json_get(sta_url)
|
||||
station_info = self.eap_connect.json_get("port/1/1/" + sta_name)
|
||||
|
||||
for i in station_info["interface"]:
|
||||
try:
|
||||
station_data_str = station_data_str + i + " : " + str(station_info["interface"][i]) + "\n"
|
||||
if d_vlan:
|
||||
if i == "ip":
|
||||
self.station_ip[sta_name] = station_info["interface"][i]
|
||||
except Exception as e:
|
||||
print(e)
|
||||
allure.attach(name=str(sta_name), body=str(station_data_str))
|
||||
@@ -246,7 +252,7 @@ class RunTest:
|
||||
cx_data = cx_data + "\n"
|
||||
allure.attach(name="cx_data", body=str(cx_data))
|
||||
if cleanup:
|
||||
self.eap_connect.cleanup(station_name)
|
||||
self.eap_connect.cleanup(station_name)
|
||||
return self.eap_connect.passes()
|
||||
|
||||
def wifi_capacity(self, mode="BRIDGE", vlan_id=100, batch_size="1,5,10,20,40,64,128",
|
||||
@@ -474,7 +480,7 @@ class RunTest:
|
||||
|
||||
influx.glob()
|
||||
return self.dualbandptest_obj
|
||||
|
||||
|
||||
def apstabilitytest(self, ssid_5G="[BLANK]", ssid_2G="[BLANK]", mode="BRIDGE", vlan_id=100, dut_name="TIP",
|
||||
instance_name="test_demo", dut_5g="", dut_2g=""):
|
||||
instance_name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=S))
|
||||
|
||||
@@ -31,7 +31,7 @@ import pandas as pd
|
||||
class ChamberView:
|
||||
|
||||
def __init__(self, lanforge_data=None, access_point_data=None, debug=True, testbed=None):
|
||||
print("lanforge data",lanforge_data)
|
||||
print("lanforge data", lanforge_data)
|
||||
print("access point data", access_point_data)
|
||||
self.access_point_data = access_point_data
|
||||
print("testbed", testbed)
|
||||
@@ -62,9 +62,12 @@ class ChamberView:
|
||||
self.testbed = "mesh"
|
||||
self.scenario_name = "TIP-" + self.testbed
|
||||
self.raw_line = [
|
||||
["profile_link " + self.upstream_resource_1 + " upstream-dhcp 1 NA NA " + self.upstream_port_1.split(".")[2] + ",AUTO -1 NA"],
|
||||
["profile_link " + self.uplink_resource_1 + " uplink-nat 1 'DUT: upstream LAN " + self.upstream_subnet + "' NA " + self.uplink_port_1.split(".")[2] + "," + self.upstream_port_1.split(".")[2] + " -1 NA"]
|
||||
]
|
||||
["profile_link " + self.upstream_resource_1 + " upstream-dhcp 1 NA NA " +
|
||||
self.upstream_port_1.split(".")[2] + ",AUTO -1 NA"],
|
||||
[
|
||||
"profile_link " + self.uplink_resource_1 + " uplink-nat 1 'DUT: upstream LAN " + self.upstream_subnet + "' NA " +
|
||||
self.uplink_port_1.split(".")[2] + "," + self.upstream_port_1.split(".")[2] + " -1 NA"]
|
||||
]
|
||||
self.CreateChamberview = CreateChamberview(self.lanforge_ip, self.lanforge_port)
|
||||
else:
|
||||
self.lanforge_ip = lanforge_data["ip"]
|
||||
@@ -90,10 +93,10 @@ class ChamberView:
|
||||
self.ssid_list = []
|
||||
self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=self.debug)
|
||||
self.raw_line = [
|
||||
["profile_link " + self.upstream_resources + " upstream-dhcp 1 NA NA " + self.upstream_port.split(".")
|
||||
[2] + ",AUTO -1 NA"],
|
||||
["profile_link " + self.uplink_resources + " uplink-nat 1 'DUT: upstream LAN " + self.upstream_subnet
|
||||
+ "' NA " + self.uplink_port.split(".")[2] + "," + self.upstream_port.split(".")[2] + " -1 NA"]
|
||||
["profile_link " + self.upstream_resources + " upstream-dhcp 1 NA NA " + self.upstream_port.split(".")
|
||||
[2] + ",AUTO -1 NA"],
|
||||
["profile_link " + self.uplink_resources + " uplink-nat 1 'DUT: upstream LAN " + self.upstream_subnet
|
||||
+ "' NA " + self.uplink_port.split(".")[2] + "," + self.upstream_port.split(".")[2] + " -1 NA"]
|
||||
]
|
||||
|
||||
# This is for rawline input | see create_chamberview_dut.py for more details
|
||||
@@ -328,7 +331,9 @@ class ChamberView:
|
||||
|
||||
def read_csv_individual_station_throughput(self, dir_name, option):
|
||||
try:
|
||||
df = pd.read_csv("../reports/" + str(dir_name) + "/csv-data/data-Combined_bps__60_second_running_average-1.csv", sep=r'\t', engine='python')
|
||||
df = pd.read_csv(
|
||||
"../reports/" + str(dir_name) + "/csv-data/data-Combined_bps__60_second_running_average-1.csv",
|
||||
sep=r'\t', engine='python')
|
||||
print("csv file opened")
|
||||
except FileNotFoundError:
|
||||
print("csv file does not exist")
|
||||
@@ -378,6 +383,7 @@ class ChamberView:
|
||||
name=i,
|
||||
attachment_type="image/png", extension=None)
|
||||
|
||||
|
||||
def create_mesh_scenario(self):
|
||||
# upstream_list = []
|
||||
# for data in range(0,len(self.access_point_data)):
|
||||
@@ -449,6 +455,7 @@ class ChamberView:
|
||||
# [['ssid_idx=0 ssid=Default-SSID-2g security=WPA|WEP| password=12345678 bssid=90:3c:b3:94:48:58']]
|
||||
self.update_ssid(ssid_data=ssid_data[ssid])
|
||||
|
||||
|
||||
def set_radio_antenna(self, req_url, shelf, resources, radio, antenna):
|
||||
data = {
|
||||
"shelf": shelf,
|
||||
@@ -463,84 +470,84 @@ class ChamberView:
|
||||
def main():
|
||||
# lanforge_data = {'ip': 'localhost', 'port': 8802, 'ssh_port': 8804, '2.4G-Radio': ['1.1.wiphy0', '1.1.wiphy2'], '5G-Radio': ['1.1.wiphy1', '1.1.wiphy3'], 'AX-Radio': ['1.1.wiphy4', '1.1.wiphy5', '1.1.wiphy6', '1.1.wiphy7'], 'upstream': '1.1.eth2', 'upstream_subnet': '10.28.2.1/24', 'uplink': '1.1.eth1', '2.4G-Station-Name': 'sta00', '5G-Station-Name': 'sta10', 'AX-Station-Name': 'ax'}
|
||||
lanforge_data = {
|
||||
"type": "mesh",
|
||||
"ip": "localhost", # 10.28.3.14
|
||||
"port": 8802, # 8080
|
||||
"ssh_port": 8804,
|
||||
"2.4G-Radio-mobile-sta": ["1.1.wiphy0", "1.1.wiphy2"],
|
||||
"5G-Radio-mobile-sta": ["1.1.wiphy1", "1.1.wiphy3"],
|
||||
"AX-Radio-mobile-sta": ["1.1.wiphy4", "1.1.wiphy5", "1.1.wiphy6", "1.1.wiphy7"],
|
||||
"upstream-mobile-sta": "1.1.eth2",
|
||||
"upstream_subnet-mobile-sta": "10.28.2.1/24",
|
||||
"uplink-mobile-sta": "1.1.eth3",
|
||||
"2.4G-Radio-root": ["1.2.wiphy0"],
|
||||
"5G-Radio-root": ["1.2.wiphy1"],
|
||||
"AX-Radio-root": [],
|
||||
"upstream-root": "1.2.eth2",
|
||||
"upstream_subnet-root": "10.28.2.1/24",
|
||||
"uplink-root": "1.2.eth3",
|
||||
"2.4G-Radio-node-1": ["1.3.wiphy0"],
|
||||
"5G-Radio-node-1": ["1.3.wiphy1"],
|
||||
"AX-Radio-node-1": [],
|
||||
"upstream-node-1": "1.3.eth2",
|
||||
"upstream_subnet-node-1": "10.28.2.1/24",
|
||||
"uplink--node-1": "1.3.eth3",
|
||||
"2.4G-Radio-node-2": ["1.4.wiphy0"],
|
||||
"5G-Radio-node-2": ["1.4.wiphy1"],
|
||||
"AX-Radio-node-2": [],
|
||||
"upstream-node-2": "1.4.eth2",
|
||||
"upstream_subnet-node-2": "10.28.2.1/24",
|
||||
"uplink--node-2": "1.4.eth3",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax"
|
||||
}
|
||||
"type": "mesh",
|
||||
"ip": "localhost", # 10.28.3.14
|
||||
"port": 8802, # 8080
|
||||
"ssh_port": 8804,
|
||||
"2.4G-Radio-mobile-sta": ["1.1.wiphy0", "1.1.wiphy2"],
|
||||
"5G-Radio-mobile-sta": ["1.1.wiphy1", "1.1.wiphy3"],
|
||||
"AX-Radio-mobile-sta": ["1.1.wiphy4", "1.1.wiphy5", "1.1.wiphy6", "1.1.wiphy7"],
|
||||
"upstream-mobile-sta": "1.1.eth2",
|
||||
"upstream_subnet-mobile-sta": "10.28.2.1/24",
|
||||
"uplink-mobile-sta": "1.1.eth3",
|
||||
"2.4G-Radio-root": ["1.2.wiphy0"],
|
||||
"5G-Radio-root": ["1.2.wiphy1"],
|
||||
"AX-Radio-root": [],
|
||||
"upstream-root": "1.2.eth2",
|
||||
"upstream_subnet-root": "10.28.2.1/24",
|
||||
"uplink-root": "1.2.eth3",
|
||||
"2.4G-Radio-node-1": ["1.3.wiphy0"],
|
||||
"5G-Radio-node-1": ["1.3.wiphy1"],
|
||||
"AX-Radio-node-1": [],
|
||||
"upstream-node-1": "1.3.eth2",
|
||||
"upstream_subnet-node-1": "10.28.2.1/24",
|
||||
"uplink--node-1": "1.3.eth3",
|
||||
"2.4G-Radio-node-2": ["1.4.wiphy0"],
|
||||
"5G-Radio-node-2": ["1.4.wiphy1"],
|
||||
"AX-Radio-node-2": [],
|
||||
"upstream-node-2": "1.4.eth2",
|
||||
"upstream_subnet-node-2": "10.28.2.1/24",
|
||||
"uplink--node-2": "1.4.eth3",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax"
|
||||
}
|
||||
# ap_data = [{'model': 'wf188n', 'mode': 'wifi6', 'serial': '0000c1018812', 'jumphost': True, 'ip': 'localhost', 'username': 'lanforge', 'password': 'pumpkin77', 'port': 8803, 'jumphost_tty': '/dev/ttyAP1', 'version': 'https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/cig_wf188/20210729-cig_wf188-v2.0.0-rc2-ec3662e-upgrade.bin'}]
|
||||
ap_data = [
|
||||
{
|
||||
'type' : 'root',
|
||||
'model': 'eap101',
|
||||
'mode': 'wifi6',
|
||||
'serial': '34efb6af4a7a',
|
||||
'jumphost': True,
|
||||
'ip': "localhost", # 10\.28\.3\.101
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8803, # 22
|
||||
'jumphost_tty': '/dev/ttyAP2',
|
||||
'version': "latest"
|
||||
},
|
||||
{
|
||||
'type': 'node-1',
|
||||
'model': 'eap101',
|
||||
'mode': 'wifi6',
|
||||
'serial': '34efb6af4903',
|
||||
'jumphost': True,
|
||||
'ip': "localhost", #10\.28\.3\.101
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8803, # 22
|
||||
'jumphost_tty': '/dev/ttyAP3',
|
||||
'version': "latest"
|
||||
},
|
||||
{
|
||||
'type' : 'node-2',
|
||||
'model': 'eap102',
|
||||
'mode': 'wifi6',
|
||||
'serial': '34efb6af4a7a',
|
||||
'jumphost': True,
|
||||
'ip': "localhost", # 10\.28\.3\.101
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8803, # 22
|
||||
'jumphost_tty': '/dev/ttyAP4',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/eap101/trunk/eap101-1.1.0.tar.gz"
|
||||
}
|
||||
]
|
||||
{
|
||||
'type': 'root',
|
||||
'model': 'eap101',
|
||||
'mode': 'wifi6',
|
||||
'serial': '34efb6af4a7a',
|
||||
'jumphost': True,
|
||||
'ip': "localhost", # 10\.28\.3\.101
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8803, # 22
|
||||
'jumphost_tty': '/dev/ttyAP2',
|
||||
'version': "latest"
|
||||
},
|
||||
{
|
||||
'type': 'node-1',
|
||||
'model': 'eap101',
|
||||
'mode': 'wifi6',
|
||||
'serial': '34efb6af4903',
|
||||
'jumphost': True,
|
||||
'ip': "localhost", # 10\.28\.3\.101
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8803, # 22
|
||||
'jumphost_tty': '/dev/ttyAP3',
|
||||
'version': "latest"
|
||||
},
|
||||
{
|
||||
'type': 'node-2',
|
||||
'model': 'eap102',
|
||||
'mode': 'wifi6',
|
||||
'serial': '34efb6af4a7a',
|
||||
'jumphost': True,
|
||||
'ip': "localhost", # 10\.28\.3\.101
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8803, # 22
|
||||
'jumphost_tty': '/dev/ttyAP4',
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/eap101/trunk/eap101-1.1.0.tar.gz"
|
||||
}
|
||||
]
|
||||
testbed = "mesh"
|
||||
obj = ChamberView(lanforge_data=lanforge_data, access_point_data=ap_data, testbed="mesh")
|
||||
obj.create_mesh_dut()
|
||||
obj.create_mesh()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
||||
@@ -11,7 +11,7 @@ import time
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.throughput_benchmark_test, pytest.mark.bridge] # pytest.mark.usefixtures("setup_test_run")]
|
||||
pytestmark = [pytest.mark.performance, pytest.mark.throughput_benchmark_test, pytest.mark.bridge] # pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
|
||||
setup_params_general = {
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa2_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import allure
|
||||
import pytest
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa2_enterprise, pytest.mark.vlan,pytest.mark.fiveg]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2e_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "something",
|
||||
"radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA,
|
||||
"radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA,
|
||||
"vlan": 100
|
||||
}]},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
@allure.feature("VLAN MODE wpa2_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlan(object):
|
||||
|
||||
@pytest.mark.dynamic_precedence_over_ssid
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_dynamic_precedence_over_ssid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5705")
|
||||
def test_dynamic_precedence_over_ssid_vlan(self, get_vif_state, lf_tools,get_ap_logs,get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100,200]
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan[0],
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True)
|
||||
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_radius_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("vlan ip...", eth_radius_vlan_ip)
|
||||
print("eth_upstream_ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per dynamic vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
@@ -0,0 +1,648 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa2_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import allure
|
||||
import pytest
|
||||
import time
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa2_enterprise, pytest.mark.vlan,
|
||||
pytest.mark.fiveg]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2e_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "something",
|
||||
"radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA,
|
||||
"radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA,
|
||||
"vlan": 100
|
||||
}]},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
@allure.feature("VLAN MODE wpa2_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlan(object):
|
||||
|
||||
@pytest.mark.absence_of_radius_vlan_identifier
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_ssid_vlan_in_the_absence_of_radius_vlan_identifier",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5704")
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m " absence_of_radius_vlan_identifier and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan_id])
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg",
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordvlannotsentuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"]
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
print(sta_ip_1)
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
# eth_ip_1 = eth_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("upstream ip...", eth_ip)
|
||||
print("ssid configured vlan ip", eth_vlan_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
elif i == j:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.invalidradiusvlan
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_dynamic_invalid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5706")
|
||||
def test_dynamic_invalid_vlan(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "invalidradiusvlan and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan_id])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan_id,
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordinvalidvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("ssid vlan ip...", eth_vlan_ip)
|
||||
print("upstream ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.periodic_reauthentication
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_radius_vlan_info_retained_after_periodic_reauthentication",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5707")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "periodic_reauthentication and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan[1],
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True, cleanup=False)
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
sta_ip = lf_test.station_ip[station_names_fiveg[0]]
|
||||
|
||||
count = 0
|
||||
# print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
# print("vlan ip...", eth_vlan_ip)
|
||||
# print("eth_vlan_ip..", eth_ip)
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_rad_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_rad_vlan_ip.split('.')
|
||||
sta_ip_1 = sta_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print(sta_ip_1)
|
||||
for k in range(0, 2):
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
break
|
||||
else:
|
||||
if count == 2:
|
||||
break # allure.attach(name="station ip",body=str(sta_ip))
|
||||
continue
|
||||
count = count + 1
|
||||
time.sleep(30)
|
||||
lf_tools.admin_up_down([station_names_fiveg[0]], option="up")
|
||||
|
||||
sta_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + station_names_fiveg[0])["interface"]["ip"]
|
||||
sta_ip_1 = sta_ip.split('.')
|
||||
print(sta_ip)
|
||||
allure.attach(name="station ip....", body=str(sta_ip))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_rad_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if count == 2:
|
||||
assert True
|
||||
print("Station ip assigned as per dynamic vlan")
|
||||
elif count == 0:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.absenceofvlanid
|
||||
@pytest.mark.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")
|
||||
def test_ssid_vlan_used_in_absence_of_radius_vlan(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "absenceofvlanid and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan,
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordvlannotsentuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("ssid configured vlan ip...", eth_vlan_ip)
|
||||
print("upstream ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid configured vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid configured vlan")
|
||||
assert False
|
||||
|
||||
'''
|
||||
@pytest.mark.unsupported
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_dynamic_unsupported_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5710")
|
||||
def test_dynamic_unsupported_vlan(self, get_vif_state, lf_tools,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "unsupported and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=100,
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordinvalidvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="vlan ip....", body=str(eth_vlan_ip))
|
||||
print("Station ip not assigned as per vlan")
|
||||
assert False
|
||||
else:
|
||||
assert True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="vlan ip....", body=str(eth_vlan_ip))
|
||||
allure.attach(name="vlan ip....", body=str(eth_ip))
|
||||
print("Station ip assigned as per vlan")
|
||||
'''
|
||||
|
||||
@pytest.mark.outofboundvlanid
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_outof_bound_vlanid",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5711")
|
||||
def test_out_of_bound_vlanid(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "outofboundvlanid and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan,
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordoutofboundvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="outofboundvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
if lf_test.station_ip[station_names_fiveg[0]] == "0.0.0.0":
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
assert True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
allure.attach(name="out of bound vlan id..", body=str(7000))
|
||||
print("Test Passsed...Client Connection failed")
|
||||
|
||||
@pytest.mark.client_association_ap_with_dynamic_vlan
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_client_association_ap_with_dynamic_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5712")
|
||||
def test_client_association_ap_with_dynamic_vlan(self, get_vif_state, lf_tools, get_ap_logs, get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=vlan[0],
|
||||
station_name=station_names_fiveg, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True)
|
||||
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.')
|
||||
eth_radius_vlan_ip_1 = eth_radius_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_fiveg[0]])
|
||||
print("radius vlan ip...", eth_radius_vlan_ip)
|
||||
print("eth_upstream_ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_radius_vlan_ip_1[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
|
||||
for i, j in zip(sta_ip_1[0:2], eth_radius_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip))
|
||||
allure.attach(name="Upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.subsequent_user_for_same_user_account
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_subsequent_user_for_same_user_account",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5713")
|
||||
def test_subsequent_user_for_same_user_account(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
for i in range(0, 2):
|
||||
station_list.append(lf_tools.fiveg_prefix + str(i))
|
||||
print(station_list)
|
||||
print([station_list[0]])
|
||||
|
||||
for m in range(0, len(station_list)):
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg", vlan_id=100,
|
||||
station_name=[station_list[m]], key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordA", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userA", d_vlan=True, cleanup=False)
|
||||
lf_tools.admin_up_down([station_list[m]], option="up")
|
||||
sta_ip.append(lf_test.station_ip[station_list[m]])
|
||||
if sta_ip[m] == "0.0.0.0":
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
print(sta_ip)
|
||||
time.sleep(30)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
for n in range(0, len(station_list)):
|
||||
sta_ip_1 = sta_ip[n].split('.')
|
||||
print("station ip...", sta_ip[n])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(sta_ip[n]))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.subsequent_user_for_different_user_account
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(name="test_subsequent_user_for_different_user_account_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5714")
|
||||
def test_subsequent_user_for_different_user_account(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_fiveg):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_5G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
dynamic_vlan_user = ["userA", "userB"]
|
||||
dynamic_vlan_pass = ["passwordA", "passwordB"]
|
||||
for i in range(0, 2):
|
||||
station_list.append(lf_tools.fiveg_prefix + str(i))
|
||||
|
||||
for user_id, user_pass, sta in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(station_list))):
|
||||
lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="fiveg", 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]])
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[sta]))["interface"]["ip"]
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
print(sta_ip)
|
||||
sta_ip_1 = sta_ip[sta].split('.')
|
||||
if sta_ip_1 == "0.0.0.0":
|
||||
allure.attach("station didn't received ip..")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_list[sta]])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(sta_ip[sta]))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[sta])))
|
||||
allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print(f"{station_list[sta]} ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print(f"{station_list[sta]} ip not assigned as per radius vlan")
|
||||
assert False
|
||||
lf_tools.admin_up_down([station_list[sta]], option="up")
|
||||
time.sleep(5)
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa2_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import allure
|
||||
import pytest
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa2_enterprise, pytest.mark.vlan,pytest.mark.twog]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2e_2g", "appliedRadios": ["2G"],
|
||||
"security_key": "something",
|
||||
"radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA,
|
||||
"radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA,
|
||||
"vlan": 100
|
||||
}]},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
@allure.feature("VLAN MODE wpa2_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlan(object):
|
||||
|
||||
@pytest.mark.dynamic_precedence_over_ssid
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_dynamic_precedence_over_ssid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5705")
|
||||
def test_dynamic_precedence_over_ssid_vlan(self, get_vif_state, lf_tools,get_ap_logs,get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "dynamic_precedence_over_ssid and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100,200]
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan[0],
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True)
|
||||
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_radius_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("vlan ip...", eth_radius_vlan_ip)
|
||||
print("eth_upstream_ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per dynamic vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
@@ -0,0 +1,648 @@
|
||||
"""
|
||||
|
||||
Dynamic_Vlan: VLAN Mode
|
||||
pytest -m "dynamic_vlan and wpa2_enterprise and vlan"
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
import allure
|
||||
import pytest
|
||||
import time
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA
|
||||
from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA
|
||||
|
||||
pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa2_enterprise, pytest.mark.vlan,
|
||||
pytest.mark.twog]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2e_2g", "appliedRadios": ["2G"],
|
||||
"security_key": "something",
|
||||
"radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA,
|
||||
"radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA,
|
||||
"vlan": 100
|
||||
}]},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@allure.suite("regression")
|
||||
@allure.feature("VLAN MODE wpa2_enterprise Dynamic Vlan")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDynamicVlan(object):
|
||||
|
||||
@pytest.mark.absence_of_radius_vlan_identifier
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_ssid_vlan_in_the_absence_of_radius_vlan_identifier",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5704")
|
||||
def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m " absence_of_radius_vlan_identifier and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan_id])
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog",
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordvlannotsentuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"]
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
print(sta_ip_1)
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
# eth_ip_1 = eth_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("upstream ip...", eth_ip)
|
||||
print("ssid configured vlan ip", eth_vlan_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
elif i == j:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.invalidradiusvlan
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_dynamic_invalid_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5706")
|
||||
def test_dynamic_invalid_vlan(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "invalidradiusvlan and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan_id = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan_id])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan_id,
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordinvalidvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("ssid vlan ip...", eth_vlan_ip)
|
||||
print("upstream ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.periodic_reauthentication
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_radius_vlan_info_retained_after_periodic_reauthentication",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5707")
|
||||
def test_radius_vlan_info_retained_after_periodic_reauthentication(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "periodic_reauthentication and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan[1],
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True, cleanup=False)
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
sta_ip = lf_test.station_ip[station_names_twog[0]]
|
||||
|
||||
count = 0
|
||||
# print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
# print("vlan ip...", eth_vlan_ip)
|
||||
# print("eth_vlan_ip..", eth_ip)
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
eth_rad_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_rad_vlan_ip.split('.')
|
||||
sta_ip_1 = sta_ip.split('.')
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip_1[0] == "0":
|
||||
print("radius configured vlan didnt recieved ip")
|
||||
assert False
|
||||
print(sta_ip_1)
|
||||
for k in range(0, 2):
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
break
|
||||
else:
|
||||
if count == 2:
|
||||
break # allure.attach(name="station ip",body=str(sta_ip))
|
||||
continue
|
||||
count = count + 1
|
||||
time.sleep(30)
|
||||
lf_tools.admin_up_down([station_names_twog[0]], option="up")
|
||||
|
||||
sta_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + station_names_twog[0])["interface"]["ip"]
|
||||
sta_ip_1 = sta_ip.split('.')
|
||||
print(sta_ip)
|
||||
allure.attach(name="station ip....", body=str(sta_ip))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_rad_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if count == 2:
|
||||
assert True
|
||||
print("Station ip assigned as per dynamic vlan")
|
||||
elif count == 0:
|
||||
print("Station ip not assigned as per dynamic vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.absenceofvlanid
|
||||
@pytest.mark.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(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "absenceofvlanid and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan,
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordvlannotsentuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("ssid configured vlan ip...", eth_vlan_ip)
|
||||
print("upstream ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_vlan_ip[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per ssid configured vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per ssid configured vlan")
|
||||
assert False
|
||||
|
||||
'''
|
||||
@pytest.mark.unsupported
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_dynamic_unsupported_vlan",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5710")
|
||||
def test_dynamic_unsupported_vlan(self, get_vif_state, lf_tools,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "unsupported and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=100,
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordinvalidvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
eth_vlan_ip_1 = eth_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="vlan ip....", body=str(eth_vlan_ip))
|
||||
print("Station ip not assigned as per vlan")
|
||||
assert False
|
||||
else:
|
||||
assert True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="vlan ip....", body=str(eth_vlan_ip))
|
||||
allure.attach(name="vlan ip....", body=str(eth_ip))
|
||||
print("Station ip assigned as per vlan")
|
||||
'''
|
||||
|
||||
@pytest.mark.outofboundvlanid
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(name="test_outof_bound_vlanid",
|
||||
url="https://telecominfraproject.atlassian.net/browse/WIFI-5711")
|
||||
def test_out_of_bound_vlanid(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "outofboundvlanid and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan,
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordoutofboundvlanuser", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="outofboundvlanuser", d_vlan=True)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
if lf_test.station_ip[station_names_twog[0]] == "0.0.0.0":
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
assert True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
allure.attach(name="out of bound vlan id..", body=str(7000))
|
||||
print("Test Passsed...Client Connection failed")
|
||||
|
||||
@pytest.mark.client_association_ap_with_dynamic_vlan
|
||||
@pytest.mark.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(self, get_vif_state, lf_tools, get_ap_logs, get_lf_logs,
|
||||
create_lanforge_chamberview_dut, lf_test, get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "client_association_ap_with_dynamic_vlan and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = [100, 200]
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=vlan[0],
|
||||
station_name=station_names_twog, key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordB", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True)
|
||||
|
||||
eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"]
|
||||
|
||||
eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
|
||||
sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.')
|
||||
eth_radius_vlan_ip_1 = eth_radius_vlan_ip.split('.')
|
||||
print("station ip...", lf_test.station_ip[station_names_twog[0]])
|
||||
print("radius vlan ip...", eth_radius_vlan_ip)
|
||||
print("eth_upstream_ip..", eth_ip)
|
||||
if sta_ip_1[0] == "0":
|
||||
print("station didnt received any ip")
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
elif eth_radius_vlan_ip_1[0] == "0":
|
||||
print("ssid configured vlan didnt recieved ip")
|
||||
assert False
|
||||
|
||||
for i, j in zip(sta_ip_1[0:2], eth_radius_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]]))
|
||||
allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0])))
|
||||
allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1])))
|
||||
allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip))
|
||||
allure.attach(name="Upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.subsequent_user_for_same_user_account
|
||||
@pytest.mark.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(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_same_user_account and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
vlan = 100
|
||||
val = ""
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=[vlan])
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
for i in range(0, 2):
|
||||
station_list.append(lf_tools.twog_prefix + str(i))
|
||||
print(station_list)
|
||||
print([station_list[0]])
|
||||
|
||||
for m in range(0, len(station_list)):
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog", vlan_id=100,
|
||||
station_name=[station_list[m]], key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="passwordA", ieee80211w=0,
|
||||
wep_key="NA", ca_cert="NA", eap="TTLS", identity="userA", d_vlan=True, cleanup=False)
|
||||
lf_tools.admin_up_down([station_list[m]], option="up")
|
||||
sta_ip.append(lf_test.station_ip[station_list[m]])
|
||||
if sta_ip[m] == "0.0.0.0":
|
||||
allure.attach("station didnt recieved ip..")
|
||||
assert False
|
||||
print(sta_ip)
|
||||
time.sleep(30)
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan))["interface"]["ip"]
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
for n in range(0, len(station_list)):
|
||||
sta_ip_1 = sta_ip[n].split('.')
|
||||
print("station ip...", sta_ip[n])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(sta_ip[n]))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print("Station ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print("Station ip not assigned as per radius vlan")
|
||||
assert False
|
||||
|
||||
@pytest.mark.subsequent_user_for_different_user_account
|
||||
@pytest.mark.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(self, get_vif_state, lf_tools, get_lf_logs,
|
||||
get_ap_logs,
|
||||
create_lanforge_chamberview_dut, lf_test,
|
||||
get_configuration,
|
||||
station_names_twog):
|
||||
"""
|
||||
pytest -m "subsequent_user_for_different_user_account and wpa2_enterprise and vlan"
|
||||
"""
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"]
|
||||
ssid_2G = profile_data[0]["ssid_name"]
|
||||
mode = "VLAN"
|
||||
val = ""
|
||||
vlan = [100, 200]
|
||||
upstream_port = lf_tools.upstream_port
|
||||
print(upstream_port)
|
||||
port_resources = upstream_port.split(".")
|
||||
print(lf_tools.dut_idx_mapping)
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan)
|
||||
|
||||
station_list = []
|
||||
sta_ip = []
|
||||
dynamic_vlan_user = ["userA", "userB"]
|
||||
dynamic_vlan_pass = ["passwordA", "passwordB"]
|
||||
for i in range(0, 2):
|
||||
station_list.append(lf_tools.twog_prefix + str(i))
|
||||
|
||||
for user_id, user_pass, sta in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(station_list))):
|
||||
lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode=mode, band="twog", 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]])
|
||||
|
||||
eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2] + "." + str(vlan[sta]))["interface"]["ip"]
|
||||
|
||||
eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
|
||||
"/" + port_resources[2])["interface"]["ip"]
|
||||
eth_vlan_ip_1 = eth_vlan_ip.split('.')
|
||||
print(sta_ip)
|
||||
sta_ip_1 = sta_ip[sta].split('.')
|
||||
if sta_ip_1 == "0.0.0.0":
|
||||
allure.attach("station didn't received ip..")
|
||||
assert False
|
||||
print("station ip...", lf_test.station_ip[station_list[sta]])
|
||||
print("vlan ip...", eth_vlan_ip)
|
||||
print("eth_vlan_ip..", eth_ip)
|
||||
for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]):
|
||||
if i != j:
|
||||
val = False
|
||||
else:
|
||||
val = True
|
||||
allure.attach(name="station ip....", body=str(sta_ip[sta]))
|
||||
allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan)))
|
||||
allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip))
|
||||
allure.attach(name="upstream port....", body=str(port_resources[2]))
|
||||
allure.attach(name="upstream ip....", body=str(eth_ip))
|
||||
if val:
|
||||
assert True
|
||||
print(f"{station_list[sta]} ip assigned as per radius vlan")
|
||||
elif not val:
|
||||
print(f"{station_list[sta]} ip not assigned as per radius vlan")
|
||||
assert False
|
||||
lf_tools.admin_up_down([station_list[sta]], option="up")
|
||||
time.sleep(5)
|
||||
|
||||
@@ -507,7 +507,7 @@ class Fixtures_2x:
|
||||
else:
|
||||
print("no")
|
||||
var = False
|
||||
|
||||
for j in profile_data["ssid"][mode]:
|
||||
if mode in get_markers.keys() and get_markers[mode]:
|
||||
try:
|
||||
if j["appliedRadios"].__contains__("2G"):
|
||||
@@ -516,6 +516,7 @@ class Fixtures_2x:
|
||||
lf_dut_data.append(j)
|
||||
j["appliedRadios"] = list(set(j["appliedRadios"]))
|
||||
j['security'] = 'wpa2'
|
||||
|
||||
if var :
|
||||
RADIUS_SERVER_DATA = j["radius_auth_data"]
|
||||
RADIUS_ACCOUNTING_DATA = j['radius_acc_data']
|
||||
|
||||
Reference in New Issue
Block a user