mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 03:07:56 +00:00
Run AP Auto Test from cv_to_grafana.py
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -20,7 +20,7 @@ def cv_base_adjust_parser(args):
|
||||
args.set.append(["Test Rig ID:", args.test_rig])
|
||||
|
||||
if args.influx_host is not None:
|
||||
if (not args.pull_report):
|
||||
if not args.pull_report:
|
||||
print("Specified influx host without pull_report, will enabled pull_request.")
|
||||
args.pull_report = True
|
||||
|
||||
@@ -182,7 +182,7 @@ class cv_test(Realm):
|
||||
|
||||
# It can take a while, some test rebuild the old scenario upon exit, for instance.
|
||||
tries = 0
|
||||
while (True):
|
||||
while True:
|
||||
if self.get_exists(instance):
|
||||
print("Waiting %i/60 for test instance: %s to be deleted."%(tries, instance))
|
||||
tries += 1
|
||||
@@ -194,7 +194,7 @@ class cv_test(Realm):
|
||||
|
||||
# And make sure chamber-view is properly re-built
|
||||
tries = 0
|
||||
while (True):
|
||||
while True:
|
||||
if not self.get_cv_is_built():
|
||||
print("Waiting %i/60 for Chamber-View to be built."%(tries))
|
||||
tries += 1
|
||||
@@ -291,7 +291,7 @@ class cv_test(Realm):
|
||||
load_old = "true"
|
||||
|
||||
start_try = 0
|
||||
while (True):
|
||||
while True:
|
||||
response = self.create_test(test_name, instance_name, load_old)
|
||||
if response[0]["LAST"]["response"] == "OK":
|
||||
break
|
||||
@@ -348,8 +348,8 @@ class cv_test(Realm):
|
||||
filelocation.close()
|
||||
print(location)
|
||||
self.report_dir = location
|
||||
try:
|
||||
if pull_report:
|
||||
try:
|
||||
print(lf_host)
|
||||
report.pull_reports(hostname=lf_host, username=lf_user, password=lf_password,
|
||||
report_location=location)
|
||||
|
||||
@@ -7,7 +7,7 @@ class lanforge_reports:
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.load_system_host_keys()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect(hostname=hostname,username=username,password=password)
|
||||
ssh.connect(hostname=hostname, username=username, password=password, allow_agent=False, look_for_keys=False)
|
||||
|
||||
with SCPClient(ssh.get_transport()) as scp:
|
||||
scp.get(report_location,recursive=True)
|
||||
|
||||
@@ -21,6 +21,16 @@ Influx from this script.
|
||||
--station 1.1.sta00002
|
||||
--duration 15s
|
||||
--upstream 1.1.eth1
|
||||
--radio2 1.1.wiphy1
|
||||
--radio5 1.1.wiphy2
|
||||
--dut5_0 linksys-8450
|
||||
--set 'Basic Client Connectivity' 1
|
||||
--set 'Multi-Station Throughput vs Pkt Size' 0
|
||||
--set 'Multi Band Performance' 1
|
||||
--set Stability 1
|
||||
--set 'Throughput vs Pkt Size' 0
|
||||
--set Capacity 0
|
||||
--set Band-Steering 0
|
||||
|
||||
OPTIONAL GRAFANA ARGUMENTS
|
||||
--grafana_token TOKEN
|
||||
@@ -38,6 +48,18 @@ Each line argument adds a line to the Chamber View Scenario which you create in
|
||||
DUT flag gives the name of the DUT which is created by this script. It can be found in the DUT tab in LANforge Manager.
|
||||
|
||||
The station flag tells Dataplane test which station to test with.
|
||||
|
||||
The AP Auto test is triggered by the radio2 or radio5 flag. Select which tests in the AP Auto Test with the set argument.
|
||||
|
||||
AP Auto test has the following argument:
|
||||
* max_stations_2: Specify maximum 2.4Ghz stations
|
||||
* max_stations_5: Specify maximum 5Ghz stations
|
||||
* max_stations_dual: Specify maximum stations for dual-band tests
|
||||
* dut5_0: Specify 5Ghz DUT entry
|
||||
* dut2_0: Specify 2Ghz DUT entry
|
||||
DUT syntax is somewhat tricky: DUT-name SSID BSID (bssid-idx), example: linksys-8450 Default-SSID-5gl c4:41:1e:f5:3f:25 (2)
|
||||
* radio2: Specify 2.4Ghz radio. May be specified multiple times.
|
||||
* radio5: Specify 5Ghz radio. May be specified multiple times.
|
||||
'''
|
||||
import sys
|
||||
import os
|
||||
@@ -58,6 +80,8 @@ from create_chamberview_dut import DUT
|
||||
from create_chamberview import CreateChamberview
|
||||
from lf_dataplane_test import DataplaneTest
|
||||
from grafana_profile import UseGrafana
|
||||
from lf_ap_auto_test import ApAutoTest
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
@@ -104,7 +128,8 @@ def main():
|
||||
help="Select requested upload rate. Kbps, Mbps, Gbps units supported. Default is 10Mbps")
|
||||
parser.add_argument("--sort", type=str, default="interleave",
|
||||
help="Select station sorting behaviour: none | interleave | linear Default is interleave.")
|
||||
parser.add_argument('--number_template', help='Start the station numbering with a particular number. Default is 0000',
|
||||
parser.add_argument('--number_template',
|
||||
help='Start the station numbering with a particular number. Default is 0000',
|
||||
default=0000)
|
||||
parser.add_argument('--mode', help='Used to force mode of stations')
|
||||
parser.add_argument('--ap', help='Used to force a connection to a particular AP')
|
||||
@@ -127,13 +152,12 @@ def main():
|
||||
parser.add_argument("--dut", default="",
|
||||
help="Specify DUT used by this test, example: linksys-8450")
|
||||
parser.add_argument("--download_speed", default="",
|
||||
help="Specify requested download speed. Percentage of theoretical is also supported. Default: 85%")
|
||||
help="Specify requested download speed. Percentage of theoretical is also supported.")
|
||||
parser.add_argument("--upload_speed", default="",
|
||||
help="Specify requested upload speed. Percentage of theoretical is also supported. Default: 0")
|
||||
parser.add_argument("--graph_groups", help="File to save graph_groups to", default=None)
|
||||
parser.add_argument("--ssid_dut", action='append', nargs=1, help="SSID", default=[])
|
||||
|
||||
|
||||
parser.add_argument("--sw_version", default="NA", help="DUT Software version.")
|
||||
parser.add_argument("--hw_version", default="NA", help="DUT Hardware version.")
|
||||
parser.add_argument("--serial_num", default="NA", help="DUT Serial number.")
|
||||
@@ -143,6 +167,24 @@ def main():
|
||||
parser.add_argument('--grafana_port', help='Grafana port if different from 3000', default=3000)
|
||||
parser.add_argument('--grafana_host', help='Grafana host', default='localhost')
|
||||
|
||||
#Flags for AP-Auto Test config
|
||||
|
||||
parser.add_argument("--max_stations_2", type=int, default=-1,
|
||||
help="Specify maximum 2.4Ghz stations")
|
||||
parser.add_argument("--max_stations_5", type=int, default=-1,
|
||||
help="Specify maximum 5Ghz stations")
|
||||
parser.add_argument("--max_stations_dual", type=int, default=-1,
|
||||
help="Specify maximum stations for dual-band tests")
|
||||
parser.add_argument("--dut5_0", type=str, default="",
|
||||
help="Specify 5Ghz DUT entry. Syntax is somewhat tricky: DUT-name SSID BSID (bssid-idx), example: linksys-8450 Default-SSID-5gl c4:41:1e:f5:3f:25 (2)")
|
||||
parser.add_argument("--dut2_0", type=str, default="",
|
||||
help="Specify 5Ghz DUT entry. Syntax is somewhat tricky: DUT-name SSID BSID (bssid-idx), example: linksys-8450 Default-SSID-2g c4:41:1e:f5:3f:24 (1)")
|
||||
|
||||
parser.add_argument("--radio2", action='append', nargs=1, default=[],
|
||||
help="Specify 2.4Ghz radio. May be specified multiple times.")
|
||||
parser.add_argument("--radio5", action='append', nargs=1, default=[],
|
||||
help="Specify 5Ghz radio. May be specified multiple times.")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
cv_base_adjust_parser(args)
|
||||
@@ -233,6 +275,34 @@ def main():
|
||||
|
||||
CV_Test.check_influx_kpi(args)
|
||||
|
||||
if len(args.radio2) + len(args.radio5) > 0:
|
||||
ApAuto = ApAutoTest(lf_host=args.mgr,
|
||||
lf_port=args.port,
|
||||
lf_user=args.lf_user,
|
||||
lf_password=args.lf_password,
|
||||
instance_name=args.instance_name,
|
||||
config_name=args.config_name,
|
||||
upstream=args.upstream,
|
||||
pull_report=args.pull_report,
|
||||
dut5_0=args.dut5_0,
|
||||
dut2_0=args.dut2_0,
|
||||
load_old_cfg=args.load_old_cfg,
|
||||
max_stations_2=args.max_stations_2,
|
||||
max_stations_5=args.max_stations_5,
|
||||
max_stations_dual=args.max_stations_dual,
|
||||
radio2=args.radio2,
|
||||
radio5=args.radio5,
|
||||
enables=args.enable,
|
||||
disables=args.disable,
|
||||
raw_lines=args.raw_line,
|
||||
raw_lines_file=args.raw_lines_file,
|
||||
sets=args.set
|
||||
)
|
||||
ApAuto.setup()
|
||||
ApAuto.run()
|
||||
|
||||
ApAuto.check_influx_kpi(args)
|
||||
|
||||
if args.grafana_token:
|
||||
print("Create Grafana dashboard")
|
||||
Grafana = UseGrafana(args.grafana_token,
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/bin/bash
|
||||
##########################
|
||||
# Help
|
||||
##########################
|
||||
Help()
|
||||
{
|
||||
echo "This bash script creates a DUT, loads a scenario, runs a WiFi Capacity test, and saves it to Influx"
|
||||
}
|
||||
MGR=192.168.1.6
|
||||
#INFLUXTOKEN=Tdxwq5KRbj1oNbZ_ErPL5tw_HUH2wJ1VR4dwZNugJ-APz__mEFIwnqHZdoobmQpt2fa1VdWMlHQClR8XNotwbg==
|
||||
#GRAFANATOKEN=eyJrIjoiZTJwZkZlemhLQVNpY3hiemRjUkNBZ3k2RWc3bWpQWEkiLCJuIjoibWFzdGVyIiwiaWQiOjF9
|
||||
INFLUXTOKEN=31N9QDhjJHBu4eMUlMBwbK3sOjXLRAhZuCzZGeO8WVCj-xvR8gZWWvRHOcuw-5RHeB7xBFnLs7ZV023k4koR1A==
|
||||
GRAFANATOKEN=eyJrIjoiS1NGRU8xcTVBQW9lUmlTM2dNRFpqNjFqV05MZkM0dzciLCJuIjoibWF0dGhldyIsImlkIjoxfQ==
|
||||
TESTBED=Stidmatt-01
|
||||
GROUPS=/tmp/lf_cv_rpt_filelocation.txt
|
||||
INFLUXBUCKET=stidmatt
|
||||
INFLUX_MGR=192.168.100.201
|
||||
|
||||
#Replace my arguments with your setup. Separate your ssid arguments with spaces and ensure the names are lowercase
|
||||
echo "Make new DUT"
|
||||
./create_chamberview_dut.py --lfmgr ${MGR} --dut_name DUT_TO_GRAFANA_DUT --ssid "ssid_idx=0 ssid=lanforge security=WPA2 password=password bssid=04:f0:21:2c:41:84 traffic=wiphy1"
|
||||
|
||||
echo "Build Chamber View Scenario" #change the lfmgr to your system, set the radio to a working radio on your LANforge system, same with the ethernet port.
|
||||
./create_chamberview.py --lfmgr ${MGR} --create_scenario DUT_TO_GRAFANA_SCENARIO \
|
||||
--line "Resource=1.1 Profile=default Amount=32 Uses-1=wiphy1 DUT=DUT_TO_GRAFANA_DUT Traffic=wiphy1 Freq=-1" \
|
||||
--line "Resource=1.1 Profile=upstream Amount=1 Uses-1=eth1 DUT=DUT_TO_GRAFANA_DUT Traffic=eth1 Freq=-1"
|
||||
|
||||
#config_name doesn't matter, change the influx_host to your LANforge device,
|
||||
echo "run Dataplane test"
|
||||
./lf_dataplane_test.py --mgr ${MGR} --instance_name dataplane-instance --config_name test_config --upstream 1.1.eth1 \
|
||||
--station 1.1.14 --dut linksys-8450 --influx_host ${INFLUX_MGR} --influx_port 8086 --influx_org Candela --influx_token ${INFLUXTOKEN} \
|
||||
--influx_bucket ${INFLUXBUCKET} --influx_tag testbed ${TESTBED} --graphgroups ${GROUPS}
|
||||
|
||||
./grafana_profile.py --create_custom --title ${TESTBED} --influx_bucket ${INFLUXBUCKET} --mgr ${MGR} --grafana_token ${GRAFANATOKEN} \
|
||||
--grafana_host ${INFLUX_MGR} --testbed ${TESTBED} --graph-groups ${GROUPS} \
|
||||
--scripts Dataplane --scripts 'WiFi Capacity'
|
||||
@@ -446,6 +446,8 @@ class WiFiCapacityTest(cv_test):
|
||||
if self.download_rate != "":
|
||||
cfg_options.append("dl_rate: " + self.download_rate)
|
||||
|
||||
cfg_options.append("save_csv: 1")
|
||||
|
||||
blob_test = "Wifi-Capacity-"
|
||||
|
||||
# We deleted the scenario earlier, now re-build new one line at a time.
|
||||
|
||||
Reference in New Issue
Block a user