提交 f6a0539d 编写于 作者: O openharmony_ci 提交者: Gitee

!22 适配hdc协议变更

Merge pull request !22 from alex_hold/master
...@@ -1052,8 +1052,8 @@ class HdcHelper: ...@@ -1052,8 +1052,8 @@ class HdcHelper:
@staticmethod @staticmethod
def handle_shake(connection, connect_key=""): def handle_shake(connection, connect_key=""):
reply = HdcHelper.read(connection, 40) reply = HdcHelper.read(connection, 48)
reply_size = struct.unpack(">I12s24s", reply) reply_size = struct.unpack(">I12s32s", reply)
banner_str = b'OHOS HDC' banner_str = b'OHOS HDC'
connect_key = connect_key.encode("utf-8") connect_key = connect_key.encode("utf-8")
size = struct.calcsize('12s256s') size = struct.calcsize('12s256s')
......
...@@ -84,6 +84,7 @@ class Scheduler(object): ...@@ -84,6 +84,7 @@ class Scheduler(object):
task_type = "" task_type = ""
task_name = "" task_name = ""
mode = "" mode = ""
proxy = None
# command_queue to store test commands # command_queue to store test commands
command_queue = [] command_queue = []
...@@ -789,6 +790,10 @@ class Scheduler(object): ...@@ -789,6 +790,10 @@ class Scheduler(object):
LOG.info( LOG.info(
"get upload params: %s, %s, %s, %s, %s, %s" % ( "get upload params: %s, %s, %s, %s, %s, %s" % (
case_id, result, error, start_time, end_time, report_path)) case_id, result, error, start_time, end_time, report_path))
if Scheduler.proxy:
Scheduler.proxy.upload_result(case_id, result, error,
start_time, end_time, report_path)
return
from agent.factory import upload_result from agent.factory import upload_result
upload_result(case_id, result, error, start_time, end_time, upload_result(case_id, result, error, start_time, end_time,
report_path) report_path)
...@@ -814,7 +819,6 @@ class Scheduler(object): ...@@ -814,7 +819,6 @@ class Scheduler(object):
error_no="00201") error_no="00201")
return return
LOG.info("need upload %s case" % len(upload_params)) LOG.info("need upload %s case" % len(upload_params))
from agent.factory import upload_batch
upload_suite = [] upload_suite = []
for upload_param in upload_params: for upload_param in upload_params:
case_id, result, error, start_time, end_time, report_path = \ case_id, result, error, start_time, end_time, report_path = \
...@@ -824,6 +828,11 @@ class Scheduler(object): ...@@ -824,6 +828,11 @@ class Scheduler(object):
"report": report_path} "report": report_path}
LOG.info("case info: %s", case) LOG.info("case info: %s", case)
upload_suite.append(case) upload_suite.append(case)
if Scheduler.proxy:
Scheduler.proxy.upload_result(case_id, result, error,
start_time, end_time, report_path)
return
from agent.factory import upload_batch
upload_batch(upload_suite) upload_batch(upload_suite)
@classmethod @classmethod
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册