diff --git a/extension/src/xdevice_extension/_core/constants.py b/extension/src/xdevice_extension/_core/constants.py index 9916642..a927459 100644 --- a/extension/src/xdevice_extension/_core/constants.py +++ b/extension/src/xdevice_extension/_core/constants.py @@ -135,6 +135,7 @@ class DeviceTestType(object): lite_cpp_test = "LiteUnitTest" open_source_test = "OpenSourceTest" build_only_test = "BuildOnlyTestLite" + ltp_posix_test = "LtpPosixTest" @dataclass @@ -205,6 +206,7 @@ class CommonParserType: cpptest = "CppTest" cpptest_list = "CppTestList" junit = "JUnit" + ltp_posix = "LtpPosixTest" @dataclass diff --git a/extension/src/xdevice_extension/_core/testkit/kit.py b/extension/src/xdevice_extension/_core/testkit/kit.py index e7f65a3..6e098e2 100644 --- a/extension/src/xdevice_extension/_core/testkit/kit.py +++ b/extension/src/xdevice_extension/_core/testkit/kit.py @@ -131,6 +131,7 @@ class PushKit(ITestKit): LOG.debug("PushKit setup, device:{}".format(device.device_sn)) for command in self.pre_push: run_command(device, command) + dst = None for push_info in self.push_list: files = re.split('->|=>', push_info) if len(files) != 2: @@ -152,10 +153,26 @@ class PushKit(ITestKit): LOG.warning(error, error_no=error.error_no) continue remount(device) - device.hdc_command("file send {} {}".format(real_src_path, dst)) - LOG.debug("Push file finished from {} to {}".format(src, dst)) + # hdc don't support push directory now + if os.path.isdir(real_src_path): + device.hdc_command("shell mkdir {}".format(dst)) + for root, _, files in os.walk(real_src_path): + for file in files: + device.hdc_command( + "file send {} {}".format(os.path.join(root, file), + dst)) + LOG.debug( + "Push file finished from {} to {}".format( + os.path.join(root, file), dst)) + self.pushed_file.append(file) + else: + device.hdc_command("file send {} {}".format(real_src_path, + dst)) + LOG.debug("Push file finished from {} to {}".format(src, dst)) + self.pushed_file.append(real_src_path) for command in self.post_push: run_command(device, command) + return self.pushed_file, dst def add_pushed_dir(self, src, dst): for root, _, files in os.walk(src):