mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 04:07:52 +00:00
JSON: wip: run cv scenario
This commit is contained in:
@@ -82,7 +82,7 @@ class RunCvScenario(LFCliBase):
|
|||||||
self._pass("Loaded scenario %s" % self.lanforge_db, True)
|
self._pass("Loaded scenario %s" % self.lanforge_db, True)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def start(self):
|
def start(self, debug_=False):
|
||||||
# /gui_cli takes commands keyed on 'cmd', so we create an array of commands
|
# /gui_cli takes commands keyed on 'cmd', so we create an array of commands
|
||||||
commands = [
|
commands = [
|
||||||
"cv apply '%s'" % self.cv_scenario,
|
"cv apply '%s'" % self.cv_scenario,
|
||||||
@@ -94,24 +94,25 @@ class RunCvScenario(LFCliBase):
|
|||||||
# "cv click test_ref Start"
|
# "cv click test_ref Start"
|
||||||
# "cv get rvr_instance 'Report Location:'"
|
# "cv get rvr_instance 'Report Location:'"
|
||||||
]
|
]
|
||||||
self.use_preexec = False
|
response_json = []
|
||||||
response_json = ["nothing"]
|
|
||||||
for command in commands:
|
for command in commands:
|
||||||
data = {
|
data = {
|
||||||
"cmd": command
|
"cmd": command
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
|
debug_par = ""
|
||||||
|
if debug_:
|
||||||
|
debug_par="?_debug=1"
|
||||||
print("List: ", type(response_json))
|
print("List: ", type(response_json))
|
||||||
response = self.json_post("/gui-json/cmd?__debug=1", data, debug_=True, response_json_list_=response_json)
|
if command.endswith("is_built"):
|
||||||
if command == "cv is_built":
|
print("xxxxxxxxxx command %s xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" % command)
|
||||||
print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
|
self.localrealm.wait_while_building(debug_=debug_)
|
||||||
LFUtils.debug_printer.pprint(response_json)
|
print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
|
||||||
last_response = response_json["LAST"]["response"];
|
|
||||||
if (last_response != "OK"):
|
|
||||||
print("keep waiting")
|
|
||||||
print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
|
|
||||||
exit(1)
|
exit(1)
|
||||||
|
else:
|
||||||
|
print("yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy")
|
||||||
|
response = self.json_post("/gui-json/cmd%s" % debug_par, data, debug_=True, response_json_list_=response_json)
|
||||||
|
print("yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy")
|
||||||
|
|
||||||
sleep(1)
|
sleep(1)
|
||||||
except Exception as x:
|
except Exception as x:
|
||||||
|
|||||||
Reference in New Issue
Block a user