mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-10-31 18:58:01 +00:00
rvr_scenario: Fix whitespace
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -12,7 +12,6 @@ if sys.version_info[0] != 3:
|
|||||||
print("This script requires Python 3")
|
print("This script requires Python 3")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
|
||||||
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
|
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
|
||||||
|
|
||||||
LFUtils = importlib.import_module("py-json.LANforge.LFUtils")
|
LFUtils = importlib.import_module("py-json.LANforge.LFUtils")
|
||||||
@@ -29,9 +28,12 @@ Realm = realm.Realm
|
|||||||
cvScenario.test_scenario = args.test_scenario
|
cvScenario.test_scenario = args.test_scenario
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class RunCvScenario(LFCliBase):
|
class RunCvScenario(LFCliBase):
|
||||||
def __init__(self, lfhost="localhost", lfport=8080, debug_=False, lanforge_db_=None, cv_scenario_=None, cv_test_=None, test_scenario_=None):
|
def __init__(self, lfhost="localhost", lfport=8080, debug_=False, lanforge_db_=None, cv_scenario_=None,
|
||||||
super().__init__( _lfjson_host=lfhost, _lfjson_port=lfport, _debug=debug_, _exit_on_error=True, _exit_on_fail=True)
|
cv_test_=None, test_scenario_=None):
|
||||||
|
super().__init__(_lfjson_host=lfhost, _lfjson_port=lfport, _debug=debug_, _exit_on_error=True,
|
||||||
|
_exit_on_fail=True)
|
||||||
self.lanforge_db = lanforge_db_
|
self.lanforge_db = lanforge_db_
|
||||||
self.cv_scenario = cv_scenario_
|
self.cv_scenario = cv_scenario_
|
||||||
self.cv_test = cv_test_
|
self.cv_test = cv_test_
|
||||||
@@ -51,7 +53,7 @@ class RunCvScenario(LFCliBase):
|
|||||||
}
|
}
|
||||||
self.json_post("/cli-json/load", data)
|
self.json_post("/cli-json/load", data)
|
||||||
sleep(1)
|
sleep(1)
|
||||||
port_counter = 0;
|
port_counter = 0
|
||||||
attempts = 6
|
attempts = 6
|
||||||
while (attempts > 0) and (port_counter > 0):
|
while (attempts > 0) and (port_counter > 0):
|
||||||
sleep(1)
|
sleep(1)
|
||||||
@@ -103,7 +105,8 @@ class RunCvScenario(LFCliBase):
|
|||||||
"cv click test_ref Start",
|
"cv click test_ref Start",
|
||||||
"sleep 2",
|
"sleep 2",
|
||||||
"cv click test_ref 'Another Iteration'",
|
"cv click test_ref 'Another Iteration'",
|
||||||
"sleep 240", #sleep for (test duration for 1 time test takes x num iterations requested) - this example is 2 iterations
|
"sleep 240",
|
||||||
|
# sleep for (test duration for 1 time test takes x num iterations requested) - this example is 2 iterations
|
||||||
"cv click test_ref 'Another Iteration'", # unselect Another Iteration before test ends
|
"cv click test_ref 'Another Iteration'", # unselect Another Iteration before test ends
|
||||||
"sleep 50" # finish test
|
"sleep 50" # finish test
|
||||||
"cv get test_ref 'Report Location:'",
|
"cv get test_ref 'Report Location:'",
|
||||||
@@ -115,7 +118,6 @@ class RunCvScenario(LFCliBase):
|
|||||||
"sleep 1",
|
"sleep 1",
|
||||||
"exit"
|
"exit"
|
||||||
]
|
]
|
||||||
response_json = []
|
|
||||||
for command in commands:
|
for command in commands:
|
||||||
data = {
|
data = {
|
||||||
"cmd": command
|
"cmd": command
|
||||||
@@ -136,18 +138,16 @@ class RunCvScenario(LFCliBase):
|
|||||||
else:
|
else:
|
||||||
response_json = []
|
response_json = []
|
||||||
print("running %s..." % command, end='')
|
print("running %s..." % command, end='')
|
||||||
response = self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, response_json_list_=response_json)
|
self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=False, response_json_list_=response_json)
|
||||||
if debug_:
|
if debug_:
|
||||||
LFUtils.debug_printer.pprint(response_json)
|
LFUtils.debug_printer.pprint(response_json)
|
||||||
print("...proceeding")
|
print("...proceeding")
|
||||||
|
|
||||||
|
|
||||||
except Exception as x:
|
except Exception as x:
|
||||||
print(x)
|
print(x)
|
||||||
|
|
||||||
self._pass("report finished", print_=True)
|
self._pass("report finished", print_=True)
|
||||||
|
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -221,6 +221,8 @@ Example:
|
|||||||
|
|
||||||
report_file = run_cv_scenario.get_report_file_name()
|
report_file = run_cv_scenario.get_report_file_name()
|
||||||
print("Report file saved to " + report_file)
|
print("Report file saved to " + report_file)
|
||||||
|
|
||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user