mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2026-03-20 03:41:54 +00:00
- changed chamberview logic and DUT
- added lf_tools which holds chamberview class and functions - added comments Signed-off-by: sushant <sushant.bawiskar@candelatech.com>
This commit is contained in:
81
libs/lanforge/lf_tools.py
Normal file
81
libs/lanforge/lf_tools.py
Normal file
@@ -0,0 +1,81 @@
|
||||
from create_chamberview import CreateChamberview
|
||||
from create_chamberview_dut import DUT
|
||||
import time
|
||||
|
||||
|
||||
class ChamberView:
|
||||
|
||||
def __init__(self, lanforge_data=None, access_point_data=None, debug=False, testbed=None):
|
||||
self.lanforge_ip = lanforge_data["ip"]
|
||||
self.lanforge_port = lanforge_data["port"]
|
||||
self.twog_radios = lanforge_data["2.4G-Radio"]
|
||||
self.fiveg_radios = lanforge_data["5G-Radio"]
|
||||
self.ax_radios = lanforge_data["AX-Radio"]
|
||||
self.upstream_port = lanforge_data["upstream"]
|
||||
self.twog_prefix = lanforge_data["2.4G-Station-Name"]
|
||||
self.fiveg_prefix = lanforge_data["5G-Station-Name"]
|
||||
self.ax_prefix = lanforge_data["AX-Station-Name"]
|
||||
self.uplink_port = lanforge_data["uplink"] # eth2
|
||||
self.upstream_subnet = lanforge_data["upstream_subnet"]
|
||||
self.testbed = testbed
|
||||
self.upstream_resources = self.upstream_port.split(".")[0] + "." + self.upstream_port.split(".")[1]
|
||||
self.uplink_resources = self.uplink_port.split(".")[0] + "." + self.uplink_port.split(".")[1]
|
||||
self.delete_old_scenario = True
|
||||
# For chamber view
|
||||
self.scenario_name = "TIP-" + self.testbed
|
||||
|
||||
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] + " -1 NA"]
|
||||
]
|
||||
# This is for rawline input | see create_chamberview_dut.py for more details
|
||||
|
||||
self.CreateChamberview = CreateChamberview(self.lanforge_ip, self.lanforge_port)
|
||||
|
||||
# for DUT
|
||||
self.dut_name = testbed
|
||||
self.ap_model = access_point_data[0]["model"]
|
||||
self.version = access_point_data[0]["version"]
|
||||
self.serial = access_point_data[0]["serial"]
|
||||
|
||||
self.CreateDut = DUT(lfmgr=self.lanforge_ip,
|
||||
port=self.lanforge_port,
|
||||
dut_name=self.testbed,
|
||||
sw_version=self.version,
|
||||
hw_version=self.ap_model,
|
||||
model_num=self.ap_model,
|
||||
serial_num=self.serial
|
||||
)
|
||||
self.CreateDut.ssid = []
|
||||
|
||||
# SSID data should be in this format
|
||||
# [
|
||||
# ['ssid_idx=0 ssid=Default-SSID-2g password=12345678 bssid=90:3c:b3:94:48:58'],
|
||||
# ['ssid_idx=1 ssid=Default-SSID-5gl password=12345678 bssid=90:3c:b3:94:48:59']
|
||||
# ]
|
||||
|
||||
def Chamber_View(self):
|
||||
if self.delete_old_scenario:
|
||||
self.CreateChamberview.clean_cv_scenario(type="Network-Connectivity", scenario_name=self.scenario_name)
|
||||
self.CreateChamberview.setup(create_scenario=self.scenario_name,
|
||||
raw_line=self.raw_line
|
||||
)
|
||||
self.CreateChamberview.build(self.scenario_name)
|
||||
self.CreateChamberview.sync_cv()
|
||||
time.sleep(2)
|
||||
self.CreateChamberview.show_text_blob(None, None, True) # Show changes on GUI
|
||||
self.CreateChamberview.sync_cv()
|
||||
return self.CreateChamberview, self.scenario_name
|
||||
|
||||
|
||||
def Create_Dut(self):
|
||||
self.CreateDut.setup()
|
||||
self.CreateDut.add_ssids()
|
||||
self.CreateDut.cv_test.show_text_blob(None, None, True) # Show changes on GUI
|
||||
self.CreateDut.cv_test.sync_cv()
|
||||
time.sleep(2)
|
||||
self.CreateDut.cv_test.show_text_blob(None, None, True) # Show changes on GUI
|
||||
self.CreateDut.cv_test.sync_cv()
|
||||
return self.CreateDut, self.dut_name
|
||||
@@ -1,40 +1,7 @@
|
||||
"""
|
||||
ec420 basic-03
|
||||
ecw5410 basic-01
|
||||
ecw5211 not available in basic
|
||||
wf188n basic-05
|
||||
eap102 basic-06
|
||||
eap101 basic-02
|
||||
wf194c baisc-08-02
|
||||
|
||||
ssh -C -L 8800:lf1:4002 -L 8801:lf1:5901 -L 8802:lf1:8080 -L 8803:lab-ctlr:22 \ # basic-01
|
||||
-L 8720:lf2:4002 -L 8721:lf2:5901 -L 8722:lf2:8080 -L 8723:lab-ctlr:22 \ # basic-02
|
||||
-L 8830:lf3:4002 -L 8831:lf3:5901 -L 8832:lf3:8080 -L 8833:lab-ctlr:22 \ # basic-03
|
||||
-L 8810:lf4:4002 -L 8811:lf4:5901 -L 8812:lf4:8080 -L 8813:lab-ctlr:22 \ # basic-04
|
||||
-L 8850:lf12:4002 -L 8851:lf12:5901 -L 8852:lf12:8080 -L 8853:lab-ctlr4:22 \ # basic-05
|
||||
-L 8860:lf13:4002 -L 8861:lf13:5901 -L 8862:lf13:8080 -L 8863:lab-ctlr4:22 \ # basic-06
|
||||
-L 8870:lf14:4002 -L 8871:lf14:5901 -L 8872:lf14:8080 -L 8873:lab-ctlr4:22 \ # basic-07
|
||||
-L 8880:lf15:4002 -L 8881:lf15:5901 -L 8882:lf15:8080 -L 8883:lab-ctlr4:22 \ # basic-08
|
||||
ubuntu@3.130.51.163
|
||||
|
||||
|
||||
|
||||
ssh -C -L 8800:lf1:4002 -L 8801:lf1:5901 -L 8802:lf1:8080 -L 8803:lab-ctlr:22 \
|
||||
-L 8720:lf2:4002 -L 8721:lf2:5901 -L 8722:lf2:8080 -L 8723:lab-ctlr:22 \
|
||||
-L 8830:lf3:4002 -L 8831:lf3:5901 -L 8832:lf3:8080 -L 8833:lab-ctlr:22 \
|
||||
-L 8810:lf4:4002 -L 8811:lf4:5901 -L 8812:lf4:8080 -L 8813:lab-ctlr:22 \
|
||||
-L 8850:lf12:4002 -L 8851:lf12:5901 -L 8852:lf12:8080 -L 8853:lab-ctlr4:22 \
|
||||
-L 8860:lf13:4002 -L 8861:lf13:5901 -L 8862:lf13:8080 -L 8863:lab-ctlr4:22 \
|
||||
-L 8870:lf14:4002 -L 8871:lf14:5901 -L 8872:lf14:8080 -L 8873:lab-ctlr4:22 \
|
||||
-L 8880:lf15:4002 -L 8881:lf15:5901 -L 8882:lf15:8080 -L 8883:lab-ctlr4:22 \
|
||||
ubuntu@3.130.51.163
|
||||
|
||||
"""
|
||||
|
||||
CONFIGURATION = {
|
||||
"basic-ext-04-01": {
|
||||
"basic-ext-03-01": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': "1.1.0-SNAPSHOT",
|
||||
@@ -44,20 +11,94 @@ CONFIGURATION = {
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': "wifi5",
|
||||
'serial': '903cb394486f',
|
||||
'serial': '903cb3944807',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.81",
|
||||
'ip': "192.168.200.230",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "ecw5410-2021-04-23-30496b1"
|
||||
'version': "ecw5410-2021-03-30-pending-9cb289b"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.81",
|
||||
"ip": "localhost",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "eth1",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan1",
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
}
|
||||
},
|
||||
"basic-ext-03-02": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': "1.1.0-SNAPSHOT",
|
||||
'commit_date': "2021-04-27"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb394486f',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.233",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "ecw5410-2021-04-26-pending-3fc41fa"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.233",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "eth1",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan1",
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
}
|
||||
},
|
||||
"basic-ext-03-03": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'username': 'support@example.com',
|
||||
'password': 'support',
|
||||
'version': "1.1.0-SNAPSHOT",
|
||||
'commit_date': "2021-04-27"
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': 'wifi5',
|
||||
'serial': '903cb3944857',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.80",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "ecw5410-1.0.4-rc4"
|
||||
}
|
||||
],
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "192.168.200.80",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
@@ -150,3 +191,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
|
||||
|
||||
@@ -37,12 +37,10 @@ from configuration import CONFIGURATION
|
||||
from configuration import FIRMWARE
|
||||
from testrails.testrail_api import APIClient
|
||||
from testrails.reporting import Reporting
|
||||
from cv_test_manager import cv_test
|
||||
import sta_connect2
|
||||
from sta_connect2 import StaConnect2
|
||||
from cv_test_manager import cv_test
|
||||
# from cv_test_manager import cv_test
|
||||
from create_chamberview import CreateChamberview
|
||||
from create_chamberview_dut import DUT
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addini("tr_url", "Test Rail URL")
|
||||
@@ -88,6 +86,41 @@ def pytest_addoption(parser):
|
||||
default=False,
|
||||
help="Stop using Testrails"
|
||||
)
|
||||
parser.addoption(
|
||||
"--exit-on-fail",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="use to stop execution if failure"
|
||||
)
|
||||
|
||||
# Perfecto Parameters
|
||||
parser.addini("perfectoURL", "Cloud URL")
|
||||
parser.addini("securityToken", "Security Token")
|
||||
parser.addini("platformName-iOS", "iOS Platform")
|
||||
parser.addini("platformName-android", "Android Platform")
|
||||
parser.addini("model-iOS", "iOS Devices")
|
||||
parser.addini("model-android", "Android Devices")
|
||||
parser.addini("bundleId-iOS", "iOS Devices")
|
||||
parser.addini("bundleId-iOS-Settings", "iOS Settings App")
|
||||
parser.addini("appPackage-android", "Android Devices")
|
||||
parser.addini("wifi-SSID-5gl-Pwd", "Wifi 5g Password")
|
||||
parser.addini("wifi-SSID-2g-Pwd", "Wifi 2g Password")
|
||||
parser.addini("Default-SSID-5gl-perfecto-b", "Wifi 5g AP Name")
|
||||
parser.addini("Default-SSID-2g-perfecto-b", "Wifi 2g AP Name")
|
||||
parser.addini("Default-SSID-perfecto-b", "Wifi AP Name")
|
||||
parser.addini("bundleId-iOS-Ping", "Ping Bundle ID")
|
||||
parser.addini("browserType-iOS", "Mobile Browser Name")
|
||||
parser.addini("projectName", "Project Name")
|
||||
parser.addini("projectVersion", "Project Version")
|
||||
parser.addini("jobName", "CI Job Name")
|
||||
parser.addini("jobNumber", "CI Job Number")
|
||||
parser.addini("reportTags", "Report Tags")
|
||||
parser.addoption(
|
||||
"--access-points-perfecto",
|
||||
# nargs="+",
|
||||
default=["Perfecto"],
|
||||
help="list of access points to test"
|
||||
)
|
||||
|
||||
|
||||
"""
|
||||
@@ -189,59 +222,6 @@ def setup_controller(request, get_configuration, instantiate_access_point,
|
||||
sdk_client = False
|
||||
yield sdk_client
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_lanforge_chamberview_dut(get_configuration, testbed):
|
||||
ap_model = get_configuration["access_point"][0]["model"]
|
||||
version = get_configuration["access_point"][0]["version"]
|
||||
serial = get_configuration["access_point"][0]["serial"]
|
||||
# ap_model = get_configuration["access_point"][0]["model"]
|
||||
lanforge_data = get_configuration['traffic_generator']['details']
|
||||
ip = lanforge_data["ip"]
|
||||
port = lanforge_data["port"]
|
||||
dut = DUT(lfmgr=ip,
|
||||
port=port,
|
||||
dut_name=testbed,
|
||||
sw_version=version,
|
||||
model_num=ap_model,
|
||||
serial_num=serial
|
||||
)
|
||||
dut.setup()
|
||||
yield dut
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_lanforge_chamberview(create_lanforge_chamberview_dut, get_configuration, testbed):
|
||||
lanforge_data = get_configuration['traffic_generator']['details']
|
||||
ip = lanforge_data["ip"]
|
||||
port = lanforge_data["port"]
|
||||
upstream_port = lanforge_data["upstream"] # eth1
|
||||
uplink_port = lanforge_data["uplink"] # eth2
|
||||
upstream_subnet = lanforge_data["upstream_subnet"]
|
||||
scenario_name = "TIP-" + testbed
|
||||
upstream_res = upstream_port.split(".")[0] + "." + upstream_port.split(".")[1]
|
||||
uplink_res = uplink_port.split(".")[0] + "." + uplink_port.split(".")[1]
|
||||
print(ip)
|
||||
print(upstream_port, upstream_res, upstream_port.split(".")[2])
|
||||
# "profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 NA"
|
||||
# "profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 10.28.2.1/24' NA eth1,eth2 -1 NA"
|
||||
raw_line = [
|
||||
["profile_link " + upstream_res + " upstream-dhcp 1 NA NA " + upstream_port.split(".")[2] + ",AUTO -1 NA"]
|
||||
, ["profile_link " + uplink_res + " uplink-nat 1 'DUT: upstream LAN "
|
||||
+ upstream_subnet + "' NA " + uplink_port.split(".")[2] + " -1 NA"]
|
||||
]
|
||||
print(raw_line)
|
||||
Create_Chamberview = CreateChamberview(ip, port)
|
||||
Create_Chamberview.clean_cv_scenario()
|
||||
Create_Chamberview.clean_cv_scenario(type="Network-Connectivity", scenario_name=scenario_name)
|
||||
|
||||
Create_Chamberview.setup(create_scenario=scenario_name,
|
||||
raw_line=raw_line)
|
||||
|
||||
Create_Chamberview.build(scenario_name)
|
||||
Create_Chamberview.show_text_blob(None, None, True) # Show changes on GUI
|
||||
yield Create_Chamberview
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def instantiate_firmware(setup_controller, instantiate_jFrog, get_configuration):
|
||||
@@ -254,79 +234,6 @@ def instantiate_firmware(setup_controller, instantiate_jFrog, get_configuration)
|
||||
yield firmware_client_obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def get_latest_firmware(instantiate_firmware):
|
||||
fw_version_list = []
|
||||
try:
|
||||
|
||||
for fw_obj in instantiate_firmware:
|
||||
latest_firmware = fw_obj.get_fw_version()
|
||||
fw_version_list.append(latest_firmware)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
fw_version_list = []
|
||||
|
||||
yield fw_version_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def upload_firmware(should_upload_firmware, instantiate_firmware, get_latest_firmware):
|
||||
firmware_id_list = []
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
firmware_id = instantiate_firmware[i].upload_fw_on_cloud(fw_version=get_latest_firmware[i],
|
||||
force_upload=should_upload_firmware)
|
||||
firmware_id_list.append(firmware_id)
|
||||
yield firmware_id_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware,
|
||||
should_upgrade_firmware):
|
||||
status_list = []
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
if request.config.getoption("--skip-upgrade"):
|
||||
status = "skip-upgrade"
|
||||
status_list.append(status)
|
||||
else:
|
||||
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
status_list.append(status)
|
||||
else:
|
||||
if should_upgrade_firmware:
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
status_list.append(status)
|
||||
else:
|
||||
status = "skip-upgrade Version Already Available"
|
||||
status_list.append(status)
|
||||
yield status_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def check_ap_firmware_cloud(setup_controller, get_equipment_id):
|
||||
ap_fw_list = []
|
||||
for i in get_equipment_id:
|
||||
ap_fw_list.append(setup_controller.get_ap_firmware_old_method(equipment_id=i))
|
||||
yield ap_fw_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def check_ap_firmware_ssh(get_configuration):
|
||||
active_fw_list = []
|
||||
try:
|
||||
for access_point in get_configuration['access_point']:
|
||||
ap_ssh = APNOS(access_point)
|
||||
active_fw = ap_ssh.get_active_firmware()
|
||||
active_fw_list.append(active_fw)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
active_fw_list = []
|
||||
yield active_fw_list
|
||||
|
||||
|
||||
"""
|
||||
Instantiate Reporting
|
||||
"""
|
||||
|
||||
@@ -7,40 +7,45 @@
|
||||
import pytest
|
||||
import time
|
||||
|
||||
|
||||
@pytest.mark.configure_lanforge
|
||||
def test_configure_lanforge(configure_lanforge):
|
||||
|
||||
assert True
|
||||
|
||||
|
||||
@pytest.mark.lanforge_scenario_setup_dut
|
||||
def test_lanforge_scenario_setup_dut(create_lanforge_chamberview_dut):
|
||||
print(create_lanforge_chamberview_dut)
|
||||
@pytest.mark.setup_dut
|
||||
def test_lanforge_scenario_setup_dut(create_lanforge_chamberview_dut, lf_tools):
|
||||
object_name, dut_name = create_lanforge_chamberview_dut
|
||||
# print(create_lanforge_chamberview_dut)
|
||||
ssid = [
|
||||
['ssid_idx=0 ssid=Default-SSID-2g password=12345678 bssid=90:3c:b3:94:48:58'],
|
||||
['ssid_idx=1 ssid=Default-SSID-5gl password=12345678 bssid=90:3c:b3:94:48:59']
|
||||
]
|
||||
|
||||
create_lanforge_chamberview_dut.ssid = ssid
|
||||
create_lanforge_chamberview_dut.setup()
|
||||
create_lanforge_chamberview_dut.add_ssids()
|
||||
create_lanforge_chamberview_dut.cv_test.show_text_blob(None, None, True) # Show changes on GUI
|
||||
create_lanforge_chamberview_dut.cv_test.sync_cv()
|
||||
time.sleep(2)
|
||||
create_lanforge_chamberview_dut.cv_test.show_text_blob(None, None, True) # Show changes on GUI
|
||||
create_lanforge_chamberview_dut.cv_test.sync_cv()
|
||||
# how to add ssid example
|
||||
# ['ssid_idx=0 ssid=Default-SSID-2g security=WPA password=12345678 bssid=90:3c:b3:94:48:58'],
|
||||
# ['ssid_idx=1 ssid=Default-SSID-5gl security=WPA password=12345678 bssid=90:3c:b3:94:48:59']
|
||||
]
|
||||
if ssid:
|
||||
lf_tools.CreateDut.ssid = ssid
|
||||
lf_tools.Create_Dut()
|
||||
print("Here")
|
||||
|
||||
assert True
|
||||
|
||||
@pytest.mark.lanforge_scenario_setup
|
||||
def test_lanforge_scenario_setup(create_lanforge_chamberview):
|
||||
# raw_line = [
|
||||
# ["profile_link 1.1 vlan-100 1 NA NA eth2,AUTO -1 100"]
|
||||
# ]
|
||||
# print(create_lanforge_chamberview.setup_scenario(create_scenario="TIP-test",raw_line=raw_line))
|
||||
# create_lanforge_chamberview.build_scenario("TIP-test")
|
||||
|
||||
@pytest.mark.setup_chamberview
|
||||
def test_lanforge_scenario_setup(create_lanforge_chamberview, lf_tools):
|
||||
raw_line = [
|
||||
# How to add in chamberview example, please look for create_chamberview.py for information
|
||||
# ["profile_link 1.1 STA-AC 10 'DUT: " + lf_tools.dut_name + " Radio-1' tcp-dl-6m-vi wiphy0,AUTO -1"]
|
||||
# ["profile_link 1.1 STA-AC 10 'DUT: temp Radio-1' tcp-dl-6m-vi wiphy0,AUTO -1"], to create stations
|
||||
# ["profile_link 1.1 vlan-100 1 NA NA eth2,AUTO -1 100"] # add new list separated by commas to add in cv
|
||||
# scenario
|
||||
]
|
||||
if raw_line:
|
||||
lf_tools.delete_old_scenario = False
|
||||
lf_tools.raw_line = raw_line
|
||||
lf_tools.Chamber_View()
|
||||
assert True
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.bridge
|
||||
@pytest.mark.nat
|
||||
@@ -110,7 +115,8 @@ def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_tes
|
||||
|
||||
assert check_ap_firmware_ssh == get_latest_firmware
|
||||
|
||||
|
||||
# adding comment here (previous git-conflict)
|
||||
# =======
|
||||
# """
|
||||
# Test Case Module: setup test cases for basic test cases
|
||||
# Details: Firmware Upgrade
|
||||
@@ -192,4 +198,3 @@ def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_tes
|
||||
# msg='Cannot reach AP after upgrade to check CLI - re-test required')
|
||||
#
|
||||
# assert check_ap_firmware_ssh == get_latest_firmware
|
||||
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
import os
|
||||
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"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
os.path.realpath(__file__)
|
||||
@@ -12,9 +26,53 @@ if "libs" not in sys.path:
|
||||
from controller.controller import ProfileUtility
|
||||
import time
|
||||
from lanforge.lf_tests import RunTest
|
||||
from lanforge.lf_tools import ChamberView
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
"""
|
||||
Basic Setup Collector
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_lanforge_data(testbed):
|
||||
lanforge_data = {}
|
||||
if CONFIGURATION[testbed]['traffic_generator']['name'] == 'lanforge':
|
||||
lanforge_data = {
|
||||
"lanforge_ip": CONFIGURATION[testbed]['traffic_generator']['details']['ip'],
|
||||
"lanforge-port-number": CONFIGURATION[testbed]['traffic_generator']['details']['port'],
|
||||
"lanforge_2dot4g": CONFIGURATION[testbed]['traffic_generator']['details']['2.4G-Radio'][0],
|
||||
"lanforge_5g": CONFIGURATION[testbed]['traffic_generator']['details']['5G-Radio'][0],
|
||||
"lanforge_2dot4g_prefix": CONFIGURATION[testbed]['traffic_generator']['details']['2.4G-Station-Name'],
|
||||
"lanforge_5g_prefix": CONFIGURATION[testbed]['traffic_generator']['details']['5G-Station-Name'],
|
||||
"lanforge_2dot4g_station": CONFIGURATION[testbed]['traffic_generator']['details']['2.4G-Station-Name'],
|
||||
"lanforge_5g_station": CONFIGURATION[testbed]['traffic_generator']['details']['5G-Station-Name'],
|
||||
"lanforge_bridge_port": CONFIGURATION[testbed]['traffic_generator']['details']['upstream'],
|
||||
"lanforge_vlan_port": CONFIGURATION[testbed]['traffic_generator']['details']['upstream'] + ".100",
|
||||
"vlan": 100
|
||||
}
|
||||
yield lanforge_data
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def instantiate_profile(instantiate_controller):
|
||||
try:
|
||||
profile_object = ProfileUtility(sdk_client=instantiate_controller)
|
||||
except Exception as e:
|
||||
profile_object = False
|
||||
yield profile_object
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_equipment_id(setup_controller, testbed, get_configuration):
|
||||
equipment_id = 0
|
||||
if len(get_configuration['access_point']) == 1:
|
||||
equipment_id = setup_controller.get_equipment_id(
|
||||
serial_number=get_configuration['access_point'][0]['serial'])
|
||||
print(equipment_id)
|
||||
yield equipment_id
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_profile():
|
||||
@@ -390,7 +448,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
name="SSID Profiles in VIF Config and Controller: ")
|
||||
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
|
||||
|
||||
# This loop will check the VIF Config with VIF State
|
||||
# This loop will check the VIF Config with VIF State
|
||||
test_cases['vifs'] = False
|
||||
for i in range(0, 18):
|
||||
vif_state = list(ap_ssh.get_vif_state_ssids())
|
||||
@@ -421,11 +479,29 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
yield test_cases
|
||||
|
||||
|
||||
@pytest.fixture(scope="package")
|
||||
def create_lanforge_chamberview(lf_tools):
|
||||
scenario_object, scenario_name = lf_tools.Chamber_View()
|
||||
return scenario_object, scenario_name
|
||||
|
||||
@pytest.fixture(scope="package")
|
||||
def create_lanforge_chamberview_dut(lf_tools):
|
||||
dut_object, dut_name = lf_tools.Create_Dut()
|
||||
return dut_object, dut_name
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def lf_test(get_configuration):
|
||||
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'])
|
||||
yield obj
|
||||
|
||||
@pytest.fixture(scope="package")
|
||||
def lf_tools(get_configuration, testbed):
|
||||
lf_tools_obj = ChamberView(lanforge_data=get_configuration['traffic_generator']['details'],
|
||||
access_point_data=get_configuration['access_point'],
|
||||
testbed=testbed)
|
||||
yield lf_tools_obj
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def station_names_twog(request, get_configuration):
|
||||
|
||||
Reference in New Issue
Block a user