From 1da6d7d2f36c71bb4d671167e74c5dee98c46384 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Sun, 30 Jan 2022 20:18:02 -0800 Subject: [PATCH] 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 --- py-json/cv_test_manager.py | 10 ++++++++-- py-scripts/create_chamberview.py | 26 +++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/py-json/cv_test_manager.py b/py-json/cv_test_manager.py index ed6e36de..4e06db94 100644 --- a/py-json/cv_test_manager.py +++ b/py-json/cv_test_manager.py @@ -85,10 +85,13 @@ class cv_test(Realm): def __init__(self, lfclient_host="localhost", lfclient_port=8080, - lf_report_dir=None + lf_report_dir=None, + debug_=False, ): super().__init__(lfclient_host=lfclient_host, - lfclient_port=lfclient_port) + lfclient_port=lfclient_port, + debug_=debug_ + ) self.lf_report_dir = lf_report_dir self.report_name = None @@ -440,6 +443,9 @@ class cv_test(Realm): text_blob = "profile_link" + " " + Resources + " " + Profile + " " + Amount + " " + "\'DUT:" + " " + DUT \ + " " + Dut_Radio + "\' " + Traffic + " " + Uses1 + "," + Uses2 + " " + Freq + " " + VLAN + if self.debug: + print("text-blob-line: %s" % (text_blob)) + data = { "type": "Network-Connectivity", "name": scenario_name, diff --git a/py-scripts/create_chamberview.py b/py-scripts/create_chamberview.py index 1dfff7b6..f2131476 100755 --- a/py-scripts/create_chamberview.py +++ b/py-scripts/create_chamberview.py @@ -36,6 +36,7 @@ import importlib import argparse import time import re +from pprint import pprint if sys.version_info[0] != 3: print("This script requires Python 3") @@ -51,10 +52,12 @@ class CreateChamberview(cv): def __init__(self, lfmgr="localhost", port="8080", + _debug_on=False, ): super().__init__( lfclient_host=lfmgr, lfclient_port=port, + debug_=_debug_on ) self.lfmgr = lfmgr self.port = port @@ -71,9 +74,11 @@ class CreateChamberview(cv): raw_line=None): if raw_line: - print("creating %s scenario" % create_scenario) + print("creating %s scenario using raw lines" % create_scenario) 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 if line: @@ -90,7 +95,13 @@ class CreateChamberview(cv): Freq = "-1" VLAN = "" + #print("line: ") + #pprint(line) + for item in line: + #print("item: ") + #pprint(item) + if " " in item[0]: item[0] = (re.split(' ', item[0])) elif "," in item[0]: @@ -99,8 +110,10 @@ class CreateChamberview(cv): print("Wrong arguments entered !") exit(1) - print("creating %s scenario" % scenario_name) for sub_item in item[0]: + #print("sub-item: ") + #pprint(sub_item) + sub_item = sub_item.split("=") if sub_item[0] == "Resource" or str( sub_item[0]) == "Res" or sub_item[0] == "R": @@ -212,9 +225,16 @@ def main(): default=False, action='store_true', help="delete scenario (by default: False)") + parser.add_argument('--debug', + '-d', + default=False, + action="store_true", + help='Enable debugging') + args = parser.parse_args() Create_Chamberview = CreateChamberview(lfmgr=args.lfmgr, + _debug_on=args.debug, port=args.port, ) if args.delete_scenario: