2.x updates

setup_profiles for 2.x added functionality - bssid band ssid mapping for lf dut
get_vif_state fixture adjustments for 2.x (posibbly changing the naming convention in next commit)
lf_tests synced up with master branch
lf_tools synced up with master
added a ssid_list in lf_tools, it will be updated and used on a class level for verification of ssid availability in each test case

Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
shivamcandela
2021-07-25 01:50:39 +05:30
parent 6ba0aa0197
commit 3ffe9b44a7
8 changed files with 831 additions and 624 deletions

View File

@@ -23,6 +23,7 @@ class APNOS:
allure.attach(name="APNOS LIbrary: ", body=str(credentials))
self.serial = credentials['serial']
self.owrt_args = "--prompt root@OpenAp -s serial --log stdout --user root --passwd openwifi"
self.sdk = sdk
if sdk == "2.x":
self.owrt_args = "--prompt root@" + self.serial + " -s serial --log stdout --user root --passwd openwifi"
if credentials is None:
@@ -85,18 +86,39 @@ class APNOS:
return output
# Method to get the iwinfo status of AP using AP-CLI/ JUMPHOST-CLI
def iwinfo_status(self):
# Method to get the iwinfo status of AP using AP-CLI/ JUMPHOST-CLI
def get_bssid_band_mapping(self):
client = self.ssh_cli_connect()
cmd = 'iwinfo'
if self.mode:
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
f"cmd --value \"{cmd}\" "
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
data = stdout.read()
client.close()
allure.attach(name="iwinfo Output Msg: ", body=str(output))
allure.attach(name="iwinfo Output Msg: ", body=str(data))
allure.attach(name="iwinfo config Err Msg: ", body=str(stderr))
return output
data = str(data).replace(" ", "").split("\\r\\n")
band_info = []
for i in data:
tmp = []
if i.__contains__("AccessPoint"):
bssid = i.replace("AccessPoint:", "")
tmp.append(bssid.casefold())
elif i.__contains__("MasterChannel"):
if i.split(":")[2].__contains__("2.4"):
tmp.append("2G")
else:
tmp.append("5G")
else:
tmp = []
if tmp != []:
band_info.append(tmp)
bssi_band_mapping = {}
for i in range(len(band_info)):
if (i % 2) == 0:
bssi_band_mapping[band_info[i][0]] = band_info[i + 1][0]
return bssi_band_mapping
# Method to get the vif_config of AP using AP-CLI/ JUMPHOST-CLI
def get_vif_config(self):
@@ -365,63 +387,86 @@ class APNOS:
print(e)
return json_output
def logread(self):
def get_interface_details(self):
r = self.get_wifi_status()
print(r)
wifi_info = {}
if self.sdk == "1.x":
for i in r:
for j in r[i]["interfaces"]:
encryption = j["config"]["encryption"]
if encryption == "psk" or encryption == "psk2" or encryption == "psk-mixed" or \
encryption == "sae" or encryption == "sae-mixed":
wifi_info[j["ifname"]] = [j["config"]["ssid"], j["config"]["encryption"], j["config"]["key"]]
else:
wifi_info[j["ifname"]] = [j["config"]["ssid"], j["config"]["encryption"], ""]
print(wifi_info)
data = self.get_iwinfo()
for i in wifi_info.keys():
wifi_info[i].append(data[i])
return wifi_info
if self.sdk == "2.x":
for i in r:
for j in r[i]["interfaces"]:
encryption = j["config"]["encryption"]
if encryption == "psk" or encryption == "psk2" or encryption == "psk-mixed" or \
encryption == "sae" or encryption == "sae-mixed":
wifi_info[j["ifname"]] = [j["config"]["ssid"], j["config"]["encryption"], j["config"]["key"]]
else:
wifi_info[j["ifname"]] = [j["config"]["ssid"], j["config"]["encryption"], ""]
data = self.get_iwinfo()
for i in wifi_info.keys():
wifi_info[i].append(data[i])
return wifi_info
def get_wifi_status(self):
try:
client = self.ssh_cli_connect()
cmd = "logread"
cmd = "wifi status"
if self.mode:
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
f"cmd --value \"{cmd}\" "
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
status = output.decode('utf-8').splitlines()
logread = status
logs = ""
for i in logread:
logs = logs + i + "\n"
output = stdout.read().decode('utf-8')
data = output.split()
data.pop(0)
data.pop(0)
data.pop(0)
OUT = "".join(data)
json_output = json.loads(OUT)
client.close()
except Exception as e:
json_output = False
print(e)
logs = ""
return logs
return json_output
def get_vifc(self):
client = self.ssh_cli_connect()
cmd = "vifC"
if self.mode:
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
f"cmd --value \"{cmd}\" "
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
client.close()
allure.attach(name="vif state Output Msg: ", body=str(output))
allure.attach(name="vif state Err Msg: ", body=str(stderr))
return output
def get_iwinfo(self):
try:
def get_vifs(self):
client = self.ssh_cli_connect()
cmd = "vifS"
if self.mode:
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
f"cmd --value \"{cmd}\" "
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
client.close()
allure.attach(name="vif state Output Msg: ", body=str(output))
allure.attach(name="vif state Err Msg: ", body=str(stderr))
return output
def get_vlan(self):
stdout = self.get_vifs()
vlan_list = []
for i in stdout.splitlines():
vlan = str(i.strip()).replace("|", ".").split(".")
try:
if not vlan[0].find("b'vlan_id"):
vlan_list.append(vlan[1].strip())
except:
pass
return vlan_list
client = self.ssh_cli_connect()
cmd = "iwinfo"
if self.mode:
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
f"cmd --value \"{cmd}\" "
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read().replace(b":~# iwinfo", b"").decode('utf-8')
o = output.split()
iwinfo_bssid_data = {}
for i in range(len(o)):
if o[i].__contains__("ESSID"):
if o[i + 9].__contains__("2.4"):
band = "2G"
else:
band = "5G"
iwinfo_bssid_data[o[i - 1]] = [o[i + 4], band]
client.close()
except Exception as e:
iwinfo_bssid_data = False
print(e)
return iwinfo_bssid_data
def logread(self):
try:
@@ -486,15 +531,15 @@ if __name__ == '__main__':
obj = {
'model': 'eap102',
'mode': 'wifi6',
'serial': '903cb39d6918',
'serial': '0000c1018812',
'jumphost': True,
'ip': "10.28.3.103", # 10.28.3.103
'ip': "10.28.3.100", # 10.28.3.103
'username': "lanforge",
'password': "pumpkin77",
'port': 22, # 22
'jumphost_tty': '/dev/ttyAP2',
'jumphost_tty': '/dev/ttyAP1',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/edgecore_eap102/20210625-edgecore_eap102-uCentral-trunk-4225122-upgrade.bin"
}
var = APNOS(credentials=obj, sdk="2.x")
r = var.get_uc_latest_config()
print(r)
var = APNOS(credentials=obj, sdk="1.x")
x = var.get_interface_details()
print(x)

View File

@@ -24,6 +24,9 @@ sys.path.append(f'../libs')
sys.path.append(f'../libs/lanforge/')
from sta_connect2 import StaConnect2
import time
import string
import random
S = 12
# from eap_connect import EAPConnect
from test_ipv4_ttls import TTLSTest
from lf_wifi_capacity_test import WiFiCapacityTest
@@ -200,42 +203,44 @@ class RunTest:
self.eap_connect.cleanup(station_name)
return self.eap_connect.passes()
def wifi_capacity(self, mode="BRIDGE", vlan_id=100, instance_name="wct_instance", stations=None):
def wifi_capacity(self, mode="BRIDGE", vlan_id=100, instance_name="wct_instance", download_rate="1Gbps",
upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000"):
instance_name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=S))
if mode == "BRIDGE":
self.client_connect.upstream_port = self.upstream_port
upstream_port = self.upstream_port
elif mode == "NAT":
self.client_connect.upstream_port = self.upstream_port
upstream_port = self.upstream_port
elif mode == "VLAN":
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
upstream_port = self.upstream_port + "." + str(vlan_id)
'''SINGLE WIFI CAPACITY using lf_wifi_capacity.py'''
wificapacity_obj = WiFiCapacityTest(lfclient_host=self.lanforge_ip,
lf_port=self.lanforge_port,
lf_user="lanforge",
lf_password="lanforge",
local_lf_report_dir=self.local_report_path,
instance_name=instance_name,
config_name="wifi_config",
upstream="1.1." + self.upstream_port,
batch_size="1",
loop_iter="1",
protocol="UDP-IPv4",
duration="3000",
pull_report=True,
load_old_cfg=False,
upload_rate="10Mbps",
download_rate="1Gbps",
sort="interleave",
stations=stations,
create_stations=False,
radio=None,
security=None,
paswd=None,
ssid=None,
enables=[],
disables=[],
raw_lines=[],
raw_lines_file="",
sets=[])
lf_port=self.lanforge_port,
lf_user="lanforge",
lf_password="lanforge",
local_lf_report_dir=self.local_report_path,
instance_name=instance_name,
config_name="wifi_config",
upstream="1.1." + upstream_port,
batch_size="1,5,10,20,40,64",
loop_iter="1",
protocol=protocol,
duration=duration,
pull_report=True,
load_old_cfg=False,
upload_rate=upload_rate,
download_rate=download_rate,
sort="interleave",
# stations=stations,
create_stations=True,
radio=None,
security=None,
paswd=None,
ssid=None,
enables=[],
disables=[],
raw_lines=[],
raw_lines_file="",
sets=[])
wificapacity_obj.setup()
wificapacity_obj.run()
@@ -282,18 +287,25 @@ class RunTest:
return True
def dataplane(self, station_name=None, mode="BRIDGE", vlan_id=100, download_rate="85%", dut_name="TIP",
upload_rate="85%", duration="1m", instance_name="test_demo"):
upload_rate="0", duration="15s", instance_name="test_demo", raw_lines=None):
instance_name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=S))
if mode == "BRIDGE":
self.client_connect.upstream_port = self.upstream_port
elif mode == "NAT":
self.client_connect.upstream_port = self.upstream_port
else:
elif mode == "VLAN":
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
if raw_lines is None:
raw_lines = [['pkts: 60;142;256;512;1024;MTU;4000'], ['directions: DUT Transmit;DUT Receive'],
['traffic_types: UDP;TCP'],
["show_3s: 1"], ["show_ll_graphs: 1"], ["show_log: 1"]]
self.dataplane_obj = DataplaneTest(lf_host=self.lanforge_ip,
lf_port=self.lanforge_port,
ssh_port=self.lf_ssh_port,
local_path=self.local_report_path,
local_lf_report_dir=self.local_report_path,
lf_user="lanforge",
lf_password="lanforge",
instance_name=instance_name,
@@ -306,61 +318,63 @@ class RunTest:
duration=duration,
dut=dut_name,
station="1.1." + station_name[0],
raw_lines=[['pkts: Custom;60;142;256;512;1024;MTU'],
['directions: DUT Transmit;DUT Receive'],
['traffic_types: UDP;TCP'], ["show_3s: 1"],
["show_ll_graphs: 1"], ["show_log: 1"]],
)
raw_lines=raw_lines)
self.dataplane_obj.setup()
self.dataplane_obj.run()
report_name = self.dataplane_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
influx = CSVtoInflux(influxdb=self.influxdb,
_influx_tag=self.influx_params["influx_tag"],
influx = CSVtoInflux(influxdb=self.influxdb, _influx_tag=self.influx_params["influx_tag"],
target_csv=self.local_report_path + report_name + "/kpi.csv")
influx.post_to_influx()
return self.dataplane_obj
def dualbandperformancetest(self,ssid_5G="[BLANK]",ssid_2G="[BLANK]",mode="BRIDGE", vlan_id=100,dut_name="TIP",
instance_name="test_demo"):
def dualbandperformancetest(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))
if mode == "BRIDGE":
self.client_connect.upstream_port = self.upstream_port
self.upstream_port = self.upstream_port
elif mode == "NAT":
self.client_connect.upstream_port = self.upstream_port
self.upstream_port = self.upstream_port
else:
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
self.upstream_port = self.upstream_port + "." + str(vlan_id)
self.dualbandptest_obj = ApAutoTest(lf_host=self.lanforge_ip,
lf_port=self.lanforge_port,
lf_user="lanforge",
lf_password="lanforge",
instance_name=instance_name,
config_name="dbp_config",
upstream="1.1." + self.upstream_port,
pull_report=True,
dut5_0=dut_name + ' ' + ssid_5G,
dut2_0=dut_name + ' ' + ssid_2G,
load_old_cfg=False,
max_stations_2=1,
max_stations_5=1,
max_stations_dual=2,
radio2=[["1.1.wiphy0"]],
radio5=[["1.1.wiphy1"]],
sets=[['Basic Client Connectivity', '0'], ['Multi Band Performance', '1'],
['Throughput vs Pkt Size', '0'], ['Capacity', '0'], ['Stability', '0'],
['Band-Steering', '0'], ['Multi-Station Throughput vs Pkt Size', '0'],
['Long-Term', '0']]
)
lf_port=self.lanforge_port,
lf_user="lanforge",
lf_password="lanforge",
instance_name=instance_name,
config_name="dbp_config",
upstream="1.1." + self.upstream_port,
pull_report=True,
dut5_0=dut_5g,
dut2_0=dut_2g,
load_old_cfg=False,
local_lf_report_dir=self.local_report_path,
max_stations_2=64,
max_stations_5=64,
max_stations_dual=124,
radio2=[self.twog_radios],
radio5=[self.fiveg_radios],
sets=[['Basic Client Connectivity', '0'], ['Multi Band Performance', '1'],
['Throughput vs Pkt Size', '0'], ['Capacity', '0'],
['Skip 2.4Ghz Tests', '1'],
['Skip 5Ghz Tests', '1'],
['Stability', '0'],
['Band-Steering', '0'], ['Multi-Station Throughput vs Pkt Size', '0'],
['Long-Term', '0']]
)
self.dualbandptest_obj.setup()
self.dualbandptest_obj.run()
report_name = self.dataplane_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
influx = CSVtoInflux(influxdb=self.influxdb,
_influx_tag=self.influx_params["influx_tag"],
target_csv=self.local_report_path + report_name + "/kpi.csv")
influx.post_to_influx()
report_name = self.dualbandptest_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
# influx = CSVtoInflux(influxdb=self.influxdb,
# _influx_tag=self.influx_params["influx_tag"],
# target_csv=self.local_report_path + report_name + "/kpi.csv")
# influx.post_to_influx()
return self.dualbandptest_obj
if __name__ == '__main__':
lanforge_data = {
"ip": "localhost",

View File

@@ -1,3 +1,6 @@
import re
import allure
from create_chamberview import CreateChamberview
from create_chamberview_dut import DUT
import time
@@ -6,6 +9,7 @@ import json
import os
import pandas as pd
class ChamberView:
def __init__(self, lanforge_data=None, access_point_data=None, debug=True, testbed=None):
@@ -28,7 +32,8 @@ class ChamberView:
self.scenario_name = "TIP-" + self.testbed
self.debug = debug
self.exit_on_error = False
self.dut_idx_mapping = {}
self.ssid_list = []
self.raw_line = [
["profile_link " + self.upstream_resources + " upstream-dhcp 1 NA NA " + self.upstream_port.split(".")
[2] + ",AUTO -1 NA"],
@@ -57,6 +62,15 @@ class ChamberView:
)
self.CreateDut.ssid = []
def reset_scenario(self):
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"]
]
self.Chamber_View()
def Chamber_View(self):
if self.delete_old_scenario:
self.CreateChamberview.clean_cv_scenario(type="Network-Connectivity", scenario_name=self.scenario_name)
@@ -70,6 +84,38 @@ class ChamberView:
self.CreateChamberview.sync_cv()
return self.CreateChamberview, self.scenario_name
def add_stations(self, band="2G", num_stations="max", dut="NA", ssid_name=[]):
idx = 0
print(self.dut_idx_mapping)
for i in self.dut_idx_mapping:
if self.dut_idx_mapping[i][0] == ssid_name and self.dut_idx_mapping[i][3] == band:
idx = i
max_stations = 0
print(idx)
if band == "2G":
max_stations = 64 * len(self.twog_radios)
radio = ",".join(self.twog_radios)
if len(self.twog_radios) == 1:
radio = radio + ",AUTO"
# self.eap_connect.sta_prefix = self.twog_prefix
if band == "5G":
max_stations = 64 * len(self.twog_radios)
radio = ",".join(self.fiveg_radios)
if len(self.fiveg_radios) == 1:
radio = radio + ",AUTO"
if band == "ax":
max_stations = len(self.twog_radios)
radio = ",".join(self.fiveg_radios)
if len(self.fiveg_radios) == 1:
radio = radio + ",AUTO"
# self.eap_connect.sta_prefix = self.fiveg_prefix
if num_stations != "max":
max_stations = num_stations
station_data = ["profile_link 1.1 STA-AUTO " + str(max_stations) + " 'DUT: " + dut + " Radio-" + str(int(idx)+1) + "'" + " NA " + radio]
self.raw_line.append(station_data)
def Create_Dut(self):
self.CreateDut.setup()
self.CreateDut.add_ssids()
@@ -95,12 +141,6 @@ class ChamberView:
json_response = cli_base.json_get(_req_url=_req_url)
return json_response
def add_stations(self, num_stations=5):
self.CreateChamberview.setup(create_scenario=self.scenario_name,
raw_line=self.raw_line)
return True
def json_post(self, req_url, shelf, resources, port, current, intrest):
data = {
"shelf": shelf,
@@ -112,7 +152,7 @@ class ChamberView:
cli_base = LFCliBase(_lfjson_host=self.lanforge_ip, _lfjson_port=self.lanforge_port, )
return cli_base.json_post(req_url, data)
def read_kpi_file(self, column_name, dir_name ):
def read_kpi_file(self, column_name, dir_name):
if column_name == None:
df = pd.read_csv("../reports/" + str(dir_name) + "/kpi.csv", sep=r'\t', engine='python')
if df.empty == True:
@@ -120,14 +160,36 @@ class ChamberView:
else:
return df
else:
df = pd.read_csv("../reports/" + str(dir_name) + "/kpi.csv", sep=r'\t', usecols=column_name, engine='python')
df = pd.read_csv("../reports/" + str(dir_name) + "/kpi.csv", sep=r'\t', usecols=column_name,
engine='python')
if df.empty == True:
return "empty"
else:
return df
def attach_report_graphs(self, report_name=None, pdf_name="WIFI Capacity Test PDF Report"):
relevant_path = "../reports/" + report_name + "/"
entries = os.listdir("../reports/" + report_name + '/')
pdf = False
for i in entries:
if ".pdf" in i:
pdf = i
if pdf:
allure.attach.file(source=relevant_path + pdf,
name=pdf_name)
included_extensions = ['png']
file_names = [fn for fn in os.listdir(relevant_path)
if any(fn.endswith(ext) for ext in included_extensions)]
a = [item for item in file_names if 'print' not in item]
a = [item for item in a if 'logo' not in item]
a = [item for item in a if 'Logo' not in item]
a = [item for item in a if 'candela' not in item]
a.sort()
for i in a:
allure.attach.file(source=relevant_path + i,
name=i,
attachment_type="image/png", extension=None)

View File

@@ -258,3 +258,78 @@ RADIUS_ACCOUNTING_DATA = {
"password": "password",
"pk_password": "whatever"
}
PASSPOINT_RADIUS_SERVER_DATA = {
"ip": "52.234.179.191",
"port": 11812,
"secret": "yeababy20!",
"user": "nolaradius",
"password": "nolastart",
"pk_password": "whatever"
}
PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA = {
"ip": "52.234.179.191",
"port": 11813,
"secret": "yeababy20!"
}
PASSPOINT_PROVIDER_INFO = {
"mcc": None,
"mnc": None,
"network": None,
"nai_realms": {
"domain": "oss.ameriband.com",
"encoding": 0,
"eap_map": {"EAP-TTLS with username/password": ["Credential Type:username/password",
"Non-EAP Inner Authentication Type:MSCHAPV2"]}
},
"osu_nai_standalone": "anonymous@ameriband.com",
"osu_nai_shared": "anonymous@ameriband.com",
"roaming_oi": []
}
PASSPOINT_OPERATOR_INFO = {
"osen": "Disabled",
"domain_name_list": ["telecominfraproject.atlassian.net"],
"operator_names": [
{"locale": "eng", "name": "Default friendly passpoint_operator name"},
{"locale": "fra", "name": "Nom de l'opérateur convivial par défaut"}
]
}
PASSPOINT_VENUE_INFO = {
"venue_type": {"group": "Business", "type": "Police Station"},
"venue_names": [
{"locale": "eng", "name": "Example passpoint_venue", "url": "http://www.example.com/info-eng"},
{"locale": "fra", "name": "Exemple de lieu", "url": "http://www.example.com/info-fra"}
]
}
PASSPOINT_PROFILE_INFO = {
"profile_download_url_ios": "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig",
"profile_download_url_android": "https://onboard.almondlabs.net/ttls/androidconfig.cfg",
"profile_name_on_device": "AmeriBand",
"radius_configuration": {
"user_defined_nas_id": "FB001AP001",
"operator_id": "AmeribandTIP",
"radius_acounting_service_interval": 60
},
"interworking_hs2dot0": "Enabled",
"hessid": None,
"access_network": {
"Access Network Type": "Free Public Network",
"Authentication Type": "Acceptance of Terms & Conditions",
"Emergency Services Reachable": "Enabled",
"Unauthenticated Emergency Service": "Disabled",
},
"ip_connectivity": {
"Internet Connectivity": "Enabled",
"IP Address Type": "Public IPv4 Address Available",
"Connection Capability": [{"status": "open", "protocol": "TCP", "port": 8888}],
"ANQP Domain ID": 1234,
"GAS Address 3 Behaviour": "P2P Spec Workaround From Request",
"Disable DGAF": False
}
}

View File

@@ -53,6 +53,7 @@ def setup_vlan():
allure.attach(body=str(vlan_id), name="VLAN Created: ")
yield vlan_id[0]
@pytest.fixture(scope="class")
def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment_id,
instantiate_profile, get_markers, create_lanforge_chamberview_dut, lf_tools,
@@ -126,7 +127,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
# Radius Profile Creation
if parameter["radius"]:
radius_info = radius_info
radius_info["name"] = testbed + "-Automation-Radius-Profile-" + testbed
radius_info["name"] = testbed + "-Automation-Radius-Profile-" + mode
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + mode)
try:
instantiate_profile.create_radius_profile(radius_info=radius_info)
@@ -145,379 +146,292 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
# print(j)
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
test_cases["open_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
test_cases["open_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["open_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
test_cases["open_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["open_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
if mode == "wpa":
for j in profile_data["ssid"][mode]:
# print(j)
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa_ssid_profile(profile_data=j)
test_cases["wpa_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_wpa_ssid_profile(profile_data=j)
test_cases["wpa_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa_ssid_profile(profile_data=j)
test_cases["wpa_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
if mode == "wpa2_personal":
for j in profile_data["ssid"][mode]:
# print(j)
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j)
test_cases["wpa2_personal_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j)
test_cases["wpa2_personal_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa2_personal_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j)
test_cases["wpa2_personal_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa2_personal_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
if mode == "wpa_wpa2_personal_mixed":
for j in profile_data["ssid"][mode]:
# print(j)
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa_wpa2_personal_mixed_ssid_profile(
profile_data=j)
test_cases["wpa_wpa2_personal_mixed_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_wpa_wpa2_personal_mixed_ssid_profile(
profile_data=j)
test_cases["wpa_wpa2_personal_mixed_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa_wpa2_personal_mixed_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa_wpa2_personal_mixed_ssid_profile(
profile_data=j)
test_cases["wpa_wpa2_personal_mixed_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa_wpa2_personal_mixed_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
if mode == "wpa3_personal":
for j in profile_data["ssid"][mode]:
print(j)
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa3_personal_ssid_profile(profile_data=j)
test_cases["wpa3_personal_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_wpa3_personal_ssid_profile(profile_data=j)
test_cases["wpa3_personal_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa3_personal_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa3_personal_ssid_profile(profile_data=j)
test_cases["wpa3_personal_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa3_personal_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
if mode == "wpa3_personal_mixed":
for j in profile_data["ssid"][mode]:
print(j)
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa3_personal_mixed_ssid_profile(
profile_data=j)
test_cases["wpa3_personal_mixed_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_wpa3_personal_mixed_ssid_profile(
profile_data=j)
test_cases["wpa3_personal_mixed_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa3_personal_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa3_personal_mixed_ssid_profile(
profile_data=j)
test_cases["wpa3_personal_mixed_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa3_personal_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
if mode == "wpa_enterprise":
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa_enterprise_ssid_profile(profile_data=j)
test_cases["wpa_enterprise_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_wpa_enterprise_ssid_profile(profile_data=j)
test_cases["wpa_enterprise_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa_enterprise_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa_enterprise_ssid_profile(profile_data=j)
test_cases["wpa_enterprise_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa_enterprise_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
if mode == "wpa2_enterprise":
for j in profile_data["ssid"][mode]:
# print(j)
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(
profile_data=j)
test_cases["wpa2_enterprise_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=j)
test_cases["wpa2_enterprise_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa2_enterprise_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(
profile_data=j)
test_cases["wpa2_enterprise_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa2_enterprise_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
if mode == "wpa3_enterprise":
for j in profile_data["ssid"][mode]:
# print(j)
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa3_enterprise_ssid_profile(
profile_data=j)
test_cases["wpa3_enterprise_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_wpa3_enterprise_ssid_profile(profile_data=j)
test_cases["wpa3_enterprise_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa3_enterprise_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa3_enterprise_ssid_profile(
profile_data=j)
test_cases["wpa3_enterprise_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa3_enterprise_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
if mode == "wpa_wpa2_enterprise_mixed":
for j in profile_data["ssid"][mode]:
# print(j)
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa_wpa2_enterprise_mixed_ssid_profile(
profile_data=j)
test_cases["wpa_wpa2_enterprise_mixed_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_wpa_wpa2_enterprise_mixed_ssid_profile(
profile_data=j)
test_cases["wpa_wpa2_enterprise_mixed_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa_wpa2_enterprise_mixed_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa_wpa2_enterprise_mixed_ssid_profile(
profile_data=j)
test_cases["wpa_wpa2_enterprise_mixed_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa_wpa2_enterprise_mixed_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
if mode == "wpa3_enterprise_mixed":
for j in profile_data["ssid"][mode]:
# print(j)
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa3_enterprise_mixed_ssid_profile(
profile_data=j)
test_cases["wpa3_enterprise_mixed_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_wpa3_enterprise_mixed_ssid_profile(
profile_data=j)
test_cases["wpa3_enterprise_mixed_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa3_enterprise_mixed_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wpa3_enterprise_mixed_ssid_profile(
profile_data=j)
test_cases["wpa3_enterprise_mixed_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa3_enterprise_mixed_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
if mode == "wep":
for j in profile_data["ssid"][mode]:
# print(j)
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wep_ssid_profile(profile_data=j)
test_cases["wpa3_enterprise_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GU", "is5GHzU")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5GL", "is5GHzL")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("5G", "is5GHz")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("2G", "is2dot4GHz")
creates_profile = instantiate_profile.create_wep_ssid_profile(profile_data=j)
test_cases["wpa3_enterprise_2g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa3_enterprise_2g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
lf_dut_data.append(j)
creates_profile = instantiate_profile.create_wep_ssid_profile(profile_data=j)
test_cases["wpa3_enterprise_5g"] = True
allure.attach(body=str(creates_profile),
name="SSID Profile Created")
except Exception as e:
print(e)
test_cases["wpa3_enterprise_5g"] = False
allure.attach(body=str(e),
name="SSID Profile Creation Failed")
# Equipment AP Profile Creation
try:
instantiate_profile.set_ap_profile(profile_data=profile_data['equipment_ap'])
@@ -539,11 +453,14 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
print("failed to create AP Profile")
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
# ssid_names = []
# for i in instantiate_profile.profile_creation_ids["ssid"]:
# ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i))
# ssid_names.sort()
ssid_names = []
for i in instantiate_profile.profile_creation_ids["ssid"]:
ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i))
for i in lf_dut_data:
ssid_names.append(i["ssid_name"])
ssid_names.sort()
# This loop will check the VIF Config with cloud profile
vif_config = []
test_cases['vifc'] = False
@@ -577,16 +494,52 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
allure.attach(body=str("VIF Config: " + str(vif_config) + "\n" + "VIF State: " + str(vif_state)),
name="SSID Profiles in VIF Config and VIF State: ")
ap_logs = ap_ssh.logread()
allure.attach(body=ap_logs, name="AP LOgs: ")
ssid_info = ap_ssh.get_ssid_info()
ssid_data = []
print(ssid_info)
band_mapping = ap_ssh.get_bssid_band_mapping()
print(band_mapping)
idx_mapping = {}
for i in range(0, len(ssid_info)):
if ssid_info[i][1] == "OPEN":
ssid_info[i].append("")
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] +
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
ssid_data.append(ssid)
if ssid_info[i][1] == "OPEN":
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=OPEN" +
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]],
ssid_info[i][0]]
if ssid_info[i][1] == "WPA":
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA" +
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]],
ssid_info[i][0]]
if ssid_info[i][1] == "WPA2":
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA2" +
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]],
ssid_info[i][0]]
if ssid_info[i][1] == "WPA3_PERSONAL":
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA3" +
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]],
ssid_info[i][0]]
if ssid_info[i][1] == "WPA | WPA2":
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=WPA|WPA2" +
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]],
ssid_info[i][0]]
if ssid_info[i][1] == "EAP-TTLS":
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] + " security=EAP-TTLS" +
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
idx_mapping[str(i)] = [ssid_info[i][3], ssid_info[i][2], ssid_info[i][1], band_mapping[ssid_info[i][0]],
ssid_info[i][0]]
ssid_data.append(ssid)
lf_tools.dut_idx_mapping = idx_mapping
# Add bssid password and security from iwinfo data
# Format SSID Data in the below format
# ssid_data = [
@@ -645,14 +598,12 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzU", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzL", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHz", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is2dot4GHz", "2G")
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
j["appliedRadios"] = list(set(j["appliedRadios"]))
j['security'] = 'none'
lf_dut_data.append(j)
creates_profile = instantiate_profile_obj.add_ssid(ssid_data=j)
test_cases["wpa_2g"] = True
allure.attach(body=str(creates_profile),
@@ -666,14 +617,12 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzU", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzL", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHz", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is2dot4GHz", "2G")
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
j["appliedRadios"] = list(set(j["appliedRadios"]))
j['security'] = 'psk'
lf_dut_data.append(j)
creates_profile = instantiate_profile_obj.add_ssid(ssid_data=j)
test_cases["wpa_2g"] = True
allure.attach(body=str(creates_profile),
@@ -687,15 +636,12 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzU", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzL", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHz", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is2dot4GHz", "2G")
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
j["appliedRadios"] = list(set(j["appliedRadios"]))
j['security'] = 'psk2'
lf_dut_data.append(j)
print("shivam: ", j)
creates_profile = instantiate_profile_obj.add_ssid(ssid_data=j)
test_cases["wpa_2g"] = True
allure.attach(body=str(creates_profile),
@@ -709,15 +655,12 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzU", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzL", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHz", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is2dot4GHz", "2G")
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
j["appliedRadios"] = list(set(j["appliedRadios"]))
j['security'] = 'psk-mixed'
lf_dut_data.append(j)
print("shivam: ", j)
creates_profile = instantiate_profile_obj.add_ssid(ssid_data=j)
test_cases["wpa_2g"] = True
allure.attach(body=str(creates_profile),
@@ -731,15 +674,12 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzU", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzL", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHz", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is2dot4GHz", "2G")
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
j["appliedRadios"] = list(set(j["appliedRadios"]))
j['security'] = 'sae'
lf_dut_data.append(j)
print("shivam: ", j)
creates_profile = instantiate_profile_obj.add_ssid(ssid_data=j)
test_cases["wpa_2g"] = True
allure.attach(body=str(creates_profile),
@@ -753,15 +693,12 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzU", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzL", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHz", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is2dot4GHz", "2G")
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
j["appliedRadios"] = list(set(j["appliedRadios"]))
j['security'] = 'sae-mixed'
lf_dut_data.append(j)
print("shivam: ", j)
creates_profile = instantiate_profile_obj.add_ssid(ssid_data=j)
test_cases["wpa_2g"] = True
allure.attach(body=str(creates_profile),
@@ -777,15 +714,12 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
for i in range(len(j["appliedRadios"])):
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzU", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHzL", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is5GHz", "5G")
j["appliedRadios"][i] = j["appliedRadios"][i].replace("is2dot4GHz", "2G")
if j["appliedRadios"].__contains__("2G"):
lf_dut_data.append(j)
if j["appliedRadios"].__contains__("5G"):
lf_dut_data.append(j)
j["appliedRadios"] = list(set(j["appliedRadios"]))
j['security'] = 'wpa2'
lf_dut_data.append(j)
RADIUS_SERVER_DATA = radius_info
RADIUS_ACCOUNTING_DATA = radius_accounting_info
creates_profile = instantiate_profile_obj.add_ssid(ssid_data=j, radius=True,
@@ -810,7 +744,8 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
ap_config_latest = ap_ssh.get_uc_latest_config()
try:
ap_config_latest["uuid"] = 0
except:
except Exception as e:
print(e)
pass
x = 1
while ap_config_latest != config:
@@ -851,9 +786,115 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
else:
print("AP is Not Broadcasting Applied Config")
allure.attach(name="Config Info", body="AP is Not Broadcasting Applied Config: " + str(allure_body))
yield True
ap_logs = ap_ssh.logread()
allure.attach(body=ap_logs, name="AP LOgs: ")
ap_wifi_data = ap_ssh.get_interface_details()
idx_mapping = {}
ssid_data = []
ap_interfaces = list(ap_wifi_data.keys())
for interface in range(len(ap_interfaces)):
if ap_wifi_data[ap_interfaces[interface]][1] == "none":
ssid = ["ssid_idx=" + str(interface) +
" ssid=" + ap_wifi_data[ap_interfaces[interface]][0] +
" security=OPEN" +
" password=" + ap_wifi_data[ap_interfaces[interface]][2] +
" bssid=" + ap_wifi_data[ap_interfaces[interface]][3][0]
]
idx_mapping[str(i)] = [ap_wifi_data[ap_interfaces[interface]][0],
ap_wifi_data[ap_interfaces[interface]][2],
ap_wifi_data[ap_interfaces[interface]][1],
ap_wifi_data[ap_interfaces[interface]][3][1],
ap_wifi_data[ap_interfaces[interface]][3][0]
]
# pass
if ap_wifi_data[ap_interfaces[interface]][1] == "psk":
ssid = ["ssid_idx=" + str(interface) +
" ssid=" + ap_wifi_data[ap_interfaces[interface]][0] +
" security=WPA" +
" password=" + ap_wifi_data[ap_interfaces[interface]][2] +
" bssid=" + ap_wifi_data[ap_interfaces[interface]][3][0]
]
idx_mapping[str(i)] = [ap_wifi_data[ap_interfaces[interface]][0],
ap_wifi_data[ap_interfaces[interface]][2],
ap_wifi_data[ap_interfaces[interface]][1],
ap_wifi_data[ap_interfaces[interface]][3][1],
ap_wifi_data[ap_interfaces[interface]][3][0]
]
# pass
if ap_wifi_data[ap_interfaces[interface]][1] == "psk-mixed":
ssid = ["ssid_idx=" + str(interface) +
" ssid=" + ap_wifi_data[ap_interfaces[interface]][0] +
" security=WPA|WPA2" +
" password=" + ap_wifi_data[ap_interfaces[interface]][2] +
" bssid=" + ap_wifi_data[ap_interfaces[interface]][3][0]
]
idx_mapping[str(i)] = [ap_wifi_data[ap_interfaces[interface]][0],
ap_wifi_data[ap_interfaces[interface]][2],
ap_wifi_data[ap_interfaces[interface]][1],
ap_wifi_data[ap_interfaces[interface]][3][1],
ap_wifi_data[ap_interfaces[interface]][3][0]
]
# pass
if ap_wifi_data[ap_interfaces[interface]][1] == "psk2":
ssid = ["ssid_idx=" + str(interface) +
" ssid=" + ap_wifi_data[ap_interfaces[interface]][0] +
" security=WPA2" +
" password=" + ap_wifi_data[ap_interfaces[interface]][2] +
" bssid=" + ap_wifi_data[ap_interfaces[interface]][3][0]
]
idx_mapping[str(i)] = [ap_wifi_data[ap_interfaces[interface]][0],
ap_wifi_data[ap_interfaces[interface]][2],
ap_wifi_data[ap_interfaces[interface]][1],
ap_wifi_data[ap_interfaces[interface]][3][1],
ap_wifi_data[ap_interfaces[interface]][3][0]
]
# pass
if ap_wifi_data[ap_interfaces[interface]][1] == "sae":
ssid = ["ssid_idx=" + str(interface) +
" ssid=" + ap_wifi_data[ap_interfaces[interface]][0] +
" security=WPA3" +
" password=" + ap_wifi_data[ap_interfaces[interface]][2] +
" bssid=" + ap_wifi_data[ap_interfaces[interface]][3][0]
]
idx_mapping[str(i)] = [ap_wifi_data[ap_interfaces[interface]][0],
ap_wifi_data[ap_interfaces[interface]][2],
ap_wifi_data[ap_interfaces[interface]][1],
ap_wifi_data[ap_interfaces[interface]][3][1],
ap_wifi_data[ap_interfaces[interface]][3][0]
]
# pass
if ap_wifi_data[ap_interfaces[interface]][1] == "sae-mixed":
ssid = ["ssid_idx=" + str(interface) +
" ssid=" + ap_wifi_data[ap_interfaces[interface]][0] +
" security=WPA3" +
" password=" + ap_wifi_data[ap_interfaces[interface]][2] +
" bssid=" + ap_wifi_data[ap_interfaces[interface]][3][0]
]
idx_mapping[str(i)] = [ap_wifi_data[ap_interfaces[interface]][0],
ap_wifi_data[ap_interfaces[interface]][2],
ap_wifi_data[ap_interfaces[interface]][1],
ap_wifi_data[ap_interfaces[interface]][3][1],
ap_wifi_data[ap_interfaces[interface]][3][0]
]
# pass
else:
ssid = ["ssid_idx=" + str(interface) +
" ssid=" + ap_wifi_data[ap_interfaces[interface]][0] +
" security=EAP-TTLS" +
" password=" + ap_wifi_data[ap_interfaces[interface]][2] +
" bssid=" + ap_wifi_data[ap_interfaces[interface]][3][0]
]
idx_mapping[str(i)] = [ap_wifi_data[ap_interfaces[interface]][0],
ap_wifi_data[ap_interfaces[interface]][2],
ap_wifi_data[ap_interfaces[interface]][1],
ap_wifi_data[ap_interfaces[interface]][3][1],
ap_wifi_data[ap_interfaces[interface]][3][0]
]
# pass
ssid_data.append(ssid)
lf_tools.ssid_list.append(ap_wifi_data[ap_interfaces[interface]][0])
lf_tools.dut_idx_mapping = idx_mapping
yield test_cases
@pytest.fixture(scope="session")
@@ -887,7 +928,7 @@ def num_stations(request):
@pytest.fixture(scope="class")
def get_vif_state(get_apnos, get_configuration, request):
def get_vif_state(get_apnos, get_configuration, request, lf_tools):
if request.config.getoption("1.x"):
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
vif_state = list(ap_ssh.get_vif_state_ssids())
@@ -895,7 +936,7 @@ def get_vif_state(get_apnos, get_configuration, request):
allure.attach(name="vif_state", body=str(vif_state))
yield vif_state
else:
yield []
yield lf_tools.ssid_list
@pytest.fixture(scope="class")
@@ -905,5 +946,3 @@ def get_vlan_list(get_apnos, get_configuration):
vlan_list.sort()
allure.attach(name="vlan_list", body=str(vlan_list))
yield vlan_list

View File

@@ -1,28 +1,28 @@
"""
Performance Test: Dataplane Throughput Test: Bridge Mode
pytest -m "dataplane_throughput_test and bridge"
Performance Test: Dataplane Throughput Test: BRIDGE Mode
pytest -m "dataplane_throughput_test and BRIDGE"
"""
import os
import pytest
import allure
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, pytest.mark.bridge] #, pytest.mark.usefixtures("setup_test_run")]
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test,
pytest.mark.bridge] #pytest.mark.usefixtures("setup_test_run")]
setup_params_general = {
"mode": "BRIDGE",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something"}]},
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"}]},
"rf": {},
"radius": False
}
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
@allure.suite("performance")
@allure.feature("BRIDGE MODE Dataplane Throughput Test")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
@@ -30,17 +30,18 @@ setup_params_general = {
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestDataplaneThroughputBridge(object):
"""Dataplane THroughput Bridge Mode
pytest -m "dataplane_throughput_test and bridge"
class TestDataplaneThroughputBRIDGE(object):
"""Dataplane THroughput BRIDGE Mode
pytest -m "dataplane_throughput_test and BRIDGE"
"""
@pytest.mark.wpa2_personal
@pytest.mark.twog
def test_client_wpa2_personal_2g(self, get_vif_state,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
"""Dataplane THroughput Bridge Mode
pytest -m "dataplane_throughput_test and bridge and wpa2_personal and twog"
def test_tcp_upd_2g_band(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
"""Dataplane THroughput BRIDGE Mode
pytest -m "dataplane_throughput_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
@@ -62,15 +63,7 @@ class TestDataplaneThroughputBridge(object):
instance_name="TIP_DPT_DPT_WPA2_2G_BRIDGE",
vlan_id=vlan, dut_name=dut_name)
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
pdf = False
for i in entries:
if ".pdf" in i:
pdf = i
if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
name=get_configuration["access_point"][0]["model"] + "_dataplane")
print("Test Completed... Cleaning up Stations")
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 2.4G")
lf_test.Client_disconnect(station_name=station_names_twog)
assert station
else:
@@ -78,10 +71,10 @@ class TestDataplaneThroughputBridge(object):
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
def test_client_wpa2_personal_5g(self, get_vif_state,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration):
"""Dataplane THroughput Bridge Mode
pytest -m "dataplane_throughput_test and bridge and wpa2_personal and fiveg"
def test_tcp_upd_5g_band(self, get_vif_state, lf_tools,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration):
"""Dataplane THroughput BRIDGE Mode
pytest -m "dataplane_throughput_test and BRIDGE and wpa2_personal and fiveg"
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
@@ -99,19 +92,13 @@ class TestDataplaneThroughputBridge(object):
station_name=station_names_fiveg, vlan_id=vlan)
if station:
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_DPT_DPT_WPA2_5G_BRIDGE",
vlan_id=vlan, dut_name=dut_name)
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode,
instance_name="TIP_DPT_DPT_WPA2_5G_BRIDGE",
vlan_id=vlan, dut_name=dut_name)
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/"+report_name + '/')
pdf = False
for i in entries:
if ".pdf" in i:
pdf = i
if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf, name=get_configuration["access_point"][0]["model"] + "_dataplane")
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 5G")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
assert station
else:
assert False

View File

@@ -8,20 +8,22 @@ import os
import pytest
import allure
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, pytest.mark.nat, pytest.mark.usefixtures("setup_test_run")]
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test,
pytest.mark.nat]# pytest.mark.usefixtures("setup_test_run")]
setup_params_general = {
"mode": "NAT",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something"}]},
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"}]},
"rf": {},
"radius": False
}
@allure.suite("performance")
@allure.feature("BRIDGE MODE Dataplane Throughput Test")
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
@@ -34,11 +36,12 @@ class TestDataplaneThroughputNAT(object):
"""Dataplane THroughput nat Mode
pytest -m "dataplane_throughput_test and nat"
"""
@pytest.mark.wpa2_personal
@pytest.mark.twog
def test_client_wpa2_personal_2g(self, get_vif_state,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
def test_tcp_upd_2g_band(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
"""Dataplane THroughput nat Mode
pytest -m "dataplane_throughput_test and nat and wpa2_personal and twog"
"""
@@ -50,6 +53,7 @@ class TestDataplaneThroughputNAT(object):
band = "twog"
vlan = 1
dut_name = create_lanforge_chamberview_dut
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -62,15 +66,7 @@ class TestDataplaneThroughputNAT(object):
instance_name="TIP_DPT_DPT_WPA2_2G_NAT",
vlan_id=vlan, dut_name=dut_name)
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
pdf = False
for i in entries:
if ".pdf" in i:
pdf = i
if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
name=get_configuration["access_point"][0]["model"] + "_dataplane")
print("Test Completed... Cleaning up Stations")
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 2.4G")
lf_test.Client_disconnect(station_name=station_names_twog)
assert station
else:
@@ -78,8 +74,8 @@ class TestDataplaneThroughputNAT(object):
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
def test_client_wpa2_personal_5g(self, get_vif_state,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration):
def test_tcp_upd_5g_band(self, get_vif_state, lf_tools,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration):
"""Dataplane THroughput nat Mode
pytest -m "dataplane_throughput_test and nat and wpa2_personal and fiveg"
"""
@@ -99,19 +95,13 @@ class TestDataplaneThroughputNAT(object):
station_name=station_names_fiveg, vlan_id=vlan)
if station:
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_DPT_DPT_WPA2_5G_NAT",
vlan_id=vlan, dut_name=dut_name)
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode,
instance_name="TIP_DPT_DPT_WPA2_5G_NAT",
vlan_id=vlan, dut_name=dut_name)
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/"+report_name + '/')
pdf = False
for i in entries:
if ".pdf" in i:
pdf = i
if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf, name=get_configuration["access_point"][0]["model"] + "_dataplane")
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 5G")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
assert station
else:
assert False

View File

@@ -1,117 +1,112 @@
"""
Performance Test: Dataplane Throughput Test: vlan Mode
pytest -m "dataplane_throughput_test and vlan"
"""
import os
import pytest
import allure
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, pytest.mark.vlan, pytest.mark.usefixtures("setup_test_run")]
setup_params_general = {
"mode": "VLAN",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something"}]},
"rf": {},
"radius": False
}
@allure.feature("VLAN MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestDataplaneThroughputVLAN(object):
"""Dataplane THroughput vlan Mode
pytest -m "dataplane_throughput_test and vlan"
"""
@pytest.mark.wpa2_personal
@pytest.mark.twog
def test_client_wpa2_personal_2g(self, get_vif_state,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
"""Dataplane THroughput vlan Mode
pytest -m "dataplane_throughput_test and vlan and wpa2_personal and twog"
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "twog"
vlan = 100
dut_name = create_lanforge_chamberview_dut
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_twog, vlan_id=vlan)
if station:
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
instance_name="TIP_DPT_DPT_WPA2_2G_VLAN",
vlan_id=vlan, dut_name=dut_name)
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/" + report_name + '/')
pdf = False
for i in entries:
if ".pdf" in i:
pdf = i
if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
name=get_configuration["access_point"][0]["model"] + "_dataplane")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_twog)
assert station
else:
assert False
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
def test_client_wpa2_personal_5g(self, get_vif_state,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration):
"""Dataplane THroughput vlan Mode
pytest -m "dataplane_throughput_test and vlan and wpa2_personal and fiveg"
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "fiveg"
vlan = 100
dut_name = create_lanforge_chamberview_dut
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_fiveg, vlan_id=vlan)
if station:
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode,
instance_name="TIP_DPT_DPT_WPA2_5G_VLAN", vlan_id=vlan, dut_name=dut_name)
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
entries = os.listdir("../reports/"+report_name + '/')
pdf = False
for i in entries:
if ".pdf" in i:
pdf = i
if pdf:
allure.attach.file(source="../reports/" + report_name + "/" + pdf, name=get_configuration["access_point"][0]["model"] + "_dataplane")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_fiveg)
assert station
else:
assert False
# """
#
# Performance Test: Dataplane Throughput Test: VLAN Mode
# pytest -m "dataplane_throughput_test and VLAN"
#
# """
# import os
# import pytest
# import allure
#
# pytestmark = [pytest.mark.performance,
# pytest.mark.vlan, pytest.mark.usefixtures("setup_test_run")]
#
# setup_params_general = {
# "mode": "VLAN",
# "ssid_modes": {
# "wpa2_personal": [
# {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something", "vlan": 100}]},
# "rf": {},
# "radius": False
# }
#
#
# @allure.suite("performance")
# @allure.feature("VLAN MODE Dataplane Throughput Test")
# @pytest.mark.parametrize(
# 'setup_profiles',
# [setup_params_general],
# indirect=True,
# scope="class"
# )
# @pytest.mark.usefixtures("setup_profiles")
# @pytest.mark.parametrize(
# 'create_vlan',
# [setup_params_general],
# indirect=True,
# scope="class"
# )
# @pytest.mark.usefixtures("create_vlan")
# class TestDataplaneThroughputVLAN(object):
# """Dataplane THroughput VLAN Mode
# pytest -m "dataplane_throughput_test and VLAN"
# """
#
# @pytest.mark.wpa2_personal
# @pytest.mark.twog
# def test_tcp_upd_2g_band(self, get_vif_state, lf_tools,
# lf_test, station_names_twog, create_lanforge_chamberview_dut,
# get_configuration):
# """Dataplane THroughput VLAN Mode
# pytest -m "dataplane_throughput_test and VLAN and wpa2_personal and twog"
# """
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
# ssid_name = profile_data["ssid_name"]
# security_key = profile_data["security_key"]
# security = "wpa2"
# mode = "VLAN"
# band = "twog"
# vlan = 100
# dut_name = create_lanforge_chamberview_dut
# if ssid_name not in get_vif_state:
# allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
# pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
# station = lf_test.Client_Connect(ssid=ssid_name, security=security,
# passkey=security_key, mode=mode, band=band,
# station_name=station_names_twog, vlan_id=vlan)
#
# if station:
# dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
# instance_name="TIP_DPT_DPT_WPA2_2G_VLAN",
# vlan_id=vlan, dut_name=dut_name)
# report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
# lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 2.4G")
# lf_test.Client_disconnect(station_name=station_names_twog)
# assert station
# else:
# assert False
#
# @pytest.mark.wpa2_personal
# @pytest.mark.fiveg
# def test_tcp_upd_5g_band(self, get_vif_state, lf_tools,
# lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration):
# """Dataplane THroughput VLAN Mode
# pytest -m "dataplane_throughput_test and VLAN and wpa2_personal and fiveg"
# """
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
# ssid_name = profile_data["ssid_name"]
# security_key = profile_data["security_key"]
# security = "wpa2"
# mode = "VLAN"
# band = "fiveg"
# vlan = 100
# dut_name = create_lanforge_chamberview_dut
# if ssid_name not in get_vif_state:
# allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
# pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
# station = lf_test.Client_Connect(ssid=ssid_name, security=security,
# passkey=security_key, mode=mode, band=band,
# station_name=station_names_fiveg, vlan_id=vlan)
#
# if station:
# dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode,
# instance_name="TIP_DPT_DPT_WPA2_5G_VLAN",
# vlan_id=vlan, dut_name=dut_name)
# report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
# lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 5G")
# print("Test Completed... Cleaning up Stations")
# lf_test.Client_disconnect(station_name=station_names_fiveg)
# assert station
# else:
# assert False