labgrid.protocol.CommandProtocol run_check #1379
-
Hi all, And yes i know: basic usage is not expecting anything but valid or stop, in my case the customer likes to do some provisioning during test, which requires different wait times (longer than regular ssh timeout) depending whether some settings have to be updated or are already correct. I'd like to do sth like (simple pseudo code): try:
cli.run_check(___provision.sth)
except ExecutionError as e:
if e.retcode = 0x1003:
time.sleep(30)
cli.run_check(__verifyprovision)
else:
raise e
test_device() Any ideas are welcome, i do not want to modify sshdriver if not absolutely required, i guess someone had sth like that before? Regards Andreas |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You'll want to use _, _, retcode = cli.run(___provision.sth)
if retcode = 0x1003:
time.sleep(30)
cli.run_check(__verifyprovision)
test_device() |
Beta Was this translation helpful? Give feedback.
You'll want to use
run()
instead ofrun_check()
.run()
returns the return code and your script can decide how to proceed.With your pseudo code: