From 7c6e4a9ddcf3ef719a8a06680edf7382ec7b0c68 Mon Sep 17 00:00:00 2001 From: openharmony_ci <120357966@qq.com> Date: Mon, 22 Jul 2024 02:59:21 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!461=20:?= =?UTF-8?q?=20=E5=86=92=E7=83=9F=E6=B5=8B=E8=AF=95=E5=A2=9E=E5=8A=A0hilog'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cases/smoke/basic/screenshot32/new_script/conftest.py | 8 ++++---- cases/smoke/basic/screenshot32/new_script/utils/device.py | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cases/smoke/basic/screenshot32/new_script/conftest.py b/cases/smoke/basic/screenshot32/new_script/conftest.py index fb6fdc9..798bce2 100644 --- a/cases/smoke/basic/screenshot32/new_script/conftest.py +++ b/cases/smoke/basic/screenshot32/new_script/conftest.py @@ -21,7 +21,7 @@ def device(request): @pytest.fixture(scope='module') def setup_teardown(request, device): - logging.info('--------------setup--------------') + # logging.info('setup--------') current_case = os.path.basename(request.path)[:-3] # 日志截图等保存路径 device.report_path = os.path.realpath(os.path.dirname(request.config.option.htmlpath)) @@ -29,7 +29,7 @@ def setup_teardown(request, device): device.resource_path = os.path.join(os.path.dirname(__file__), 'resource') os.makedirs(device.report_path, exist_ok=True) # device.rm_faultlog() - device.start_hilog() + # device.start_hilog() device.wakeup() device.set_power_mode() device.set_screen_timeout() @@ -41,9 +41,9 @@ def setup_teardown(request, device): yield - logging.info('--------------teardown--------------') + # logging.info('后置操作') device.go_home() logging.info('clear recent task') device.clear_recent_task() device.clean_app_data(request.param) - device.stop_and_collect_hilog('{}.tar'.format(current_case)) + # device.stop_and_collect_hilog() diff --git a/cases/smoke/basic/screenshot32/new_script/utils/device.py b/cases/smoke/basic/screenshot32/new_script/utils/device.py index cddf6e6..0561135 100644 --- a/cases/smoke/basic/screenshot32/new_script/utils/device.py +++ b/cases/smoke/basic/screenshot32/new_script/utils/device.py @@ -420,11 +420,10 @@ class Device: self.hdc_shell('hilog -w stop;hilog -w clear') self.hdc_shell('hilog -r;hilog -b INFO;hilog -w start -l 10M -n 1000') - def stop_and_collect_hilog(self, local_file=''): + def stop_and_collect_hilog(self, local_dir=''): # logging.info('停止并收集hilog') self.hdc_shell('hilog -w stop') - self.hdc_shell(f'cd /data/log/hilog && tar -cf {local_file} *') - self.hdc_file_recv(f'/data/log/hilog/{local_file}') + self.hdc_file_recv('/data/log/hilog/', local_dir) def unlock(self): """ -- Gitee