mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-24 05:55:12 +00:00
python/cv: Start adding debugging to create_chamberview
Try to figure out why this doesn't work on testbed heather, at the least, I think DUT is probably wrong in the resgresison script. More work is needed to get this working. Signed-off-by: Ben Greear <greearb@candelatech.com>
This commit is contained in:
@@ -85,10 +85,13 @@ class cv_test(Realm):
|
|||||||
def __init__(self,
|
def __init__(self,
|
||||||
lfclient_host="localhost",
|
lfclient_host="localhost",
|
||||||
lfclient_port=8080,
|
lfclient_port=8080,
|
||||||
lf_report_dir=None
|
lf_report_dir=None,
|
||||||
|
debug_=False,
|
||||||
):
|
):
|
||||||
super().__init__(lfclient_host=lfclient_host,
|
super().__init__(lfclient_host=lfclient_host,
|
||||||
lfclient_port=lfclient_port)
|
lfclient_port=lfclient_port,
|
||||||
|
debug_=debug_
|
||||||
|
)
|
||||||
self.lf_report_dir = lf_report_dir
|
self.lf_report_dir = lf_report_dir
|
||||||
self.report_name = None
|
self.report_name = None
|
||||||
|
|
||||||
@@ -440,6 +443,9 @@ class cv_test(Realm):
|
|||||||
text_blob = "profile_link" + " " + Resources + " " + Profile + " " + Amount + " " + "\'DUT:" + " " + DUT \
|
text_blob = "profile_link" + " " + Resources + " " + Profile + " " + Amount + " " + "\'DUT:" + " " + DUT \
|
||||||
+ " " + Dut_Radio + "\' " + Traffic + " " + Uses1 + "," + Uses2 + " " + Freq + " " + VLAN
|
+ " " + Dut_Radio + "\' " + Traffic + " " + Uses1 + "," + Uses2 + " " + Freq + " " + VLAN
|
||||||
|
|
||||||
|
if self.debug:
|
||||||
|
print("text-blob-line: %s" % (text_blob))
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
"type": "Network-Connectivity",
|
"type": "Network-Connectivity",
|
||||||
"name": scenario_name,
|
"name": scenario_name,
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import importlib
|
|||||||
import argparse
|
import argparse
|
||||||
import time
|
import time
|
||||||
import re
|
import re
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
if sys.version_info[0] != 3:
|
if sys.version_info[0] != 3:
|
||||||
print("This script requires Python 3")
|
print("This script requires Python 3")
|
||||||
@@ -51,10 +52,12 @@ class CreateChamberview(cv):
|
|||||||
def __init__(self,
|
def __init__(self,
|
||||||
lfmgr="localhost",
|
lfmgr="localhost",
|
||||||
port="8080",
|
port="8080",
|
||||||
|
_debug_on=False,
|
||||||
):
|
):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
lfclient_host=lfmgr,
|
lfclient_host=lfmgr,
|
||||||
lfclient_port=port,
|
lfclient_port=port,
|
||||||
|
debug_=_debug_on
|
||||||
)
|
)
|
||||||
self.lfmgr = lfmgr
|
self.lfmgr = lfmgr
|
||||||
self.port = port
|
self.port = port
|
||||||
@@ -71,9 +74,11 @@ class CreateChamberview(cv):
|
|||||||
raw_line=None):
|
raw_line=None):
|
||||||
|
|
||||||
if raw_line:
|
if raw_line:
|
||||||
print("creating %s scenario" % create_scenario)
|
print("creating %s scenario using raw lines" % create_scenario)
|
||||||
for create_lines in raw_line:
|
for create_lines in raw_line:
|
||||||
self.pass_raw_lines_to_cv(create_scenario, create_lines[0])
|
ln = create_lines[0]
|
||||||
|
#print("ln: %s" % (ln))
|
||||||
|
self.pass_raw_lines_to_cv(create_scenario, ln)
|
||||||
|
|
||||||
# check for lines
|
# check for lines
|
||||||
if line:
|
if line:
|
||||||
@@ -90,7 +95,13 @@ class CreateChamberview(cv):
|
|||||||
Freq = "-1"
|
Freq = "-1"
|
||||||
VLAN = ""
|
VLAN = ""
|
||||||
|
|
||||||
|
#print("line: ")
|
||||||
|
#pprint(line)
|
||||||
|
|
||||||
for item in line:
|
for item in line:
|
||||||
|
#print("item: ")
|
||||||
|
#pprint(item)
|
||||||
|
|
||||||
if " " in item[0]:
|
if " " in item[0]:
|
||||||
item[0] = (re.split(' ', item[0]))
|
item[0] = (re.split(' ', item[0]))
|
||||||
elif "," in item[0]:
|
elif "," in item[0]:
|
||||||
@@ -99,8 +110,10 @@ class CreateChamberview(cv):
|
|||||||
print("Wrong arguments entered !")
|
print("Wrong arguments entered !")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
print("creating %s scenario" % scenario_name)
|
|
||||||
for sub_item in item[0]:
|
for sub_item in item[0]:
|
||||||
|
#print("sub-item: ")
|
||||||
|
#pprint(sub_item)
|
||||||
|
|
||||||
sub_item = sub_item.split("=")
|
sub_item = sub_item.split("=")
|
||||||
if sub_item[0] == "Resource" or str(
|
if sub_item[0] == "Resource" or str(
|
||||||
sub_item[0]) == "Res" or sub_item[0] == "R":
|
sub_item[0]) == "Res" or sub_item[0] == "R":
|
||||||
@@ -212,9 +225,16 @@ def main():
|
|||||||
default=False,
|
default=False,
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help="delete scenario (by default: False)")
|
help="delete scenario (by default: False)")
|
||||||
|
parser.add_argument('--debug',
|
||||||
|
'-d',
|
||||||
|
default=False,
|
||||||
|
action="store_true",
|
||||||
|
help='Enable debugging')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
Create_Chamberview = CreateChamberview(lfmgr=args.lfmgr,
|
Create_Chamberview = CreateChamberview(lfmgr=args.lfmgr,
|
||||||
|
_debug_on=args.debug,
|
||||||
port=args.port,
|
port=args.port,
|
||||||
)
|
)
|
||||||
if args.delete_scenario:
|
if args.delete_scenario:
|
||||||
|
|||||||
Reference in New Issue
Block a user