mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 03:37:55 +00:00
run_cv_scenario.py: WIP: working on checking post results of 'is_built'
This commit is contained in:
@@ -88,19 +88,34 @@ class RunCvScenario(LFCliBase):
|
|||||||
"cv apply '%s'" % self.cv_scenario,
|
"cv apply '%s'" % self.cv_scenario,
|
||||||
"cv build",
|
"cv build",
|
||||||
"cv is_built",
|
"cv is_built",
|
||||||
"cv create '%r' test_ref",
|
"cv create '%s' test_ref" % self.cv_test,
|
||||||
"cv load test_ref '%s'" % self.cv_test,
|
"cv load test_ref '%s'" % self.cv_scenario
|
||||||
"cv click test_ref 'Auto Save Report'",
|
# "cv click test_ref 'Auto Save Report'",
|
||||||
"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
|
self.use_preexec = False
|
||||||
|
response_json = ["nothing"]
|
||||||
for command in commands:
|
for command in commands:
|
||||||
data = {
|
data = {
|
||||||
"cmd": command
|
"cmd": command
|
||||||
}
|
}
|
||||||
self.json_post("/gui-json/cmd?__debug=1", data, debug_=True)
|
try:
|
||||||
sleep(1)
|
|
||||||
|
print("List: ", type(response_json))
|
||||||
|
response = self.json_post("/gui-json/cmd?__debug=1", data, debug_=True, response_json_list_=response_json)
|
||||||
|
if command == "cv is_built":
|
||||||
|
print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
|
||||||
|
LFUtils.debug_printer.pprint(response_json)
|
||||||
|
last_response = response_json["LAST"]["response"];
|
||||||
|
if (last_response != "OK"):
|
||||||
|
print("keep waiting")
|
||||||
|
print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
sleep(1)
|
||||||
|
except Exception as x:
|
||||||
|
print(x)
|
||||||
|
|
||||||
self._fail("start unfinished", print_=True)
|
self._fail("start unfinished", print_=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user