Added wifi6 rf capability, did some configuration fixes

This commit is contained in:
shivamcandela
2021-04-23 17:34:50 +05:30
parent 9b7a29b4ff
commit f4addf0f08
5 changed files with 58 additions and 28 deletions

View File

@@ -126,6 +126,7 @@ class APNOS:
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
status = str(output.decode('utf-8').splitlines())
print(output, stderr.read())
client.close()
except Exception as e:
print(e)

View File

@@ -323,13 +323,13 @@ class ProfileUtility:
self.push_profile_old_method(equipment_id=equipment_id)
self.delete_profile(profile_id=delete_ids)
# This will delete all the profiles on an controller_tests instance, except the default profiles
# This will delete all the profiles on an controller instance, except the default profiles
def cleanup_profiles(self):
try:
self.get_default_profiles()
pagination_context = """{
"model_type": "PaginationContext",
"maxItemsPerPage": 5000
"maxItemsPerPage": 10000
}"""
skip_delete_id = []
for i in self.default_profiles:
@@ -345,14 +345,13 @@ class ProfileUtility:
for i in self.default_profiles:
skip_delete_id.append(self.default_profiles[i]._id)
delete_ids = list(set(delete_ids) - set(delete_ids).intersection(set(skip_delete_id)))
print(delete_ids)
for i in delete_ids:
self.set_equipment_to_profile(profile_id=i)
try:
self.delete_profile(profile_id=delete_ids)
except Exception as e:
pass
status = True
except:
except Exception as e:
print(e)
status = False
return status
@@ -394,11 +393,36 @@ class ProfileUtility:
Library method to create a new rf profile: Now using default profile
"""
def set_rf_profile(self, profile_data=None):
def set_rf_profile(self, profile_data=None, mode=None):
self.get_default_profiles()
if mode == "wifi5":
default_profile = self.default_profiles['rf']
if profile_data is None:
self.profile_creation_ids['rf'].append(default_profile._id)
return default_profile
default_profile._name = profile_data["name"]
default_profile._details["rfConfigMap"]["is2dot4GHz"]["rf"] = profile_data["name"]
default_profile._details["rfConfigMap"]["is5GHz"]["rf"] = profile_data["name"]
default_profile._details["rfConfigMap"]["is5GHzL"]["rf"] = profile_data["name"]
default_profile._details["rfConfigMap"]["is5GHzU"]["rf"] = profile_data["name"]
profile = self.profile_client.create_profile(body=default_profile)
self.profile_creation_ids['rf'].append(profile._id)
return profile
if mode == "wifi6":
default_profile = self.default_profiles['rf']
default_profile._name = profile_data["name"]
default_profile._details["rfConfigMap"]["is2dot4GHz"]["activeScanSettings"]["enabled"] = False
default_profile._details["rfConfigMap"]["is2dot4GHz"]["radioMode"] = 'modeAX'
default_profile._details["rfConfigMap"]["is5GHz"]["radioMode"] = 'modeAX'
default_profile._details["rfConfigMap"]["is5GHzL"]["radioMode"] = 'modeAX'
default_profile._details["rfConfigMap"]["is5GHzU"]["radioMode"] = 'modeAX'
default_profile._details["rfConfigMap"]["is2dot4GHz"]["rf"] = profile_data["name"]
default_profile._details["rfConfigMap"]["is5GHz"]["rf"] = profile_data["name"]
default_profile._details["rfConfigMap"]["is5GHzL"]["rf"] = profile_data["name"]
default_profile._details["rfConfigMap"]["is5GHzU"]["rf"] = profile_data["name"]
default_profile._name = profile_data["name"]
profile = self.profile_client.create_profile(body=default_profile)
self.profile_creation_ids['rf'].append(profile._id)
return profile
"""
method call: used to create a ssid profile with the given parameters
@@ -798,3 +822,4 @@ class FirmwareUtility(JFrogUtility):
firmware_version = False
print("firmware not available: ", firmware_version)
return firmware_version

View File

@@ -1,5 +1,4 @@
CONFIGURATION = {
"ext-03": {
"controller": {
@@ -12,6 +11,7 @@ CONFIGURATION = {
'access_point': [
{
'model': 'ecw5410',
'mode' : "wifi5",
'serial': '903cb3944857',
'jumphost': True,
'ip': "192.168.200.80",
@@ -25,7 +25,7 @@ CONFIGURATION = {
"traffic_generator": {
"name": "lanforge",
"details": {
"ip": "localhost",
"ip": "192.168.200.80",
"port": 8080,
"2.4G-Radio": ["wiphy0"],
"5G-Radio": ["wiphy1"],
@@ -48,6 +48,7 @@ CONFIGURATION = {
'access_point': [
{
'model': 'ecw5410',
'mode': 'wifi5',
'serial': '903cb394486f',
'jumphost': True,
'ip': "192.168.200.81",
@@ -84,12 +85,13 @@ CONFIGURATION = {
'access_point': [
{
'model': 'ecw5410',
'mode': 'wifi5',
'serial': '903cb3944817',
'jumphost': True,
'ip': "192.168.200.82",
'username': "lanforge",
'password': "lanforge",
'port': 22,
'port': 8809,
'jumphost_tty': '/dev/ttyAP1',
'version': "version"
}
@@ -113,6 +115,7 @@ CONFIGURATION = {
}
FIRMWARE = {
# jFrog parameters
"JFROG":
@@ -192,3 +195,6 @@ TEST_CASES = {
"nat_ssid_update": 8743,
"vlan_ssid_update": 8744
}
# cmd = /bin/wlan_ap_redirector.sh ssl:opensync-redirector-nola-01.cicd.lab.wlan.tip.build:6643
# radius server
# radsec

View File

@@ -176,7 +176,7 @@ def setup_profiles(request, create_profiles, instantiate_profile, get_equipment_
@pytest.fixture(scope="module")
def create_profiles(request, get_security_flags, get_markers, instantiate_profile, setup_profile_data):
def create_profiles(request, testbed, get_security_flags, get_markers, instantiate_profile, setup_profile_data):
profile_id = {"ssid": [], "rf": None, "radius": None, "equipment_ap": None}
mode = str(request.param[0])
test_cases = {}
@@ -190,15 +190,12 @@ def create_profiles(request, get_security_flags, get_markers, instantiate_profil
profile_name=setup_profile_data[mode][i][j]['profile_name'])
instantiate_profile.delete_profile_by_name(profile_name="Automation-Radius-Profile-" + mode)
instantiate_profile.get_default_profiles()
# if get_markers["wifi5"]:
# # Create RF Profile
# pass
# if get_markers["wifi6"]:
# # Create RF Profile
# pass
profile_data = {
"name": "RF-Profile-"+CONFIGURATION[testbed]['access_point'][0]['mode']+CONFIGURATION[testbed]['access_point'][0]['model'] + mode
}
instantiate_profile.delete_profile_by_name(profile_name=profile_data['name'])
instantiate_profile.set_rf_profile(profile_data=profile_data, mode=CONFIGURATION[testbed]['access_point'][0]['mode'])
# Create RF Profile Here
instantiate_profile.set_rf_profile()
if get_markers["radius"]:
radius_info = RADIUS_SERVER_DATA
radius_info["name"] = "Automation-Radius-Profile-" + mode

View File

@@ -2,7 +2,8 @@
python_files = test_*.py setup_*.py
norecursedirs = .svn _build tmp*
addopts= --junitxml=test_everything.xml
log_format = %(asctime)s %(levelname)s %(message)s
log_date_format = %Y-%m-%d %H:%M:%S
num_stations=1