Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Applications Sample Wifi Iot
提交
18549928
A
Applications Sample Wifi Iot
项目概览
OpenHarmony
/
Applications Sample Wifi Iot
大约 1 年 前同步成功
通知
3
Star
24
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
Applications Sample Wifi Iot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
18549928
编写于
9月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!226 临时添加wifi连接后ping网重试,分布式组网失败添加日志
Merge pull request !226 from hongshaojie/cherry-pick-1664276999
上级
0b46e164
4500491e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
10 deletion
+20
-10
screenshot32/resource/capturescreentest.py
screenshot32/resource/capturescreentest.py
+20
-10
未找到文件。
screenshot32/resource/capturescreentest.py
浏览文件 @
18549928
...
...
@@ -134,7 +134,7 @@ def ImageCheck(str, testnum=1):
def
ConnectionJudgment
():
connection_status
=
EnterCmd
(
"hdc_std list targets"
,
2
)
connection_cnt
=
0
while
"7001005458323933328a"
not
in
connection_status
and
connection_cnt
<
15
:
while
args
.
device_num
not
in
connection_status
and
connection_cnt
<
15
:
connection_status
=
EnterCmd
(
"hdc_std list targets"
,
2
)
connection_cnt
+=
1
if
connection_cnt
==
15
:
...
...
@@ -315,7 +315,7 @@ if __name__ == "__main__":
mode
=
'a'
,
encoding
=
'utf-8'
)
as
cmd_f
:
cmd_f
.
write
(
"
\n
SmokeTest::::::Last failed, try again
\n
"
)
cmd_f
.
close
()
if
idx
==
2
or
idx
==
3
or
idx
==
8
:
if
idx
==
2
or
idx
==
8
:
testcnt
=
1
if
single_app
[
'entry'
]
!=
""
:
EnterShellCmd
(
call_app_cmd
,
5
)
...
...
@@ -536,10 +536,13 @@ if __name__ == "__main__":
EnterShellCmd
(
"sed -i 's/enforcing/permissive/g' /system/etc/selinux/config"
,
1
)
EnterShellCmd
(
"cat /system/etc/selinux/config | grep SELINUX="
,
1
)
EnterShellCmd
(
"reboot"
)
for
i
in
range
(
6
):
EnterCmd
(
"hdc_std list targets"
,
5
)
unlockcnt
=
3
hdc_list
=
EnterCmd
(
"hdc_std list targets"
,
3
)
waitcnt
=
0
while
args
.
device_num
not
in
hdc_list
and
waitcnt
<
15
:
hdc_list
=
EnterCmd
(
"hdc_std list targets"
,
3
)
waitcnt
+=
1
PrintToLog
(
"SmokeTest:: start remove lock"
)
unlockcnt
=
3
while
unlockcnt
:
EnterShellCmd
(
"uinput -T -m 425 1000 425 400;power-shell wakeup;
\
uinput -T -m 425 400 425 1000;power-shell setmode 602;uinput -T -m 425 1000 425 400;"
,
1
)
...
...
@@ -555,6 +558,10 @@ if __name__ == "__main__":
PrintToLog
(
"SmokeTest:: error: name {}, index {}, these testcase is failed"
.
format
(
fail_name_list
,
\
fail_idx_list
))
SysExit
()
if
ping_cnt
==
60
:
PrintToLog
(
"SmokeTest:: Ping failed, timeout of 5 minutes"
)
PrintToLog
(
"SmokeTest:: please check the testcase {}"
.
format
(
fail_name_list
))
SysExit
()
elif
args
.
test_num
==
"2/2"
:
EnterShellCmd
(
"ifconfig eth0 192.168.0.2"
,
1
)
ping_result
=
EnterShellCmd
(
"ping 192.168.0.1 -i 1 -c 2"
,
3
)
...
...
@@ -562,9 +569,14 @@ if __name__ == "__main__":
while
"2 packets transmitted, 2 received"
not
in
ping_result
and
ping_cnt
<
60
:
ping_result
=
EnterShellCmd
(
"ping 192.168.0.1 -i 1 -c 2"
,
5
)
ping_cnt
+=
1
if
ping_cnt
==
60
:
PrintToLog
(
"SmokeTest:: Ping failed, timeout of 5 minutes"
)
PrintToLog
(
"SmokeTest:: please check the testcase {}"
.
format
(
fail_name_list
))
SysExit
()
PrintToLog
(
"SmokeTest:: ##### case 13 : distributed test start #####"
)
execute_path
=
os
.
path
.
normpath
(
os
.
path
.
join
(
args
.
tools_path
,
"DistributedTest"
))
PrintToLog
(
"SmokeTest:: execute_path {}"
.
format
(
execute_path
))
EnterShellCmd
(
"rm /data/log/hilog/*;hilog -r;hilog -w start -l 400000000 -m none"
,
1
)
os
.
system
(
"cd {} && python main.py run -l DistributedTest"
.
format
(
execute_path
))
report_path
=
os
.
path
.
normpath
(
os
.
path
.
join
(
args
.
tools_path
,
"DistributedTest
\\
reports"
))
PrintToLog
(
"SmokeTest:: report_path {}"
.
format
(
report_path
))
...
...
@@ -585,11 +597,6 @@ if __name__ == "__main__":
fs
.
close
()
except
Exception
as
reason
:
PrintToLog
(
"SmokeTest:: task_log.log is not exist!"
)
PrintToLog
(
"SmokeTest:: error:testcase 13, distributed failed!"
)
if
len
(
fail_idx_list
)
!=
0
:
PrintToLog
(
"SmokeTest:: error: name {}, index {}, these testcase is failed"
.
format
(
fail_name_list
,
\
fail_idx_list
))
SysExit
()
if
distributed_result
==
1
:
PrintToLog
(
"SmokeTest:: testcase 13, distributed is ok!"
)
else
:
...
...
@@ -597,6 +604,9 @@ if __name__ == "__main__":
if
len
(
fail_idx_list
)
!=
0
:
PrintToLog
(
"SmokeTest:: error: name {}, index {}, these testcase is failed"
.
format
(
fail_name_list
,
\
fail_idx_list
))
EnterShellCmd
(
"hilog -w stop"
,
1
)
EnterShellCmd
(
"cd /data/log/hilog && tar -cf distributed_log.tar *"
,
1
)
GetFileFromDev
(
"/data/log/hilog/distributed_log.tar"
,
args
.
save_path
)
SysExit
()
EnterShellCmd
(
"cd /data/log/faultlog/temp && tar -cf after_test_crash_log_{}.tar cppcrash*"
.
format
(
args
.
device_num
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录