Skip to content

Commit ffaf4e2

Browse files
committed
Merge pull request #128 from Shao-Feng/native
For executing Native Command on Windows Device, Add a new API in com-module
2 parents 646cbc4 + 00fb6cc commit ffaf4e2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

testkitlite/commodule/windowshttp.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,22 @@ def stop_debug(self):
188188
global debug_flag
189189
debug_flag = False
190190

191+
def shell_cmd_ext(self,
192+
cmd="",
193+
timeout=None,
194+
boutput=False,
195+
stdout_file=None,
196+
stderr_file=None):
197+
cmd_json = {}
198+
cmd_json['cmd'] = cmd
199+
server_url = "http://%s:8000" % self.deviceip
200+
result = http_request(
201+
get_url(server_url, "/general_cmd_response"), "POST", cmd_json, 30)
202+
LOGGER.info("Response exit_code: %s" % result["exit_code"])
203+
LOGGER.info("Response output: %s" % result["output"])
204+
time.sleep(1)
205+
return [int(result["exit_code"]), result["output"], ""]
206+
191207
######### commodule TC execution end #############
192208

193209
def get_target_conn(deviceip=None):

0 commit comments

Comments
 (0)