From fc82b0b643d1d7c61044e485f37550a1a669686d Mon Sep 17 00:00:00 2001 From: liyanlin02 Date: Tue, 18 Jun 2024 13:55:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=9D=E5=AD=98hilog=E4=BE=BF=E4=BA=8E?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=AE=9A=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liyanlin02 --- .../resource/capturescreentest.py | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/cases/smoke/basic/screenshot32/resource/capturescreentest.py b/cases/smoke/basic/screenshot32/resource/capturescreentest.py index 0e3a068d..237635f3 100644 --- a/cases/smoke/basic/screenshot32/resource/capturescreentest.py +++ b/cases/smoke/basic/screenshot32/resource/capturescreentest.py @@ -83,7 +83,7 @@ def enter_cmd(mycmd, waittime=0, printresult=1): def enter_shell_cmd(shellcmd, waittime=1, printresult=1): if shellcmd == "": return - cmd = 'hdc -t {} shell "{}"'.format(args.device_num, shellcmd) + cmd = 'hdc -l0 -t {} shell "{}"'.format(args.device_num, shellcmd) return enter_cmd(cmd, waittime, printresult) @@ -98,12 +98,12 @@ def sys_exit(): def file_to_dev(src, dst): - cmd = 'hdc -t {} file send "{}" "{}"'.format(args.device_num, src, dst) + cmd = 'hdc -l0 -t {} file send "{}" "{}"'.format(args.device_num, src, dst) return enter_cmd(cmd, 1, 1) def file_from_dev(src, dst): - cmd = 'hdc -t {} file recv "{}" "{}"'.format(args.device_num, src, dst) + cmd = 'hdc -l0 -t {} file recv "{}" "{}"'.format(args.device_num, src, dst) return enter_cmd(cmd, 1, 1) @@ -344,6 +344,10 @@ if __name__ == "__main__": WAIT_TIME_TWO = 2 WAIT_TIME_FOUR = 4 + # 保存hilog + enter_shell_cmd("hilog -w stop") + enter_shell_cmd('rm -rf /data/log/hilog/*') + enter_shell_cmd('hilog -w start -l 1M -n 1000 -m zlib -j 11') reboot_cnt = 2 while reboot_cnt: reboot_cnt -= 1 @@ -353,11 +357,11 @@ if __name__ == "__main__": while rmlock_cnt: enter_shell_cmd("uinput -T -m 425 400 425 1000;uinput -T -m 425 1000 425 400") rmlock_cnt -= 1 - enter_shell_cmd("hilog -w stop") - enter_shell_cmd( - "cd /data/log/hilog && tar -cf system_start_log_{}.tar *".format(args.device_num)) - file_from_dev("/data/log/hilog/system_start_log_{}.tar".format(args.device_num), - args.save_path) + # enter_shell_cmd("hilog -w stop") + # enter_shell_cmd( + # "cd /data/log/hilog && tar -cf system_start_log_{}.tar *".format(args.device_num)) + # file_from_dev("/data/log/hilog/system_start_log_{}.tar".format(args.device_num), + # args.save_path) connect_check() launcher_similarity = shot_and_cmp("launcher.jpeg") power_state = enter_shell_cmd("hidumper -s 3308") @@ -400,6 +404,9 @@ if __name__ == "__main__": if findp == -1: lose_process.append(pname) + enter_shell_cmd("hilog -w stop") + enter_shell_cmd("cd /data/log/hilog && tar -cf system_start_log_{}.tar *".format(args.device_num)) + file_from_dev("/data/log/hilog/system_start_log_{}.tar".format(args.device_num),args.save_path) if lose_process: print_to_log("SmokeTest: error: %s, These processes do not exist!!!" % lose_process) sys_exit() From 85afa1116acb6c6935adcf43086795dd4f59f819 Mon Sep 17 00:00:00 2001 From: liyanlin02 Date: Tue, 18 Jun 2024 14:06:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?hdc=E5=91=BD=E4=BB=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liyanlin02 --- .../basic/screenshot32/resource/capturescreentest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cases/smoke/basic/screenshot32/resource/capturescreentest.py b/cases/smoke/basic/screenshot32/resource/capturescreentest.py index 237635f3..5123f63b 100644 --- a/cases/smoke/basic/screenshot32/resource/capturescreentest.py +++ b/cases/smoke/basic/screenshot32/resource/capturescreentest.py @@ -389,7 +389,7 @@ if __name__ == "__main__": two_check_process_list = text.split('#####')[1].split()[0:-1] other_process_list = text.split('#####')[2].split() for pname in two_check_process_list: - pids = enter_cmd("hdc -t {} shell pidof {}".format(args.device_num, pname), 0, 1) + pids = enter_cmd("hdc -l0 -t {} shell pidof {}".format(args.device_num, pname), 0, 1) try: pidlist = pids.split() int(pidlist[0]) @@ -514,17 +514,17 @@ if __name__ == "__main__": elif type(single_action[1]) == str and single_action[1] == 'install_hap': next_cmd = "" if len(single_action) == 3: - enter_cmd("hdc -t {} install \"{}\"".format(args.device_num, + enter_cmd("hdc -l0 -t {} install \"{}\"".format(args.device_num, os.path.normpath(os.path.join(args.tools_path, single_action[2])))) elif type(single_action[1]) == str and single_action[1] == 'get_file_from_dev': next_cmd = "" if len(single_action) == 3: - enter_cmd("hdc -t {} file recv \"{}\" \"{}\"".format(args.device_num, + enter_cmd("hdc -l0 -t {} file recv \"{}\" \"{}\"".format(args.device_num, single_action[2], os.path.normpath(args.save_path))) elif type(single_action[1]) == str and single_action[1] == 'send_file_to_dev': next_cmd = "" if len(single_action) == 4: - enter_cmd("hdc -t {} file send \"{}\" \"{}\"".format(args.device_num, + enter_cmd("hdc -l0 -t {} file send \"{}\" \"{}\"".format(args.device_num, os.path.normpath(os.path.join(args.tools_path, single_action[2])), single_action[3])) elif type(single_action[1]) == str and single_action[1] == 'connect_wifi': next_cmd = ""