mirror of
https://gitee.com/openharmony/testfwk_xdevice
synced 2024-11-23 07:20:44 +00:00
优化日志打印和hdc日志采集
Signed-off-by: deveco_xdevice <liguangjie1@huawei.com>
This commit is contained in:
parent
f6c98ff821
commit
f0905c77ee
@ -1579,13 +1579,15 @@ class DeviceLogCollector:
|
||||
if not begin:
|
||||
LOG.warning('hilog task begin time is not set')
|
||||
return
|
||||
minutes, _ = divmod(int(time.time() - begin), 60)
|
||||
minutes, seconds = divmod(int(time.time() - begin), 60)
|
||||
if minutes < 0:
|
||||
LOG.warning('get logs in a period failed!')
|
||||
LOG.warning('当前日志打印的时间先与开始抓取日志的时间')
|
||||
return
|
||||
# 若时间间隔小于1分钟,则将1分钟内生成的日志都拉下来
|
||||
unites = '%dm' % (minutes if minutes > 1 else 1)
|
||||
if minutes > 0:
|
||||
unites = '%dm' % minutes
|
||||
else:
|
||||
unites = '%ds' % seconds
|
||||
|
||||
remote_tmp = '/data/local/tmp/' + os.path.basename(local_path)
|
||||
for remote_dir, on_folder in remotes.items():
|
||||
|
@ -31,6 +31,7 @@ from _core.constants import ConfigConst
|
||||
from _core.error import ErrorMessage
|
||||
from _core.exception import ParamError
|
||||
from _core.logger import platform_logger
|
||||
from _core.testkit.json_parser import JsonParser
|
||||
from _core.utils import get_filename_extension
|
||||
from _core.utils import is_config_str
|
||||
from _core.utils import unique_id
|
||||
@ -332,7 +333,6 @@ def _make_test_descriptor(file_path, test_type_key):
|
||||
|
||||
def _get_test_driver(test_source):
|
||||
try:
|
||||
from _core.testkit.json_parser import JsonParser
|
||||
json_config = JsonParser(test_source)
|
||||
return json_config.get_driver_type()
|
||||
except ParamError as error:
|
||||
@ -380,12 +380,14 @@ def _make_test_descriptors_from_testsources(test_sources, config):
|
||||
|
||||
def _get_module_info(config_file):
|
||||
module_info_path = config_file.replace(MODULE_CONFIG_SUFFIX, MODULE_INFO_SUFFIX)
|
||||
if not os.path.exists(module_info_path):
|
||||
return NO_MODULE_SUBSYSTEM
|
||||
try:
|
||||
from _core.testkit.json_parser import JsonParser
|
||||
json_config = JsonParser(module_info_path)
|
||||
return json_config.get_module_subsystem()
|
||||
except ParamError as error:
|
||||
LOG.error(error, error_no=error.error_no)
|
||||
LOG.warning(error, error_no=error.error_no)
|
||||
return NO_MODULE_SUBSYSTEM
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user