!309 修复Mount异常失败的bug

Merge pull request !309 from liguangjie/OpenHarmony-5.0.1-Release
This commit is contained in:
openharmony_ci 2024-11-13 07:03:13 +00:00 committed by Gitee
commit 63f672a9fe
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -58,6 +58,9 @@ def execute_query(device, query):
if not query:
LOG.debug("query bin is none")
return
if device.device_props:
LOG.debug("query bin has been executed")
return
LOG.debug("execute query bin begins")
if device.__get_device_kernel__() == DeviceLiteKernel.linux_kernel:
command = f"chmod +x /storage{query} && /storage{query}"
@ -239,14 +242,17 @@ class MountKit(ITestKit):
if target in self.mounted_dir:
LOG.debug("%s is mounted" % target)
continue
if target == "/test_root/tools" and device.device_props:
LOG.debug("query bin has been executed, '/test_root/tools' no need to mount again")
continue
mkdir_on_board(device, target)
# local nfs server need use alias of dir to mount
temp_linux_directory = linux_directory
if is_remote.lower() == "false":
linux_directory = get_mount_dir(linux_directory)
temp_linux_directory = get_mount_dir(linux_directory)
for command in commands:
command = command.replace("nfs_ip", linux_host). \
replace("nfs_directory", linux_directory).replace(
replace("nfs_directory", temp_linux_directory).replace(
"device_directory", target).replace("//", "/")
timeout = 15 if command.startswith("mount") else 1
if command.startswith("mount"):