Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Test Xdevice
提交
23c183df
T
Test Xdevice
项目概览
OpenHarmony
/
Test Xdevice
大约 1 年 前同步成功
通知
6
Star
23
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Test Xdevice
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
23c183df
编写于
9月 13, 2021
作者:
A
alex_hold
提交者:
Gitee
9月 13, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update src/xdevice/_core/testkit/kit_lite.py.
Signed-off-by: <hejian3@huawei.com>
上级
8df84570
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
12 addition
and
7 deletion
+12
-7
src/xdevice/_core/testkit/kit_lite.py
src/xdevice/_core/testkit/kit_lite.py
+12
-7
未找到文件。
src/xdevice/_core/testkit/kit_lite.py
浏览文件 @
23c183df
...
@@ -44,6 +44,7 @@ from _core.utils import get_local_ip
...
@@ -44,6 +44,7 @@ from _core.utils import get_local_ip
from
_core.utils
import
get_test_component_version
from
_core.utils
import
get_test_component_version
from
_core.exception
import
LiteDeviceConnectError
from
_core.exception
import
LiteDeviceConnectError
from
_core.constants
import
DeviceLabelType
from
_core.constants
import
DeviceLabelType
from
_core.constants
import
FilePermission
from
_core.environment.manager_env
import
DeviceAllocationState
from
_core.environment.manager_env
import
DeviceAllocationState
...
@@ -194,9 +195,8 @@ class MountKit(ITestKit):
...
@@ -194,9 +195,8 @@ class MountKit(ITestKit):
"mount nfs_ip:nfs_directory device"
"mount nfs_ip:nfs_directory device"
"_directory nfs"
]
"_directory nfs"
]
linux_commands
=
[
"cd /%s"
%
"storage"
,
linux_commands
=
[
"cd /%s"
%
"storage"
,
"fuser -k /%s/%s"
%
(
"storage"
,
"device_directory"
),
"umount -f /%s/%s"
%
(
"storage"
,
"device_directory"
),
"umount -f /%s/%s"
%
(
"storage"
,
"device_directory"
),
"
mount -t nfs -o nolock -o tc
p nfs_ip:nfs_directory "
"
toybox mount -t nfs -o nolock,addr=nfs_i
p nfs_ip:nfs_directory "
"/%s/%s"
%
(
"storage"
,
"device_directory"
),
"/%s/%s"
%
(
"storage"
,
"device_directory"
),
"chmod 755 -R /%s/%s"
%
(
"chmod 755 -R /%s/%s"
%
(
"storage"
,
"device_directory"
)]
"storage"
,
"device_directory"
)]
...
@@ -244,8 +244,15 @@ class MountKit(ITestKit):
...
@@ -244,8 +244,15 @@ class MountKit(ITestKit):
timeout
=
timeout
)
timeout
=
timeout
)
if
status
:
if
status
:
break
break
LOG
.
info
(
"mount failed,try "
if
"already mounted"
in
result
:
LOG
.
info
(
"{} is mounted"
.
format
(
target
))
break
LOG
.
info
(
"Mount failed,try "
"again {} time"
.
format
(
mount_time
))
"again {} time"
.
format
(
mount_time
))
if
mount_time
==
3
:
raise
LiteDeviceMountError
(
"Failed to mount the "
"device[00402]"
,
error_no
=
"00402"
)
else
:
else
:
result
,
status
,
_
=
device
.
execute_command_with_timeout
(
result
,
status
,
_
=
device
.
execute_command_with_timeout
(
command
=
command
,
case_type
=
case_type
,
timeout
=
timeout
)
command
=
command
,
case_type
=
case_type
,
timeout
=
timeout
)
...
@@ -365,9 +372,6 @@ class MountKit(ITestKit):
...
@@ -365,9 +372,6 @@ class MountKit(ITestKit):
device
.
execute_command_with_timeout
(
command
=
"cd /storage"
,
device
.
execute_command_with_timeout
(
command
=
"cd /storage"
,
timeout
=
1
)
timeout
=
1
)
for
mounted_dir
in
self
.
mounted_dir
:
for
mounted_dir
in
self
.
mounted_dir
:
device
.
execute_command_with_timeout
(
command
=
"fuser -k {}"
.
format
(
mounted_dir
),
timeout
=
2
)
device
.
execute_command_with_timeout
(
command
=
"umount -f "
device
.
execute_command_with_timeout
(
command
=
"umount -f "
"/storage{}"
.
"/storage{}"
.
format
(
mounted_dir
),
format
(
mounted_dir
),
...
@@ -514,7 +518,8 @@ class RootFsKit(ITestKit):
...
@@ -514,7 +518,8 @@ class RootFsKit(ITestKit):
hash_file_path
=
os
.
path
.
join
(
report_path
,
hash_file_name
)
hash_file_path
=
os
.
path
.
join
(
report_path
,
hash_file_name
)
# write result to file
# write result to file
hash_file_path_open
=
os
.
open
(
hash_file_path
,
os
.
O_WRONLY
|
hash_file_path_open
=
os
.
open
(
hash_file_path
,
os
.
O_WRONLY
|
os
.
O_CREAT
|
os
.
O_APPEND
,
0o755
)
os
.
O_CREAT
|
os
.
O_APPEND
,
FilePermission
.
mode_755
)
with
os
.
fdopen
(
hash_file_path_open
,
mode
=
"w"
)
as
hash_file
:
with
os
.
fdopen
(
hash_file_path_open
,
mode
=
"w"
)
as
hash_file
:
hash_file
.
write
(
result
)
hash_file
.
write
(
result
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录