mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 03:48:09 +00:00
radius cases working, bridge nat
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
@@ -103,7 +103,7 @@ class CloudSDK(ConfigureCloudSDK):
|
||||
print("Connected to CloudSDK Server")
|
||||
|
||||
"""
|
||||
Login Utilities
|
||||
Login Utilitiesdefault_profile = self.default_profiles['ssid']
|
||||
"""
|
||||
|
||||
def get_bearer_token(self):
|
||||
@@ -115,7 +115,7 @@ class CloudSDK(ConfigureCloudSDK):
|
||||
def disconnect_cloudsdk(self):
|
||||
self.api_client.__del__()
|
||||
|
||||
"""
|
||||
"""default_profile = self.default_profiles['ssid']
|
||||
Equipment Utilities
|
||||
"""
|
||||
|
||||
@@ -208,7 +208,7 @@ class ProfileUtility:
|
||||
|
||||
def get_profile_by_id(self, profile_id=None):
|
||||
profiles = self.profile_client.get_profile_by_id(profile_id=profile_id)
|
||||
print(profiles)
|
||||
print(profiles._child_profile_ids)
|
||||
|
||||
def get_default_profiles(self):
|
||||
pagination_context = """{
|
||||
@@ -374,6 +374,8 @@ class ProfileUtility:
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
default_profile._details['secureMode'] = 'wpa2OnlyRadius'
|
||||
profile_id = self.profile_client.create_profile(body=default_profile)._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
@@ -398,6 +400,8 @@ class ProfileUtility:
|
||||
default_profile._details['keyStr'] = profile_data['security_key']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'wpa3OnlyRadius'
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
profile_id = self.profile_client.create_profile(body=default_profile)._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
@@ -428,14 +432,15 @@ class ProfileUtility:
|
||||
method call: used to create a radius profile with the settings given
|
||||
"""
|
||||
|
||||
def set_radius_profile(self, radius_info=None):
|
||||
default_profile = self.sdk_client.get_profile_template(customer_id=2, profile_name="Radius-Profile")
|
||||
def create_radius_profile(self, radius_info=None):
|
||||
# default_profile = self.sdk_client.get_profile_template(customer_id=self.sdk_client.customer_id, profile_name="Radius-Profile")
|
||||
default_profile = self.default_profiles['radius']
|
||||
default_profile._name = radius_info['name']
|
||||
default_profile._details['primaryRadiusAuthServer']['ipAddress'] = radius_info['ip']
|
||||
default_profile._details['primaryRadiusAuthServer']['port'] = radius_info['port']
|
||||
default_profile._details['primaryRadiusAuthServer']['secret'] = radius_info['secret']
|
||||
default_profile = self.profile_client.create_profile(body=default_profile)
|
||||
self.profile_creation_ids['radius'].append(default_profile._id)
|
||||
self.profile_creation_ids['radius'] = [default_profile._id]
|
||||
self.profile_ids.append(default_profile._id)
|
||||
|
||||
"""
|
||||
@@ -625,11 +630,40 @@ class FirmwareUtility(JFrogUtility):
|
||||
return firmware_version
|
||||
|
||||
|
||||
# from testbed_info import JFROG_CREDENTIALS
|
||||
# sdk_client = CloudSDK(testbed="nola-ext-03", customer_id=2)
|
||||
# profile_obj = ProfileUtility(sdk_client=sdk_client)
|
||||
# profile_obj.get_default_profiles()
|
||||
# profile_obj.set_rf_profile()
|
||||
# # print(profile_obj.default_profiles["ssid"]._id)
|
||||
# # profile_obj.get_profile_by_id(profile_id=profile_obj.default_profiles["ssid"]._id)
|
||||
# #
|
||||
# # print(profile_obj.default_profiles)default_profiles
|
||||
# radius_info = {
|
||||
# "name": "nola-ext-03" + "-RADIUS-Sanity",
|
||||
# "ip": "192.168.200.75",
|
||||
# "port": 1812,
|
||||
# "secret": "testing123"
|
||||
# }
|
||||
# profile_obj.create_radius_profile(radius_info=radius_info)
|
||||
# profile_data = {
|
||||
# "profile_name": "NOLA-ext-03-WPA2-Enterprise-2G",
|
||||
# "ssid_name": "NOLA-ext-03-WPA2-Enterprise-2G",
|
||||
# "vlan": 1,
|
||||
# "mode": "BRIDGE"
|
||||
# }
|
||||
# profile_obj.create_wpa2_enterprise_ssid_profile(profile_data=profile_data)
|
||||
# profile_data = {
|
||||
# "profile_name": "%s-%s-%s" % ("Nola-ext-03", "ecw5410", 'Bridge')
|
||||
# }
|
||||
# profile_obj.set_ap_profile(profile_data=profile_data)
|
||||
# profile_obj.push_profile_old_method(equipment_id=23)
|
||||
# sdk_client.disconnect_cloudsdk()
|
||||
#
|
||||
# sdk_client = CloudSDK(testbed="nola-ext-05", customer_id=2)
|
||||
# obj = FirmwareUtility(jfrog_credentials=JFROG_CREDENTIALS, sdk_client=sdk_client)
|
||||
# obj.upgrade_fw(equipment_id=7, force_upload=False, force_upgrade=False)
|
||||
# # from testbed_info import JFROG_CREDENTIALS
|
||||
# #
|
||||
# # sdk_client = CloudSDK(testbed="nola-ext-05", customer_id=2)
|
||||
# # obj = FirmwareUtility(jfrog_credentials=JFROG_CREDENTIALS, sdk_client=sdk_client)
|
||||
# # obj.upgrade_fw(equipment_id=7, force_upload=False, force_upgrade=False)
|
||||
|
||||
"""
|
||||
Check the ap model
|
||||
|
||||
@@ -5,6 +5,9 @@ for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
@@ -12,6 +15,8 @@ if 'py-json' not in sys.path:
|
||||
|
||||
import sta_connect2
|
||||
from sta_connect2 import StaConnect2
|
||||
import eap_connect
|
||||
from eap_connect import EAPConnect
|
||||
import time
|
||||
|
||||
|
||||
@@ -30,37 +35,67 @@ class TestBridgeModeClientConnectivity(object):
|
||||
test_result = []
|
||||
for profile in setup_bridge_mode[3]:
|
||||
print(profile)
|
||||
# SSID, Passkey, Security, Run layer3 tcp, udp upstream downstream
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], 8080, debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile["ssid_name"]
|
||||
staConnect.dut_passwd = profile["security_key"]
|
||||
staConnect.dut_security = profile["security_key"].split("-")[1].split("_")[0].lower()
|
||||
staConnect.station_names = [get_lanforge_data["lanforge_5g_station"]]
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes() == True:
|
||||
test_result.append("PASS")
|
||||
if str(profile["ssid_name"]).__contains__("EAP"):
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], 8080)
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = [get_lanforge_data["lanforge_5g_station"]]
|
||||
eap_connect.station_names = [get_lanforge_data["lanforge_5g_station"]]
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
eap_connect.ssid = profile["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_5g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = "nolaradius"
|
||||
eap_connect.ttls_passwd = "nolastart"
|
||||
eap_connect.runtime_secs = 10
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
eap_connect.stop()
|
||||
eap_connect.cleanup()
|
||||
run_results = eap_connect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", eap_connect.passes)
|
||||
if eap_connect.passes() == True:
|
||||
test_result.append("PASS")
|
||||
else:
|
||||
test_result.append("FAIL")
|
||||
else:
|
||||
test_result.append("FAIL")
|
||||
# SSID, Passkey, Security, Run layer3 tcp, udp upstream downstream
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], 8080, debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile["ssid_name"]
|
||||
staConnect.dut_passwd = profile["security_key"]
|
||||
staConnect.dut_security = profile["security_key"].split("-")[1].split("_")[0].lower()
|
||||
staConnect.station_names = [get_lanforge_data["lanforge_5g_station"]]
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes() == True:
|
||||
test_result.append("PASS")
|
||||
else:
|
||||
test_result.append("FAIL")
|
||||
print(test_result)
|
||||
if test_result.__contains__("FAIL"):
|
||||
assert False
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import pytest
|
||||
|
||||
import sys
|
||||
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
@@ -12,9 +15,12 @@ if 'py-json' not in sys.path:
|
||||
|
||||
import sta_connect2
|
||||
from sta_connect2 import StaConnect2
|
||||
import eap_connect
|
||||
from eap_connect import EAPConnect
|
||||
import time
|
||||
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('setup_cloudsdk')
|
||||
@pytest.mark.usefixtures('upgrade_firmware')
|
||||
class TestNATModeClientConnectivity(object):
|
||||
@@ -30,37 +36,67 @@ class TestNATModeClientConnectivity(object):
|
||||
test_result = []
|
||||
for profile in setup_nat_mode[3]:
|
||||
print(profile)
|
||||
# SSID, Passkey, Security, Run layer3 tcp, udp upstream downstream
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], 8080, debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile["ssid_name"]
|
||||
staConnect.dut_passwd = profile["security_key"]
|
||||
staConnect.dut_security = profile["security_key"].split("-")[1].split("_")[0].lower()
|
||||
staConnect.station_names = [get_lanforge_data["lanforge_5g_station"]]
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes() == True:
|
||||
test_result.append("PASS")
|
||||
if str(profile["ssid_name"]).__contains__("EAP"):
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], 8080)
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = [get_lanforge_data["lanforge_5g_station"]]
|
||||
eap_connect.station_names = [get_lanforge_data["lanforge_5g_station"]]
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
eap_connect.ssid = profile["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_5g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = "nolaradius"
|
||||
eap_connect.ttls_passwd = "nolastart"
|
||||
eap_connect.runtime_secs = 10
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
eap_connect.stop()
|
||||
eap_connect.cleanup()
|
||||
run_results = eap_connect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", eap_connect.passes)
|
||||
if eap_connect.passes() == True:
|
||||
test_result.append("PASS")
|
||||
else:
|
||||
test_result.append("FAIL")
|
||||
else:
|
||||
test_result.append("FAIL")
|
||||
# SSID, Passkey, Security, Run layer3 tcp, udp upstream downstream
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], 8080, debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile["ssid_name"]
|
||||
staConnect.dut_passwd = profile["security_key"]
|
||||
staConnect.dut_security = profile["security_key"].split("-")[1].split("_")[0].lower()
|
||||
staConnect.station_names = [get_lanforge_data["lanforge_5g_station"]]
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 10
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes() == True:
|
||||
test_result.append("PASS")
|
||||
else:
|
||||
test_result.append("FAIL")
|
||||
print(test_result)
|
||||
if test_result.__contains__("FAIL"):
|
||||
assert False
|
||||
|
||||
@@ -266,13 +266,18 @@ def create_bridge_profile(request, instantiate_cloudsdk, setup_profile_data, get
|
||||
profile_list.append(profile_data)
|
||||
if get_markers.__contains__("eap"):
|
||||
radius_info = {
|
||||
"name": get_testbed_name + "-RADIUS-Nightly",
|
||||
"name": "nola-ext-03" + "-RADIUS-Sanity",
|
||||
"ip": "192.168.200.75",
|
||||
"port": 1812,
|
||||
"secret": "testing123"
|
||||
}
|
||||
# create a eap profile
|
||||
pass
|
||||
profile_object.create_radius_profile(radius_info=radius_info)
|
||||
profile_data = setup_profile_data['EAP']['2G']
|
||||
profile_object.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
profile_list.append(profile_data)
|
||||
profile_data = setup_profile_data['EAP']['5G']
|
||||
profile_object.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
profile_list.append(profile_data)
|
||||
profile_data = {
|
||||
"profile_name": "%s-%s-%s" % (get_testbed_name, "ecw5410", 'BRIDGE'),
|
||||
}
|
||||
@@ -360,12 +365,18 @@ def create_nat_profile(request, instantiate_cloudsdk, setup_profile_data, get_te
|
||||
profile_list.append(profile_data)
|
||||
if get_markers.__contains__("eap"):
|
||||
radius_info = {
|
||||
"name": get_testbed_name + "-RADIUS-Nightly",
|
||||
"name": "nola-ext-03" + "-RADIUS-Sanity",
|
||||
"ip": "192.168.200.75",
|
||||
"port": 1812,
|
||||
"secret": "testing123"
|
||||
}
|
||||
# create a eap profile
|
||||
profile_object.create_radius_profile(radius_info=radius_info)
|
||||
profile_data = setup_profile_data['EAP']['2G']
|
||||
profile_object.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
profile_list.append(profile_data)
|
||||
profile_data = setup_profile_data['EAP']['5G']
|
||||
profile_object.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
profile_list.append(profile_data)
|
||||
profile_data = {
|
||||
"profile_name": "%s-%s-%s" % (get_testbed_name, "ecw5410", "NAT")
|
||||
}
|
||||
@@ -456,13 +467,18 @@ def create_vlan_profile(request, instantiate_cloudsdk, setup_profile_data, get_t
|
||||
profile_list.append(profile_data)
|
||||
if request.config.getini("skip-eap") == 'False':
|
||||
radius_info = {
|
||||
"name": get_testbed_name + "-RADIUS-Nightly",
|
||||
"name": "nola-ext-03" + "-RADIUS-Sanity",
|
||||
"ip": "192.168.200.75",
|
||||
"port": 1812,
|
||||
"secret": "testing123"
|
||||
}
|
||||
# create a eap profile
|
||||
pass
|
||||
profile_object.create_radius_profile(radius_info=radius_info)
|
||||
profile_data = setup_profile_data['EAP']['2G']
|
||||
profile_object.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False)
|
||||
profile_list.append(profile_data)
|
||||
profile_data = setup_profile_data['EAP']['5G']
|
||||
profile_object.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False)
|
||||
profile_list.append(profile_data)
|
||||
profile_data = {
|
||||
"profile_name": "%s-%s-%s" % (get_testbed_name, "ecw5410", 'VLAN')
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ lanforge-ethernet-port=eth2
|
||||
|
||||
# Cloud SDK settings
|
||||
sdk-customer-id=2
|
||||
sdk-equipment-id=21
|
||||
sdk-equipment-id=23
|
||||
|
||||
# Profile
|
||||
skip-open=True
|
||||
|
||||
Reference in New Issue
Block a user