!85 modified xdevice

Merge pull request !85 from jiyong/local-1112
This commit is contained in:
openharmony_ci
2022-03-01 12:15:30 +00:00
committed by Gitee
2 changed files with 21 additions and 2 deletions
@@ -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
@@ -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):