diff --git a/aw/python/distributed/common/devices.py b/aw/python/distributed/common/devices.py
index e0443f346df26b1a7d550ab6a0b67ca810e0c431..a8235867a5cb279e503b36001a01f428e6fd3566 100755
--- a/aw/python/distributed/common/devices.py
+++ b/aw/python/distributed/common/devices.py
@@ -122,6 +122,45 @@ class DeviceShell:
return device_para
+ @classmethod
+ def execute_command(cls, command, print_flag=True, timeout=900):
+ try:
+ if print_flag:
+ print("command: " + command)
+ if subprocess.call(command, shell=True, timeout=timeout) == 0:
+ print("results: successed")
+ return True
+ except Exception as error:
+ print("Exception: %s" % str(error))
+ print("results: failed")
+ return False
+
+ @classmethod
+ def execute_command_with_output(cls, command, print_flag=True):
+ if print_flag:
+ print("command: " + command)
+
+ proc = subprocess.Popen(command,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ shell=True)
+
+ result = ""
+ try:
+ data, _ = proc.communicate()
+ if isinstance(data, bytes):
+ result = data.decode('utf-8', 'ignore')
+ finally:
+ proc.stdout.close()
+ proc.stderr.close()
+ return result if result else data
+
+ @classmethod
+ def check_path_legal(cls, path):
+ if path and " " in path:
+ return "\"%s\"" % path
+ return path
+
def remount(self):
if self.conn_type:
remount = "target mount"
@@ -185,19 +224,6 @@ class DeviceShell:
command,
QUOTATION_MARKS))
- @classmethod
- def execute_command(cls, command, print_flag=True, timeout=900):
- try:
- if print_flag:
- print("command: " + command)
- if subprocess.call(command, shell=True, timeout=timeout) == 0:
- print("results: successed")
- return True
- except Exception as error:
- print("Exception: %s" % str(error))
- print("results: failed")
- return False
-
def shell_with_output(self, command=""):
return self.execute_command_with_output("%s %s shell %s%s%s" % (
HDC_TOOLS,
@@ -205,29 +231,4 @@ class DeviceShell:
QUOTATION_MARKS,
command,
QUOTATION_MARKS))
-
- @classmethod
- def execute_command_with_output(cls, command, print_flag=True):
- if print_flag:
- print("command: " + command)
-
- proc = subprocess.Popen(command,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- shell=True)
-
- result = ""
- try:
- data, _ = proc.communicate()
- if isinstance(data, bytes):
- result = data.decode('utf-8', 'ignore')
- finally:
- proc.stdout.close()
- proc.stderr.close()
- return result if result else data
-
- @classmethod
- def check_path_legal(cls, path):
- if path and " " in path:
- return "\"%s\"" % path
- return path
\ No newline at end of file
+
\ No newline at end of file
diff --git a/aw/python/distributed/common/manager.py b/aw/python/distributed/common/manager.py
index ef583156c2b1c0b2df849ddf9bc22c73e236c5e8..3fd8cc85bc8e86c66f45612c7df4ffc9b5111614 100755
--- a/aw/python/distributed/common/manager.py
+++ b/aw/python/distributed/common/manager.py
@@ -32,6 +32,23 @@ class DeviceManager:
self.tv_device_list = []
self.watch_device_list = []
self.make_device_list(result_path)
+
+ @staticmethod
+ def get_device_info_list(result):
+ device_info_list = []
+ tmp_path = os.path.join(result, "temp")
+ device_info_file_path = os.path.join(tmp_path,
+ "device_info_file.txt")
+
+ if os.path.exists(device_info_file_path):
+ with open(device_info_file_path, "r") as file_handle:
+ lines = file_handle.readlines()
+ for line in lines:
+ line = line.replace("\n", "")
+ line = line.strip()
+ temp = line.split(",")
+ device_info_list.append(temp)
+ return device_info_list
def make_device_adapter(self, device_info_list, device_name):
device = DeviceShell(self.is_hdc, device_sn=device_info_list[0],
@@ -71,22 +88,5 @@ class DeviceManager:
setattr(self, device.name, device)
return
- @staticmethod
- def get_device_info_list(result):
- device_info_list = []
- tmp_path = os.path.join(result, "temp")
- device_info_file_path = os.path.join(tmp_path,
- "device_info_file.txt")
-
- if os.path.exists(device_info_file_path):
- with open(device_info_file_path, "r") as file_handle:
- lines = file_handle.readlines()
- for line in lines:
- line = line.replace("\n", "")
- line = line.strip()
- temp = line.split(",")
- device_info_list.append(temp)
- return device_info_list
-
##############################################################################
##############################################################################
diff --git a/aw/python/distributed/distribute/distribute.py b/aw/python/distributed/distribute/distribute.py
index 1e68bd5a523a181e5b95a089f0972481b0b379a8..ad29c82ecfbba0fb086dcfb6b1235ec1769e755d 100755
--- a/aw/python/distributed/distribute/distribute.py
+++ b/aw/python/distributed/distribute/distribute.py
@@ -85,40 +85,6 @@ class Distribute:
self.agent_list = agent_list
self.hdc_tools = hdc_tools
- def exec_agent(self, device, target_name, result_path, options):
- driver = get_current_driver(device, target_name, self.hdc_tools)
- if driver is None:
- print("Error: driver is None.")
- return False
-
- resource_dir = get_resource_dir(self.suite_dir, device.name)
-
- self._make_agent_desc_file(device)
- device.push_file(os.path.join(self.suite_dir, "agent.desc"),
- device.test_path)
- device.push_file(os.path.join(resource_dir, target_name),
- device.test_path)
-
- suite_path = os.path.join(self.suite_dir, target_name)
- driver.execute(suite_path, result_path, options, background=True)
- return self._check_thread(device, target_name)
-
- def exec_major(self, device, target_name, result_path, options):
- driver = get_current_driver(device, target_name, self.hdc_tools)
- if driver is None:
- print("Error: driver is None.")
- return False
-
- resource_dir = get_resource_dir(self.suite_dir, device.name)
- self._make_major_desc_file()
- device.push_file(os.path.join(self.suite_dir, "major.desc"),
- device.test_path)
- device.push_file(os.path.join(resource_dir, target_name),
- device.test_path)
-
- suite_path = os.path.join(self.suite_dir, target_name)
- return driver.execute(suite_path, result_path, options, background=False)
-
@staticmethod
def pull_result(device, source_path, result_save_path):
_, file_name = os.path.split(source_path)
@@ -141,75 +107,6 @@ class Distribute:
break
return True if checksum < 100 else False
- def _make_agent_desc_file(self, device):
- agent_ip_list = ""
- device_uuid_list = ""
-
- if self.hdc_tools != "hdc":
- if self._query_device_uuid(self.major) != '':
- device_uuid_list += self._query_device_uuid(self.major) + ","
-
- if self._query_device_ip(device) != "":
- agent_ip_list += self._query_device_ip(device) + ","
-
- for agent in self.agent_list:
- if self._query_device_uuid(agent):
- device_uuid_list += self._query_device_uuid(agent) + ","
-
- config_info = DEVICE_INFO_TEMPLATE % (agent_ip_list, "8888",
- device_uuid_list)
-
- config_agent_file = os.path.join(self.suite_dir, "agent.desc")
- self._write_device_config(config_info, config_agent_file)
- else:
- if self._query_device_agent_uuid(self.major):
- device_uuid_list += self._query_device_agent_uuid(self.major) + ","
-
- if self._query_device_hdc_ip(device):
- agent_ip_list += self._query_device_hdc_ip(device) + ","
-
- for agent in self.agent_list:
- if self._query_device_agent_uuid(agent):
- device_uuid_list += self._query_device_agent_uuid(agent) + ","
-
- config_info = DEVICE_INFO_TEMPLATE % (agent_ip_list, "8888",
- device_uuid_list)
-
- config_agent_file = os.path.join(self.suite_dir, "agent.desc")
- self._write_device_config(config_info, config_agent_file)
-
- def _make_major_desc_file(self):
- agent_ip_list = ""
- device_uuid_list = ""
-
- if self.hdc_tools != "hdc":
- if self._query_device_uuid(self.major) != "NoneTyple":
- device_uuid_list += self._query_device_uuid(self.major) + ","
-
- for agent in self.agent_list:
- if self._query_device_ip(agent) != "" and self._query_device_uuid(agent) != "":
- agent_ip_list += self._query_device_ip(agent) + ","
- device_uuid_list += self._query_device_uuid(agent) + ","
-
- config_info = DEVICE_INFO_TEMPLATE % (agent_ip_list, "8888",
- device_uuid_list)
-
- config_major_file = os.path.join(self.suite_dir, "major.desc")
- self._write_device_config(config_info, config_major_file)
- else:
- if self._query_device_major_uuid(self.major):
- device_uuid_list += self._query_device_major_uuid(self.major) + ","
-
- for agent in self.agent_list:
- if self._query_device_major_uuid(agent):
- agent_ip_list += self._query_device_hdc_ip(agent) + ","
- device_uuid_list += self._query_device_major_uuid(agent) + ","
- config_info = DEVICE_INFO_TEMPLATE % (agent_ip_list, "8888",
- device_uuid_list)
-
- config_major_file = os.path.join(self.suite_dir, "major.desc")
- self._write_device_config(config_info, config_major_file)
-
@staticmethod
def _query_device_ip(device):
output = device.shell_with_output("getprop ro.hardware")
@@ -317,7 +214,108 @@ class Distribute:
file_desc.write(device_info)
os.rename(file_path, final_file)
+ def exec_agent(self, device, target_name, result_path, options):
+ driver = get_current_driver(device, target_name, self.hdc_tools)
+ if driver is None:
+ print("Error: driver is None.")
+ return False
+
+ resource_dir = get_resource_dir(self.suite_dir, device.name)
+
+ self._make_agent_desc_file(device)
+ device.push_file(os.path.join(self.suite_dir, "agent.desc"),
+ device.test_path)
+ device.push_file(os.path.join(resource_dir, target_name),
+ device.test_path)
+
+ suite_path = os.path.join(self.suite_dir, target_name)
+ driver.execute(suite_path, result_path, options, background=True)
+ return self._check_thread(device, target_name)
+
+ def exec_major(self, device, target_name, result_path, options):
+ driver = get_current_driver(device, target_name, self.hdc_tools)
+ if driver is None:
+ print("Error: driver is None.")
+ return False
+
+ resource_dir = get_resource_dir(self.suite_dir, device.name)
+ self._make_major_desc_file()
+ device.push_file(os.path.join(self.suite_dir, "major.desc"),
+ device.test_path)
+ device.push_file(os.path.join(resource_dir, target_name),
+ device.test_path)
+
+ suite_path = os.path.join(self.suite_dir, target_name)
+ return driver.execute(suite_path, result_path, options, background=False)
+
+ def _make_agent_desc_file(self, device):
+ agent_ip_list = ""
+ device_uuid_list = ""
+
+ if self.hdc_tools != "hdc":
+ if self._query_device_uuid(self.major) != '':
+ device_uuid_list += self._query_device_uuid(self.major) + ","
+
+ if self._query_device_ip(device) != "":
+ agent_ip_list += self._query_device_ip(device) + ","
+
+ for agent in self.agent_list:
+ if self._query_device_uuid(agent):
+ device_uuid_list += self._query_device_uuid(agent) + ","
+
+ config_info = DEVICE_INFO_TEMPLATE % (agent_ip_list, "8888",
+ device_uuid_list)
+ config_agent_file = os.path.join(self.suite_dir, "agent.desc")
+ self._write_device_config(config_info, config_agent_file)
+ else:
+ if self._query_device_agent_uuid(self.major):
+ device_uuid_list += self._query_device_agent_uuid(self.major) + ","
+
+ if self._query_device_hdc_ip(device):
+ agent_ip_list += self._query_device_hdc_ip(device) + ","
+
+ for agent in self.agent_list:
+ if self._query_device_agent_uuid(agent):
+ device_uuid_list += self._query_device_agent_uuid(agent) + ","
+
+ config_info = DEVICE_INFO_TEMPLATE % (agent_ip_list, "8888",
+ device_uuid_list)
+
+ config_agent_file = os.path.join(self.suite_dir, "agent.desc")
+ self._write_device_config(config_info, config_agent_file)
+
+ def _make_major_desc_file(self):
+ agent_ip_list = ""
+ device_uuid_list = ""
+
+ if self.hdc_tools != "hdc":
+ if self._query_device_uuid(self.major) != "NoneTyple":
+ device_uuid_list += self._query_device_uuid(self.major) + ","
+
+ for agent in self.agent_list:
+ if self._query_device_ip(agent) != "" and self._query_device_uuid(agent) != "":
+ agent_ip_list += self._query_device_ip(agent) + ","
+ device_uuid_list += self._query_device_uuid(agent) + ","
+
+ config_info = DEVICE_INFO_TEMPLATE % (agent_ip_list, "8888",
+ device_uuid_list)
+
+ config_major_file = os.path.join(self.suite_dir, "major.desc")
+ self._write_device_config(config_info, config_major_file)
+ else:
+ if self._query_device_major_uuid(self.major):
+ device_uuid_list += self._query_device_major_uuid(self.major) + ","
+
+ for agent in self.agent_list:
+ if self._query_device_major_uuid(agent):
+ agent_ip_list += self._query_device_hdc_ip(agent) + ","
+ device_uuid_list += self._query_device_major_uuid(agent) + ","
+ config_info = DEVICE_INFO_TEMPLATE % (agent_ip_list, "8888",
+ device_uuid_list)
+
+ config_major_file = os.path.join(self.suite_dir, "major.desc")
+ self._write_device_config(config_info, config_major_file)
##############################################################################
##############################################################################
diff --git a/libs/benchmark/report/benchmark_reporter.py b/libs/benchmark/report/benchmark_reporter.py
index b90bf2515ba2e86884f395bc7da2ff12c05052ca..c95772c2a11f34cbbbd7ef7175ab3e467e7e6993 100644
--- a/libs/benchmark/report/benchmark_reporter.py
+++ b/libs/benchmark/report/benchmark_reporter.py
@@ -29,6 +29,7 @@ from _core.logger import platform_logger
__all__ = ["BenchmarkReporter"]
LOG = platform_logger("BenchmarkReporter")
+
@Plugin(type=Plugin.REPORTER, id=TestType.benchmark)
class BenchmarkReporter(IReporter):
diff --git a/libs/benchmark/report/generate_report.py b/libs/benchmark/report/generate_report.py
index 264b51a29eb692ea0981672cb07f9927adfc89d0..39ec4f785460e58161346369ad338d6aea719e71 100644
--- a/libs/benchmark/report/generate_report.py
+++ b/libs/benchmark/report/generate_report.py
@@ -27,6 +27,7 @@ MODES = stat.S_IWUSR | stat.S_IRUSR
SETTING_RED_STYLE = """\033[33;31m%s\033[0m"""
+
def load_json_data(json_file_path):
json_data = {}
if os.path.isfile(json_file_path):
@@ -68,6 +69,7 @@ def get_file_list_by_postfix(path, postfix, filter_jar=""):
file_list.append(file_path)
return file_list
+
class BenchmarkReport(object):
SUBSYSTEM_SUMMARY = "OHOS_SUBSYSTEM_SUMMARY"
ENABLE_LINK = "OHOS_ENABLE_PASSCASE_LINK"
@@ -88,24 +90,7 @@ class BenchmarkReport(object):
self.sbs_mdl_summary_list = []
self.benchmark_list = []
self._init_default_item()
-
- def _init_default_item(self):
- self.default_item.append("Subsystem")
- self.default_item.append("Module")
- self.default_item.append("Testsuit")
- self.default_item.append("Benchmark")
- self.default_item.append("Mode")
- self.default_item.append("RunType")
- self.default_item.append("TestTargetName")
- self.default_item.append("TestTargetMethod")
- self.default_item.append("Repetitions")
- self.default_item.append("RepetitionIndex")
- self.default_item.append("Threads")
- self.default_item.append("Iterations")
- self.default_item.append("Score")
- self.default_item.append("CpuTime")
- self.max_index = len(self.default_item) + 1000
-
+
def generate_benchmark(self, args):
if args is None or len(args) <= 2:
print(SETTING_RED_STYLE %
@@ -129,6 +114,23 @@ class BenchmarkReport(object):
self._generate_benchmark_summary_report(os.path.abspath(dest_path))
self._generate_all_benchmark_detail(os.path.abspath(dest_path))
+ def _init_default_item(self):
+ self.default_item.append("Subsystem")
+ self.default_item.append("Module")
+ self.default_item.append("Testsuit")
+ self.default_item.append("Benchmark")
+ self.default_item.append("Mode")
+ self.default_item.append("RunType")
+ self.default_item.append("TestTargetName")
+ self.default_item.append("TestTargetMethod")
+ self.default_item.append("Repetitions")
+ self.default_item.append("RepetitionIndex")
+ self.default_item.append("Threads")
+ self.default_item.append("Iterations")
+ self.default_item.append("Score")
+ self.default_item.append("CpuTime")
+ self.max_index = len(self.default_item) + 1000
+
def _remove_iterations(self, mdl_summary_list):
final_mdl_summary = []
for item_info in mdl_summary_list:
diff --git a/libs/fuzzlib/fuzzer_helper.py b/libs/fuzzlib/fuzzer_helper.py
index 63dcb16ecde6c30ad49d85ceeabbcc43db2c7608..c1702f054c3e41013518dbc557d86a511c38f60e 100644
--- a/libs/fuzzlib/fuzzer_helper.py
+++ b/libs/fuzzlib/fuzzer_helper.py
@@ -166,7 +166,7 @@ def generate(args):
#complie fuzzer project
-def make(args, stdout=None):
+def make(args, stdout=None):
"""make fuzzer module."""
color_logger = Colored.get_project_logger()
diff --git a/libs/fuzzlib/tools/colored.py b/libs/fuzzlib/tools/colored.py
index 865c1f3dd384723a9ef81dd7314a38642c4332ad..9d2b267c785439405be893cc13e5a84017ef4dfb 100644
--- a/libs/fuzzlib/tools/colored.py
+++ b/libs/fuzzlib/tools/colored.py
@@ -56,6 +56,26 @@ class Colored(object):
self.log_project = log_project
self.log_date = time.strftime("%Y%m%d%H%M%S", time.localtime())
+ @staticmethod
+ def get_fuzz_log_dir():
+ return Colored.LOG_DIR
+
+ @staticmethod
+ def log_task_init(project):
+ Colored.LOG_TO_FILE = True
+ Colored.LOG_PROJECT = project
+ Colored.LOG_DATE = time.strftime("%Y%m%d%H%M%S", time.localtime())
+
+ if not os.path.exists(Colored.LOG_DIR):
+ os.mkdir(Colored.LOG_DIR)
+
+ project_log_dir = Colored.get_fuzz_project_log_dir()
+ if not os.path.exists(project_log_dir):
+ os.mkdir(project_log_dir)
+
+ current_project_log_dir = Colored.get_fuzz_current_project_log_dir()
+ if not os.path.exists(current_project_log_dir):
+ os.mkdir(current_project_log_dir)
def start_log_file(self):
self.is_log_file = True
@@ -100,7 +120,7 @@ class Colored(object):
Colored.RESET
)
else:
- msg = '{}{}{}'.format(
+ msg = '{}{}{}'.format(
getattr(Colored, color),
s,
Colored.RESET
@@ -137,25 +157,3 @@ class Colored(object):
def simple_print(self, s):
self.loghook(s)
print(s)
-
-
- @staticmethod
- def get_fuzz_log_dir():
- return Colored.LOG_DIR
-
- @staticmethod
- def log_task_init(project):
- Colored.LOG_TO_FILE = True
- Colored.LOG_PROJECT = project
- Colored.LOG_DATE = time.strftime("%Y%m%d%H%M%S", time.localtime())
-
- if not os.path.exists(Colored.LOG_DIR):
- os.mkdir(Colored.LOG_DIR)
-
- project_log_dir = Colored.get_fuzz_project_log_dir()
- if not os.path.exists(project_log_dir):
- os.mkdir(project_log_dir)
-
- current_project_log_dir = Colored.get_fuzz_current_project_log_dir()
- if not os.path.exists(current_project_log_dir):
- os.mkdir(current_project_log_dir)
diff --git a/libs/fuzzlib/tools/run_result.py b/libs/fuzzlib/tools/run_result.py
index f8f5e59e810265bf5edd6cda461e852bcfd10cad..875403b25f9b53f458c83ac2c02c0d856a0bff62 100644
--- a/libs/fuzzlib/tools/run_result.py
+++ b/libs/fuzzlib/tools/run_result.py
@@ -56,9 +56,6 @@ class RunResult():
"report_progress": 0
}
- def get_log(self):
- return "code :{}, msg: {}".format(self.code, self.data)
-
@staticmethod
def filter_log(log_str):
ansi_escape = re.compile(r'''
@@ -75,6 +72,9 @@ class RunResult():
result = ansi_escape.sub('', log_str)
return result
+ def get_log(self):
+ return "code :{}, msg: {}".format(self.code, self.data)
+
def analysis(self, result, outdir):
pass
diff --git a/libs/fuzzlib/tools/templates.py b/libs/fuzzlib/tools/templates.py
index deb56751d199e0da19607b1ff60173fc8ffe6c49..5a3cde3bf5adf7394c4165b6a238b733ecd2c593 100644
--- a/libs/fuzzlib/tools/templates.py
+++ b/libs/fuzzlib/tools/templates.py
@@ -186,7 +186,7 @@ REPORT_CSS_TEMPLATE = """
def render_tbody(data):
- res = ""
+ res = ""
for row in data:
row_line = "
"
for row_td in row:
diff --git a/localCoverage/__init__.py b/local_coverage/__init__.py
similarity index 100%
rename from localCoverage/__init__.py
rename to local_coverage/__init__.py
diff --git a/localCoverage/all_subsystem_config.json b/local_coverage/all_subsystem_config.json
similarity index 95%
rename from localCoverage/all_subsystem_config.json
rename to local_coverage/all_subsystem_config.json
index 342d02209dde5beeac37be4d8f05240f4331f787..c261eb8650944f77041da2966ca9e51f42a7deb7 100644
--- a/localCoverage/all_subsystem_config.json
+++ b/local_coverage/all_subsystem_config.json
@@ -1,1970 +1,1970 @@
-{
- "bundle_framework": {
- "name": "bundle_framework",
- "path": [
- "foundation/bundlemanager/bundle_framework"
- ]
- },
- "bundle_framework_lite": {
- "name": "bundle_framework_lite",
- "path": [
- "foundation/bundlemanager/bundle_framework_lite"
- ]
- },
- "packing_tool": {
- "name": "packing_tool",
- "path": [
- "developtools/packing_tool"
- ]
- },
- "appverify": {
- "name": "appverify",
- "path": [
- "base/security/appverify"
- ]
- },
- "zlib": {
- "name": "zlib",
- "path": [
- "third_party/zlib"
- ]
- },
- "ability_lite": {
- "name": "ability_lite",
- "path": [
- "foundation/ability/ability_lite"
- ]
- },
- "ability_base": {
- "name": "ability_base",
- "path": [
- "foundation/ability/ability_base"
- ]
- },
- "ability_runtime": {
- "name": "ability_runtime",
- "path": [
- "foundation/ability/ability_runtime"
- ]
- },
- "idl_tool": {
- "name": "idl_tool",
- "path": [
- "foundation/ability/idl_tool"
- ]
- },
- "form_fwk": {
- "name": "form_fwk",
- "path": [
- "foundation/ability/form_fwk"
- ]
- },
- "window_manager_lite": {
- "name": "window_manager_lite",
- "path": [
- "foundation/window/window_manager_lite"
- ]
- },
- "ui_lite": {
- "name": "ui_lite",
- "path": [
- "foundation/arkui/ui_lite"
- ]
- },
- "graphic_utils_lite": {
- "name": "graphic_utils_lite",
- "path": [
- "foundation/graphic/graphic_utils_lite"
- ]
- },
- "graphic_2d": {
- "name": "graphic_2d",
- "path": [
- "foundation/graphic/graphic_2d"
- ]
- },
- "graphic_2d_ext": {
- "name": "graphic_2d_ext",
- "path": [
- "foundation/graphic/graphic_2d_ext"
- ]
- },
- "image_framework": {
- "name": "image_framework",
- "path": [
- "foundation/multimedia/image_framework"
- ]
- },
- "background_task_mgr": {
- "name": "background_task_mgr",
- "path": [
- "foundation/resourceschedule/background_task_mgr"
- ]
- },
- "work_scheduler": {
- "name": "work_scheduler",
- "path": [
- "foundation/resourceschedule/work_scheduler"
- ]
- },
- "device_usage_statistics": {
- "name": "device_usage_statistics",
- "path": [
- "foundation/resourceschedule/device_usage_statistics"
- ]
- },
- "resource_schedule_service": {
- "name": "resource_schedule_service",
- "path": [
- "foundation/resourceschedule/resource_schedule_service"
- ]
- },
- "schedule_ext": {
- "name": "schedule_ext",
- "path": [
- "foundation/resourceschedule/resource_schedule_service/schedule_ext"
- ]
- },
- "efficiency_manager": {
- "name": "efficiency_manager",
- "path": [
- "foundation/resourceschedule/efficiency_manager"
- ]
- },
- "efficiency_manager_ext": {
- "name": "efficiency_manager_ext",
- "path": [
- "foundation/resourceschedule/efficiency_manager_ext"
- ]
- },
- "preferences": {
- "name": "preferences",
- "path": [
- "foundation/distributeddatamgr/preferences"
- ]
- },
- "relational_store": {
- "name": "relational_store",
- "path": [
- "foundation/distributeddatamgr/relational_store"
- ]
- },
- "data_share": {
- "name": "data_share",
- "path": [
- "foundation/distributeddatamgr/data_share"
- ]
- },
- "kv_store": {
- "name": "kv_store",
- "path": [
- "foundation/distributeddatamgr/kv_store"
- ]
- },
- "datamgr_service": {
- "name": "datamgr_service",
- "path": [
- "foundation/distributeddatamgr/distributeddatamgr"
- ]
- },
- "data_object": {
- "name": "data_object",
- "path": [
- "foundation/distributeddatamgr/data_object"
- ]
- },
- "pasteboard": {
- "name": "pasteboard",
- "path": [
- "foundation/distributeddatamgr/pasteboard"
- ]
- },
- "ipc": {
- "name": "ipc",
- "path": [
- "foundation/communication/ipc"
- ]
- },
- "dsoftbus": {
- "name": "dsoftbus",
- "path": [
- "foundation/communication/dsoftbus"
- ]
- },
- "device_manager": {
- "name": "device_manager",
- "path": [
- "foundation/distributedhardware/device_manager"
- ]
- },
- "distributed_hardware_fwk": {
- "name": "distributed_hardware_fwk",
- "path": [
- "foundation/distributedhardware/distributed_hardware_fwk"
- ]
- },
- "distributed_camera": {
- "name": "distributed_camera",
- "path": [
- "foundation/distributedhardware/distributed_camera"
- ]
- },
- "distributed_audio": {
- "name": "distributed_audio",
- "path": [
- "foundation/distributedhardware/distributed_audio"
- ]
- },
- "distributed_screen": {
- "name": "distributed_screen",
- "path": [
- "foundation/distributedhardware/distributed_screen"
- ]
- },
- "distributed_input": {
- "name": "distributed_input",
- "path": [
- "foundation/distributedhardware/distributed_input"
- ]
- },
- "input": {
- "name": "input",
- "path": [
- "foundation/multimodalinput/input"
- ]
- },
- "audio_framework": {
- "name": "audio_framework",
- "path": [
- "foundation/multimedia/audio_framework"
- ]
- },
- "audio_manager_lite": {
- "name": "audio_manager_lite",
- "path": [
- "foundation/multimedia/audio_lite"
- ]
- },
- "camera_lite": {
- "name": "camera_lite",
- "path": [
- "foundation/multimedia/camera_lite"
- ]
- },
- "camera_framework": {
- "name": "camera_framework",
- "path": [
- "foundation/multimedia/camera_standard"
- ]
- },
- "media_lite": {
- "name": "media_lite",
- "path": [
- "foundation/multimedia/media_lite"
- ]
- },
- "av_session": {
- "name": "av_session",
- "path": [
- "foundation/multimedia/av_session"
- ]
- },
- "media_foundation": {
- "name": "media_foundation",
- "path": [
- "foundation/multimedia/media_foundation"
- ]
- },
- "player_framework": {
- "name": "player_framework",
- "path": [
- "foundation/multimedia/player_framework"
- ]
- },
- "neural_network_runtime": {
- "name": "neural_network_runtime",
- "path": [
- "foundation/ai/neural_network_runtime"
- ]
- },
- "ai_engine": {
- "name": "ai_engine",
- "path": [
- "foundation/ai/ai_engine"
- ]
- },
- "mindspore": {
- "name": "mindspore",
- "path": [
- "third_party/mindspore"
- ]
- },
- "core_service": {
- "name": "core_service",
- "path": [
- "base/telephony/core_service"
- ]
- },
- "call_manager": {
- "name": "call_manager",
- "path": [
- "base/telephony/call_manager"
- ]
- },
- "telephony_data": {
- "name": "telephony_data",
- "path": [
- "base/telephony/telephony_data"
- ]
- },
- "sms_mms": {
- "name": "sms_mms",
- "path": [
- "base/telephony/sms_mms"
- ]
- },
- "cellular_call": {
- "name": "cellular_call",
- "path": [
- "base/telephony/cellular_call"
- ]
- },
- "cellular_data": {
- "name": "cellular_data",
- "path": [
- "base/telephony/cellular_data"
- ]
- },
- "state_registry": {
- "name": "state_registry",
- "path": [
- "base/telephony/state_registry"
- ]
- },
- "ril_adapter": {
- "name": "ril_adapter",
- "path": [
- "base/telephony/ril_adapter"
- ]
- },
- "ims_service": {
- "name": "ims_service",
- "path": [
- "vendor/huawei/base/telephony/ims_service"
- ]
- },
- "certificate_manager": {
- "name": "certificate_manager",
- "path": [
- "base/security/certificate_manager"
- ]
- },
- "crypto_framework": {
- "name": "crypto_framework",
- "path": [
- "base/security/crypto_framework"
- ]
- },
- "dataclassification": {
- "name": "dataclassification",
- "path": [
- "base/security/dataclassification"
- ]
- },
- "device_auth": {
- "name": "device_auth",
- "path": [
- "base/security/device_auth"
- ]
- },
- "device_security_level": {
- "name": "device_security_level",
- "path": [
- "base/security/device_security_level"
- ]
- },
- "device_threat_detection": {
- "name": "device_threat_detection",
- "path": [
- "base/security/device_threat_detection"
- ]
- },
- "huks": {
- "name": "huks",
- "path": [
- "base/security/huks"
- ]
- },
- "appspawn": {
- "name": "appspawn",
- "path": [
- "base/startup/appspawn"
- ]
- },
- "bootstrap_lite": {
- "name": "bootstrap_lite",
- "path": [
- "base/startup/bootstrap_lite"
- ]
- },
- "init": {
- "name": "init",
- "path": [
- "base/startup/init"
- ]
- },
- "common_event_service": {
- "name": "common_event_service",
- "path": [
- "base/notification/common_event_service"
- ]
- },
- "distributed_notification_service": {
- "name": "distributed_notification_service",
- "path": [
- "base/notification/distributed_notification_service"
- ]
- },
- "eventhandler": {
- "name": "eventhandler",
- "path": [
- "base/notification/eventhandler"
- ]
- },
- "hilog": {
- "name": "hilog",
- "path": [
- "base/hiviewdfx/hilog"
- ]
- },
- "hilog_lite": {
- "name": "hilog_lite",
- "path": [
- "base/hiviewdfx/hilog_lite"
- ]
- },
- "hitrace": {
- "name": "hitrace",
- "path": [
- "base/hiviewdfx/hitrace"
- ]
- },
- "hiview": {
- "name": "hiview",
- "path": [
- "base/hiviewdfx/hiview/adapter",
- "base/hiviewdfx/hiview/build",
- "base/hiviewdfx/hiview/base",
- "base/hiviewdfx/hiview/core",
- "base/hiviewdfx/hiview/figures",
- "base/hiviewdfx/hiview/include",
- "base/hiviewdfx/hiview/service",
- "base/hiviewdfx/hiview/utility",
- "base/hiviewdfx/hiview/test",
- "base/hiviewdfx/hiview/plugins/eventlogger",
- "base/hiviewdfx/hiview/plugins/eventservice",
- "base/hiviewdfx/hiview/plugins/faultlogger",
- "base/hiviewdfx/hiview/plugins/freeze_detector",
- "base/hiviewdfx/hiview/plugins/hicollie_collector",
- "base/hiviewdfx/hiview/plugins/usage_event_report",
- "base/hiviewdfx/hiview/plugins/huawei_proprietary/leak_detectors",
- "base/hiviewdfx/hiview/plugins/huawei_proprietary/test"
- ]
- },
- "hiview_lite": {
- "name": "hiview_lite",
- "path": [
- "base/hiviewdfx/hiview_lite"
- ]
- },
- "hichecker": {
- "name": "hichecker",
- "path": [
- "base/hiviewdfx/hichecker"
- ]
- },
- "hicollie": {
- "name": "hicollie",
- "path": [
- "base/hiviewdfx/hicollie"
- ]
- },
- "hiappevent": {
- "name": "hiappevent",
- "path": [
- "base/hiviewdfx/hiappevent"
- ]
- },
- "hisysevent": {
- "name": "hisysevent",
- "path": [
- "base/hiviewdfx/hisysevent"
- ]
- },
- "hievent_lite": {
- "name": "hievent_lite",
- "path": [
- "base/hiviewdfx/hievent_lite"
- ]
- },
- "faultloggerd": {
- "name": "faultloggerd",
- "path": [
- "base/hiviewdfx/faultloggerd"
- ]
- },
- "hiprofiler": {
- "name": "hiprofiler",
- "path": [
- "developtools/profiler"
- ]
- },
- "hiperf": {
- "name": "hiperf",
- "path": [
- "developtools/hiperf"
- ]
- },
- "bytrace": {
- "name": "bytrace",
- "path": [
- "developtools/bytrace"
- ]
- },
- "hidumper_lite": {
- "name": "hidumper_lite",
- "path": [
- "base/hiviewdfx/hidumper_lite"
- ]
- },
- "blackbox_lite": {
- "name": "blackbox_lite",
- "path": [
- "base/hiviewdfx/blackbox_lite"
- ]
- },
- "hidumper": {
- "name": "hidumper",
- "path": [
- "base/hiviewdfx/hidumper"
- ]
- },
- "bluetooth": {
- "name": "bluetooth",
- "path": [
- "foundation/communication/bluetooth"
- ]
- },
- "nfc": {
- "name": "nfc",
- "path": [
- "foundation/communication/nfc/nfc_core"
- ]
- },
- "connected_nfc_tag": {
- "name": "connected_nfc_tag",
- "path": [
- "foundation/communication/connected_nfc_tag"
- ]
- },
- "wifi": {
- "name": "wifi",
- "path": [
- "foundation/communication/wifi/wifi"
- ]
- },
- "dhcp": {
- "name": "dhcp",
- "path": [
- "foundation/communication/wifi/dhcp"
- ]
- },
- "wifi_aware": {
- "name": "wifi_aware",
- "path": [
- "foundation/communication/wifi_aware"
- ]
- },
- "wifi_lite": {
- "name": "wifi_lite",
- "path": [
- "foundation/communication/wifi_lite"
- ]
- },
- "algorithm": {
- "name": "algorithm",
- "path": [
- "base/msdp/algorithm"
- ]
- },
- "geofence": {
- "name": "geofence",
- "path": [
- "base/msdp/geofence"
- ]
- },
- "motion": {
- "name": "motion",
- "path": [
- "base/msdp/motion"
- ]
- },
- "movement": {
- "name": "movement",
- "path": [
- "base/msdp/movement"
- ]
- },
- "spatial_awareness": {
- "name": "spatial_awareness",
- "path": [
- "base/msdp/spatial_awareness"
- ]
- },
- "timeline": {
- "name": "timeline",
- "path": [
- "base/msdp/timeline"
- ]
- },
- "device_status": {
- "name": "device_status",
- "path": [
- "base/msdp/device_status"
- ]
- },
- "os_account": {
- "name": "os_account",
- "path": [
- "base/account/os_account"
- ]
- },
- "i18n": {
- "name": "i18n",
- "path": [
- "base/global/i18n"
- ]
- },
- "i18n_lite": {
- "name": "i18n_lite",
- "path": [
- "base/global/i18n_lite"
- ]
- },
- "system_resources": {
- "name": "system_resources",
- "path": [
- "utils/system_resources"
- ]
- },
- "jsoncpp": {
- "name": "jsoncpp",
- "path": [
- "third_party/jsoncpp"
- ]
- },
- "libxml2": {
- "name": "libxml2",
- "path": [
- "third_party/libxml2"
- ]
- },
- "global_resource_tool": {
- "name": "global_resource_tool",
- "path": [
- "developtools/global_resource_tool"
- ]
- },
- "resource_management": {
- "name": "resource_management",
- "path": [
- "base/global/resource_management"
- ]
- },
- "resource_management_lite": {
- "name": "resource_management_lite",
- "path": [
- "base/global/resource_management_lite"
- ]
- },
- "timezone": {
- "name": "timezone",
- "path": [
- "base/global/timezone"
- ]
- },
- "accessibility": {
- "name": "accessibility",
- "path": [
- "foundation/barrierfree/accessibility"
- ]
- },
- "time_service": {
- "name": "time_service",
- "path": [
- "base/time/time_service"
- ]
- },
- "imf": {
- "name": "imf",
- "path": [
- "base/inputmethod/imf"
- ]
- },
- "wallpaper_mgr": {
- "name": "wallpaper_mgr",
- "path": [
- "base/theme/wallpaper_mgr"
- ]
- },
- "screenlock_mgr": {
- "name": "screenlock_mgr",
- "path": [
- "base/theme/screenlock_mgr"
- ]
- },
- "request": {
- "name": "request",
- "path": [
- "base/request"
- ]
- },
- "battery_manager": {
- "name": "battery_manager",
- "path": [
- "base/powermgr/battery_manager"
- ]
- },
- "display_manager": {
- "name": "display_manager",
- "path": [
- "base/powermgr/display_manager"
- ]
- },
- "powermgr_lite": {
- "name": "powermgr_lite",
- "path": [
- "base/powermgr/powermgr_lite"
- ]
- },
- "battery_lite": {
- "name": "battery_lite",
- "path": [
- "base/powermgr/battery_lite"
- ]
- },
- "battery_statistics": {
- "name": "battery_statistics",
- "path": [
- "base/powermgr/battery_statistics"
- ]
- },
- "power_manager": {
- "name": "power_manager",
- "path": [
- "base/powermgr/power_manager"
- ]
- },
- "thermal_manager": {
- "name": "thermal_manager",
- "path": [
- "base/powermgr/thermal_manager"
- ]
- },
- "sensor": {
- "name": "sensor",
- "path": [
- "base/sensors/sensor"
- ]
- },
- "miscdevice": {
- "name": "miscdevice",
- "path": [
- "base/sensors/miscdevice"
- ]
- },
- "sensor_lite": {
- "name": "sensor_lite",
- "path": [
- "base/sensors/sensor_lite"
- ]
- },
- "start": {
- "name": "start",
- "path": [
- "base/sensors/start"
- ]
- },
- "user_auth_framework": {
- "name": "user_auth_framework",
- "path": [
- "base/useriam/user_auth_framework"
- ]
- },
- "pin_auth": {
- "name": "pin_auth",
- "path": [
- "base/useriam/pin_auth"
- ]
- },
- "face_auth": {
- "name": "face_auth",
- "path": [
- "base/useriam/face_auth"
- ]
- },
- "fingerprint_auth": {
- "name": "fingerprint_auth",
- "path": [
- "base/useriam/fingerprint_auth"
- ]
- },
- "peripheral": {
- "name": "peripheral",
- "path": [
- "drivers/peripheral/pin_auth",
- "drivers/peripheral/face_auth",
- "drivers/peripheral/user_auth",
- "drivers/peripheral/fingerprint_auth"
- ]
- },
- "location": {
- "name": "location",
- "path": [
- "base/location"
- ]
- },
- "usb_manager": {
- "name": "usb_manager",
- "path": [
- "base/usb/usb_manager"
- ]
- },
- "build": {
- "name": "build",
- "path": [
- "build"
- ]
- },
- "gn": {
- "name": "gn",
- "path": [
- "third_party/gn"
- ]
- },
- "ninja": {
- "name": "ninja",
- "path": [
- "third_party/ninja"
- ]
- },
- "hidl_adapter": {
- "name": "hidl_adapter",
- "path": [
- "drivers/peripheral/adapter/activity_recognition",
- "drivers/peripheral/adapter/audio",
- "drivers/peripheral/adapter/camera",
- "drivers/peripheral/adapter/gralloc",
- "drivers/peripheral/adapter/hwc",
- "drivers/peripheral/adapter/input",
- "drivers/peripheral/adapter/motion",
- "drivers/peripheral/adapter/sensor",
- "drivers/peripheral/adapter/thermal"
- ]
- },
- "hdf_core": {
- "name": "hdf_core",
- "path": [
- "drivers/hdf_core/adapter/uhdf2",
- "drivers/hdf_core/framework/core/common",
- "drivers/hdf_core/framework/core/host",
- "drivers/hdf_core/framework/core/manager",
- "drivers/hdf_core/framework/core/shared",
- "drivers/hdf_core/framework/support/posix/"
- ]
- },
- "app_file_service": {
- "name": "app_file_service",
- "path": [
- "foundation/filemanagement/app_file_service"
- ]
- },
- "dfs_service": {
- "name": "dfs_service",
- "path": [
- "foundation/filemanagement/dfs_service"
- ]
- },
- "file_api": {
- "name": "file_api",
- "path": [
- "foundation/filemanagement/file_api"
- ]
- },
- "storage_service": {
- "name": "storage_service",
- "path": [
- "foundation/filemanagement/storage_service"
- ]
- },
- "user_file_service": {
- "name": "user_file_service",
- "path": [
- "foundation/filemanagement/user_file_service"
- ]
- },
- "media_library": {
- "name": "media_library",
- "path": [
- "foundation/multimedia/media_library"
- ]
- },
- "netmanager_base": {
- "name": "netmanager_base",
- "path": [
- "foundation/communication/netmanager_base"
- ]
- },
- "netmanager_ext": {
- "name": "netmanager_ext",
- "path": [
- "foundation/communication/netmanager_ext"
- ]
- },
- "netstack": {
- "name": "netstack",
- "path": [
- "foundation/communication/netstack"
- ]
- },
- "webview": {
- "name": "webview",
- "path": [
- "base/web/webview/ohos_adapter",
- "base/web/webview/ohos_nweb"
- ]
- },
- "tee_client": {
- "name": "tee_client",
- "path": [
- "base/tee/tee_client"
- ]
- },
- "tee_dev_kit": {
- "name": "tee_dev_kit",
- "path": [
- "base/tee/tee_dev_kit"
- ]
- },
- "tee_tzdriver": {
- "name": "tee_tzdriver",
- "path": [
- "base/tee/tee_tzdriver"
- ]
- },
- "device_info_manager": {
- "name": "device_info_manager",
- "path": [
- "foundation/deviceprofile"
- ]
- },
- "enterprise_device_management": {
- "name": "enterprise_device_management",
- "path": [
- "base/customization/enterprise_device_management"
- ]
- },
- "config_policy": {
- "name": "config_policy",
- "path": [
- "base/customization/config_policy"
- ]
- },
- "toolchain": {
- "name": "toolchain",
- "path": [
- "arkcompiler/toolchain"
- ]
- },
- "runtime_core": {
- "name": "runtime_core",
- "path": [
- "arkcompiler/runtime_core"
- ]
- },
- "ets_frontend": {
- "name": "ets_frontend",
- "path": [
- "arkcompiler/ets_frontend"
- ]
- },
- "ets_runtime": {
- "name": "ets_runtime",
- "path": [
- "arkcompiler/ets_runtime"
- ]
- },
- "jerryscript": {
- "name": "jerryscript",
- "path": [
- "third_party/jerryscript"
- ]
- },
- "safwk": {
- "name": "safwk",
- "path": [
- "foundation/systemabilitymgr/safwk"
- ]
- },
- "safwk_lite": {
- "name": "safwk_lite",
- "path": [
- "foundation/systemabilitymgr/safwk_lite"
- ]
- },
- "samgr_lite": {
- "name": "samgr_lite",
- "path": [
- "foundation/systemabilitymgr/samgr_lite"
- ]
- },
- "samgr": {
- "name": "samgr",
- "path": [
- "foundation/systemabilitymgr/samgr"
- ]
- },
- "dmsfwk": {
- "name": "dmsfwk",
- "path": [
- "foundation/ability/dmsfwk"
- ]
- },
- "dmsfwk_lite": {
- "name": "dmsfwk_lite",
- "path": [
- "foundation/ability/dmsfwk_lite"
- ]
- },
- "window_manager": {
- "name": "window_manager",
- "path": [
- "foundation/window/window_manager"
- ]
- },
- "utils_lite": {
- "name": "utils_lite",
- "path": [
- "commonlibrary/utils_lite"
- ]
- },
- "c_utils": {
- "name": "c_utils",
- "path": [
- "commonlibrary/c_utils"
- ]
- },
- "ets_utils": {
- "name": "ets_utils",
- "path": [
- "commonlibrary/ets_utils"
- ]
- },
- "selinux_adapter": {
- "name": "selinux_adapter",
- "path": [
- "base/security/selinux_adapter"
- ]
- },
- "access_token": {
- "name": "access_token",
- "path": [
- "base/security/access_token"
- ]
- },
- "permission_lite": {
- "name": "permission_lite",
- "path": [
- "base/security/permission_lite"
- ]
- },
- "dlp_permission_service": {
- "name": "dlp_permission_service",
- "path": [
- "base/security/dlp_permission_service"
- ]
- },
- "dlp_credential_service": {
- "name": "dlp_credential_service",
- "path": [
- "base/security/dlp_credential_service"
- ]
- },
- "memmgr_override": {
- "name": "memmgr_override",
- "path": [
- "foundation/resourceschedule/memmgr_override"
- ]
- },
- "frame_aware_sched": {
- "name": "frame_aware_sched",
- "path": [
- "foundation/resourceschedule/frame_aware_sched"
- ]
- },
- "sys_installer": {
- "name": "sys_installer",
- "path": [
- "base/update/sys_installer"
- ]
- },
- "updater": {
- "name": "updater",
- "path": [
- "base/update/updater"
- ]
- },
- "dupdate_engine": {
- "name": "dupdate_engine",
- "path": [
- "base/update/dupdate_engine"
- ]
- },
- "memory_utils": {
- "name": "memory_utils",
- "path": [
- "commonlibrary/memory_utils"
- ]
- },
- "ace_engine": {
- "name": "ace_engine",
- "path": [
- "foundation/arkui/ace_engine/frameworks/base/geometry",
- "foundation/arkui/ace_engine/frameworks/base/json",
- "foundation/arkui/ace_engine/frameworks/base/utils",
- "foundation/arkui/ace_engine/frameworks/bridge/card_frontend",
- "foundation/arkui/ace_engine/frameworks/bridge/common/manifest",
- "foundation/arkui/ace_engine/frameworks/bridge/common/media_query",
- "foundation/arkui/ace_engine/frameworks/bridge/common/plugin_adapter",
- "foundation/arkui/ace_engine/frameworks/bridge/common/utils",
- "foundation/arkui/ace_engine/frameworks/bridge/plugin_frontend",
- "foundation/arkui/ace_engine/interfaces"
- ]
- },
- "ace_engine_lite": {
- "name": "ace_engine_lite",
- "path": [
- "foundation/arkui/ace_engine_lite"
- ]
- },
- "container_linux_service_broker": {
- "name": "container_linux_service_broker",
- "path": [
- "vendor/huawei/virt_service/linux_fusion_service"
- ]
- },
- "container_manager": {
- "name": "container_manager",
- "path": [
- "vendor/huawei/virt_service/container_manager"
- ]
- },
- "container_comm": {
- "name": "container_comm",
- "path": [
- "vendor/huawei/virt_service/container_comm"
- ]
- },
- "ace_engine_ext": {
- "name": "ace_engine_ext",
- "path": [
- "vendor/huawei/foundation/ace/ace_engine_ext"
- ]
- },
- "audio_driver_handset": {
- "name": "audio_driver_handset",
- "path": [
- "vendor/huawei/chipset/modules/audio"
- ]
- },
- "audio_framework_ext": {
- "name": "audio_framework_ext",
- "path": [
- "vendor/huawei/foundation/multimedia/audio_framework_ext"
- ]
- },
- "baltimore_products": {
- "name": "container_comm",
- "path": [
- "vendor/huawei/m40"
- ]
- },
- "battery_management_service_extra": {
- "name": "battery_management_service_extra",
- "path": [
- "vendor/huawei/chipset/modules/power"
- ]
- },
- "bluetooth_service_override": {
- "name": "bluetooth_service_override",
- "path": [
- "vendor/huawei/foundation/communication/bluetooth_service_override"
- ]
- },
- "booster": {
- "name": "booster",
- "path": [
- "vendor/huawei/base/radio/booster"
- ]
- },
- "boot_detector_plugin": {
- "name": "boot_detector_plugin",
- "path": [
- "vendor/huawei/base/hiviewdfx/hiview_plugins/boot_detector_plugin"
- ]
- },
- "bundle_framework_ext": {
- "name": "bundle_framework_ext",
- "path": [
- "vendor/huawei/foundation/bundlemanager/bundle_framework_ext"
- ]
- },
- "advanced_ui_component": {
- "name": "advanced_ui_component",
- "path": [
- "foundation/arkui/advanced_ui_component"
- ]
- },
- "appspawn_lite": {
- "name": "appspawn_lite",
- "path": [
- "base/startup/appspawn/lite"
- ]
- },
- "auth_widget": {
- "name": "auth_widget",
- "path": [
- "applications/standard/applications_auth_widget"
- ]
- },
- "av_codec": {
- "name": "av_codec",
- "path": [
- "foundation/multimedia/av_codec"
- ]
- },
- "bluetooth_service": {
- "name": "bluetooth_service",
- "path": [
- "foundation/communication/bluetooth_service"
- ]
- },
- "build_framework": {
- "name": "build_framework",
- "path": [
- "build/common"
- ]
- },
- "bundle_tool": {
- "name": "bundle_tool",
- "path": [
- "foundation/bundlemanager/bundle_tool"
- ]
- },
- "calendar_data": {
- "name": "calendar_data",
- "path": [
- "applications/standard/calendardata"
- ]
- },
- "camera_sample_app": {
- "name": "camera_sample_app",
- "path": [
- "applications/sample/camera"
- ]
- },
- "camera_sample_communication": {
- "name": "camera_sample_communication",
- "path": [
- "applications/sample/camera/communication"
- ]
- },
- "camera_screensaver_app": {
- "name": "camera_screensaver_app",
- "path": [
- "applications/sample/camera/screensaver"
- ]
- },
- "certificate_framework": {
- "name": "certificate_framework",
- "path": [
- "base/security/certificate_framework"
- ]
- },
- "contacts_data_hap": {
- "name": "contacts_data_hap",
- "path": [
- "applications/standard/contacts_data"
- ]
- },
- "contacts_standard": {
- "name": "contacts_standard",
- "path": [
- "applications/standard/contacts"
- ]
- },
- "device_standby": {
- "name": "device_standby",
- "path": [
- "foundation/resourceschedule/device_standby"
- ]
- },
- "device_standby_ext": {
- "name": "device_standby_ext",
- "path": [
- "foundation/resourceschedule/device_standby_ext"
- ]
- },
- "distributed_bundle_framework": {
- "name": "distributed_bundle_framework",
- "path": [
- "foundation/bundlemanager/distributed_bundle_framework"
- ]
- },
- "distributedfilejs": {
- "name": "distributedfilejs",
- "path": [
- "foundation/distributeddatamgr/distributedfile"
- ]
- },
- "drivers_interface_act_recg": {
- "name": "drivers_interface_act_recg",
- "path": [
- "drivers/interface/activity_recognition"
- ]
- },
- "drivers_interface_audio": {
- "name": "drivers_interface_audio",
- "path": [
- "drivers/interface/audio"
- ]
- },
- "drivers_interface_battery": {
- "name": "drivers_interface_battery",
- "path": [
- "drivers/interface/battery"
- ]
- },
- "drivers_interface_bluetooth": {
- "name": "drivers_interface_bluetooth",
- "path": [
- "drivers/interface/bluetooth"
- ]
- },
- "drivers_interface_camera": {
- "name": "drivers_interface_camera",
- "path": [
- "drivers/interface/camera"
- ]
- },
- "drivers_interface_codec": {
- "name": "drivers_interface_codec",
- "path": [
- "drivers/interface/codec"
- ]
- },
- "drivers_interface_connected_nfc_tag": {
- "name": "drivers_interface_connected_nfc_tag",
- "path": [
- "drivers/interface/connected_nfc_tag"
- ]
- },
- "drivers_interface_display": {
- "name": "drivers_interface_display",
- "path": [
- "drivers/interface/display"
- ]
- },
- "drivers_interface_distributed_audio": {
- "name": "drivers_interface_distributed_audio",
- "path": [
- "foundation/distributedhardware/distributed_audio/hdf_interfaces/distributed_audio"
- ]
- },
- "drivers_interface_distributed_camera": {
- "name": "drivers_interface_distributed_camera",
- "path": [
- "drivers/interface/distributed_camera"
- ]
- },
- "drivers_interface_face_auth": {
- "name": "drivers_interface_face_auth",
- "path": [
- "drivers/interface/face_auth"
- ]
- },
- "drivers_interface_fingerprint_auth": {
- "name": "drivers_interface_fingerprint_auth",
- "path": [
- "drivers/interface/fingerprint_auth"
- ]
- },
- "drivers_interface_huks": {
- "name": "drivers_interface_huks",
- "path": [
- "drivers/interface/huks"
- ]
- },
- "drivers_interface_input": {
- "name": "drivers_interface_input",
- "path": [
- "drivers/interface/input"
- ]
- },
- "drivers_interface_intelligent_voice": {
- "name": "drivers_interface_intelligent_voice",
- "path": [
- "drivers/interface/intelligent_voice"
- ]
- },
- "drivers_interface_light": {
- "name": "drivers_interface_light",
- "path": [
- "drivers/interface/light"
- ]
- },
- "drivers_interface_location_agnss": {
- "name": "drivers_interface_location_agnss",
- "path": [
- "drivers/interface/location/agnss"
- ]
- },
- "drivers_interface_location_geofence": {
- "name": "drivers_interface_location_geofence",
- "path": [
- "drivers/interface/location/geofence"
- ]
- },
- "drivers_interface_location_gnss": {
- "name": "drivers_interface_location_gnss",
- "path": [
- "drivers/interface/location/gnss"
- ]
- },
- "drivers_interface_lpfence_cellbatching": {
- "name": "drivers_interface_lpfence_cellbatching",
- "path": [
- "drivers/interface/location/lpfence/cellbatching"
- ]
- },
- "drivers_interface_lpfence_cellfence": {
- "name": "drivers_interface_lpfence_cellfence",
- "path": [
- "drivers/interface/location/lpfence/cellfence"
- ]
- },
- "drivers_interface_lpfence_geofence": {
- "name": "drivers_interface_lpfence_geofence",
- "path": [
- "drivers/interface/location/lpfence/geofence"
- ]
- },
- "drivers_interface_lpfence_wififence": {
- "name": "drivers_interface_lpfence_wififence",
- "path": [
- "drivers/interface/location/lpfence/wififence"
- ]
- },
- "drivers_interface_memorytracker": {
- "name": "drivers_interface_memorytracker",
- "path": [
- "drivers/interface/memorytracker"
- ]
- },
- "drivers_interface_motion": {
- "name": "drivers_interface_motion",
- "path": [
- "drivers/interface/motion"
- ]
- },
- "drivers_interface_nfc": {
- "name": "drivers_interface_nfc",
- "path": [
- "drivers/interface/nfc"
- ]
- },
- "drivers_interface_nnrt": {
- "name": "drivers_interface_nnrt",
- "path": [
- "drivers/interface/nnrt"
- ]
- },
- "drivers_interface_partitionslot": {
- "name": "drivers_interface_partitionslot",
- "path": [
- "drivers/interface/partitionslot"
- ]
- },
- "drivers_interface_pin_auth": {
- "name": "drivers_interface_pin_auth",
- "path": [
- "drivers/interface/pin_auth"
- ]
- },
- "drivers_interface_power": {
- "name": "drivers_interface_power",
- "path": [
- "drivers/interface/power"
- ]
- },
- "drivers_interface_ril": {
- "name": "drivers_interface_ril",
- "path": [
- "drivers/interface/ril"
- ]
- },
- "drivers_interface_secure_element": {
- "name": "drivers_interface_secure_element",
- "path": [
- "drivers/interface/secure_element"
- ]
- },
- "drivers_interface_sensor": {
- "name": "drivers_interface_sensor",
- "path": [
- "drivers/interface/sensor"
- ]
- },
- "drivers_interface_thermal": {
- "name": "drivers_interface_thermal",
- "path": [
- "drivers/interface/thermal"
- ]
- },
- "drivers_interface_usb": {
- "name": "drivers_interface_usb",
- "path": [
- "drivers/interface/usb"
- ]
- },
- "drivers_interface_user_auth": {
- "name": "drivers_interface_user_auth",
- "path": [
- "drivers/interface/user_auth"
- ]
- },
- "drivers_interface_vibrator": {
- "name": "drivers_interface_vibrator",
- "path": [
- "drivers/interface/vibrator"
- ]
- },
- "drivers_interface_wlan": {
- "name": "drivers_interface_wlan",
- "path": [
- "drivers/interface/wlan"
- ]
- },
- "drivers_peripheral_audio": {
- "name": "drivers_peripheral_audio",
- "path": [
- "drivers/peripheral/audio"
- ]
- },
- "drivers_peripheral_battery": {
- "name": "drivers_peripheral_battery",
- "path": [
- "drivers/peripheral/battery"
- ]
- },
- "drivers_peripheral_bluetooth": {
- "name": "drivers_peripheral_bluetooth",
- "path": [
- "drivers/peripheral/bluetooth"
- ]
- },
- "drivers_peripheral_camera": {
- "name": "drivers_peripheral_camera",
- "path": [
- "drivers/peripheral/camera"
- ]
- },
- "drivers_peripheral_codec": {
- "name": "drivers_peripheral_codec",
- "path": [
- "drivers/peripheral/codec"
- ]
- },
- "drivers_peripheral_connected_nfc_tag": {
- "name": "drivers_peripheral_connected_nfc_tag",
- "path": [
- "drivers/peripheral/connected_nfc_tag"
- ]
- },
- "drivers_peripheral_display": {
- "name": "drivers_peripheral_display",
- "path": [
- "drivers/peripheral/display"
- ]
- },
- "drivers_peripheral_distributed_audio": {
- "name": "drivers_peripheral_distributed_audio",
- "path": [
- "foundation/distributedhardware/distributed_audio/hdf_service/distributed_audio"
- ]
- },
- "drivers_peripheral_distributed_camera": {
- "name": "drivers_peripheral_distributed_camera",
- "path": [
- "drivers/peripheral/distributed_camera"
- ]
- },
- "drivers_peripheral_face_auth": {
- "name": "drivers_peripheral_face_auth",
- "path": [
- "drivers/peripheral/face_auth"
- ]
- },
- "drivers_peripheral_fingerprint_auth": {
- "name": "drivers_peripheral_fingerprint_auth",
- "path": [
- "drivers/peripheral/fingerprint_auth"
- ]
- },
- "drivers_peripheral_huks": {
- "name": "drivers_peripheral_huks",
- "path": [
- "drivers/peripheral/huks"
- ]
- },
- "drivers_peripheral_input": {
- "name": "drivers_peripheral_input",
- "path": [
- "drivers/peripheral/input"
- ]
- },
- "drivers_peripheral_intelligent_voice": {
- "name": "drivers_peripheral_intelligent_voice",
- "path": [
- "drivers/peripheral/intelligent_voice"
- ]
- },
- "drivers_peripheral_light": {
- "name": "drivers_peripheral_light",
- "path": [
- "drivers/peripheral/light"
- ]
- },
- "drivers_peripheral_location_agnss": {
- "name": "drivers_peripheral_location_agnss",
- "path": [
- "drivers/peripheral/location/agnss"
- ]
- },
- "drivers_peripheral_location_geofence": {
- "name": "drivers_peripheral_location_geofence",
- "path": [
- "drivers/peripheral/location/geofence"
- ]
- },
- "drivers_peripheral_location_gnss": {
- "name": "drivers_peripheral_location_gnss",
- "path": [
- "drivers/peripheral/location/gnss"
- ]
- },
- "drivers_peripheral_memorytracker": {
- "name": "drivers_peripheral_memorytracker",
- "path": [
- "drivers/peripheral/memorytracker"
- ]
- },
- "drivers_peripheral_motion": {
- "name": "drivers_peripheral_motion",
- "path": [
- "drivers/peripheral/motion"
- ]
- },
- "drivers_peripheral_nfc": {
- "name": "drivers_peripheral_nfc",
- "path": [
- "drivers/peripheral/nfc"
- ]
- },
- "drivers_peripheral_partitionslot": {
- "name": "drivers_peripheral_partitionslot",
- "path": [
- "drivers/peripheral/partitionslot"
- ]
- },
- "drivers_peripheral_pin_auth": {
- "name": "drivers_peripheral_pin_auth",
- "path": [
- "drivers/peripheral/pin_auth"
- ]
- },
- "drivers_peripheral_power": {
- "name": "drivers_peripheral_power",
- "path": [
- "drivers/peripheral/power"
- ]
- },
- "drivers_peripheral_ril": {
- "name": "drivers_peripheral_ril",
- "path": [
- "drivers/peripheral/ril"
- ]
- },
- "drivers_peripheral_secure_element": {
- "name": "drivers_peripheral_secure_element",
- "path": [
- "drivers/peripheral/secure_element"
- ]
- },
- "drivers_peripheral_sensor": {
- "name": "drivers_peripheral_sensor",
- "path": [
- "drivers/peripheral/sensor"
- ]
- },
- "drivers_peripheral_thermal": {
- "name": "drivers_peripheral_thermal",
- "path": [
- "drivers/peripheral/thermal"
- ]
- },
- "drivers_peripheral_usb": {
- "name": "drivers_peripheral_usb",
- "path": [
- "drivers/peripheral/usb"
- ]
- },
- "drivers_peripheral_user_auth": {
- "name": "drivers_peripheral_user_auth",
- "path": [
- "drivers/peripheral/user_auth"
- ]
- },
- "drivers_peripheral_vibrator": {
- "name": "drivers_peripheral_vibrator",
- "path": [
- "drivers/peripheral/vibrator"
- ]
- },
- "drivers_peripheral_wlan": {
- "name": "drivers_peripheral_wlan",
- "path": [
- "drivers/peripheral/wlan"
- ]
- },
- "external_device_manager": {
- "name": "external_device_manager",
- "path": [
- "drivers/external_device_manager"
- ]
- },
- "ffrt": {
- "name": "ffrt",
- "path": [
- "foundation/resourceschedule/ffrt"
- ]
- },
- "graphic_surface": {
- "name": "graphic_surface",
- "path": [
- "foundation/graphic/graphic_surface/surface"
- ]
- },
- "hilog_featured_lite": {
- "name": "hilog_featured_lite",
- "path": [
- "base/hiviewdfx/hilog_lite/frameworks/featured"
- ]
- },
- "hvb": {
- "name": "hvb",
- "path": [
- "base/startup/hvb"
- ]
- },
- "init_lite": {
- "name": "init_lite",
- "path": [
- "base/startup/init/services/init/lite"
- ]
- },
- "intelligent_voice_framework": {
- "name": "intelligent_voice_framework",
- "path": [
- "foundation/ai/intelligent_voice_framework"
- ]
- },
- "ipc_js": {
- "name": "ipc_js",
- "path": [
- "foundation/communication/ipc/interfaces/kits"
- ]
- },
- "media_utils_lite": {
- "name": "media_utils_lite",
- "path": [
- "foundation/multimedia/media_utils_lite"
- ]
- },
- "medical_sensor": {
- "name": "medical_sensor",
- "path": [
- "base/sensors/medical_sensor"
- ]
- },
- "permission_manager": {
- "name": "permission_manager",
- "path": [
- "applications/standard/permission_manager"
- ]
- },
- "prebuilt_hap": {
- "name": "prebuilt_hap",
- "path": [
- "applications/standard/hap"
- ]
- },
- "print_fwk": {
- "name": "print_fwk",
- "path": [
- "base/print/print_fwk"
- ]
- },
- "qos_manager": {
- "name": "qos_manager",
- "path": [
- "foundation/resourceschedule/qos_manager"
- ]
- },
- "rockchip_products": {
- "name": "rockchip_products",
- "path": [
- "device/board/hihope/rk3568"
- ]
- },
- "settings_standard": {
- "name": "settings_standard",
- "path": [
- "applications/standard/settings"
- ]
- },
- "soc_perf": {
- "name": "soc_perf",
- "path": [
- "foundation/resourceschedule/soc_perf"
- ]
- },
- "surface_lite": {
- "name": "surface_lite",
- "path": [
- "foundation/graphic/surface_lite"
- ]
- },
- "sys_installer_lite": {
- "name": "sys_installer_lite",
- "path": [
- "base/update/sys_installer_lite"
- ]
- },
- "udmf": {
- "name": "udmf",
- "path": [
- "foundation/distributeddatamgr/udmf"
- ]
- },
- "ui_appearance": {
- "name": "ui_appearance",
- "path": [
- "foundation/arkui/ui_appearance"
- ]
- },
- "update_service": {
- "name": "update_service",
- "path": [
- "base/update/updateservice"
- ]
- },
- "wifi_aware_lite": {
- "name": "wifi_aware_lite",
- "path": [
- "foundation/communication/wifi_aware"
- ]
- },
- "wifi_iot_sample_app": {
- "name": "wifi_iot_sample_app",
- "path": [
- "applications/sample/wifi-iot/app"
- ]
- },
- "ylong_http": {
- "name": "ylong_http",
- "path": [
- "commonlibrary/rust/ylong_http"
- ]
- },
- "ylong_runtime_mod": {
- "name": "ylong_runtime_mod",
- "path": [
- "commonlibrary/rust/ylong_runtime"
- ]
- },
- "findnetwork": {
- "name": "findnetwork",
- "path": [
- "vendor/huawei/domains/finddevice/findnetwork"
- ]
- },
- "push_manager_service": {
- "name": "push_manager_service",
- "path": [
- "vendor/huawei/domains/push/push_manager_service"
- ]
- },
- "quickfix_engine": {
- "name": "quickfix_engine",
- "path": [
- "vendor/huawei/base/update/quickfix_engine"
- ]
- },
- "security_guard": {
- "name": "security_guard",
- "path": [
- "base/security/security_guard"
- ]
- },
- "container_hmos_service_broker": {
- "name": "container_hmos_service_broker",
- "path": [
- "vendor/huawei/virt_service/container_hmos_service_broker"
- ]
- },
- "iShare": {
- "name": "iShare",
- "path": [
- "vendor/huawei/foundation/HMconnect/iShare"
- ]
- },
- "cast_engine": {
- "name": "cast_engine",
- "path": [
- "vendor/huawei/foundation/HMconnect/CastEngine"
- ]
- },
- "CollaborationFwk": {
- "name": "CollaborationFwk",
- "path": [
- "vendor/huawei/foundation/HMconnect/CollaborationFwk"
- ]
- },
- "sys_installer_ext": {
- "name": "sys_installer_ext",
- "path": [
- "vendor/huawei/base/update/sys_installer_ext"
- ]
- }
-}
+{
+ "bundle_framework": {
+ "name": "bundle_framework",
+ "path": [
+ "foundation/bundlemanager/bundle_framework"
+ ]
+ },
+ "bundle_framework_lite": {
+ "name": "bundle_framework_lite",
+ "path": [
+ "foundation/bundlemanager/bundle_framework_lite"
+ ]
+ },
+ "packing_tool": {
+ "name": "packing_tool",
+ "path": [
+ "developtools/packing_tool"
+ ]
+ },
+ "appverify": {
+ "name": "appverify",
+ "path": [
+ "base/security/appverify"
+ ]
+ },
+ "zlib": {
+ "name": "zlib",
+ "path": [
+ "third_party/zlib"
+ ]
+ },
+ "ability_lite": {
+ "name": "ability_lite",
+ "path": [
+ "foundation/ability/ability_lite"
+ ]
+ },
+ "ability_base": {
+ "name": "ability_base",
+ "path": [
+ "foundation/ability/ability_base"
+ ]
+ },
+ "ability_runtime": {
+ "name": "ability_runtime",
+ "path": [
+ "foundation/ability/ability_runtime"
+ ]
+ },
+ "idl_tool": {
+ "name": "idl_tool",
+ "path": [
+ "foundation/ability/idl_tool"
+ ]
+ },
+ "form_fwk": {
+ "name": "form_fwk",
+ "path": [
+ "foundation/ability/form_fwk"
+ ]
+ },
+ "window_manager_lite": {
+ "name": "window_manager_lite",
+ "path": [
+ "foundation/window/window_manager_lite"
+ ]
+ },
+ "ui_lite": {
+ "name": "ui_lite",
+ "path": [
+ "foundation/arkui/ui_lite"
+ ]
+ },
+ "graphic_utils_lite": {
+ "name": "graphic_utils_lite",
+ "path": [
+ "foundation/graphic/graphic_utils_lite"
+ ]
+ },
+ "graphic_2d": {
+ "name": "graphic_2d",
+ "path": [
+ "foundation/graphic/graphic_2d"
+ ]
+ },
+ "graphic_2d_ext": {
+ "name": "graphic_2d_ext",
+ "path": [
+ "foundation/graphic/graphic_2d_ext"
+ ]
+ },
+ "image_framework": {
+ "name": "image_framework",
+ "path": [
+ "foundation/multimedia/image_framework"
+ ]
+ },
+ "background_task_mgr": {
+ "name": "background_task_mgr",
+ "path": [
+ "foundation/resourceschedule/background_task_mgr"
+ ]
+ },
+ "work_scheduler": {
+ "name": "work_scheduler",
+ "path": [
+ "foundation/resourceschedule/work_scheduler"
+ ]
+ },
+ "device_usage_statistics": {
+ "name": "device_usage_statistics",
+ "path": [
+ "foundation/resourceschedule/device_usage_statistics"
+ ]
+ },
+ "resource_schedule_service": {
+ "name": "resource_schedule_service",
+ "path": [
+ "foundation/resourceschedule/resource_schedule_service"
+ ]
+ },
+ "schedule_ext": {
+ "name": "schedule_ext",
+ "path": [
+ "foundation/resourceschedule/resource_schedule_service/schedule_ext"
+ ]
+ },
+ "efficiency_manager": {
+ "name": "efficiency_manager",
+ "path": [
+ "foundation/resourceschedule/efficiency_manager"
+ ]
+ },
+ "efficiency_manager_ext": {
+ "name": "efficiency_manager_ext",
+ "path": [
+ "foundation/resourceschedule/efficiency_manager_ext"
+ ]
+ },
+ "preferences": {
+ "name": "preferences",
+ "path": [
+ "foundation/distributeddatamgr/preferences"
+ ]
+ },
+ "relational_store": {
+ "name": "relational_store",
+ "path": [
+ "foundation/distributeddatamgr/relational_store"
+ ]
+ },
+ "data_share": {
+ "name": "data_share",
+ "path": [
+ "foundation/distributeddatamgr/data_share"
+ ]
+ },
+ "kv_store": {
+ "name": "kv_store",
+ "path": [
+ "foundation/distributeddatamgr/kv_store"
+ ]
+ },
+ "datamgr_service": {
+ "name": "datamgr_service",
+ "path": [
+ "foundation/distributeddatamgr/distributeddatamgr"
+ ]
+ },
+ "data_object": {
+ "name": "data_object",
+ "path": [
+ "foundation/distributeddatamgr/data_object"
+ ]
+ },
+ "pasteboard": {
+ "name": "pasteboard",
+ "path": [
+ "foundation/distributeddatamgr/pasteboard"
+ ]
+ },
+ "ipc": {
+ "name": "ipc",
+ "path": [
+ "foundation/communication/ipc"
+ ]
+ },
+ "dsoftbus": {
+ "name": "dsoftbus",
+ "path": [
+ "foundation/communication/dsoftbus"
+ ]
+ },
+ "device_manager": {
+ "name": "device_manager",
+ "path": [
+ "foundation/distributedhardware/device_manager"
+ ]
+ },
+ "distributed_hardware_fwk": {
+ "name": "distributed_hardware_fwk",
+ "path": [
+ "foundation/distributedhardware/distributed_hardware_fwk"
+ ]
+ },
+ "distributed_camera": {
+ "name": "distributed_camera",
+ "path": [
+ "foundation/distributedhardware/distributed_camera"
+ ]
+ },
+ "distributed_audio": {
+ "name": "distributed_audio",
+ "path": [
+ "foundation/distributedhardware/distributed_audio"
+ ]
+ },
+ "distributed_screen": {
+ "name": "distributed_screen",
+ "path": [
+ "foundation/distributedhardware/distributed_screen"
+ ]
+ },
+ "distributed_input": {
+ "name": "distributed_input",
+ "path": [
+ "foundation/distributedhardware/distributed_input"
+ ]
+ },
+ "input": {
+ "name": "input",
+ "path": [
+ "foundation/multimodalinput/input"
+ ]
+ },
+ "audio_framework": {
+ "name": "audio_framework",
+ "path": [
+ "foundation/multimedia/audio_framework"
+ ]
+ },
+ "audio_manager_lite": {
+ "name": "audio_manager_lite",
+ "path": [
+ "foundation/multimedia/audio_lite"
+ ]
+ },
+ "camera_lite": {
+ "name": "camera_lite",
+ "path": [
+ "foundation/multimedia/camera_lite"
+ ]
+ },
+ "camera_framework": {
+ "name": "camera_framework",
+ "path": [
+ "foundation/multimedia/camera_standard"
+ ]
+ },
+ "media_lite": {
+ "name": "media_lite",
+ "path": [
+ "foundation/multimedia/media_lite"
+ ]
+ },
+ "av_session": {
+ "name": "av_session",
+ "path": [
+ "foundation/multimedia/av_session"
+ ]
+ },
+ "media_foundation": {
+ "name": "media_foundation",
+ "path": [
+ "foundation/multimedia/media_foundation"
+ ]
+ },
+ "player_framework": {
+ "name": "player_framework",
+ "path": [
+ "foundation/multimedia/player_framework"
+ ]
+ },
+ "neural_network_runtime": {
+ "name": "neural_network_runtime",
+ "path": [
+ "foundation/ai/neural_network_runtime"
+ ]
+ },
+ "ai_engine": {
+ "name": "ai_engine",
+ "path": [
+ "foundation/ai/ai_engine"
+ ]
+ },
+ "mindspore": {
+ "name": "mindspore",
+ "path": [
+ "third_party/mindspore"
+ ]
+ },
+ "core_service": {
+ "name": "core_service",
+ "path": [
+ "base/telephony/core_service"
+ ]
+ },
+ "call_manager": {
+ "name": "call_manager",
+ "path": [
+ "base/telephony/call_manager"
+ ]
+ },
+ "telephony_data": {
+ "name": "telephony_data",
+ "path": [
+ "base/telephony/telephony_data"
+ ]
+ },
+ "sms_mms": {
+ "name": "sms_mms",
+ "path": [
+ "base/telephony/sms_mms"
+ ]
+ },
+ "cellular_call": {
+ "name": "cellular_call",
+ "path": [
+ "base/telephony/cellular_call"
+ ]
+ },
+ "cellular_data": {
+ "name": "cellular_data",
+ "path": [
+ "base/telephony/cellular_data"
+ ]
+ },
+ "state_registry": {
+ "name": "state_registry",
+ "path": [
+ "base/telephony/state_registry"
+ ]
+ },
+ "ril_adapter": {
+ "name": "ril_adapter",
+ "path": [
+ "base/telephony/ril_adapter"
+ ]
+ },
+ "ims_service": {
+ "name": "ims_service",
+ "path": [
+ "vendor/huawei/base/telephony/ims_service"
+ ]
+ },
+ "certificate_manager": {
+ "name": "certificate_manager",
+ "path": [
+ "base/security/certificate_manager"
+ ]
+ },
+ "crypto_framework": {
+ "name": "crypto_framework",
+ "path": [
+ "base/security/crypto_framework"
+ ]
+ },
+ "dataclassification": {
+ "name": "dataclassification",
+ "path": [
+ "base/security/dataclassification"
+ ]
+ },
+ "device_auth": {
+ "name": "device_auth",
+ "path": [
+ "base/security/device_auth"
+ ]
+ },
+ "device_security_level": {
+ "name": "device_security_level",
+ "path": [
+ "base/security/device_security_level"
+ ]
+ },
+ "device_threat_detection": {
+ "name": "device_threat_detection",
+ "path": [
+ "base/security/device_threat_detection"
+ ]
+ },
+ "huks": {
+ "name": "huks",
+ "path": [
+ "base/security/huks"
+ ]
+ },
+ "appspawn": {
+ "name": "appspawn",
+ "path": [
+ "base/startup/appspawn"
+ ]
+ },
+ "bootstrap_lite": {
+ "name": "bootstrap_lite",
+ "path": [
+ "base/startup/bootstrap_lite"
+ ]
+ },
+ "init": {
+ "name": "init",
+ "path": [
+ "base/startup/init"
+ ]
+ },
+ "common_event_service": {
+ "name": "common_event_service",
+ "path": [
+ "base/notification/common_event_service"
+ ]
+ },
+ "distributed_notification_service": {
+ "name": "distributed_notification_service",
+ "path": [
+ "base/notification/distributed_notification_service"
+ ]
+ },
+ "eventhandler": {
+ "name": "eventhandler",
+ "path": [
+ "base/notification/eventhandler"
+ ]
+ },
+ "hilog": {
+ "name": "hilog",
+ "path": [
+ "base/hiviewdfx/hilog"
+ ]
+ },
+ "hilog_lite": {
+ "name": "hilog_lite",
+ "path": [
+ "base/hiviewdfx/hilog_lite"
+ ]
+ },
+ "hitrace": {
+ "name": "hitrace",
+ "path": [
+ "base/hiviewdfx/hitrace"
+ ]
+ },
+ "hiview": {
+ "name": "hiview",
+ "path": [
+ "base/hiviewdfx/hiview/adapter",
+ "base/hiviewdfx/hiview/build",
+ "base/hiviewdfx/hiview/base",
+ "base/hiviewdfx/hiview/core",
+ "base/hiviewdfx/hiview/figures",
+ "base/hiviewdfx/hiview/include",
+ "base/hiviewdfx/hiview/service",
+ "base/hiviewdfx/hiview/utility",
+ "base/hiviewdfx/hiview/test",
+ "base/hiviewdfx/hiview/plugins/eventlogger",
+ "base/hiviewdfx/hiview/plugins/eventservice",
+ "base/hiviewdfx/hiview/plugins/faultlogger",
+ "base/hiviewdfx/hiview/plugins/freeze_detector",
+ "base/hiviewdfx/hiview/plugins/hicollie_collector",
+ "base/hiviewdfx/hiview/plugins/usage_event_report",
+ "base/hiviewdfx/hiview/plugins/huawei_proprietary/leak_detectors",
+ "base/hiviewdfx/hiview/plugins/huawei_proprietary/test"
+ ]
+ },
+ "hiview_lite": {
+ "name": "hiview_lite",
+ "path": [
+ "base/hiviewdfx/hiview_lite"
+ ]
+ },
+ "hichecker": {
+ "name": "hichecker",
+ "path": [
+ "base/hiviewdfx/hichecker"
+ ]
+ },
+ "hicollie": {
+ "name": "hicollie",
+ "path": [
+ "base/hiviewdfx/hicollie"
+ ]
+ },
+ "hiappevent": {
+ "name": "hiappevent",
+ "path": [
+ "base/hiviewdfx/hiappevent"
+ ]
+ },
+ "hisysevent": {
+ "name": "hisysevent",
+ "path": [
+ "base/hiviewdfx/hisysevent"
+ ]
+ },
+ "hievent_lite": {
+ "name": "hievent_lite",
+ "path": [
+ "base/hiviewdfx/hievent_lite"
+ ]
+ },
+ "faultloggerd": {
+ "name": "faultloggerd",
+ "path": [
+ "base/hiviewdfx/faultloggerd"
+ ]
+ },
+ "hiprofiler": {
+ "name": "hiprofiler",
+ "path": [
+ "developtools/profiler"
+ ]
+ },
+ "hiperf": {
+ "name": "hiperf",
+ "path": [
+ "developtools/hiperf"
+ ]
+ },
+ "bytrace": {
+ "name": "bytrace",
+ "path": [
+ "developtools/bytrace"
+ ]
+ },
+ "hidumper_lite": {
+ "name": "hidumper_lite",
+ "path": [
+ "base/hiviewdfx/hidumper_lite"
+ ]
+ },
+ "blackbox_lite": {
+ "name": "blackbox_lite",
+ "path": [
+ "base/hiviewdfx/blackbox_lite"
+ ]
+ },
+ "hidumper": {
+ "name": "hidumper",
+ "path": [
+ "base/hiviewdfx/hidumper"
+ ]
+ },
+ "bluetooth": {
+ "name": "bluetooth",
+ "path": [
+ "foundation/communication/bluetooth"
+ ]
+ },
+ "nfc": {
+ "name": "nfc",
+ "path": [
+ "foundation/communication/nfc/nfc_core"
+ ]
+ },
+ "connected_nfc_tag": {
+ "name": "connected_nfc_tag",
+ "path": [
+ "foundation/communication/connected_nfc_tag"
+ ]
+ },
+ "wifi": {
+ "name": "wifi",
+ "path": [
+ "foundation/communication/wifi/wifi"
+ ]
+ },
+ "dhcp": {
+ "name": "dhcp",
+ "path": [
+ "foundation/communication/wifi/dhcp"
+ ]
+ },
+ "wifi_aware": {
+ "name": "wifi_aware",
+ "path": [
+ "foundation/communication/wifi_aware"
+ ]
+ },
+ "wifi_lite": {
+ "name": "wifi_lite",
+ "path": [
+ "foundation/communication/wifi_lite"
+ ]
+ },
+ "algorithm": {
+ "name": "algorithm",
+ "path": [
+ "base/msdp/algorithm"
+ ]
+ },
+ "geofence": {
+ "name": "geofence",
+ "path": [
+ "base/msdp/geofence"
+ ]
+ },
+ "motion": {
+ "name": "motion",
+ "path": [
+ "base/msdp/motion"
+ ]
+ },
+ "movement": {
+ "name": "movement",
+ "path": [
+ "base/msdp/movement"
+ ]
+ },
+ "spatial_awareness": {
+ "name": "spatial_awareness",
+ "path": [
+ "base/msdp/spatial_awareness"
+ ]
+ },
+ "timeline": {
+ "name": "timeline",
+ "path": [
+ "base/msdp/timeline"
+ ]
+ },
+ "device_status": {
+ "name": "device_status",
+ "path": [
+ "base/msdp/device_status"
+ ]
+ },
+ "os_account": {
+ "name": "os_account",
+ "path": [
+ "base/account/os_account"
+ ]
+ },
+ "i18n": {
+ "name": "i18n",
+ "path": [
+ "base/global/i18n"
+ ]
+ },
+ "i18n_lite": {
+ "name": "i18n_lite",
+ "path": [
+ "base/global/i18n_lite"
+ ]
+ },
+ "system_resources": {
+ "name": "system_resources",
+ "path": [
+ "utils/system_resources"
+ ]
+ },
+ "jsoncpp": {
+ "name": "jsoncpp",
+ "path": [
+ "third_party/jsoncpp"
+ ]
+ },
+ "libxml2": {
+ "name": "libxml2",
+ "path": [
+ "third_party/libxml2"
+ ]
+ },
+ "global_resource_tool": {
+ "name": "global_resource_tool",
+ "path": [
+ "developtools/global_resource_tool"
+ ]
+ },
+ "resource_management": {
+ "name": "resource_management",
+ "path": [
+ "base/global/resource_management"
+ ]
+ },
+ "resource_management_lite": {
+ "name": "resource_management_lite",
+ "path": [
+ "base/global/resource_management_lite"
+ ]
+ },
+ "timezone": {
+ "name": "timezone",
+ "path": [
+ "base/global/timezone"
+ ]
+ },
+ "accessibility": {
+ "name": "accessibility",
+ "path": [
+ "foundation/barrierfree/accessibility"
+ ]
+ },
+ "time_service": {
+ "name": "time_service",
+ "path": [
+ "base/time/time_service"
+ ]
+ },
+ "imf": {
+ "name": "imf",
+ "path": [
+ "base/inputmethod/imf"
+ ]
+ },
+ "wallpaper_mgr": {
+ "name": "wallpaper_mgr",
+ "path": [
+ "base/theme/wallpaper_mgr"
+ ]
+ },
+ "screenlock_mgr": {
+ "name": "screenlock_mgr",
+ "path": [
+ "base/theme/screenlock_mgr"
+ ]
+ },
+ "request": {
+ "name": "request",
+ "path": [
+ "base/request"
+ ]
+ },
+ "battery_manager": {
+ "name": "battery_manager",
+ "path": [
+ "base/powermgr/battery_manager"
+ ]
+ },
+ "display_manager": {
+ "name": "display_manager",
+ "path": [
+ "base/powermgr/display_manager"
+ ]
+ },
+ "powermgr_lite": {
+ "name": "powermgr_lite",
+ "path": [
+ "base/powermgr/powermgr_lite"
+ ]
+ },
+ "battery_lite": {
+ "name": "battery_lite",
+ "path": [
+ "base/powermgr/battery_lite"
+ ]
+ },
+ "battery_statistics": {
+ "name": "battery_statistics",
+ "path": [
+ "base/powermgr/battery_statistics"
+ ]
+ },
+ "power_manager": {
+ "name": "power_manager",
+ "path": [
+ "base/powermgr/power_manager"
+ ]
+ },
+ "thermal_manager": {
+ "name": "thermal_manager",
+ "path": [
+ "base/powermgr/thermal_manager"
+ ]
+ },
+ "sensor": {
+ "name": "sensor",
+ "path": [
+ "base/sensors/sensor"
+ ]
+ },
+ "miscdevice": {
+ "name": "miscdevice",
+ "path": [
+ "base/sensors/miscdevice"
+ ]
+ },
+ "sensor_lite": {
+ "name": "sensor_lite",
+ "path": [
+ "base/sensors/sensor_lite"
+ ]
+ },
+ "start": {
+ "name": "start",
+ "path": [
+ "base/sensors/start"
+ ]
+ },
+ "user_auth_framework": {
+ "name": "user_auth_framework",
+ "path": [
+ "base/useriam/user_auth_framework"
+ ]
+ },
+ "pin_auth": {
+ "name": "pin_auth",
+ "path": [
+ "base/useriam/pin_auth"
+ ]
+ },
+ "face_auth": {
+ "name": "face_auth",
+ "path": [
+ "base/useriam/face_auth"
+ ]
+ },
+ "fingerprint_auth": {
+ "name": "fingerprint_auth",
+ "path": [
+ "base/useriam/fingerprint_auth"
+ ]
+ },
+ "peripheral": {
+ "name": "peripheral",
+ "path": [
+ "drivers/peripheral/pin_auth",
+ "drivers/peripheral/face_auth",
+ "drivers/peripheral/user_auth",
+ "drivers/peripheral/fingerprint_auth"
+ ]
+ },
+ "location": {
+ "name": "location",
+ "path": [
+ "base/location"
+ ]
+ },
+ "usb_manager": {
+ "name": "usb_manager",
+ "path": [
+ "base/usb/usb_manager"
+ ]
+ },
+ "build": {
+ "name": "build",
+ "path": [
+ "build"
+ ]
+ },
+ "gn": {
+ "name": "gn",
+ "path": [
+ "third_party/gn"
+ ]
+ },
+ "ninja": {
+ "name": "ninja",
+ "path": [
+ "third_party/ninja"
+ ]
+ },
+ "hidl_adapter": {
+ "name": "hidl_adapter",
+ "path": [
+ "drivers/peripheral/adapter/activity_recognition",
+ "drivers/peripheral/adapter/audio",
+ "drivers/peripheral/adapter/camera",
+ "drivers/peripheral/adapter/gralloc",
+ "drivers/peripheral/adapter/hwc",
+ "drivers/peripheral/adapter/input",
+ "drivers/peripheral/adapter/motion",
+ "drivers/peripheral/adapter/sensor",
+ "drivers/peripheral/adapter/thermal"
+ ]
+ },
+ "hdf_core": {
+ "name": "hdf_core",
+ "path": [
+ "drivers/hdf_core/adapter/uhdf2",
+ "drivers/hdf_core/framework/core/common",
+ "drivers/hdf_core/framework/core/host",
+ "drivers/hdf_core/framework/core/manager",
+ "drivers/hdf_core/framework/core/shared",
+ "drivers/hdf_core/framework/support/posix/"
+ ]
+ },
+ "app_file_service": {
+ "name": "app_file_service",
+ "path": [
+ "foundation/filemanagement/app_file_service"
+ ]
+ },
+ "dfs_service": {
+ "name": "dfs_service",
+ "path": [
+ "foundation/filemanagement/dfs_service"
+ ]
+ },
+ "file_api": {
+ "name": "file_api",
+ "path": [
+ "foundation/filemanagement/file_api"
+ ]
+ },
+ "storage_service": {
+ "name": "storage_service",
+ "path": [
+ "foundation/filemanagement/storage_service"
+ ]
+ },
+ "user_file_service": {
+ "name": "user_file_service",
+ "path": [
+ "foundation/filemanagement/user_file_service"
+ ]
+ },
+ "media_library": {
+ "name": "media_library",
+ "path": [
+ "foundation/multimedia/media_library"
+ ]
+ },
+ "netmanager_base": {
+ "name": "netmanager_base",
+ "path": [
+ "foundation/communication/netmanager_base"
+ ]
+ },
+ "netmanager_ext": {
+ "name": "netmanager_ext",
+ "path": [
+ "foundation/communication/netmanager_ext"
+ ]
+ },
+ "netstack": {
+ "name": "netstack",
+ "path": [
+ "foundation/communication/netstack"
+ ]
+ },
+ "webview": {
+ "name": "webview",
+ "path": [
+ "base/web/webview/ohos_adapter",
+ "base/web/webview/ohos_nweb"
+ ]
+ },
+ "tee_client": {
+ "name": "tee_client",
+ "path": [
+ "base/tee/tee_client"
+ ]
+ },
+ "tee_dev_kit": {
+ "name": "tee_dev_kit",
+ "path": [
+ "base/tee/tee_dev_kit"
+ ]
+ },
+ "tee_tzdriver": {
+ "name": "tee_tzdriver",
+ "path": [
+ "base/tee/tee_tzdriver"
+ ]
+ },
+ "device_info_manager": {
+ "name": "device_info_manager",
+ "path": [
+ "foundation/deviceprofile"
+ ]
+ },
+ "enterprise_device_management": {
+ "name": "enterprise_device_management",
+ "path": [
+ "base/customization/enterprise_device_management"
+ ]
+ },
+ "config_policy": {
+ "name": "config_policy",
+ "path": [
+ "base/customization/config_policy"
+ ]
+ },
+ "toolchain": {
+ "name": "toolchain",
+ "path": [
+ "arkcompiler/toolchain"
+ ]
+ },
+ "runtime_core": {
+ "name": "runtime_core",
+ "path": [
+ "arkcompiler/runtime_core"
+ ]
+ },
+ "ets_frontend": {
+ "name": "ets_frontend",
+ "path": [
+ "arkcompiler/ets_frontend"
+ ]
+ },
+ "ets_runtime": {
+ "name": "ets_runtime",
+ "path": [
+ "arkcompiler/ets_runtime"
+ ]
+ },
+ "jerryscript": {
+ "name": "jerryscript",
+ "path": [
+ "third_party/jerryscript"
+ ]
+ },
+ "safwk": {
+ "name": "safwk",
+ "path": [
+ "foundation/systemabilitymgr/safwk"
+ ]
+ },
+ "safwk_lite": {
+ "name": "safwk_lite",
+ "path": [
+ "foundation/systemabilitymgr/safwk_lite"
+ ]
+ },
+ "samgr_lite": {
+ "name": "samgr_lite",
+ "path": [
+ "foundation/systemabilitymgr/samgr_lite"
+ ]
+ },
+ "samgr": {
+ "name": "samgr",
+ "path": [
+ "foundation/systemabilitymgr/samgr"
+ ]
+ },
+ "dmsfwk": {
+ "name": "dmsfwk",
+ "path": [
+ "foundation/ability/dmsfwk"
+ ]
+ },
+ "dmsfwk_lite": {
+ "name": "dmsfwk_lite",
+ "path": [
+ "foundation/ability/dmsfwk_lite"
+ ]
+ },
+ "window_manager": {
+ "name": "window_manager",
+ "path": [
+ "foundation/window/window_manager"
+ ]
+ },
+ "utils_lite": {
+ "name": "utils_lite",
+ "path": [
+ "commonlibrary/utils_lite"
+ ]
+ },
+ "c_utils": {
+ "name": "c_utils",
+ "path": [
+ "commonlibrary/c_utils"
+ ]
+ },
+ "ets_utils": {
+ "name": "ets_utils",
+ "path": [
+ "commonlibrary/ets_utils"
+ ]
+ },
+ "selinux_adapter": {
+ "name": "selinux_adapter",
+ "path": [
+ "base/security/selinux_adapter"
+ ]
+ },
+ "access_token": {
+ "name": "access_token",
+ "path": [
+ "base/security/access_token"
+ ]
+ },
+ "permission_lite": {
+ "name": "permission_lite",
+ "path": [
+ "base/security/permission_lite"
+ ]
+ },
+ "dlp_permission_service": {
+ "name": "dlp_permission_service",
+ "path": [
+ "base/security/dlp_permission_service"
+ ]
+ },
+ "dlp_credential_service": {
+ "name": "dlp_credential_service",
+ "path": [
+ "base/security/dlp_credential_service"
+ ]
+ },
+ "memmgr_override": {
+ "name": "memmgr_override",
+ "path": [
+ "foundation/resourceschedule/memmgr_override"
+ ]
+ },
+ "frame_aware_sched": {
+ "name": "frame_aware_sched",
+ "path": [
+ "foundation/resourceschedule/frame_aware_sched"
+ ]
+ },
+ "sys_installer": {
+ "name": "sys_installer",
+ "path": [
+ "base/update/sys_installer"
+ ]
+ },
+ "updater": {
+ "name": "updater",
+ "path": [
+ "base/update/updater"
+ ]
+ },
+ "dupdate_engine": {
+ "name": "dupdate_engine",
+ "path": [
+ "base/update/dupdate_engine"
+ ]
+ },
+ "memory_utils": {
+ "name": "memory_utils",
+ "path": [
+ "commonlibrary/memory_utils"
+ ]
+ },
+ "ace_engine": {
+ "name": "ace_engine",
+ "path": [
+ "foundation/arkui/ace_engine/frameworks/base/geometry",
+ "foundation/arkui/ace_engine/frameworks/base/json",
+ "foundation/arkui/ace_engine/frameworks/base/utils",
+ "foundation/arkui/ace_engine/frameworks/bridge/card_frontend",
+ "foundation/arkui/ace_engine/frameworks/bridge/common/manifest",
+ "foundation/arkui/ace_engine/frameworks/bridge/common/media_query",
+ "foundation/arkui/ace_engine/frameworks/bridge/common/plugin_adapter",
+ "foundation/arkui/ace_engine/frameworks/bridge/common/utils",
+ "foundation/arkui/ace_engine/frameworks/bridge/plugin_frontend",
+ "foundation/arkui/ace_engine/interfaces"
+ ]
+ },
+ "ace_engine_lite": {
+ "name": "ace_engine_lite",
+ "path": [
+ "foundation/arkui/ace_engine_lite"
+ ]
+ },
+ "container_linux_service_broker": {
+ "name": "container_linux_service_broker",
+ "path": [
+ "vendor/huawei/virt_service/linux_fusion_service"
+ ]
+ },
+ "container_manager": {
+ "name": "container_manager",
+ "path": [
+ "vendor/huawei/virt_service/container_manager"
+ ]
+ },
+ "container_comm": {
+ "name": "container_comm",
+ "path": [
+ "vendor/huawei/virt_service/container_comm"
+ ]
+ },
+ "ace_engine_ext": {
+ "name": "ace_engine_ext",
+ "path": [
+ "vendor/huawei/foundation/ace/ace_engine_ext"
+ ]
+ },
+ "audio_driver_handset": {
+ "name": "audio_driver_handset",
+ "path": [
+ "vendor/huawei/chipset/modules/audio"
+ ]
+ },
+ "audio_framework_ext": {
+ "name": "audio_framework_ext",
+ "path": [
+ "vendor/huawei/foundation/multimedia/audio_framework_ext"
+ ]
+ },
+ "baltimore_products": {
+ "name": "container_comm",
+ "path": [
+ "vendor/huawei/m40"
+ ]
+ },
+ "battery_management_service_extra": {
+ "name": "battery_management_service_extra",
+ "path": [
+ "vendor/huawei/chipset/modules/power"
+ ]
+ },
+ "bluetooth_service_override": {
+ "name": "bluetooth_service_override",
+ "path": [
+ "vendor/huawei/foundation/communication/bluetooth_service_override"
+ ]
+ },
+ "booster": {
+ "name": "booster",
+ "path": [
+ "vendor/huawei/base/radio/booster"
+ ]
+ },
+ "boot_detector_plugin": {
+ "name": "boot_detector_plugin",
+ "path": [
+ "vendor/huawei/base/hiviewdfx/hiview_plugins/boot_detector_plugin"
+ ]
+ },
+ "bundle_framework_ext": {
+ "name": "bundle_framework_ext",
+ "path": [
+ "vendor/huawei/foundation/bundlemanager/bundle_framework_ext"
+ ]
+ },
+ "advanced_ui_component": {
+ "name": "advanced_ui_component",
+ "path": [
+ "foundation/arkui/advanced_ui_component"
+ ]
+ },
+ "appspawn_lite": {
+ "name": "appspawn_lite",
+ "path": [
+ "base/startup/appspawn/lite"
+ ]
+ },
+ "auth_widget": {
+ "name": "auth_widget",
+ "path": [
+ "applications/standard/applications_auth_widget"
+ ]
+ },
+ "av_codec": {
+ "name": "av_codec",
+ "path": [
+ "foundation/multimedia/av_codec"
+ ]
+ },
+ "bluetooth_service": {
+ "name": "bluetooth_service",
+ "path": [
+ "foundation/communication/bluetooth_service"
+ ]
+ },
+ "build_framework": {
+ "name": "build_framework",
+ "path": [
+ "build/common"
+ ]
+ },
+ "bundle_tool": {
+ "name": "bundle_tool",
+ "path": [
+ "foundation/bundlemanager/bundle_tool"
+ ]
+ },
+ "calendar_data": {
+ "name": "calendar_data",
+ "path": [
+ "applications/standard/calendardata"
+ ]
+ },
+ "camera_sample_app": {
+ "name": "camera_sample_app",
+ "path": [
+ "applications/sample/camera"
+ ]
+ },
+ "camera_sample_communication": {
+ "name": "camera_sample_communication",
+ "path": [
+ "applications/sample/camera/communication"
+ ]
+ },
+ "camera_screensaver_app": {
+ "name": "camera_screensaver_app",
+ "path": [
+ "applications/sample/camera/screensaver"
+ ]
+ },
+ "certificate_framework": {
+ "name": "certificate_framework",
+ "path": [
+ "base/security/certificate_framework"
+ ]
+ },
+ "contacts_data_hap": {
+ "name": "contacts_data_hap",
+ "path": [
+ "applications/standard/contacts_data"
+ ]
+ },
+ "contacts_standard": {
+ "name": "contacts_standard",
+ "path": [
+ "applications/standard/contacts"
+ ]
+ },
+ "device_standby": {
+ "name": "device_standby",
+ "path": [
+ "foundation/resourceschedule/device_standby"
+ ]
+ },
+ "device_standby_ext": {
+ "name": "device_standby_ext",
+ "path": [
+ "foundation/resourceschedule/device_standby_ext"
+ ]
+ },
+ "distributed_bundle_framework": {
+ "name": "distributed_bundle_framework",
+ "path": [
+ "foundation/bundlemanager/distributed_bundle_framework"
+ ]
+ },
+ "distributedfilejs": {
+ "name": "distributedfilejs",
+ "path": [
+ "foundation/distributeddatamgr/distributedfile"
+ ]
+ },
+ "drivers_interface_act_recg": {
+ "name": "drivers_interface_act_recg",
+ "path": [
+ "drivers/interface/activity_recognition"
+ ]
+ },
+ "drivers_interface_audio": {
+ "name": "drivers_interface_audio",
+ "path": [
+ "drivers/interface/audio"
+ ]
+ },
+ "drivers_interface_battery": {
+ "name": "drivers_interface_battery",
+ "path": [
+ "drivers/interface/battery"
+ ]
+ },
+ "drivers_interface_bluetooth": {
+ "name": "drivers_interface_bluetooth",
+ "path": [
+ "drivers/interface/bluetooth"
+ ]
+ },
+ "drivers_interface_camera": {
+ "name": "drivers_interface_camera",
+ "path": [
+ "drivers/interface/camera"
+ ]
+ },
+ "drivers_interface_codec": {
+ "name": "drivers_interface_codec",
+ "path": [
+ "drivers/interface/codec"
+ ]
+ },
+ "drivers_interface_connected_nfc_tag": {
+ "name": "drivers_interface_connected_nfc_tag",
+ "path": [
+ "drivers/interface/connected_nfc_tag"
+ ]
+ },
+ "drivers_interface_display": {
+ "name": "drivers_interface_display",
+ "path": [
+ "drivers/interface/display"
+ ]
+ },
+ "drivers_interface_distributed_audio": {
+ "name": "drivers_interface_distributed_audio",
+ "path": [
+ "foundation/distributedhardware/distributed_audio/hdf_interfaces/distributed_audio"
+ ]
+ },
+ "drivers_interface_distributed_camera": {
+ "name": "drivers_interface_distributed_camera",
+ "path": [
+ "drivers/interface/distributed_camera"
+ ]
+ },
+ "drivers_interface_face_auth": {
+ "name": "drivers_interface_face_auth",
+ "path": [
+ "drivers/interface/face_auth"
+ ]
+ },
+ "drivers_interface_fingerprint_auth": {
+ "name": "drivers_interface_fingerprint_auth",
+ "path": [
+ "drivers/interface/fingerprint_auth"
+ ]
+ },
+ "drivers_interface_huks": {
+ "name": "drivers_interface_huks",
+ "path": [
+ "drivers/interface/huks"
+ ]
+ },
+ "drivers_interface_input": {
+ "name": "drivers_interface_input",
+ "path": [
+ "drivers/interface/input"
+ ]
+ },
+ "drivers_interface_intelligent_voice": {
+ "name": "drivers_interface_intelligent_voice",
+ "path": [
+ "drivers/interface/intelligent_voice"
+ ]
+ },
+ "drivers_interface_light": {
+ "name": "drivers_interface_light",
+ "path": [
+ "drivers/interface/light"
+ ]
+ },
+ "drivers_interface_location_agnss": {
+ "name": "drivers_interface_location_agnss",
+ "path": [
+ "drivers/interface/location/agnss"
+ ]
+ },
+ "drivers_interface_location_geofence": {
+ "name": "drivers_interface_location_geofence",
+ "path": [
+ "drivers/interface/location/geofence"
+ ]
+ },
+ "drivers_interface_location_gnss": {
+ "name": "drivers_interface_location_gnss",
+ "path": [
+ "drivers/interface/location/gnss"
+ ]
+ },
+ "drivers_interface_lpfence_cellbatching": {
+ "name": "drivers_interface_lpfence_cellbatching",
+ "path": [
+ "drivers/interface/location/lpfence/cellbatching"
+ ]
+ },
+ "drivers_interface_lpfence_cellfence": {
+ "name": "drivers_interface_lpfence_cellfence",
+ "path": [
+ "drivers/interface/location/lpfence/cellfence"
+ ]
+ },
+ "drivers_interface_lpfence_geofence": {
+ "name": "drivers_interface_lpfence_geofence",
+ "path": [
+ "drivers/interface/location/lpfence/geofence"
+ ]
+ },
+ "drivers_interface_lpfence_wififence": {
+ "name": "drivers_interface_lpfence_wififence",
+ "path": [
+ "drivers/interface/location/lpfence/wififence"
+ ]
+ },
+ "drivers_interface_memorytracker": {
+ "name": "drivers_interface_memorytracker",
+ "path": [
+ "drivers/interface/memorytracker"
+ ]
+ },
+ "drivers_interface_motion": {
+ "name": "drivers_interface_motion",
+ "path": [
+ "drivers/interface/motion"
+ ]
+ },
+ "drivers_interface_nfc": {
+ "name": "drivers_interface_nfc",
+ "path": [
+ "drivers/interface/nfc"
+ ]
+ },
+ "drivers_interface_nnrt": {
+ "name": "drivers_interface_nnrt",
+ "path": [
+ "drivers/interface/nnrt"
+ ]
+ },
+ "drivers_interface_partitionslot": {
+ "name": "drivers_interface_partitionslot",
+ "path": [
+ "drivers/interface/partitionslot"
+ ]
+ },
+ "drivers_interface_pin_auth": {
+ "name": "drivers_interface_pin_auth",
+ "path": [
+ "drivers/interface/pin_auth"
+ ]
+ },
+ "drivers_interface_power": {
+ "name": "drivers_interface_power",
+ "path": [
+ "drivers/interface/power"
+ ]
+ },
+ "drivers_interface_ril": {
+ "name": "drivers_interface_ril",
+ "path": [
+ "drivers/interface/ril"
+ ]
+ },
+ "drivers_interface_secure_element": {
+ "name": "drivers_interface_secure_element",
+ "path": [
+ "drivers/interface/secure_element"
+ ]
+ },
+ "drivers_interface_sensor": {
+ "name": "drivers_interface_sensor",
+ "path": [
+ "drivers/interface/sensor"
+ ]
+ },
+ "drivers_interface_thermal": {
+ "name": "drivers_interface_thermal",
+ "path": [
+ "drivers/interface/thermal"
+ ]
+ },
+ "drivers_interface_usb": {
+ "name": "drivers_interface_usb",
+ "path": [
+ "drivers/interface/usb"
+ ]
+ },
+ "drivers_interface_user_auth": {
+ "name": "drivers_interface_user_auth",
+ "path": [
+ "drivers/interface/user_auth"
+ ]
+ },
+ "drivers_interface_vibrator": {
+ "name": "drivers_interface_vibrator",
+ "path": [
+ "drivers/interface/vibrator"
+ ]
+ },
+ "drivers_interface_wlan": {
+ "name": "drivers_interface_wlan",
+ "path": [
+ "drivers/interface/wlan"
+ ]
+ },
+ "drivers_peripheral_audio": {
+ "name": "drivers_peripheral_audio",
+ "path": [
+ "drivers/peripheral/audio"
+ ]
+ },
+ "drivers_peripheral_battery": {
+ "name": "drivers_peripheral_battery",
+ "path": [
+ "drivers/peripheral/battery"
+ ]
+ },
+ "drivers_peripheral_bluetooth": {
+ "name": "drivers_peripheral_bluetooth",
+ "path": [
+ "drivers/peripheral/bluetooth"
+ ]
+ },
+ "drivers_peripheral_camera": {
+ "name": "drivers_peripheral_camera",
+ "path": [
+ "drivers/peripheral/camera"
+ ]
+ },
+ "drivers_peripheral_codec": {
+ "name": "drivers_peripheral_codec",
+ "path": [
+ "drivers/peripheral/codec"
+ ]
+ },
+ "drivers_peripheral_connected_nfc_tag": {
+ "name": "drivers_peripheral_connected_nfc_tag",
+ "path": [
+ "drivers/peripheral/connected_nfc_tag"
+ ]
+ },
+ "drivers_peripheral_display": {
+ "name": "drivers_peripheral_display",
+ "path": [
+ "drivers/peripheral/display"
+ ]
+ },
+ "drivers_peripheral_distributed_audio": {
+ "name": "drivers_peripheral_distributed_audio",
+ "path": [
+ "foundation/distributedhardware/distributed_audio/hdf_service/distributed_audio"
+ ]
+ },
+ "drivers_peripheral_distributed_camera": {
+ "name": "drivers_peripheral_distributed_camera",
+ "path": [
+ "drivers/peripheral/distributed_camera"
+ ]
+ },
+ "drivers_peripheral_face_auth": {
+ "name": "drivers_peripheral_face_auth",
+ "path": [
+ "drivers/peripheral/face_auth"
+ ]
+ },
+ "drivers_peripheral_fingerprint_auth": {
+ "name": "drivers_peripheral_fingerprint_auth",
+ "path": [
+ "drivers/peripheral/fingerprint_auth"
+ ]
+ },
+ "drivers_peripheral_huks": {
+ "name": "drivers_peripheral_huks",
+ "path": [
+ "drivers/peripheral/huks"
+ ]
+ },
+ "drivers_peripheral_input": {
+ "name": "drivers_peripheral_input",
+ "path": [
+ "drivers/peripheral/input"
+ ]
+ },
+ "drivers_peripheral_intelligent_voice": {
+ "name": "drivers_peripheral_intelligent_voice",
+ "path": [
+ "drivers/peripheral/intelligent_voice"
+ ]
+ },
+ "drivers_peripheral_light": {
+ "name": "drivers_peripheral_light",
+ "path": [
+ "drivers/peripheral/light"
+ ]
+ },
+ "drivers_peripheral_location_agnss": {
+ "name": "drivers_peripheral_location_agnss",
+ "path": [
+ "drivers/peripheral/location/agnss"
+ ]
+ },
+ "drivers_peripheral_location_geofence": {
+ "name": "drivers_peripheral_location_geofence",
+ "path": [
+ "drivers/peripheral/location/geofence"
+ ]
+ },
+ "drivers_peripheral_location_gnss": {
+ "name": "drivers_peripheral_location_gnss",
+ "path": [
+ "drivers/peripheral/location/gnss"
+ ]
+ },
+ "drivers_peripheral_memorytracker": {
+ "name": "drivers_peripheral_memorytracker",
+ "path": [
+ "drivers/peripheral/memorytracker"
+ ]
+ },
+ "drivers_peripheral_motion": {
+ "name": "drivers_peripheral_motion",
+ "path": [
+ "drivers/peripheral/motion"
+ ]
+ },
+ "drivers_peripheral_nfc": {
+ "name": "drivers_peripheral_nfc",
+ "path": [
+ "drivers/peripheral/nfc"
+ ]
+ },
+ "drivers_peripheral_partitionslot": {
+ "name": "drivers_peripheral_partitionslot",
+ "path": [
+ "drivers/peripheral/partitionslot"
+ ]
+ },
+ "drivers_peripheral_pin_auth": {
+ "name": "drivers_peripheral_pin_auth",
+ "path": [
+ "drivers/peripheral/pin_auth"
+ ]
+ },
+ "drivers_peripheral_power": {
+ "name": "drivers_peripheral_power",
+ "path": [
+ "drivers/peripheral/power"
+ ]
+ },
+ "drivers_peripheral_ril": {
+ "name": "drivers_peripheral_ril",
+ "path": [
+ "drivers/peripheral/ril"
+ ]
+ },
+ "drivers_peripheral_secure_element": {
+ "name": "drivers_peripheral_secure_element",
+ "path": [
+ "drivers/peripheral/secure_element"
+ ]
+ },
+ "drivers_peripheral_sensor": {
+ "name": "drivers_peripheral_sensor",
+ "path": [
+ "drivers/peripheral/sensor"
+ ]
+ },
+ "drivers_peripheral_thermal": {
+ "name": "drivers_peripheral_thermal",
+ "path": [
+ "drivers/peripheral/thermal"
+ ]
+ },
+ "drivers_peripheral_usb": {
+ "name": "drivers_peripheral_usb",
+ "path": [
+ "drivers/peripheral/usb"
+ ]
+ },
+ "drivers_peripheral_user_auth": {
+ "name": "drivers_peripheral_user_auth",
+ "path": [
+ "drivers/peripheral/user_auth"
+ ]
+ },
+ "drivers_peripheral_vibrator": {
+ "name": "drivers_peripheral_vibrator",
+ "path": [
+ "drivers/peripheral/vibrator"
+ ]
+ },
+ "drivers_peripheral_wlan": {
+ "name": "drivers_peripheral_wlan",
+ "path": [
+ "drivers/peripheral/wlan"
+ ]
+ },
+ "external_device_manager": {
+ "name": "external_device_manager",
+ "path": [
+ "drivers/external_device_manager"
+ ]
+ },
+ "ffrt": {
+ "name": "ffrt",
+ "path": [
+ "foundation/resourceschedule/ffrt"
+ ]
+ },
+ "graphic_surface": {
+ "name": "graphic_surface",
+ "path": [
+ "foundation/graphic/graphic_surface/surface"
+ ]
+ },
+ "hilog_featured_lite": {
+ "name": "hilog_featured_lite",
+ "path": [
+ "base/hiviewdfx/hilog_lite/frameworks/featured"
+ ]
+ },
+ "hvb": {
+ "name": "hvb",
+ "path": [
+ "base/startup/hvb"
+ ]
+ },
+ "init_lite": {
+ "name": "init_lite",
+ "path": [
+ "base/startup/init/services/init/lite"
+ ]
+ },
+ "intelligent_voice_framework": {
+ "name": "intelligent_voice_framework",
+ "path": [
+ "foundation/ai/intelligent_voice_framework"
+ ]
+ },
+ "ipc_js": {
+ "name": "ipc_js",
+ "path": [
+ "foundation/communication/ipc/interfaces/kits"
+ ]
+ },
+ "media_utils_lite": {
+ "name": "media_utils_lite",
+ "path": [
+ "foundation/multimedia/media_utils_lite"
+ ]
+ },
+ "medical_sensor": {
+ "name": "medical_sensor",
+ "path": [
+ "base/sensors/medical_sensor"
+ ]
+ },
+ "permission_manager": {
+ "name": "permission_manager",
+ "path": [
+ "applications/standard/permission_manager"
+ ]
+ },
+ "prebuilt_hap": {
+ "name": "prebuilt_hap",
+ "path": [
+ "applications/standard/hap"
+ ]
+ },
+ "print_fwk": {
+ "name": "print_fwk",
+ "path": [
+ "base/print/print_fwk"
+ ]
+ },
+ "qos_manager": {
+ "name": "qos_manager",
+ "path": [
+ "foundation/resourceschedule/qos_manager"
+ ]
+ },
+ "rockchip_products": {
+ "name": "rockchip_products",
+ "path": [
+ "device/board/hihope/rk3568"
+ ]
+ },
+ "settings_standard": {
+ "name": "settings_standard",
+ "path": [
+ "applications/standard/settings"
+ ]
+ },
+ "soc_perf": {
+ "name": "soc_perf",
+ "path": [
+ "foundation/resourceschedule/soc_perf"
+ ]
+ },
+ "surface_lite": {
+ "name": "surface_lite",
+ "path": [
+ "foundation/graphic/surface_lite"
+ ]
+ },
+ "sys_installer_lite": {
+ "name": "sys_installer_lite",
+ "path": [
+ "base/update/sys_installer_lite"
+ ]
+ },
+ "udmf": {
+ "name": "udmf",
+ "path": [
+ "foundation/distributeddatamgr/udmf"
+ ]
+ },
+ "ui_appearance": {
+ "name": "ui_appearance",
+ "path": [
+ "foundation/arkui/ui_appearance"
+ ]
+ },
+ "update_service": {
+ "name": "update_service",
+ "path": [
+ "base/update/updateservice"
+ ]
+ },
+ "wifi_aware_lite": {
+ "name": "wifi_aware_lite",
+ "path": [
+ "foundation/communication/wifi_aware"
+ ]
+ },
+ "wifi_iot_sample_app": {
+ "name": "wifi_iot_sample_app",
+ "path": [
+ "applications/sample/wifi-iot/app"
+ ]
+ },
+ "ylong_http": {
+ "name": "ylong_http",
+ "path": [
+ "commonlibrary/rust/ylong_http"
+ ]
+ },
+ "ylong_runtime_mod": {
+ "name": "ylong_runtime_mod",
+ "path": [
+ "commonlibrary/rust/ylong_runtime"
+ ]
+ },
+ "findnetwork": {
+ "name": "findnetwork",
+ "path": [
+ "vendor/huawei/domains/finddevice/findnetwork"
+ ]
+ },
+ "push_manager_service": {
+ "name": "push_manager_service",
+ "path": [
+ "vendor/huawei/domains/push/push_manager_service"
+ ]
+ },
+ "quickfix_engine": {
+ "name": "quickfix_engine",
+ "path": [
+ "vendor/huawei/base/update/quickfix_engine"
+ ]
+ },
+ "security_guard": {
+ "name": "security_guard",
+ "path": [
+ "base/security/security_guard"
+ ]
+ },
+ "container_hmos_service_broker": {
+ "name": "container_hmos_service_broker",
+ "path": [
+ "vendor/huawei/virt_service/container_hmos_service_broker"
+ ]
+ },
+ "iShare": {
+ "name": "iShare",
+ "path": [
+ "vendor/huawei/foundation/HMconnect/iShare"
+ ]
+ },
+ "cast_engine": {
+ "name": "cast_engine",
+ "path": [
+ "vendor/huawei/foundation/HMconnect/CastEngine"
+ ]
+ },
+ "CollaborationFwk": {
+ "name": "CollaborationFwk",
+ "path": [
+ "vendor/huawei/foundation/HMconnect/CollaborationFwk"
+ ]
+ },
+ "sys_installer_ext": {
+ "name": "sys_installer_ext",
+ "path": [
+ "vendor/huawei/base/update/sys_installer_ext"
+ ]
+ }
+}
diff --git a/localCoverage/automate_execute/build_part.py b/local_coverage/automate_execute/build_part.py
similarity index 95%
rename from localCoverage/automate_execute/build_part.py
rename to local_coverage/automate_execute/build_part.py
index 12c849762d5bb13dc7811f2256ec9686f695de6c..d2136cd74f7084e7b05eaeaccd493bc7027e8cf4 100644
--- a/localCoverage/automate_execute/build_part.py
+++ b/local_coverage/automate_execute/build_part.py
@@ -24,7 +24,7 @@ import sys
def get_subsystem_config(part_str, developer_path):
all_system_info_path = os.path.join(
- developer_path, "localCoverage/all_subsystem_config.json"
+ developer_path, "local_coverage/all_subsystem_config.json"
)
if os.path.exists(all_system_info_path):
new_json_text = {}
@@ -74,7 +74,7 @@ def get_bundle_json(part_str, developer_path, code_path):
return False
if part_json.get(part_str):
- bundle_json_path = os.path.join(code_path, part_json[part_str]["path"][0], "bundle.json")
+ bundle_json_path = os.path.join(code_path, part_json.get(part_str, {}).get("path", [""])[0], "bundle.json")
if os.path.exists(bundle_json_path):
with open(bundle_json_path, "r", encoding="utf-8") as bundle_json_text:
bundle_json = json.load(bundle_json_text)
@@ -122,7 +122,7 @@ if __name__ == '__main__':
developer_test_path = os.path.join(root_path, "test/testfwk/developer_test")
build_before_path = os.path.join(
developer_test_path,
- "localCoverage/restore_comment/build_before_generate.py"
+ "local_coverage/restore_comment/build_before_generate.py"
)
subprocess.run("python3 %s %s" % (build_before_path, test_part_str), shell=True)
build_success = get_bundle_json(test_part_str, developer_test_path, root_path)
diff --git a/localCoverage/automate_execute/coverage.sh b/local_coverage/automate_execute/coverage.sh
similarity index 100%
rename from localCoverage/automate_execute/coverage.sh
rename to local_coverage/automate_execute/coverage.sh
diff --git a/localCoverage/automate_execute/install_coverage_tools.py b/local_coverage/automate_execute/install_coverage_tools.py
similarity index 95%
rename from localCoverage/automate_execute/install_coverage_tools.py
rename to local_coverage/automate_execute/install_coverage_tools.py
index c93f5ae9c61509254fac0fa8978d5c464875bbe2..830c86b186eaa0ae1a9416e75bc18292c2dae48c 100644
--- a/localCoverage/automate_execute/install_coverage_tools.py
+++ b/local_coverage/automate_execute/install_coverage_tools.py
@@ -31,7 +31,7 @@ def sub_command(command):
def install_tool(home_path):
coverage_sh = os.path.join(
- home_path, "test/testfwk/developer_test/localCoverage/automate_execute/coverage.sh")
+ home_path, "test/testfwk/developer_test/local_coverage/automate_execute/coverage.sh")
sub_command("chmod +x %s" % coverage_sh)
sub_command(coverage_sh)
diff --git a/localCoverage/codeCoverage/__init__.py b/local_coverage/code_coverage/__init__.py
similarity index 100%
rename from localCoverage/codeCoverage/__init__.py
rename to local_coverage/code_coverage/__init__.py
diff --git a/localCoverage/codeCoverage/coverage_rc/lcovrc_cov_template b/local_coverage/code_coverage/coverage_rc/lcovrc_cov_template
similarity index 100%
rename from localCoverage/codeCoverage/coverage_rc/lcovrc_cov_template
rename to local_coverage/code_coverage/coverage_rc/lcovrc_cov_template
diff --git a/localCoverage/codeCoverage/llvm-gcov.sh b/local_coverage/code_coverage/llvm-gcov.sh
similarity index 90%
rename from localCoverage/codeCoverage/llvm-gcov.sh
rename to local_coverage/code_coverage/llvm-gcov.sh
index 21b2409ed7a7b6d7f773d49d5b729efab06e1874..23d7c50852238fac1ac940126b7fd77840bf6088 100644
--- a/localCoverage/codeCoverage/llvm-gcov.sh
+++ b/local_coverage/code_coverage/llvm-gcov.sh
@@ -16,5 +16,5 @@
# This file is autogenerated by c_coverage_mgr.py, do not edit manually .
current_path=$(cd $(dirname $0);pwd)
-root_path=${current_path%%/test/testfwk/developer_test/localCoverage/codeCoverage}
+root_path=${current_path%%/test/testfwk/developer_test/local_coverage/code_coverage}
exec $root_path/prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-cov gcov "$@"
diff --git a/localCoverage/codeCoverage/mutilProcess_CodeCoverage.py b/local_coverage/code_coverage/multiprocess_code_coverage.py
similarity index 92%
rename from localCoverage/codeCoverage/mutilProcess_CodeCoverage.py
rename to local_coverage/code_coverage/multiprocess_code_coverage.py
index 4fde91aabc80fb0b3231584a5ba599c33ae09563..2c56cecb907f3604ae0b138d678c4726ad70dfa1 100644
--- a/localCoverage/codeCoverage/mutilProcess_CodeCoverage.py
+++ b/local_coverage/code_coverage/multiprocess_code_coverage.py
@@ -1,396 +1,396 @@
-#!/usr/bin/env python3
-# coding=utf-8
-
-#
-# Copyright (c) 2023 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-import os
-import json
-import shutil
-import shlex
-import subprocess
-import multiprocessing
-import sys
-import stat
-
-from multiprocessing import Process
-
-FLAGS = os.O_WRONLY | os.O_APPEND | os.O_CREAT
-MODES = stat.S_IWUSR | stat.S_IRUSR
-
-# 子系统json目录
-SYSTEM_JSON = "test/testfwk/developer_test/localCoverage/codeCoverage/subsystem_config.json"
-# 覆盖率gcda
-COVERAGE_GCDA_RESULTS = "test/testfwk/developer_test/localCoverage/codeCoverage/results/coverage/data/cxx"
-# 报告路径
-REPORT_PATH = "test/testfwk/developer_test/localCoverage/codeCoverage/results/coverage/reports/cxx"
-# llvm-gcov.sh
-LLVM_GCOV = "test/testfwk/developer_test/localCoverage/codeCoverage/llvm-gcov.sh"
-# 测试套划分步长
-STEP_SIZE = 10
-
-
-def _init_sys_config():
- sys.localcoverage_path = os.path.join(current_path, "..")
- sys.path.insert(0, sys.localcoverage_path)
-
-
-def call(cmd_list, is_show_cmd=False, out=None, err=None):
- return_flag = False
- try:
- if is_show_cmd:
- print("execute command: {}".format(" ".join(cmd_list)))
- if 0 == subprocess.call(cmd_list, shell=False, stdout=out, stderr=err):
- return_flag = True
- except IOError:
- print("Error : command {} execute faild!".format(cmd_list))
- return_flag = False
-
- return return_flag
-
-
-def execute_command(command, printflag=False):
- try:
- cmd_list = shlex.split(command)
- coverage_log_path = os.path.join(
- CODEPATH, "test/testfwk/developer_test/localCoverage", "coverage.log")
- with os.fdopen(os.open(coverage_log_path, FLAGS, MODES), 'a') as fd:
- call(cmd_list, printflag, fd, fd)
- except IOError:
- print("Error: Exception occur in open error")
-
-
-def get_subsystem_config_info():
- filter_subsystem_name_list = [
- "subsystem_examples",
- ]
- subsystem_info_dic = {}
- subsystem_config_filepath = os.path.join(CODEPATH, SYSTEM_JSON)
- if os.path.exists(subsystem_config_filepath):
- data = None
- with open(subsystem_config_filepath, "r", encoding="utf-8") as f:
- data = json.load(f)
- if not data:
- print("subsystem config file error.")
- for value in data.values():
- subsystem_name = value.get("name")
- if subsystem_name in filter_subsystem_name_list:
- continue
- subsystem_dir = value.get('dir')
- subsystem_path = value.get('path')
- subsystem_project = value.get('project')
- subsystem_rootpath = []
- for path in subsystem_path:
- subsystem_rootpath.append(os.path.join(CODEPATH, path))
- subsystem_info_dic[subsystem_name] = [
- subsystem_project, subsystem_dir,
- subsystem_path, subsystem_rootpath
- ]
- return subsystem_info_dic
-
-
-def get_subsystem_name_list():
- subsystem_name_list = []
- subsystem_info_dic = get_subsystem_config_info()
- for key in subsystem_info_dic.keys():
- subsystem_rootpath = subsystem_info_dic[key][3]
- for subsystem_rootpath_item in subsystem_rootpath:
- if os.path.exists(subsystem_rootpath_item):
- subsystem_name_list.append(key)
-
- return subsystem_name_list
-
-
-def get_subsystem_rootpath(subsystem_name):
- subsystem_path = ""
- subsystem_rootpath = ""
- subsystem_info_dic = get_subsystem_config_info()
- for key in subsystem_info_dic.keys():
- if key == subsystem_name:
- subsystem_path = subsystem_info_dic[key][2]
- subsystem_rootpath = subsystem_info_dic[key][3]
- break
-
- return subsystem_path, subsystem_rootpath
-
-
-def is_filterout_dir(ignore_prefix, check_path):
- filter_out_list = ["unittest", "third_party", "test"]
- for item in filter_out_list:
- check_list = check_path[len(ignore_prefix):].split("/")
- if item in check_list:
- return True
-
- return False
-
-
-def rm_unnecessary_dir(cov_path):
- topdir = os.path.join(cov_path, "obj")
- for root, dirs, files in os.walk(topdir):
- if is_filterout_dir(topdir, root):
- shutil.rmtree(root)
-
-
-def get_files_from_dir(find_path, postfix=None):
- names = os.listdir(find_path)
- file_list = []
- for fn in names:
- if not os.path.isfile(os.path.join(find_path, fn)):
- continue
- if postfix is not None:
- if fn.endswith(postfix):
- file_list.append(fn)
- else:
- file_list.append(fn)
-
- return file_list
-
-
-def get_gcno_files(cov_path, dir_name):
- gcda_strip_path = dir_name[len(cov_path) + 1:]
- gcda_list = get_files_from_dir(dir_name, ".gcda")
- for file_name in gcda_list:
- gcno_name = f"{os.path.splitext(file_name)[0]}.gcno"
- gcno_path = os.path.join(
- os.path.join(CODEPATH, OUTPUT), gcda_strip_path, gcno_name
- )
- if os.path.exists(gcno_path):
- shutil.copy(gcno_path, dir_name)
- else:
- print(f"{gcno_path} not exists!")
-
-
-def get_module_gcno_files(cov_path, dir_name):
- for root, dirs, files in os.walk(dir_name):
- get_gcno_files(cov_path, root)
-
-
-def gen_subsystem_trace_info(subsystem, data_dir, test_dir, lcovrc_path):
- src_dir = os.path.join(CODEPATH, OUTPUT)
- single_info_path = os.path.join(
- CODEPATH, REPORT_PATH, "single_test", test_dir
- )
- if not os.path.exists(single_info_path):
- os.makedirs(single_info_path)
- output_name = os.path.join(
- CODEPATH, single_info_path, f"{subsystem}_output.info"
- )
- if not os.path.exists(src_dir):
- print(f"Sours path {src_dir} not exists!")
- return
-
- cmd = "lcov -c -b {} -d {} --gcov-tool {} --config-file {} -o {} --ignore-errors source,gcov".format(
- src_dir, data_dir, os.path.join(CODEPATH, LLVM_GCOV), lcovrc_path, output_name)
- print("single_test**##father_pid:%s##child_pid:%s cmd:%s config file:%s" % (
- os.getpid(), os.getppid(), cmd, lcovrc_path
- ))
- execute_command(cmd)
-
-
-def cut_info(subsystem, test_dir):
- trace_file = os.path.join(
- CODEPATH, REPORT_PATH, "single_test",
- test_dir, f"{subsystem}_output.info"
- )
- output_name = os.path.join(
- CODEPATH, REPORT_PATH, "single_test",
- test_dir, f"{subsystem}_strip.info"
- )
-
- remove = r"'*/third_party/*' '*/prebuilts/*' '*/unittest/*' " \
- r"'*/moduletest/*' '*/systemtest/*' '*.h*'"
- if not os.path.exists(trace_file):
- print(f"Error: trace file {trace_file} not exists!")
- return
-
- cmd = "lcov --remove {} {} -o {}".format(trace_file, remove, output_name)
- execute_command(cmd)
-
-
-def gen_info(cov_path, test_dir, subsystem_list, lcovrc_path):
- if len(subsystem_list) == 0:
- print("Error: get subsystem list failed, can not generate trace info")
- return
-
- loop = 0
- for subsystem in list(set(subsystem_list)):
- subsystem_path, subsystem_rootpath = get_subsystem_rootpath(subsystem)
- for subsys_path in subsystem_path:
- subsystem_data_abspath = os.path.join(cov_path, "obj", subsys_path)
- # check id subsystem data is exists
- if not os.path.exists(subsystem_data_abspath):
- continue
-
- # copy gcno to the gcda same directory
- get_module_gcno_files(cov_path, subsystem_data_abspath)
-
- # generate coverage info for each subsystem
- gen_subsystem_trace_info(
- f"{subsystem}#{subsys_path.replace('/', '_')}#{ str(loop)}",
- subsystem_data_abspath, test_dir, lcovrc_path
- )
-
- # remove some type which useless
- cut_info(f"{subsystem}#{subsys_path.replace('/', '_')}#{str(loop)}", test_dir)
-
- loop += 1
-
-
-def generate_coverage_info(single_test_dir_list, lcovrc_path, subsystem_list):
- cov_path = os.path.join(CODEPATH, COVERAGE_GCDA_RESULTS)
- for index, cur_test_dir in enumerate(single_test_dir_list):
- cur_test_abs_dir = os.path.join(cov_path, cur_test_dir)
- gen_info(cur_test_abs_dir, cur_test_dir, subsystem_list, lcovrc_path)
-
-
-def gen_all_test_info(subsystem_list):
- cov_path = os.path.join(CODEPATH, COVERAGE_GCDA_RESULTS)
- print(os.getpid(), os.getppid())
- single_test_dir_list = []
- for root, dirs, files in os.walk(cov_path):
- single_test_dir_list = dirs
- break
-
- return single_test_dir_list
-
-
-def merge_subsystem_info_from_all_test(subsystem):
- single_test_info_path = os.path.join(
- CODEPATH, REPORT_PATH, "single_test"
- )
- subsystem_info_list = []
- subsystem_info_name = f"{subsystem}_strip.info"
- for root, dirs, files in os.walk(single_test_info_path):
- for file in files:
- if file.startswith(subsystem) and file.endswith("_strip.info"):
- subsystem_info_path_tmp = os.path.join(
- single_test_info_path, root, file
- )
- print(f"##{subsystem_info_path_tmp}")
- subsystem_info_list.append(subsystem_info_path_tmp)
-
- if len(subsystem_info_list) == 0:
- return
-
- info_output_name = os.path.join(
- CODEPATH, REPORT_PATH, subsystem_info_name
- )
- cmd = "lcov -a {} -o {}".format(
- " -a ".join(subsystem_info_list), info_output_name
- )
- execute_command(cmd)
-
-
-def merge_all_test_subsystem_info(subsystem_list):
- single_test_info_path = os.path.join(
- CODEPATH, REPORT_PATH, "single_test"
- )
- if not os.path.exists(single_test_info_path):
- print(f"Error: the single test info path "
- f"{single_test_info_path} not exist")
- return
-
- for subsystem in subsystem_list:
- print(f"Merging all {subsystem} info from test data")
- merge_subsystem_info_from_all_test(subsystem)
-
-
-def merge_info(report_dir):
- if not os.path.exists(report_dir):
- print(f"Error: report dir {report_dir} not exists!")
- return
-
- subsystem_name_list = get_files_from_dir(report_dir, "_strip.info")
- if len(subsystem_name_list) == 0:
- print("Error: get subsystem trace files in report directory failed.")
- return
-
- trace_file_list = []
- for subsystem in subsystem_name_list:
- trace_file_name = os.path.join(report_dir, subsystem)
- trace_file_list.append(trace_file_name)
-
- cmd = "lcov -a {} -o {}".format(
- " -a ".join(trace_file_list), os.path.join(report_dir, "ohos_codeCoverage.info")
- )
- execute_command(cmd)
-
-
-def merge_all_subsystem_info():
- print("Merging all the subsystem trace files")
- merge_info(os.path.join(CODEPATH, REPORT_PATH))
-
-
-def gen_html(cov_path):
- tracefile = os.path.join(CODEPATH, REPORT_PATH, "ohos_codeCoverage.info")
- if not os.path.exists(tracefile):
- print(f"Error: the trace file {tracefile} not exists!")
- return
-
- cmd = "genhtml --branch-coverage --demangle-cpp -o {} -p {} --ignore-errors source {}".format(
- os.path.join(CODEPATH, REPORT_PATH, "html"), CODEPATH, tracefile)
- execute_command(cmd)
-
-
-def gen_final_report(cov_path):
- print("Generating the html report")
- gen_html(cov_path)
-
-
-if __name__ == '__main__':
- current_path = os.path.abspath(os.path.dirname(__name__))
- CODEPATH = current_path.split("/test/testfwk/developer_test")[0]
- # lcovrc配置文件集合
- LCOVRC_SET = f"{CODEPATH}/test/testfwk/developer_test/localCoverage/codeCoverage/coverage_rc"
- _init_sys_config()
- from localCoverage.utils import get_product_name
- # 编译生成的out路径
- OUTPUT = "out/{}".format(get_product_name(CODEPATH))
-
- case_list = gen_all_test_info(subsystem_list=get_subsystem_name_list())
- multiprocessing.set_start_method("fork") # fork spawn forkserver
- start = end = 0
- Tag = False
- process_list = []
- for i in range(len(case_list)):
- lcov_path = f"{LCOVRC_SET}/lcovrc_cov_{str(i)}"
- print(lcov_path)
- if os.path.exists(lcov_path):
- print(f"{lcov_path}{'@' * 20}yes")
- else:
- raise Exception("mutilProcess have error -rc path not existed. "
- "please fix add run")
-
- start = end
- end += STEP_SIZE
- if end >= len(case_list):
- end = len(case_list)
- Tag = True
-
- p = Process(target=generate_coverage_info,
- args=(case_list[start:end], lcov_path,
- get_subsystem_name_list()))
- p.daemon = True
- p.start()
- process_list.append(p)
- if Tag:
- break
-
- for i in process_list:
- i.join()
-
- merge_all_test_subsystem_info(subsystem_list=get_subsystem_name_list())
- merge_all_subsystem_info()
- gen_final_report(os.path.join(CODEPATH, COVERAGE_GCDA_RESULTS))
+#!/usr/bin/env python3
+# coding=utf-8
+
+#
+# Copyright (c) 2023 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import os
+import json
+import shutil
+import shlex
+import subprocess
+import multiprocessing
+import sys
+import stat
+
+from multiprocessing import Process
+
+FLAGS = os.O_WRONLY | os.O_APPEND | os.O_CREAT
+MODES = stat.S_IWUSR | stat.S_IRUSR
+
+# 子系统json目录
+SYSTEM_JSON = "test/testfwk/developer_test/local_coverage/code_coverage/subsystem_config.json"
+# 覆盖率gcda
+COVERAGE_GCDA_RESULTS = "test/testfwk/developer_test/local_coverage/code_coverage/results/coverage/data/cxx"
+# 报告路径
+REPORT_PATH = "test/testfwk/developer_test/local_coverage/code_coverage/results/coverage/reports/cxx"
+# llvm-gcov.sh
+LLVM_GCOV = "test/testfwk/developer_test/local_coverage/code_coverage/llvm-gcov.sh"
+# 测试套划分步长
+STEP_SIZE = 10
+
+
+def _init_sys_config():
+ sys.localcoverage_path = os.path.join(current_path, "..")
+ sys.path.insert(0, sys.localcoverage_path)
+
+
+def call(cmd_list, is_show_cmd=False, out=None, err=None):
+ return_flag = False
+ try:
+ if is_show_cmd:
+ print("execute command: {}".format(" ".join(cmd_list)))
+ if 0 == subprocess.call(cmd_list, shell=False, stdout=out, stderr=err):
+ return_flag = True
+ except IOError:
+ print("Error : command {} execute faild!".format(cmd_list))
+ return_flag = False
+
+ return return_flag
+
+
+def execute_command(command, printflag=False):
+ try:
+ cmd_list = shlex.split(command)
+ coverage_log_path = os.path.join(
+ CODEPATH, "test/testfwk/developer_test/local_coverage", "coverage.log")
+ with os.fdopen(os.open(coverage_log_path, FLAGS, MODES), 'a') as fd:
+ call(cmd_list, printflag, fd, fd)
+ except IOError:
+ print("Error: Exception occur in open error")
+
+
+def get_subsystem_config_info():
+ filter_subsystem_name_list = [
+ "subsystem_examples",
+ ]
+ subsystem_info_dic = {}
+ subsystem_config_filepath = os.path.join(CODEPATH, SYSTEM_JSON)
+ if os.path.exists(subsystem_config_filepath):
+ data = None
+ with open(subsystem_config_filepath, "r", encoding="utf-8") as f:
+ data = json.load(f)
+ if not data:
+ print("subsystem config file error.")
+ for value in data.values():
+ subsystem_name = value.get("name")
+ if subsystem_name in filter_subsystem_name_list:
+ continue
+ subsystem_dir = value.get('dir')
+ subsystem_path = value.get('path')
+ subsystem_project = value.get('project')
+ subsystem_rootpath = []
+ for path in subsystem_path:
+ subsystem_rootpath.append(os.path.join(CODEPATH, path))
+ subsystem_info_dic[subsystem_name] = [
+ subsystem_project, subsystem_dir,
+ subsystem_path, subsystem_rootpath
+ ]
+ return subsystem_info_dic
+
+
+def get_subsystem_name_list():
+ subsystem_name_list = []
+ subsystem_info_dic = get_subsystem_config_info()
+ for key in subsystem_info_dic.keys():
+ subsystem_rootpath = subsystem_info_dic[key][3]
+ for subsystem_rootpath_item in subsystem_rootpath:
+ if os.path.exists(subsystem_rootpath_item):
+ subsystem_name_list.append(key)
+
+ return subsystem_name_list
+
+
+def get_subsystem_rootpath(subsystem_name):
+ subsystem_path = ""
+ subsystem_rootpath = ""
+ subsystem_info_dic = get_subsystem_config_info()
+ for key in subsystem_info_dic.keys():
+ if key == subsystem_name:
+ subsystem_path = subsystem_info_dic[key][2]
+ subsystem_rootpath = subsystem_info_dic[key][3]
+ break
+
+ return subsystem_path, subsystem_rootpath
+
+
+def is_filterout_dir(ignore_prefix, check_path):
+ filter_out_list = ["unittest", "third_party", "test"]
+ for item in filter_out_list:
+ check_list = check_path[len(ignore_prefix):].split("/")
+ if item in check_list:
+ return True
+
+ return False
+
+
+def rm_unnecessary_dir(cov_path):
+ topdir = os.path.join(cov_path, "obj")
+ for root, dirs, files in os.walk(topdir):
+ if is_filterout_dir(topdir, root):
+ shutil.rmtree(root)
+
+
+def get_files_from_dir(find_path, postfix=None):
+ names = os.listdir(find_path)
+ file_list = []
+ for fn in names:
+ if not os.path.isfile(os.path.join(find_path, fn)):
+ continue
+ if postfix is not None:
+ if fn.endswith(postfix):
+ file_list.append(fn)
+ else:
+ file_list.append(fn)
+
+ return file_list
+
+
+def get_gcno_files(cov_path, dir_name):
+ gcda_strip_path = dir_name[len(cov_path) + 1:]
+ gcda_list = get_files_from_dir(dir_name, ".gcda")
+ for file_name in gcda_list:
+ gcno_name = f"{os.path.splitext(file_name)[0]}.gcno"
+ gcno_path = os.path.join(
+ os.path.join(CODEPATH, OUTPUT), gcda_strip_path, gcno_name
+ )
+ if os.path.exists(gcno_path):
+ shutil.copy(gcno_path, dir_name)
+ else:
+ print(f"{gcno_path} not exists!")
+
+
+def get_module_gcno_files(cov_path, dir_name):
+ for root, dirs, files in os.walk(dir_name):
+ get_gcno_files(cov_path, root)
+
+
+def gen_subsystem_trace_info(subsystem, data_dir, test_dir, lcovrc_path):
+ src_dir = os.path.join(CODEPATH, OUTPUT)
+ single_info_path = os.path.join(
+ CODEPATH, REPORT_PATH, "single_test", test_dir
+ )
+ if not os.path.exists(single_info_path):
+ os.makedirs(single_info_path)
+ output_name = os.path.join(
+ CODEPATH, single_info_path, f"{subsystem}_output.info"
+ )
+ if not os.path.exists(src_dir):
+ print(f"Sours path {src_dir} not exists!")
+ return
+
+ cmd = "lcov -c -b {} -d {} --gcov-tool {} --config-file {} -o {} --ignore-errors source,gcov".format(
+ src_dir, data_dir, os.path.join(CODEPATH, LLVM_GCOV), lcovrc_path, output_name)
+ print("single_test**##father_pid:%s##child_pid:%s cmd:%s config file:%s" % (
+ os.getpid(), os.getppid(), cmd, lcovrc_path
+ ))
+ execute_command(cmd)
+
+
+def cut_info(subsystem, test_dir):
+ trace_file = os.path.join(
+ CODEPATH, REPORT_PATH, "single_test",
+ test_dir, f"{subsystem}_output.info"
+ )
+ output_name = os.path.join(
+ CODEPATH, REPORT_PATH, "single_test",
+ test_dir, f"{subsystem}_strip.info"
+ )
+
+ remove = r"'*/third_party/*' '*/prebuilts/*' '*/unittest/*' " \
+ r"'*/moduletest/*' '*/systemtest/*' '*.h*'"
+ if not os.path.exists(trace_file):
+ print(f"Error: trace file {trace_file} not exists!")
+ return
+
+ cmd = "lcov --remove {} {} -o {}".format(trace_file, remove, output_name)
+ execute_command(cmd)
+
+
+def gen_info(cov_path, test_dir, subsystem_list, lcovrc_path):
+ if len(subsystem_list) == 0:
+ print("Error: get subsystem list failed, can not generate trace info")
+ return
+
+ loop = 0
+ for subsystem in list(set(subsystem_list)):
+ subsystem_path, subsystem_rootpath = get_subsystem_rootpath(subsystem)
+ for subsys_path in subsystem_path:
+ subsystem_data_abspath = os.path.join(cov_path, "obj", subsys_path)
+ # check id subsystem data is exists
+ if not os.path.exists(subsystem_data_abspath):
+ continue
+
+ # copy gcno to the gcda same directory
+ get_module_gcno_files(cov_path, subsystem_data_abspath)
+
+ # generate coverage info for each subsystem
+ gen_subsystem_trace_info(
+ f"{subsystem}#{subsys_path.replace('/', '_')}#{ str(loop)}",
+ subsystem_data_abspath, test_dir, lcovrc_path
+ )
+
+ # remove some type which useless
+ cut_info(f"{subsystem}#{subsys_path.replace('/', '_')}#{str(loop)}", test_dir)
+
+ loop += 1
+
+
+def generate_coverage_info(single_test_dir_list, lcovrc_path, subsystem_list):
+ cov_path = os.path.join(CODEPATH, COVERAGE_GCDA_RESULTS)
+ for index, cur_test_dir in enumerate(single_test_dir_list):
+ cur_test_abs_dir = os.path.join(cov_path, cur_test_dir)
+ gen_info(cur_test_abs_dir, cur_test_dir, subsystem_list, lcovrc_path)
+
+
+def gen_all_test_info(subsystem_list):
+ cov_path = os.path.join(CODEPATH, COVERAGE_GCDA_RESULTS)
+ print(os.getpid(), os.getppid())
+ single_test_dir_list = []
+ for root, dirs, files in os.walk(cov_path):
+ single_test_dir_list = dirs
+ break
+
+ return single_test_dir_list
+
+
+def merge_subsystem_info_from_all_test(subsystem):
+ single_test_info_path = os.path.join(
+ CODEPATH, REPORT_PATH, "single_test"
+ )
+ subsystem_info_list = []
+ subsystem_info_name = f"{subsystem}_strip.info"
+ for root, dirs, files in os.walk(single_test_info_path):
+ for file in files:
+ if file.startswith(subsystem) and file.endswith("_strip.info"):
+ subsystem_info_path_tmp = os.path.join(
+ single_test_info_path, root, file
+ )
+ print(f"##{subsystem_info_path_tmp}")
+ subsystem_info_list.append(subsystem_info_path_tmp)
+
+ if len(subsystem_info_list) == 0:
+ return
+
+ info_output_name = os.path.join(
+ CODEPATH, REPORT_PATH, subsystem_info_name
+ )
+ cmd = "lcov -a {} -o {}".format(
+ " -a ".join(subsystem_info_list), info_output_name
+ )
+ execute_command(cmd)
+
+
+def merge_all_test_subsystem_info(subsystem_list):
+ single_test_info_path = os.path.join(
+ CODEPATH, REPORT_PATH, "single_test"
+ )
+ if not os.path.exists(single_test_info_path):
+ print(f"Error: the single test info path "
+ f"{single_test_info_path} not exist")
+ return
+
+ for subsystem in subsystem_list:
+ print(f"Merging all {subsystem} info from test data")
+ merge_subsystem_info_from_all_test(subsystem)
+
+
+def merge_info(report_dir):
+ if not os.path.exists(report_dir):
+ print(f"Error: report dir {report_dir} not exists!")
+ return
+
+ subsystem_name_list = get_files_from_dir(report_dir, "_strip.info")
+ if len(subsystem_name_list) == 0:
+ print("Error: get subsystem trace files in report directory failed.")
+ return
+
+ trace_file_list = []
+ for subsystem in subsystem_name_list:
+ trace_file_name = os.path.join(report_dir, subsystem)
+ trace_file_list.append(trace_file_name)
+
+ cmd = "lcov -a {} -o {}".format(
+ " -a ".join(trace_file_list), os.path.join(report_dir, "ohos_codeCoverage.info")
+ )
+ execute_command(cmd)
+
+
+def merge_all_subsystem_info():
+ print("Merging all the subsystem trace files")
+ merge_info(os.path.join(CODEPATH, REPORT_PATH))
+
+
+def gen_html(cov_path):
+ tracefile = os.path.join(CODEPATH, REPORT_PATH, "ohos_codeCoverage.info")
+ if not os.path.exists(tracefile):
+ print(f"Error: the trace file {tracefile} not exists!")
+ return
+
+ cmd = "genhtml --branch-coverage --demangle-cpp -o {} -p {} --ignore-errors source {}".format(
+ os.path.join(CODEPATH, REPORT_PATH, "html"), CODEPATH, tracefile)
+ execute_command(cmd)
+
+
+def gen_final_report(cov_path):
+ print("Generating the html report")
+ gen_html(cov_path)
+
+
+if __name__ == '__main__':
+ current_path = os.path.abspath(os.path.dirname(__name__))
+ CODEPATH = current_path.split("/test/testfwk/developer_test")[0]
+ # lcovrc配置文件集合
+ LCOVRC_SET = f"{CODEPATH}/test/testfwk/developer_test/local_coverage/code_coverage/coverage_rc"
+ _init_sys_config()
+ from local_coverage.utils import get_product_name
+ # 编译生成的out路径
+ OUTPUT = "out/{}".format(get_product_name(CODEPATH))
+
+ case_list = gen_all_test_info(subsystem_list=get_subsystem_name_list())
+ multiprocessing.set_start_method("fork") # fork spawn forkserver
+ start = end = 0
+ Tag = False
+ process_list = []
+ for i in range(len(case_list)):
+ lcov_path = f"{LCOVRC_SET}/lcovrc_cov_{str(i)}"
+ print(lcov_path)
+ if os.path.exists(lcov_path):
+ print(f"{lcov_path}{'@' * 20}yes")
+ else:
+ raise Exception("mutilProcess have error -rc path not existed. "
+ "please fix add run")
+
+ start = end
+ end += STEP_SIZE
+ if end >= len(case_list):
+ end = len(case_list)
+ Tag = True
+
+ p = Process(target=generate_coverage_info,
+ args=(case_list[start:end], lcov_path,
+ get_subsystem_name_list()))
+ p.daemon = True
+ p.start()
+ process_list.append(p)
+ if Tag:
+ break
+
+ for i in process_list:
+ i.join()
+
+ merge_all_test_subsystem_info(subsystem_list=get_subsystem_name_list())
+ merge_all_subsystem_info()
+ gen_final_report(os.path.join(CODEPATH, COVERAGE_GCDA_RESULTS))
diff --git a/localCoverage/coverage_tools.py b/local_coverage/coverage_tools.py
similarity index 84%
rename from localCoverage/coverage_tools.py
rename to local_coverage/coverage_tools.py
index 609f1cc481cb7f3b6631d5bae09f39b78e65e418..3944766b38cb18b1e0091bb3190825705c45db05 100644
--- a/localCoverage/coverage_tools.py
+++ b/local_coverage/coverage_tools.py
@@ -1,200 +1,200 @@
-#!/usr/bin/env python3
-# coding=utf-8
-
-#
-# Copyright (c) 2023 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-
-import os
-import sys
-import json
-import shutil
-import subprocess
-import stat
-from shutil import copyfile
-
-from utils import get_product_name, coverage_command
-
-FLAGS = os.O_WRONLY | os.O_CREAT | os.O_EXCL
-MODES = stat.S_IWUSR | stat.S_IRUSR
-
-
-def get_subsystem_config(part_list, developer_path):
- all_system_info_path = os.path.join(
- developer_path, "localCoverage/all_subsystem_config.json"
- )
- system_info_path = os.path.join(
- developer_path, "localCoverage/codeCoverage/subsystem_config.json"
- )
- if os.path.exists(all_system_info_path):
- new_json_text = {}
- for part in part_list:
- with open(all_system_info_path, "r", encoding="utf-8") as system_text:
- system_text_json = json.load(system_text)
- if part in system_text_json:
- new_json_text[part] = system_text_json[part]
- else:
- print("Error: part not in all_subsystem_config.json")
-
- new_json = json.dumps(new_json_text, indent=4)
- if os.path.exists(system_info_path):
- os.remove(system_info_path)
- with os.fdopen(os.open(system_info_path, FLAGS, MODES), 'w') as out_file:
- out_file.write(new_json)
- else:
- print("%s not exists.", all_system_info_path)
-
-
-def copy_coverage(developer_path):
- print("*" * 40, "Start TO Get Code Coverage Report", "*" * 40)
- coverage_path = os.path.join(developer_path, "reports/coverage")
- code_path = os.path.join(
- developer_path, "localCoverage/codeCoverage/results/coverage"
- )
- if os.path.exists(code_path):
- shutil.rmtree(code_path)
- shutil.copytree(coverage_path, code_path)
-
-
-def remove_thrd_gcda(developer_path):
- print("remove thirdparty gcda")
- gcda_dir_path = os.path.join(developer_path, "localCoverage/codeCoverage/results/coverage/data/cxx")
- if os.path.exists(gcda_dir_path):
- for i in os.listdir(gcda_dir_path):
- remove_out = os.path.join(gcda_dir_path, i, "obj/out")
- remove_thrd = os.path.join(gcda_dir_path, i, "obj/third_party")
- if os.path.exists(remove_out):
- print("remove {}".format(remove_out))
- shutil.rmtree(remove_out)
- if os.path.exists(remove_thrd):
- print("remove {}".format(remove_thrd))
- shutil.rmtree(remove_thrd)
-
-
-def generate_coverage_rc(developer_path):
- coverage_rc_path = os.path.join(
- developer_path, "localCoverage/codeCoverage/coverage_rc"
- )
- lcovrc_cov_template_path = os.path.join(coverage_rc_path, "lcovrc_cov_template")
- for num in range(16):
- tmp_cov_path = os.path.join(coverage_rc_path, f"tmp_cov_{num}")
- lcovrc_cov_path = os.path.join(coverage_rc_path, f"lcovrc_cov_{num}")
- if not os.path.exists(tmp_cov_path):
- os.mkdir(tmp_cov_path)
- if not os.path.exists(os.path.join(tmp_cov_path, "ex.txt")):
- with open(os.path.join(tmp_cov_path, "ex.txt"), mode="w") as f:
- f.write("")
-
- copyfile(lcovrc_cov_template_path, lcovrc_cov_path)
- with open(lcovrc_cov_path, mode="a") as f:
- f.write("\n\n")
- f.write("# Location for temporary directories\n")
- f.write(f"lcov_tmp_dir = {tmp_cov_path}")
-
-
-def execute_code_cov_tools(developer_path):
- llvm_gcov_path = os.path.join(
- developer_path, "localCoverage/codeCoverage/llvm-gcov.sh"
- )
- coverage_command("dos2unix %s" % llvm_gcov_path)
- coverage_command("chmod 777 %s" % llvm_gcov_path)
- tools_path = os.path.join(
- developer_path, "localCoverage/codeCoverage/mutilProcess_CodeCoverage.py"
- )
- coverage_command("python3 %s" % tools_path)
-
-
-def get_subsystem_name(part_list, product_name):
- if product_name:
- testfwk_json_path = os.path.join(
- root_path, "out", product_name, "build_configs/infos_for_testfwk.json"
- )
- if os.path.exists(testfwk_json_path):
- with open(testfwk_json_path, "r", encoding="utf-8") as json_text:
- system_json = json.load(json_text)
- subsystem_info = system_json.get("phone").get("subsystem_infos")
- subsystem_list = []
- for part in part_list:
- for key in subsystem_info.keys():
- if part in subsystem_info.get(key) and key not in subsystem_list:
- subsystem_list.append(key)
- subsystem_str = ','.join(list(map(str, subsystem_list)))
- return subsystem_str
- else:
- print("%s not exists.", testfwk_json_path)
- return ""
- else:
- print("product_name is not null")
- return ""
-
-
-def execute_interface_cov_tools(partname_str, developer_path):
- print("*" * 40, "Start TO Get Interface Coverage Report", "*" * 40)
- innerkits_json_path = os.path.join(
- developer_path,
- "localCoverage/interfaceCoverage/get_innerkits_json.py"
- )
- coverage_command("python3 %s" % innerkits_json_path)
-
- interface_path = os.path.join(
- developer_path,
- "localCoverage/interfaceCoverage/interfaceCoverage_gcov_lcov.py"
- )
- subprocess.run("python3 %s %s" % (interface_path, partname_str), shell=True)
-
-
-if __name__ == '__main__':
- testpart_args = sys.argv[1]
- test_part_list = testpart_args.split("testpart=")[1].split(",")
-
- current_path = os.getcwd()
- root_path = current_path.split("/test/testfwk/developer_test")[0]
- developer_test_path = os.path.join(root_path, "test/testfwk/developer_test")
-
- # 获取产品形态
- product_names = get_product_name(root_path)
-
- # copy gcda数据到覆盖率工具指定位置
- copy_coverage(developer_test_path)
- generate_coverage_rc(developer_test_path)
- remove_thrd_gcda(developer_test_path)
-
- # 获取部件位置信息config
- if len(test_part_list) > 0:
- get_subsystem_config(test_part_list, developer_test_path)
-
- # 执行代码覆盖率
- execute_code_cov_tools(developer_test_path)
- # 报备
- keyword_path = os.path.join(
- developer_test_path, "localCoverage/keyword_registration/keyword_filter.py")
- subprocess.run("python3 %s" % keyword_path, shell=True)
-
- # 执行接口覆盖率
- if len(test_part_list) > 0:
- execute_interface_cov_tools(testpart_args, developer_test_path)
- else:
- print("subsystem or part without!")
-
- # 源代码还原
- after_lcov_branch_path = os.path.join(
- developer_test_path, "localCoverage/restore_comment/after_lcov_branch.py")
- if os.path.exists(after_lcov_branch_path):
- subprocess.run("python3 %s " % after_lcov_branch_path, shell=True)
-
- print(r"See the code coverage report in: "
- r"/test/testfwk/developer_test/localCoverage/codeCoverage/results/coverage/reports/cxx/html")
- print(r"See the interface coverage report in: "
- r"/test/testfwk/developer_test/localCoverage/interfaceCoverage/results/coverage/interface_kits")
+#!/usr/bin/env python3
+# coding=utf-8
+
+#
+# Copyright (c) 2023 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+import os
+import sys
+import json
+import shutil
+import subprocess
+import stat
+from shutil import copyfile
+
+from utils import get_product_name, coverage_command
+
+FLAGS = os.O_WRONLY | os.O_CREAT | os.O_EXCL
+MODES = stat.S_IWUSR | stat.S_IRUSR
+
+
+def get_subsystem_config(part_list, developer_path):
+ all_system_info_path = os.path.join(
+ developer_path, "local_coverage/all_subsystem_config.json"
+ )
+ system_info_path = os.path.join(
+ developer_path, "local_coverage/code_coverage/subsystem_config.json"
+ )
+ if os.path.exists(all_system_info_path):
+ new_json_text = {}
+ for part in part_list:
+ with open(all_system_info_path, "r", encoding="utf-8") as system_text:
+ system_text_json = json.load(system_text)
+ if part in system_text_json:
+ new_json_text[part] = system_text_json[part]
+ else:
+ print("Error: part not in all_subsystem_config.json")
+
+ new_json = json.dumps(new_json_text, indent=4)
+ if os.path.exists(system_info_path):
+ os.remove(system_info_path)
+ with os.fdopen(os.open(system_info_path, FLAGS, MODES), 'w') as out_file:
+ out_file.write(new_json)
+ else:
+ print("%s not exists.", all_system_info_path)
+
+
+def copy_coverage(developer_path):
+ print("*" * 40, "Start TO Get Code Coverage Report", "*" * 40)
+ coverage_path = os.path.join(developer_path, "reports/coverage")
+ code_path = os.path.join(
+ developer_path, "local_coverage/code_coverage/results/coverage"
+ )
+ if os.path.exists(code_path):
+ shutil.rmtree(code_path)
+ shutil.copytree(coverage_path, code_path)
+
+
+def remove_thrd_gcda(developer_path):
+ print("remove thirdparty gcda")
+ gcda_dir_path = os.path.join(developer_path, "local_coverage/code_coverage/results/coverage/data/cxx")
+ if os.path.exists(gcda_dir_path):
+ for i in os.listdir(gcda_dir_path):
+ remove_out = os.path.join(gcda_dir_path, i, "obj/out")
+ remove_thrd = os.path.join(gcda_dir_path, i, "obj/third_party")
+ if os.path.exists(remove_out):
+ print("remove {}".format(remove_out))
+ shutil.rmtree(remove_out)
+ if os.path.exists(remove_thrd):
+ print("remove {}".format(remove_thrd))
+ shutil.rmtree(remove_thrd)
+
+
+def generate_coverage_rc(developer_path):
+ coverage_rc_path = os.path.join(
+ developer_path, "local_coverage/code_coverage/coverage_rc"
+ )
+ lcovrc_cov_template_path = os.path.join(coverage_rc_path, "lcovrc_cov_template")
+ for num in range(16):
+ tmp_cov_path = os.path.join(coverage_rc_path, f"tmp_cov_{num}")
+ lcovrc_cov_path = os.path.join(coverage_rc_path, f"lcovrc_cov_{num}")
+ if not os.path.exists(tmp_cov_path):
+ os.mkdir(tmp_cov_path)
+ if not os.path.exists(os.path.join(tmp_cov_path, "ex.txt")):
+ with open(os.path.join(tmp_cov_path, "ex.txt"), mode="w") as f:
+ f.write("")
+
+ copyfile(lcovrc_cov_template_path, lcovrc_cov_path)
+ with open(lcovrc_cov_path, mode="a") as f:
+ f.write("\n\n")
+ f.write("# Location for temporary directories\n")
+ f.write(f"lcov_tmp_dir = {tmp_cov_path}")
+
+
+def execute_code_cov_tools(developer_path):
+ llvm_gcov_path = os.path.join(
+ developer_path, "local_coverage/code_coverage/llvm-gcov.sh"
+ )
+ coverage_command("dos2unix %s" % llvm_gcov_path)
+ coverage_command("chmod 777 %s" % llvm_gcov_path)
+ tools_path = os.path.join(
+ developer_path, "local_coverage/code_coverage/multiprocess_code_coverage.py"
+ )
+ coverage_command("python3 %s" % tools_path)
+
+
+def get_subsystem_name(part_list, product_name):
+ if product_name:
+ testfwk_json_path = os.path.join(
+ root_path, "out", product_name, "build_configs/infos_for_testfwk.json"
+ )
+ if os.path.exists(testfwk_json_path):
+ with open(testfwk_json_path, "r", encoding="utf-8") as json_text:
+ system_json = json.load(json_text)
+ subsystem_info = system_json.get("phone").get("subsystem_infos")
+ subsystem_list = []
+ for part in part_list:
+ for key in subsystem_info.keys():
+ if part in subsystem_info.get(key) and key not in subsystem_list:
+ subsystem_list.append(key)
+ subsystem_str = ','.join(list(map(str, subsystem_list)))
+ return subsystem_str
+ else:
+ print("%s not exists.", testfwk_json_path)
+ return ""
+ else:
+ print("product_name is not null")
+ return ""
+
+
+def execute_interface_cov_tools(partname_str, developer_path):
+ print("*" * 40, "Start TO Get Interface Coverage Report", "*" * 40)
+ innerkits_json_path = os.path.join(
+ developer_path,
+ "local_coverage/interface_coverage/get_innerkits_json.py"
+ )
+ coverage_command("python3 %s" % innerkits_json_path)
+
+ interface_path = os.path.join(
+ developer_path,
+ "local_coverage/interface_coverage/interface_coverage_gcov_lcov.py"
+ )
+ subprocess.run("python3 %s %s" % (interface_path, partname_str), shell=True)
+
+
+if __name__ == '__main__':
+ testpart_args = sys.argv[1]
+ test_part_list = testpart_args.split("testpart=")[1].split(",")
+
+ current_path = os.getcwd()
+ root_path = current_path.split("/test/testfwk/developer_test")[0]
+ developer_test_path = os.path.join(root_path, "test/testfwk/developer_test")
+
+ # 获取产品形态
+ product_names = get_product_name(root_path)
+
+ # copy gcda数据到覆盖率工具指定位置
+ copy_coverage(developer_test_path)
+ generate_coverage_rc(developer_test_path)
+ remove_thrd_gcda(developer_test_path)
+
+ # 获取部件位置信息config
+ if len(test_part_list) > 0:
+ get_subsystem_config(test_part_list, developer_test_path)
+
+ # 执行代码覆盖率
+ execute_code_cov_tools(developer_test_path)
+ # 报备
+ keyword_path = os.path.join(
+ developer_test_path, "local_coverage/keyword_registration/keyword_filter.py")
+ subprocess.run("python3 %s" % keyword_path, shell=True)
+
+ # 执行接口覆盖率
+ if len(test_part_list) > 0:
+ execute_interface_cov_tools(testpart_args, developer_test_path)
+ else:
+ print("subsystem or part without!")
+
+ # 源代码还原
+ after_lcov_branch_path = os.path.join(
+ developer_test_path, "local_coverage/restore_comment/after_lcov_branch.py")
+ if os.path.exists(after_lcov_branch_path):
+ subprocess.run("python3 %s " % after_lcov_branch_path, shell=True)
+
+ print(r"See the code coverage report in: "
+ r"/test/testfwk/developer_test/local_coverage/code_coverage/results/coverage/reports/cxx/html")
+ print(r"See the interface coverage report in: "
+ r"/test/testfwk/developer_test/local_coverage/interface_coverage/results/coverage/interface_kits")
diff --git a/localCoverage/interfaceCoverage/__init__.py b/local_coverage/interface_coverage/__init__.py
similarity index 100%
rename from localCoverage/interfaceCoverage/__init__.py
rename to local_coverage/interface_coverage/__init__.py
diff --git a/localCoverage/interfaceCoverage/get_innerkits_json.py b/local_coverage/interface_coverage/get_innerkits_json.py
similarity index 93%
rename from localCoverage/interfaceCoverage/get_innerkits_json.py
rename to local_coverage/interface_coverage/get_innerkits_json.py
index e8484e358e868cfe470718d82034a3aec74cca6d..9b0a5659a677dbdcc92c51655c1c2a7571052d36 100644
--- a/localCoverage/interfaceCoverage/get_innerkits_json.py
+++ b/local_coverage/interface_coverage/get_innerkits_json.py
@@ -1,80 +1,80 @@
-#!/usr/bin/env python3
-# coding=utf-8
-
-#
-# Copyright (c) 2023 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-
-import os
-import json
-import sys
-import stat
-
-FLAGS = os.O_WRONLY | os.O_CREAT | os.O_EXCL
-MODES = stat.S_IWUSR | stat.S_IRUSR
-
-
-def _init_sys_config():
- sys.localcoverage_path = os.path.join(current_path, "..")
- sys.path.insert(0, sys.localcoverage_path)
-
-
-def gen_parts_info_json(folder_list, output_json_path, target_cpu):
- """
- 根据部件信息,生成字典至json文件中
- """
- if len(folder_list) != 0:
- data_dict = {}
- for folder_str in folder_list:
- data_dict[folder_str] = f"innerkits/ohos-{target_cpu}/{folder_str}"
- output_json_path = os.path.join(output_json_path, "kits_modules_info.json")
- json_str = json.dumps(data_dict, indent=2)
- if os.path.exists(output_json_path):
- os.remove(output_json_path)
- with os.fdopen(os.open(output_json_path, FLAGS, MODES), 'w') as json_file:
- json_file.write(json_str)
- else:
- print("part_name list information is null")
-
-
-def get_parts_list(path):
- """
- #获取out/ohos-arm-release/innerkits/ohos-arm内部接口文件夹名称列表
- """
- if os.path.exists(path):
- folder_list = os.listdir(path)
- else:
- print("The folder: %s does not exist" % path)
- folder_list = []
- return folder_list
-
-
-if __name__ == "__main__":
- current_path = os.getcwd()
- _init_sys_config()
- from localCoverage.utils import get_product_name, coverage_command, get_target_cpu
-
- root_path = current_path.split("/test/testfwk/developer_test")[0]
- product_name = get_product_name(root_path)
- cpu_type = get_target_cpu(root_path)
- part_info_path = os.path.join(
- root_path, "out", product_name, "innerkits/ohos-%s" % cpu_type
- )
- json_path = os.path.join(
- root_path, "out", product_name, "packages/phone/innerkits/ohos-%s" % cpu_type
- )
- coverage_command("mkdir -p %s" % json_path)
- part_list = get_parts_list(part_info_path)
- gen_parts_info_json(part_list, json_path, cpu_type)
+#!/usr/bin/env python3
+# coding=utf-8
+
+#
+# Copyright (c) 2023 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+import os
+import json
+import sys
+import stat
+
+FLAGS = os.O_WRONLY | os.O_CREAT | os.O_EXCL
+MODES = stat.S_IWUSR | stat.S_IRUSR
+
+
+def _init_sys_config():
+ sys.localcoverage_path = os.path.join(current_path, "..")
+ sys.path.insert(0, sys.localcoverage_path)
+
+
+def gen_parts_info_json(folder_list, output_json_path, target_cpu):
+ """
+ 根据部件信息,生成字典至json文件中
+ """
+ if len(folder_list) != 0:
+ data_dict = {}
+ for folder_str in folder_list:
+ data_dict[folder_str] = f"innerkits/ohos-{target_cpu}/{folder_str}"
+ output_json_path = os.path.join(output_json_path, "kits_modules_info.json")
+ json_str = json.dumps(data_dict, indent=2)
+ if os.path.exists(output_json_path):
+ os.remove(output_json_path)
+ with os.fdopen(os.open(output_json_path, FLAGS, MODES), 'w') as json_file:
+ json_file.write(json_str)
+ else:
+ print("part_name list information is null")
+
+
+def get_parts_list(path):
+ """
+ #获取out/ohos-arm-release/innerkits/ohos-arm内部接口文件夹名称列表
+ """
+ if os.path.exists(path):
+ folder_list = os.listdir(path)
+ else:
+ print("The folder: %s does not exist" % path)
+ folder_list = []
+ return folder_list
+
+
+if __name__ == "__main__":
+ current_path = os.getcwd()
+ _init_sys_config()
+ from local_coverage.utils import get_product_name, coverage_command, get_target_cpu
+
+ root_path = current_path.split("/test/testfwk/developer_test")[0]
+ product_name = get_product_name(root_path)
+ cpu_type = get_target_cpu(root_path)
+ part_info_path = os.path.join(
+ root_path, "out", product_name, "innerkits/ohos-%s" % cpu_type
+ )
+ json_path = os.path.join(
+ root_path, "out", product_name, "packages/phone/innerkits/ohos-%s" % cpu_type
+ )
+ coverage_command("mkdir -p %s" % json_path)
+ part_list = get_parts_list(part_info_path)
+ gen_parts_info_json(part_list, json_path, cpu_type)
diff --git a/localCoverage/interfaceCoverage/interfaceCoverage_gcov_lcov.py b/local_coverage/interface_coverage/interface_coverage_gcov_lcov.py
similarity index 87%
rename from localCoverage/interfaceCoverage/interfaceCoverage_gcov_lcov.py
rename to local_coverage/interface_coverage/interface_coverage_gcov_lcov.py
index 2c2e21912e35a743fc974760732dbe659d08540f..e3f0b4d45750ef896d2fd96b971bc608293ec884 100644
--- a/localCoverage/interfaceCoverage/interfaceCoverage_gcov_lcov.py
+++ b/local_coverage/interface_coverage/interface_coverage_gcov_lcov.py
@@ -100,14 +100,16 @@ def get_file_list_by_postfix(path, postfix, filter_jar=""):
for dirs in os.walk(path):
files = get_file_list(find_path=dirs[0], postfix=postfix)
for file_path in files:
- if "" != file_path and -1 == file_path.find(__file__):
- pos = file_path.rfind(os.sep)
- file_name = file_path[pos + 1:]
- file_path = os.path.join(dirs[0], file_path)
- if filter_jar != "" and file_name == filter_jar:
- print("Skipped %s" % file_path)
- continue
- file_list.append(file_path)
+ if "" == file_path or -1 != file_path.find(__file__):
+ continue
+
+ pos = file_path.rfind(os.sep)
+ file_name = file_path[pos + 1:]
+ file_path = os.path.join(dirs[0], file_path)
+ if filter_jar != "" and file_name == filter_jar:
+ print("Skipped %s" % file_path)
+ continue
+ file_list.append(file_path)
return file_list
@@ -192,16 +194,18 @@ def get_sdk_interface_func_list(part_name):
return interface_func_list
sdk_path = os.path.join(CODEPATH, "out", product_name, sub_path)
- if os.path.exists(sdk_path):
- file_list = get_file_list_by_postfix(sdk_path, ".h")
- for file in file_list:
- try:
- if is_need_to_be_parsed(file):
- interface_func_list += get_pubilc_func_list_from_headfile(file)
- except Exception:
- print("get interface error ", sdk_path)
- else:
+ if not os.path.exists(sdk_path):
print("Error: %s is not exist." % sdk_path)
+ return interface_func_list
+
+ file_list = get_file_list_by_postfix(sdk_path, ".h")
+ for file in file_list:
+ try:
+ if is_need_to_be_parsed(file):
+ interface_func_list += get_pubilc_func_list_from_headfile(file)
+ except Exception:
+ print("get interface error ", sdk_path)
+
return interface_func_list
@@ -220,23 +224,27 @@ def get_covered_function_list(part_name):
covered_function_list = []
file_name = f"{part_name}_strip.info"
file_path = os.path.join(SUB_SYSTEM_INFO_PATH, file_name)
- if os.path.exists(file_path):
- with open(file_path, "r") as fd:
- for line in fd:
- if line.startswith("FNDA:"):
- sub_line_string = line[len("FNDA:"):].replace("\n", "").strip()
- temp_list = sub_line_string.split(",")
- if len(temp_list) == 2 and int(temp_list[0]) != 0:
- func_info = get_function_info_string(temp_list[1])
- after_func_info = func_info.decode("utf-8")
- if "" == after_func_info:
- continue
- after_func_info = after_func_info.replace("\n", "")
- if after_func_info == temp_list[1] and after_func_info.startswith("_"):
- continue
- covered_function_list.append(after_func_info)
- else:
+ if not os.path.exists(file_path):
+ return covered_function_list
+
+ with open(file_path, "r") as fd:
pass
+
+ for line in fd:
+ if not line.startswith("FNDA:"):
+ continue
+
+ sub_line_string = line[len("FNDA:"):].replace("\n", "").strip()
+ temp_list = sub_line_string.split(",")
+ if len(temp_list) == 2 and int(temp_list[0]) != 0:
+ func_info = get_function_info_string(temp_list[1])
+ after_func_info = func_info.decode("utf-8")
+ if "" == after_func_info:
+ continue
+ after_func_info = after_func_info.replace("\n", "")
+ if after_func_info == temp_list[1] and after_func_info.startswith("_"):
+ continue
+ covered_function_list.append(after_func_info)
return covered_function_list
@@ -246,8 +254,7 @@ def get_para_sub_string(content):
parentheses_list_left = []
parentheses_list_right = []
- for index in range(len(content)):
- char = content[index]
+ for index, char in enumerate(content):
if "<" == char:
if 0 == len(parentheses_list_left):
start_index = index
@@ -305,10 +312,10 @@ def get_covered_result_data(public_interface_func_list, covered_func_list):
return_val = data_list[4]
para_string = ""
new_list = []
- for index in range(len(para_list)):
- if para_list[index].strip() == "":
+ for curr_para in para_list:
+ if curr_para.strip() == "":
continue
- curr_para = para_list[index]
+
new_list.append(curr_para)
para_string = ",".join(new_list)
fun_string = f"{return_val}' '{func_name}({para_string.strip().strip(',')})"
@@ -444,12 +451,12 @@ if __name__ == "__main__":
current_path = os.getcwd()
CODEPATH = current_path.split("/test/testfwk/developer_test")[0]
SUB_SYSTEM_INFO_PATH = os.path.join(
- CODEPATH, "test/testfwk/developer_test/localCoverage/codeCoverage/results/coverage/reports/cxx")
+ CODEPATH, "test/testfwk/developer_test/local_coverage/code_coverage/results/coverage/reports/cxx")
OUTPUT_REPORT_PATH = os.path.join(
- CODEPATH, "test/testfwk/developer_test/localCoverage/interfaceCoverage/results/coverage/interface_kits"
+ CODEPATH, "test/testfwk/developer_test/local_coverage/interface_coverage/results/coverage/interface_kits"
)
_init_sys_config()
- from localCoverage.utils import get_product_name, get_target_cpu
+ from local_coverage.utils import get_product_name, get_target_cpu
product_name = get_product_name(CODEPATH)
cpu_type = get_target_cpu(CODEPATH)
PATH_INFO_PATH = "out/{}/innerkits/ohos-{}".format(product_name, cpu_type)
diff --git a/localCoverage/interfaceCoverage/make_report.py b/local_coverage/interface_coverage/make_report.py
similarity index 97%
rename from localCoverage/interfaceCoverage/make_report.py
rename to local_coverage/interface_coverage/make_report.py
index 7195842047579904b61b59d5589a87b23702a1ed..11edcad197598e266b19d5a082af76d47f79deab 100644
--- a/localCoverage/interfaceCoverage/make_report.py
+++ b/local_coverage/interface_coverage/make_report.py
@@ -16,20 +16,19 @@
# limitations under the License.
#
-
+import os
import sys
+import stat
import datetime
from importlib import reload
+
reload(sys)
-import os
-import stat
FLAGS_WRITE = os.O_WRONLY | os.O_CREAT | os.O_EXCL
FLAGS_ADD = os.O_WRONLY | os.O_APPEND | os.O_CREAT
MODES = stat.S_IWUSR | stat.S_IRUSR
-
-html_head = """
+HTML_HEAD = """
@@ -75,12 +74,12 @@ html_head = """
"""
-html_body_start = """
+HTML_BODY_START = """
"""
-html_body_ended = """
+HTML_BODY_ENDED = """
"""
-html_ended = """
+HTML_ENDED = """
"""
@@ -97,8 +96,8 @@ def create_html_start(reportpath):
if os.path.exists(reportpath):
os.remove(reportpath)
with os.fdopen(os.open(reportpath, FLAGS_WRITE, MODES), 'w') as report:
- report.write(html_head)
- report.write(html_body_start)
+ report.write(HTML_HEAD)
+ report.write(HTML_BODY_START)
except(IOError, ValueError):
print("Error for create html start ",)
@@ -244,7 +243,7 @@ def create_table_test(reportpath, subsystem_name, datalist, total_count, covered
def create_html_ended(reportpath):
try:
with os.fdopen(os.open(reportpath, FLAGS_ADD, MODES), 'a') as report:
- report.write(html_body_ended)
- report.write(html_ended)
+ report.write(HTML_BODY_ENDED)
+ report.write(HTML_ENDED)
except(IOError, ValueError):
print("Error for create html end")
diff --git a/localCoverage/interfaceCoverage/results/coverage/interface_kits/coverage_summary_file.xml b/local_coverage/interface_coverage/results/coverage/interface_kits/coverage_summary_file.xml
similarity index 100%
rename from localCoverage/interfaceCoverage/results/coverage/interface_kits/coverage_summary_file.xml
rename to local_coverage/interface_coverage/results/coverage/interface_kits/coverage_summary_file.xml
diff --git a/localCoverage/interfaceCoverage/results/coverage/interface_kits/ohos_interfaceCoverage.html b/local_coverage/interface_coverage/results/coverage/interface_kits/ohos_interfaceCoverage.html
similarity index 100%
rename from localCoverage/interfaceCoverage/results/coverage/interface_kits/ohos_interfaceCoverage.html
rename to local_coverage/interface_coverage/results/coverage/interface_kits/ohos_interfaceCoverage.html
diff --git a/localCoverage/keyword_registration/keyword.json b/local_coverage/keyword_registration/keyword.json
similarity index 100%
rename from localCoverage/keyword_registration/keyword.json
rename to local_coverage/keyword_registration/keyword.json
diff --git a/localCoverage/keyword_registration/keyword_filter.py b/local_coverage/keyword_registration/keyword_filter.py
similarity index 99%
rename from localCoverage/keyword_registration/keyword_filter.py
rename to local_coverage/keyword_registration/keyword_filter.py
index b5189adbe9c375d94e459aaabf1de7cf00889068..a83b1a8fbdd0ae13691585ec4f2042363fefcd4b 100644
--- a/localCoverage/keyword_registration/keyword_filter.py
+++ b/local_coverage/keyword_registration/keyword_filter.py
@@ -26,6 +26,7 @@ import platform
import linecache
import traceback
from multiprocessing import Pool
+
from lxml import html
from selectolax.parser import HTMLParser
@@ -94,18 +95,6 @@ class KeywordRegistration:
self.keyword_file_path = os.path.normcase(
os.path.join(os.path.dirname(__file__), "keyword.json"))
- def get_keyword_info(self):
- """
- 获取报备关键字信息
- """
- try:
- with open(self.keyword_file_path, "r") as file:
- keyword_dict = json.load(file)
- keyword_list = keyword_dict.get("KEYWORD")
- return keyword_list
- except (FileNotFoundError, AttributeError, FileExistsError):
- return []
-
@staticmethod
def get_coverage_content(file_path):
"""
@@ -152,6 +141,206 @@ class KeywordRegistration:
tag = tag.replace(item, replace_item)
return tag
+ @staticmethod
+ def get_branch_line_list(keyword_line: int, branch_line_list: list):
+ """
+ 获取大于关键字行号的所有分支行号
+ """
+ if keyword_line in branch_line_list:
+ index = branch_line_list.index(keyword_line)
+ branch_line_list = branch_line_list[index:]
+ else:
+ for line in branch_line_list:
+ if line > keyword_line:
+ index = branch_line_list.index(line)
+ branch_line_list = branch_line_list[index:]
+ break
+ return branch_line_list
+
+ @staticmethod
+ def get_keyword_judge_char(keyword, keyword_source_code):
+ """
+ 获取关键字替代字符
+ """
+ if "&" in keyword:
+ keyword = keyword.replace("&", "<")
+
+ keyword_index = keyword_source_code.find(keyword)
+ if keyword_index == -1:
+ return ""
+
+ try:
+ keyword_code = keyword_source_code[:keyword_index + len(keyword)]
+ if " = " in keyword_code:
+ judge_key = keyword_code.split(" = ")[0].split()[-1]
+ else:
+ bracket_index = keyword_code.find("(")
+ bracket_code = keyword_code[:bracket_index]
+ judge_key = bracket_code.split()[-1]
+ return judge_key
+ except (IndexError, ValueError):
+ return ""
+
+ @staticmethod
+ def get_branch_data_by_tag(tag_html: str, symbol_status=None):
+ """
+ 根据前端标签获取分支数据
+ """
+ if symbol_status:
+ key = r"#+\-*"
+ else:
+ key = r"#+\-"
+ branch_line_list = re.findall(rf"> ([{key}]) ", tag_html)
+
+ return branch_line_list
+
+ @staticmethod
+ def get_judge_condition_index(judge_key: str, source_code: str):
+ """
+ 获取判断条件索引
+ """
+ keyword_index_list = []
+ keyword_index_list_append = keyword_index_list.append
+
+ condition_str_list = re.split(rf"\|\||&&", source_code)
+ for index, code_str in enumerate(condition_str_list):
+ if judge_key in code_str:
+ keyword_index_list_append(index)
+ return keyword_index_list, condition_str_list
+
+ @staticmethod
+ def update_source_code_tag(html_tag: str):
+ replace_item_list = ["lineNum", "lineCov", "lineNoCov"]
+
+ for item in replace_item_list:
+ if item in html_tag:
+ replace_item = (item + "Update").lower()
+ html_tag = html_tag.replace(item, replace_item)
+
+ return html_tag
+
+ @staticmethod
+ def modify_tag_style(tag, rate):
+ """
+ 修改标签样式
+ """
+ if 75 <= rate < 90:
+ tag = tag.replace("headerCovTableEntryLo", "headerCovTableEntryMed")
+ tag = tag.replace("coverPerLo", "coverPerMed")
+ tag = tag.replace("coverNumLo", "coverNumMed")
+ elif rate >= 90:
+ tag = tag.replace("headerCovTableEntryLo", "headerCovTableEntryHi")
+ tag = tag.replace("headerCovTableEntryMed", "headerCovTableEntryHi")
+ tag = tag.replace("coverPerLo", "coverPerHi")
+ tag = tag.replace("coverNumLo", "coverNumHi")
+ tag = tag.replace("coverPerMed", "coverPerHi")
+ tag = tag.replace("coverNumMed", "coverNumHi")
+ return tag
+
+ @staticmethod
+ def _branch_replace(branch):
+ """
+ 分支符号替换
+ """
+ if branch == "#":
+ branch = "> # <"
+ elif branch == "+":
+ branch = "> + <"
+ elif branch == "*":
+ branch = "> * <"
+ else:
+ branch = "> - <"
+ return branch
+
+ @staticmethod
+ def _single_condition_modify_html(branch_html, branch_list):
+ """
+ 单条件修改代码块html
+ """
+ line_item = ' '
+ line_feed_index = branch_html.find(line_item)
+ if line_feed_index == -1:
+ if "+" in branch_list:
+ update_branch_tag = branch_html.replace("> - <", "> <")
+ update_branch_tag = update_branch_tag.replace("> # <", "> <")
+ else:
+ try:
+ first_branch = branch_list[0]
+ first_branch = "> " + first_branch + " <"
+ first_branch_index = branch_html.find(first_branch)
+ branch_tag = branch_html[:first_branch_index + 5]
+ update_branch_tag = branch_html[first_branch_index + 5:]
+ update_branch_tag = update_branch_tag.replace("> - <", "> <")
+ update_branch_tag = update_branch_tag.replace("> # <", "> <")
+ update_branch_tag = branch_tag + update_branch_tag
+ except ValueError:
+ return ""
+ else:
+ line_feed_index = branch_html.find(line_item)
+ update_branch_tag = branch_html[:line_feed_index + len(line_item) + 1]
+ if "-" not in branch_list and "+" not in branch_list:
+ del_count = update_branch_tag.count("> # <")
+ update_branch_tag = update_branch_tag.replace("> # <", "> <", del_count - 1)
+ else:
+ update_branch_tag = update_branch_tag.replace("> - <", "> <")
+ update_branch_tag = update_branch_tag.replace("> # <", "> <")
+ branch_tag = branch_html[line_feed_index + len(line_item) + 1:]
+ line_feed_index = branch_tag.find(line_item)
+ if line_feed_index == -1:
+ branch_tag = branch_tag.replace("> - <", "> <")
+ branch_tag = branch_tag.replace("> # <", "> <")
+ update_branch_tag += branch_tag
+ else:
+ loop_count = 0
+ while line_feed_index + 1:
+ loop_count += 1
+ if loop_count > 200:
+ continue
+ try:
+ update_branch_tag += branch_tag[:line_feed_index + len(line_item) + 1]
+ update_branch_tag = update_branch_tag.replace("> - <", "> <")
+ update_branch_tag = update_branch_tag.replace("> # <", "> <")
+ branch_tag = branch_tag[line_feed_index + len(line_item) + 1:]
+ line_feed_index = branch_tag.find(line_item)
+ except ValueError:
+ return ""
+
+ branch_tag = branch_tag.replace("> - <", "> <")
+ update_branch_tag = update_branch_tag.replace("> # <", "> <")
+ update_branch_tag += branch_tag
+ return update_branch_tag
+
+ def get_break_line_tag(self, content, origin_branch_html, branch_line):
+ """
+ 获取分支换行的判断条件源码tag
+ """
+ get_tag = self.get_tag
+ left_brace_exist = False
+ line_break = loop_count = 0
+ while not left_brace_exist:
+ if loop_count > 10:
+ break
+ line_break += 1
+ origin_branch_html = os.path.join(origin_branch_html, "\n")
+ next_line_tag = get_tag(content, branch_line + line_break)
+ if "{" in next_line_tag:
+ left_brace_exist = True
+ origin_branch_html += next_line_tag
+ loop_count += 1
+ return origin_branch_html
+
+ def get_keyword_info(self):
+ """
+ 获取报备关键字信息
+ """
+ try:
+ with open(self.keyword_file_path, "r") as file:
+ keyword_dict = json.load(file)
+ keyword_list = keyword_dict.get("KEYWORD")
+ return keyword_list
+ except (FileNotFoundError, AttributeError, FileExistsError):
+ return []
+
def get_coverage_lines_by_branch(self, file_path, content=None):
"""
获取覆盖率报告中的所有的if分支行号
@@ -308,143 +497,28 @@ class KeywordRegistration:
return function_name
return function_name
- @staticmethod
- def get_branch_line_list(keyword_line: int, branch_line_list: list):
- """
- 获取大于关键字行号的所有分支行号
- """
- if keyword_line in branch_line_list:
- index = branch_line_list.index(keyword_line)
- branch_line_list = branch_line_list[index:]
- else:
- for line in branch_line_list:
- if line > keyword_line:
- index = branch_line_list.index(line)
- branch_line_list = branch_line_list[index:]
- break
- return branch_line_list
-
- @staticmethod
- def get_keyword_judge_char(keyword, keyword_source_code):
+ def update_coverage_ratio_tag(self, file_path):
"""
- 获取关键字替代字符
+ 修改覆盖率比率数据
"""
- if "&" in keyword:
- keyword = keyword.replace("&", "<")
+ with open(file_path, "r", encoding="utf-8") as coverage_file:
+ content = coverage_file.read()
- keyword_index = keyword_source_code.find(keyword)
- if keyword_index == -1:
- return ""
+ covered_nums = len(re.findall(r"> ([+]) ", content))
+ branch_total = len(re.findall(r"> ([+\-#]) ", content))
- try:
- keyword_code = keyword_source_code[:keyword_index + len(keyword)]
- if " = " in keyword_code:
- judge_key = keyword_code.split(" = ")[0].split()[-1]
- else:
- bracket_index = keyword_code.find("(")
- bracket_code = keyword_code[:bracket_index]
- judge_key = bracket_code.split()[-1]
- return judge_key
- except (IndexError, ValueError):
- return ""
-
- @staticmethod
- def get_branch_data_by_tag(tag_html: str, symbol_status=None):
- """
- 根据前端标签获取分支数据
- """
- if symbol_status:
- key = r"#+\-*"
- else:
- key = r"#+\-"
- branch_line_list = re.findall(rf"> ([{key}]) ", tag_html)
-
- return branch_line_list
-
- @staticmethod
- def get_judge_condition_index(judge_key: str, source_code: str):
- """
- 获取判断条件索引
- """
- keyword_index_list = []
- keyword_index_list_append = keyword_index_list.append
-
- condition_str_list = re.split(rf"\|\||&&", source_code)
- for index, code_str in enumerate(condition_str_list):
- if judge_key in code_str:
- keyword_index_list_append(index)
- return keyword_index_list, condition_str_list
-
- @staticmethod
- def update_source_code_tag(html_tag: str):
- replace_item_list = ["lineNum", "lineCov", "lineNoCov"]
-
- for item in replace_item_list:
- if item in html_tag:
- replace_item = (item + "Update").lower()
- html_tag = html_tag.replace(item, replace_item)
-
- return html_tag
-
- def get_break_line_tag(self, content, origin_branch_html, branch_line):
- """
- 获取分支换行的判断条件源码tag
- """
- get_tag = self.get_tag
- left_brace_exist = False
- line_break = loop_count = 0
- while not left_brace_exist:
- if loop_count > 10:
- break
- line_break += 1
- origin_branch_html = os.path.join(origin_branch_html, "\n")
- next_line_tag = get_tag(content, branch_line + line_break)
- if "{" in next_line_tag:
- left_brace_exist = True
- origin_branch_html += next_line_tag
- loop_count += 1
- return origin_branch_html
-
- @staticmethod
- def modify_tag_style(tag, rate):
- """
- 修改标签样式
- """
- if 75 <= rate < 90:
- tag = tag.replace("headerCovTableEntryLo", "headerCovTableEntryMed")
- tag = tag.replace("coverPerLo", "coverPerMed")
- tag = tag.replace("coverNumLo", "coverNumMed")
- elif rate >= 90:
- tag = tag.replace("headerCovTableEntryLo", "headerCovTableEntryHi")
- tag = tag.replace("headerCovTableEntryMed", "headerCovTableEntryHi")
- tag = tag.replace("coverPerLo", "coverPerHi")
- tag = tag.replace("coverNumLo", "coverNumHi")
- tag = tag.replace("coverPerMed", "coverPerHi")
- tag = tag.replace("coverNumMed", "coverNumHi")
- return tag
-
- def update_coverage_ratio_tag(self, file_path):
- """
- 修改覆盖率比率数据
- """
- with open(file_path, "r", encoding="utf-8") as coverage_file:
- content = coverage_file.read()
-
- covered_nums = len(re.findall(r"> ([+]) ", content))
- branch_total = len(re.findall(r"> ([+\-#]) ", content))
-
- line = 0
- start_line = 1
- content_list = content.splitlines()
- for line_text in content_list:
- if '' in line_text:
- line = start_line
- break
- start_line += 1
- linecache.clearcache()
- coverage_tag = linecache.getline(file_path, line)
- covered_tag = linecache.getline(file_path, line + 1)
- coverage_total_tag = linecache.getline(file_path, line + 2)
+ line = 0
+ start_line = 1
+ content_list = content.splitlines()
+ for line_text in content_list:
+ if '' in line_text:
+ line = start_line
+ break
+ start_line += 1
+ linecache.clearcache()
+ coverage_tag = linecache.getline(file_path, line)
+ covered_tag = linecache.getline(file_path, line + 1)
+ coverage_total_tag = linecache.getline(file_path, line + 2)
try:
origin_hit = int(re.findall(r"(\d+)", covered_tag)[0])
origin_total = int(re.findall(r"(\d+)", coverage_total_tag)[0])
@@ -583,187 +657,6 @@ class KeywordRegistration:
except (IndexError, TypeError, FileNotFoundError):
pass
- def _check_if_branch_line(self, judge_key, sub_branch_line_list,
- key_line, content, function_name):
- """
- 确定if分支行号
- """
- if_branch_line = None
- for branch_line in sub_branch_line_list:
- if branch_line == key_line:
- if_branch_line = key_line
- break
- # 获取分支行所在函数名
- branch_function_name = self.get_line_funcname(
- branch_line, content)
- # 关键字范围只在关键字所在函数之内
- branch_line_tag = self.get_tag(content, branch_line)
- try:
- if "{" not in branch_line_tag:
- branch_line_tag = self.get_break_line_tag(
- content, branch_line_tag, branch_line)
- branch_line_source_code = self.get_source_code(
- branch_line_tag)
- if function_name == branch_function_name:
- if judge_key in branch_line_source_code:
- if_branch_line = branch_line
- break
- else:
- break
- except (ValueError, KeyError):
- pass
-
- return if_branch_line
-
- @staticmethod
- def _branch_replace(branch):
- """
- 分支符号替换
- """
- if branch == "#":
- branch = "> # <"
- elif branch == "+":
- branch = "> + <"
- elif branch == "*":
- branch = "> * <"
- else:
- branch = "> - <"
- return branch
-
- @staticmethod
- def _single_condition_modify_html(branch_html, branch_list):
- """
- 单条件修改代码块html
- """
- line_item = ' '
- line_feed_index = branch_html.find(line_item)
- if line_feed_index == -1:
- if "+" in branch_list:
- update_branch_tag = branch_html.replace("> - <", "> <")
- update_branch_tag = update_branch_tag.replace("> # <", "> <")
- else:
- try:
- first_branch = branch_list[0]
- first_branch = "> " + first_branch + " <"
- first_branch_index = branch_html.find(first_branch)
- branch_tag = branch_html[:first_branch_index + 5]
- update_branch_tag = branch_html[first_branch_index + 5:]
- update_branch_tag = update_branch_tag.replace("> - <", "> <")
- update_branch_tag = update_branch_tag.replace("> # <", "> <")
- update_branch_tag = branch_tag + update_branch_tag
- except ValueError:
- return ""
- else:
- line_feed_index = branch_html.find(line_item)
- update_branch_tag = branch_html[:line_feed_index + len(line_item) + 1]
- if "-" not in branch_list and "+" not in branch_list:
- del_count = update_branch_tag.count("> # <")
- update_branch_tag = update_branch_tag.replace("> # <", "> <", del_count - 1)
- else:
- update_branch_tag = update_branch_tag.replace("> - <", "> <")
- update_branch_tag = update_branch_tag.replace("> # <", "> <")
- branch_tag = branch_html[line_feed_index + len(line_item) + 1:]
- line_feed_index = branch_tag.find(line_item)
- if line_feed_index == -1:
- branch_tag = branch_tag.replace("> - <", "> <")
- branch_tag = branch_tag.replace("> # <", "> <")
- update_branch_tag += branch_tag
- else:
- loop_count = 0
- while line_feed_index + 1:
- loop_count += 1
- if loop_count > 200:
- continue
- try:
- update_branch_tag += branch_tag[:line_feed_index + len(line_item) + 1]
- update_branch_tag = update_branch_tag.replace("> - <", "> <")
- update_branch_tag = update_branch_tag.replace("> # <", "> <")
- branch_tag = branch_tag[line_feed_index + len(line_item) + 1:]
- line_feed_index = branch_tag.find(line_item)
- except ValueError:
- return ""
-
- branch_tag = branch_tag.replace("> - <", "> <")
- update_branch_tag = update_branch_tag.replace("> # <", "> <")
- update_branch_tag += branch_tag
- return update_branch_tag
-
- def _multi_condition_modify_html(self, branch_html, branch_length,
- condition_str_list, judge_index_list):
- """
- 多条件修改代码块html
- """
- line_item = ' '
- if branch_length % len(condition_str_list):
- line_feed_index = branch_html.find(line_item)
- update_branch_tag = branch_html[:line_feed_index]
- update_branch_tag = update_branch_tag.replace("> - <", "> <")
- branch_html = branch_html[line_feed_index:]
- loop_count = 0
- while line_feed_index + 1:
- loop_count += 1
- if loop_count > 200:
- continue
- line_feed_index = branch_html.count(line_item)
- if line_feed_index > 1:
- try:
- line_feed_length = len(line_item)
- branch_tag_before = branch_html[:line_feed_length]
- branch_html = branch_html[line_feed_length:]
- line_feed_index = branch_html.find(line_item)
- branch_tag_after = branch_html[:line_feed_index]
- branch_tag_after = branch_tag_after.replace("> - <", "> <")
- branch_tag = branch_tag_before + branch_tag_after
- except ValueError:
- return ""
- else:
- branch_tag = branch_html
- branch_tag = branch_tag.replace("> - <", "> <")
- # 不再换行,索引为-1
- line_feed_index = -1
-
- update_branch_tag += branch_tag
- if line_feed_index == -1:
- branch_html = ""
- else:
- branch_html = branch_html[line_feed_index:]
- if branch_html != "":
- branch_html = branch_html.replace("> - <", "> <")
- update_branch_tag += branch_html
- else:
- branch_list = self.get_branch_data_by_tag(branch_html, True)
- update_branch_tag = ""
- end_count = -1
- try:
- for index in judge_index_list:
- branch_data = branch_list[:(index + 1) * 2]
- # 要修改的分支数据列表长度
- branch_data_length = len(branch_data)
- change_status = False
- for count, branch in enumerate(branch_data, 1):
- if count <= end_count:
- continue
-
- end_count = count
- branch = self._branch_replace(branch)
- end_index = branch_html.find(branch)
- branch_tag = branch_html[:end_index + 5]
- if branch_data_length - count in [0, 1]:
- if change_status:
- continue
- if branch == "> # <":
- change_status = True
- branch_tag = branch_tag.replace("> # <", "> * <")
- elif branch == "> - <":
- change_status = True
- branch_tag = branch_tag.replace("> - <", "> * <")
- update_branch_tag += branch_tag
- branch_html = branch_html[end_index + 5:]
- except (ValueError, TypeError):
- return ""
- update_branch_tag += branch_html
- return update_branch_tag
-
def judge_branch_exists(self, file_path):
"""
判断报告是否存在分支
@@ -918,6 +811,114 @@ class KeywordRegistration:
pool.close()
pool.join()
+
+ def _check_if_branch_line(self, judge_key, sub_branch_line_list,
+ key_line, content, function_name):
+ """
+ 确定if分支行号
+ """
+ if_branch_line = None
+ for branch_line in sub_branch_line_list:
+ if branch_line == key_line:
+ if_branch_line = key_line
+ break
+ # 获取分支行所在函数名
+ branch_function_name = self.get_line_funcname(
+ branch_line, content)
+ # 关键字范围只在关键字所在函数之内
+ branch_line_tag = self.get_tag(content, branch_line)
+ try:
+ if "{" not in branch_line_tag:
+ branch_line_tag = self.get_break_line_tag(
+ content, branch_line_tag, branch_line)
+ branch_line_source_code = self.get_source_code(
+ branch_line_tag)
+ if function_name == branch_function_name:
+ if judge_key in branch_line_source_code:
+ if_branch_line = branch_line
+ break
+ else:
+ break
+ except (ValueError, KeyError):
+ pass
+
+ return if_branch_line
+
+ def _multi_condition_modify_html(self, branch_html, branch_length,
+ condition_str_list, judge_index_list):
+ """
+ 多条件修改代码块html
+ """
+ line_item = ' '
+ if branch_length % len(condition_str_list):
+ line_feed_index = branch_html.find(line_item)
+ update_branch_tag = branch_html[:line_feed_index]
+ update_branch_tag = update_branch_tag.replace("> - <", "> <")
+ branch_html = branch_html[line_feed_index:]
+ loop_count = 0
+ while line_feed_index + 1:
+ loop_count += 1
+ if loop_count > 200:
+ continue
+ line_feed_index = branch_html.count(line_item)
+ if line_feed_index > 1:
+ try:
+ line_feed_length = len(line_item)
+ branch_tag_before = branch_html[:line_feed_length]
+ branch_html = branch_html[line_feed_length:]
+ line_feed_index = branch_html.find(line_item)
+ branch_tag_after = branch_html[:line_feed_index]
+ branch_tag_after = branch_tag_after.replace("> - <", "> <")
+ branch_tag = branch_tag_before + branch_tag_after
+ except ValueError:
+ return ""
+ else:
+ branch_tag = branch_html
+ branch_tag = branch_tag.replace("> - <", "> <")
+ # 不再换行,索引为-1
+ line_feed_index = -1
+
+ update_branch_tag += branch_tag
+ if line_feed_index == -1:
+ branch_html = ""
+ else:
+ branch_html = branch_html[line_feed_index:]
+ if branch_html != "":
+ branch_html = branch_html.replace("> - <", "> <")
+ update_branch_tag += branch_html
+ else:
+ branch_list = self.get_branch_data_by_tag(branch_html, True)
+ update_branch_tag = ""
+ end_count = -1
+ try:
+ for index in judge_index_list:
+ branch_data = branch_list[:(index + 1) * 2]
+ # 要修改的分支数据列表长度
+ branch_data_length = len(branch_data)
+ change_status = False
+ for count, branch in enumerate(branch_data, 1):
+ if count <= end_count:
+ continue
+
+ end_count = count
+ branch = self._branch_replace(branch)
+ end_index = branch_html.find(branch)
+ branch_tag = branch_html[:end_index + 5]
+ if branch_data_length - count in [0, 1]:
+ if change_status:
+ continue
+ if branch == "> # <":
+ change_status = True
+ branch_tag = branch_tag.replace("> # <", "> * <")
+ elif branch == "> - <":
+ change_status = True
+ branch_tag = branch_tag.replace("> - <", "> * <")
+ update_branch_tag += branch_tag
+ branch_html = branch_html[end_index + 5:]
+ except (ValueError, TypeError):
+ return ""
+ update_branch_tag += branch_html
+ return update_branch_tag
def main(report_path):
@@ -933,5 +934,5 @@ if __name__ == '__main__':
current_path = os.getcwd()
home_path = current_path.split("/test/testfwk/developer_test")[0]
developer_path = os.path.join(home_path, "test/testfwk/developer_test")
- html_path = os.path.join(developer_path, "localCoverage/codeCoverage/results/coverage/reports/cxx/html")
+ html_path = os.path.join(developer_path, "local_coverage/code_coverage/results/coverage/reports/cxx/html")
main(html_path)
diff --git a/localCoverage/push_coverage_so/__init__.py b/local_coverage/push_coverage_so/__init__.py
similarity index 100%
rename from localCoverage/push_coverage_so/__init__.py
rename to local_coverage/push_coverage_so/__init__.py
diff --git a/localCoverage/push_coverage_so/push_coverage.py b/local_coverage/push_coverage_so/push_coverage.py
similarity index 97%
rename from localCoverage/push_coverage_so/push_coverage.py
rename to local_coverage/push_coverage_so/push_coverage.py
index 42468bd9729cba0fc4a731f2425cc9af7d30c09b..bb75224e250028f90936422ead29dc52bbec548e 100644
--- a/localCoverage/push_coverage_so/push_coverage.py
+++ b/local_coverage/push_coverage_so/push_coverage.py
@@ -152,8 +152,8 @@ if __name__ == "__main__":
current_path = os.path.abspath(os.path.dirname(__name__))
_init_sys_config()
- from localCoverage.resident_service.public_method import get_config_ip, get_sn_list
- from localCoverage.utils import get_product_name, hdc_command, tree_find_file_endswith,\
+ from local_coverage.resident_service.public_method import get_config_ip, get_sn_list
+ from local_coverage.utils import get_product_name, hdc_command, tree_find_file_endswith,\
json_parse, logger, is_elffile
root_path = current_path.split("/test/testfwk/developer_test")[0]
diff --git a/localCoverage/resident_service/config/ams/ams.cfg b/local_coverage/resident_service/config/ams/ams.cfg
similarity index 97%
rename from localCoverage/resident_service/config/ams/ams.cfg
rename to local_coverage/resident_service/config/ams/ams.cfg
index 085972360c43f22e0bc6d8a2c84eabd2ab1e00de..6a54d3773ef50ea240b59e942e7f517dea379e91 100644
--- a/localCoverage/resident_service/config/ams/ams.cfg
+++ b/local_coverage/resident_service/config/ams/ams.cfg
@@ -1,50 +1,50 @@
-{
- "jobs": [{
- "name": "services:ams",
- "cmds": [
- "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
- "mkdir /data/storage/el1/bundle 0711 system system",
- "mkdir /data/storage/el2/base 0711 system system",
- "mkdir /data/storage/el2/database 0711 system system",
- "mkdir /data/service/el1/public/notification 0711 foundation system",
- "mkdir /data/service/el1/public/database 0711 ddms ddms",
- "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
- "chown radio system /sys/power/wake_lock",
- "chown radio system /sys/power/wake_unlock",
- "chmod 0664 /sys/power/wakeup_count"
- ]
- },{
- "name": "services:restartfoundation",
- "cmds": [
- "reset appspawn",
- "reset accountmgr"
- ]
- }
- ],
- "services": [{
- "name": "ams",
- "path": ["/system/bin/sa_main", "/system/profile/ams.xml"],
- "critical": [1, 1, 60],
- "importance": -20,
- "uid": "foundation",
- "permission": [
- "ohos.permission.INPUT_MONITORING",
- "ohos.permission.PERMISSION_USED_STATS",
- "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
- "ohos.permission.DISTRIBUTED_DATASYNC",
- "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
- "ohos.permission.INSTALL_BUNDLE",
- "ohos.permission.MICROPHONE"
- ],
- "gid": ["system"],
- "caps": ["SYS_PTRACE", "KILL"],
- "jobs": {
- "on-start": "services:ams",
- "on-restart": "services:restartfoundation"
- },
- "secon": "u:r:foundation:s0"
- }
- ]
+{
+ "jobs": [{
+ "name": "services:ams",
+ "cmds": [
+ "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
+ "mkdir /data/storage/el1/bundle 0711 system system",
+ "mkdir /data/storage/el2/base 0711 system system",
+ "mkdir /data/storage/el2/database 0711 system system",
+ "mkdir /data/service/el1/public/notification 0711 foundation system",
+ "mkdir /data/service/el1/public/database 0711 ddms ddms",
+ "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
+ "chown radio system /sys/power/wake_lock",
+ "chown radio system /sys/power/wake_unlock",
+ "chmod 0664 /sys/power/wakeup_count"
+ ]
+ },{
+ "name": "services:restartfoundation",
+ "cmds": [
+ "reset appspawn",
+ "reset accountmgr"
+ ]
+ }
+ ],
+ "services": [{
+ "name": "ams",
+ "path": ["/system/bin/sa_main", "/system/profile/ams.xml"],
+ "critical": [1, 1, 60],
+ "importance": -20,
+ "uid": "foundation",
+ "permission": [
+ "ohos.permission.INPUT_MONITORING",
+ "ohos.permission.PERMISSION_USED_STATS",
+ "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
+ "ohos.permission.DISTRIBUTED_DATASYNC",
+ "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
+ "ohos.permission.INSTALL_BUNDLE",
+ "ohos.permission.MICROPHONE"
+ ],
+ "gid": ["system"],
+ "caps": ["SYS_PTRACE", "KILL"],
+ "jobs": {
+ "on-start": "services:ams",
+ "on-restart": "services:restartfoundation"
+ },
+ "secon": "u:r:foundation:s0"
+ }
+ ]
}
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/ams/ams.xml b/local_coverage/resident_service/config/ams/ams.xml
similarity index 96%
rename from localCoverage/resident_service/config/ams/ams.xml
rename to local_coverage/resident_service/config/ams/ams.xml
index 64894c734131f790c800ceecc11070fd6ed3ef71..e5a03b3476f804edbd3040e6987acf2a55a58499 100644
--- a/localCoverage/resident_service/config/ams/ams.xml
+++ b/local_coverage/resident_service/config/ams/ams.xml
@@ -1,64 +1,64 @@
-
-
-
- foundation
-
-
- /system/lib64/libabilityms.z.so
- /system/lib64/libdataobsms.z.so
- /system/lib64/libupms.z.so
- /system/lib64/libappms.z.so
-
-
-
-
- 180
- /system/lib64/libabilityms.z.so
-
-
- true
- false
- 1
-
-
- 182
- /system/lib64/libdataobsms.z.so
-
-
- true
- false
- 1
-
-
- 183
- /system/lib64/libupms.z.so
-
-
- true
- false
- 1
-
-
- 501
- /system/lib64/libappms.z.so
-
-
- true
- false
- 1
-
-
+
+
+
+ foundation
+
+
+ /system/lib64/libabilityms.z.so
+ /system/lib64/libdataobsms.z.so
+ /system/lib64/libupms.z.so
+ /system/lib64/libappms.z.so
+
+
+
+
+ 180
+ /system/lib64/libabilityms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 182
+ /system/lib64/libdataobsms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 183
+ /system/lib64/libupms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 501
+ /system/lib64/libappms.z.so
+
+
+ true
+ false
+ 1
+
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/ams/foundation.xml b/local_coverage/resident_service/config/ams/foundation.xml
similarity index 97%
rename from localCoverage/resident_service/config/ams/foundation.xml
rename to local_coverage/resident_service/config/ams/foundation.xml
index 11d2a92046f8a59977b23ebf8d6d1c0ae67503cc..deda7820ebc9d0e462b0b4a4e3997f6a70d939ff 100644
--- a/localCoverage/resident_service/config/ams/foundation.xml
+++ b/local_coverage/resident_service/config/ams/foundation.xml
@@ -1,128 +1,128 @@
-
-
-
- foundation
-
- /system/lib64/libcesfwk_services.z.so
- libans.z.so
- libbatteryservice.z.so
- libdisplaymgrservice.z.so
- libpowermgrservice.z.so
- libtel_call_manager.z.so
- libtel_state_registry.z.so
-
-
-
-
- /system/lib64/libfms.z.so
- /system/lib64/libbms.z.so
- libwms.z.so
-
-
- 401
- /system/lib64/libbms.z.so
- 1301
- 60000
- true
- false
- 1
- CoreStartPhase
-
-
- 4606
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 4607
- libwms.z.so
- true
- false
- 1
- CoreStartPhase
-
-
- 3299
- /system/lib64/libcesfwk_services.z.so
-
-
- true
- false
- 1
-
-
- 3203
- libans.z.so
- 1301
- 3299
- 5000
- true
- false
- 1
-
-
- 3302
- libbatteryservice.z.so
- true
- false
- 1
-
-
- 3308
- libdisplaymgrservice.z.so
-
-
- true
- false
- 1
-
-
- 3301
- libpowermgrservice.z.so
- true
- false
- 1
-
-
- 4005
- libtel_call_manager.z.so
- true
- false
- 1
-
-
- 4009
- libtel_state_registry.z.so
- true
- false
- 1
-
-
-
- 403
- /system/lib64/libfms.z.so
-
-
- true
- false
- 1
-
+
+
+
+ foundation
+
+ /system/lib64/libcesfwk_services.z.so
+ libans.z.so
+ libbatteryservice.z.so
+ libdisplaymgrservice.z.so
+ libpowermgrservice.z.so
+ libtel_call_manager.z.so
+ libtel_state_registry.z.so
+
+
+
+
+ /system/lib64/libfms.z.so
+ /system/lib64/libbms.z.so
+ libwms.z.so
+
+
+ 401
+ /system/lib64/libbms.z.so
+ 1301
+ 60000
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4606
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4607
+ libwms.z.so
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 3299
+ /system/lib64/libcesfwk_services.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3203
+ libans.z.so
+ 1301
+ 3299
+ 5000
+ true
+ false
+ 1
+
+
+ 3302
+ libbatteryservice.z.so
+ true
+ false
+ 1
+
+
+ 3308
+ libdisplaymgrservice.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3301
+ libpowermgrservice.z.so
+ true
+ false
+ 1
+
+
+ 4005
+ libtel_call_manager.z.so
+ true
+ false
+ 1
+
+
+ 4009
+ libtel_state_registry.z.so
+ true
+ false
+ 1
+
+
+
+ 403
+ /system/lib64/libfms.z.so
+
+
+ true
+ false
+ 1
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/bms/bms.cfg b/local_coverage/resident_service/config/bms/bms.cfg
similarity index 97%
rename from localCoverage/resident_service/config/bms/bms.cfg
rename to local_coverage/resident_service/config/bms/bms.cfg
index f3da1bf7bef9a2eea0b499beb165b9dc2e3bfb22..22830b09724b2cf3e0ce80426b212e8ddaced253 100644
--- a/localCoverage/resident_service/config/bms/bms.cfg
+++ b/local_coverage/resident_service/config/bms/bms.cfg
@@ -1,50 +1,50 @@
-{
- "jobs": [{
- "name": "services:bms",
- "cmds": [
- "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
- "mkdir /data/storage/el1/bundle 0711 system system",
- "mkdir /data/storage/el2/base 0711 system system",
- "mkdir /data/storage/el2/database 0711 system system",
- "mkdir /data/service/el1/public/notification 0711 foundation system",
- "mkdir /data/service/el1/public/database 0711 ddms ddms",
- "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
- "chown radio system /sys/power/wake_lock",
- "chown radio system /sys/power/wake_unlock",
- "chmod 0664 /sys/power/wakeup_count"
- ]
- },{
- "name": "services:restartfoundation",
- "cmds": [
- "reset appspawn",
- "reset accountmgr"
- ]
- }
- ],
- "services": [{
- "name": "bms",
- "path": ["/system/bin/sa_main", "/system/profile/bms.xml"],
- "critical": [1, 1, 60],
- "importance": -20,
- "uid": "foundation",
- "permission": [
- "ohos.permission.INPUT_MONITORING",
- "ohos.permission.PERMISSION_USED_STATS",
- "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
- "ohos.permission.DISTRIBUTED_DATASYNC",
- "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
- "ohos.permission.INSTALL_BUNDLE",
- "ohos.permission.MICROPHONE"
- ],
- "gid": ["system"],
- "caps": ["SYS_PTRACE", "KILL"],
- "jobs": {
- "on-start": "services:bms",
- "on-restart": "services:restartfoundation"
- },
- "secon": "u:r:foundation:s0"
- }
- ]
+{
+ "jobs": [{
+ "name": "services:bms",
+ "cmds": [
+ "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
+ "mkdir /data/storage/el1/bundle 0711 system system",
+ "mkdir /data/storage/el2/base 0711 system system",
+ "mkdir /data/storage/el2/database 0711 system system",
+ "mkdir /data/service/el1/public/notification 0711 foundation system",
+ "mkdir /data/service/el1/public/database 0711 ddms ddms",
+ "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
+ "chown radio system /sys/power/wake_lock",
+ "chown radio system /sys/power/wake_unlock",
+ "chmod 0664 /sys/power/wakeup_count"
+ ]
+ },{
+ "name": "services:restartfoundation",
+ "cmds": [
+ "reset appspawn",
+ "reset accountmgr"
+ ]
+ }
+ ],
+ "services": [{
+ "name": "bms",
+ "path": ["/system/bin/sa_main", "/system/profile/bms.xml"],
+ "critical": [1, 1, 60],
+ "importance": -20,
+ "uid": "foundation",
+ "permission": [
+ "ohos.permission.INPUT_MONITORING",
+ "ohos.permission.PERMISSION_USED_STATS",
+ "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
+ "ohos.permission.DISTRIBUTED_DATASYNC",
+ "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
+ "ohos.permission.INSTALL_BUNDLE",
+ "ohos.permission.MICROPHONE"
+ ],
+ "gid": ["system"],
+ "caps": ["SYS_PTRACE", "KILL"],
+ "jobs": {
+ "on-start": "services:bms",
+ "on-restart": "services:restartfoundation"
+ },
+ "secon": "u:r:foundation:s0"
+ }
+ ]
}
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/bms/bms.xml b/local_coverage/resident_service/config/bms/bms.xml
similarity index 97%
rename from localCoverage/resident_service/config/bms/bms.xml
rename to local_coverage/resident_service/config/bms/bms.xml
index d74a33ec2cdcc33b4d6e0e2199aeeeabeb31dfd4..3b14f41d00a4a39df84f51bd9ed262af5c49ddcb 100644
--- a/localCoverage/resident_service/config/bms/bms.xml
+++ b/local_coverage/resident_service/config/bms/bms.xml
@@ -1,34 +1,34 @@
-
-
-
- foundation
-
-
- /system/lib64/libbms.z.so
-
-
-
- 401
- /system/lib64/libbms.z.so
- 1301
- 60000
- true
- false
- 1
- CoreStartPhase
-
-
+
+
+
+ foundation
+
+
+ /system/lib64/libbms.z.so
+
+
+
+ 401
+ /system/lib64/libbms.z.so
+ 1301
+ 60000
+ true
+ false
+ 1
+ CoreStartPhase
+
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/bms/foundation.xml b/local_coverage/resident_service/config/bms/foundation.xml
similarity index 96%
rename from localCoverage/resident_service/config/bms/foundation.xml
rename to local_coverage/resident_service/config/bms/foundation.xml
index c7be367c0de6ac02bfd60cfdd8282993ea135cb5..d9ebf1a7b28161f72487d1b2899b3e1dae96be49 100644
--- a/localCoverage/resident_service/config/bms/foundation.xml
+++ b/local_coverage/resident_service/config/bms/foundation.xml
@@ -1,156 +1,156 @@
-
-
-
- foundation
-
- /system/lib64/libcesfwk_services.z.so
- libans.z.so
- libbatteryservice.z.so
- libdisplaymgrservice.z.so
- libpowermgrservice.z.so
- libtel_call_manager.z.so
- libtel_state_registry.z.so
- /system/lib64/libabilityms.z.so
- /system/lib64/libdataobsms.z.so
- /system/lib64/libupms.z.so
- /system/lib64/libappms.z.so
- /system/lib64/libfms.z.so
-
- libwms.z.so
-
-
-
- 4606
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 4607
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 3299
- /system/lib64/libcesfwk_services.z.so
-
-
- true
- false
- 1
-
-
- 3203
- libans.z.so
- 1301
- 3299
- 5000
- true
- false
- 1
-
-
- 3302
- libbatteryservice.z.so
- true
- false
- 1
-
-
- 3308
- libdisplaymgrservice.z.so
-
-
- true
- false
- 1
-
-
- 3301
- libpowermgrservice.z.so
- true
- false
- 1
-
-
- 4005
- libtel_call_manager.z.so
- true
- false
- 1
-
-
- 4009
- libtel_state_registry.z.so
- true
- false
- 1
-
-
- 180
- /system/lib64/libabilityms.z.so
-
-
- true
- false
- 1
-
-
- 182
- /system/lib64/libdataobsms.z.so
-
-
- true
- false
- 1
-
-
- 183
- /system/lib64/libupms.z.so
-
-
- true
- false
- 1
-
-
- 501
- /system/lib64/libappms.z.so
-
-
- true
- false
- 1
-
-
- 403
- /system/lib64/libfms.z.so
-
-
- true
- false
- 1
-
+
+
+
+ foundation
+
+ /system/lib64/libcesfwk_services.z.so
+ libans.z.so
+ libbatteryservice.z.so
+ libdisplaymgrservice.z.so
+ libpowermgrservice.z.so
+ libtel_call_manager.z.so
+ libtel_state_registry.z.so
+ /system/lib64/libabilityms.z.so
+ /system/lib64/libdataobsms.z.so
+ /system/lib64/libupms.z.so
+ /system/lib64/libappms.z.so
+ /system/lib64/libfms.z.so
+
+ libwms.z.so
+
+
+
+ 4606
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4607
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 3299
+ /system/lib64/libcesfwk_services.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3203
+ libans.z.so
+ 1301
+ 3299
+ 5000
+ true
+ false
+ 1
+
+
+ 3302
+ libbatteryservice.z.so
+ true
+ false
+ 1
+
+
+ 3308
+ libdisplaymgrservice.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3301
+ libpowermgrservice.z.so
+ true
+ false
+ 1
+
+
+ 4005
+ libtel_call_manager.z.so
+ true
+ false
+ 1
+
+
+ 4009
+ libtel_state_registry.z.so
+ true
+ false
+ 1
+
+
+ 180
+ /system/lib64/libabilityms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 182
+ /system/lib64/libdataobsms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 183
+ /system/lib64/libupms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 501
+ /system/lib64/libappms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 403
+ /system/lib64/libfms.z.so
+
+
+ true
+ false
+ 1
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/call/call.cfg b/local_coverage/resident_service/config/call/call.cfg
similarity index 97%
rename from localCoverage/resident_service/config/call/call.cfg
rename to local_coverage/resident_service/config/call/call.cfg
index 1d9a890952a2f11a381f2d5df523f82bdf13813d..093320fed8ea52e20b3c3dc1fbad9c8cffe33cfa 100644
--- a/localCoverage/resident_service/config/call/call.cfg
+++ b/local_coverage/resident_service/config/call/call.cfg
@@ -1,50 +1,50 @@
-{
- "jobs": [{
- "name": "services:call",
- "cmds": [
- "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
- "mkdir /data/storage/el1/bundle 0711 system system",
- "mkdir /data/storage/el2/base 0711 system system",
- "mkdir /data/storage/el2/database 0711 system system",
- "mkdir /data/service/el1/public/notification 0711 foundation system",
- "mkdir /data/service/el1/public/database 0711 ddms ddms",
- "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
- "chown radio system /sys/power/wake_lock",
- "chown radio system /sys/power/wake_unlock",
- "chmod 0664 /sys/power/wakeup_count"
- ]
- },{
- "name": "services:restartfoundation",
- "cmds": [
- "reset appspawn",
- "reset accountmgr"
- ]
- }
- ],
- "services": [{
- "name": "call",
- "path": ["/system/bin/sa_main", "/system/profile/call.xml"],
- "critical": [1, 1, 60],
- "importance": -20,
- "uid": "foundation",
- "permission": [
- "ohos.permission.INPUT_MONITORING",
- "ohos.permission.PERMISSION_USED_STATS",
- "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
- "ohos.permission.DISTRIBUTED_DATASYNC",
- "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
- "ohos.permission.INSTALL_BUNDLE",
- "ohos.permission.MICROPHONE"
- ],
- "gid": ["system"],
- "caps": ["SYS_PTRACE", "KILL"],
- "jobs": {
- "on-start": "services:call",
- "on-restart": "services:restartfoundation"
- },
- "secon": "u:r:foundation:s0"
- }
- ]
+{
+ "jobs": [{
+ "name": "services:call",
+ "cmds": [
+ "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
+ "mkdir /data/storage/el1/bundle 0711 system system",
+ "mkdir /data/storage/el2/base 0711 system system",
+ "mkdir /data/storage/el2/database 0711 system system",
+ "mkdir /data/service/el1/public/notification 0711 foundation system",
+ "mkdir /data/service/el1/public/database 0711 ddms ddms",
+ "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
+ "chown radio system /sys/power/wake_lock",
+ "chown radio system /sys/power/wake_unlock",
+ "chmod 0664 /sys/power/wakeup_count"
+ ]
+ },{
+ "name": "services:restartfoundation",
+ "cmds": [
+ "reset appspawn",
+ "reset accountmgr"
+ ]
+ }
+ ],
+ "services": [{
+ "name": "call",
+ "path": ["/system/bin/sa_main", "/system/profile/call.xml"],
+ "critical": [1, 1, 60],
+ "importance": -20,
+ "uid": "foundation",
+ "permission": [
+ "ohos.permission.INPUT_MONITORING",
+ "ohos.permission.PERMISSION_USED_STATS",
+ "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
+ "ohos.permission.DISTRIBUTED_DATASYNC",
+ "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
+ "ohos.permission.INSTALL_BUNDLE",
+ "ohos.permission.MICROPHONE"
+ ],
+ "gid": ["system"],
+ "caps": ["SYS_PTRACE", "KILL"],
+ "jobs": {
+ "on-start": "services:call",
+ "on-restart": "services:restartfoundation"
+ },
+ "secon": "u:r:foundation:s0"
+ }
+ ]
}
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/call/call.xml b/local_coverage/resident_service/config/call/call.xml
similarity index 97%
rename from localCoverage/resident_service/config/call/call.xml
rename to local_coverage/resident_service/config/call/call.xml
index e6f850f613dc16d0fed532b8437195b75b059868..8ac543697ab113cad9fcdb42d457a501f49c6182 100644
--- a/localCoverage/resident_service/config/call/call.xml
+++ b/local_coverage/resident_service/config/call/call.xml
@@ -1,32 +1,32 @@
-
-
-
- foundation
-
-
- libtel_call_manager.z.so
-
-
-
-
- 4005
- libtel_call_manager.z.so
- true
- false
- 1
-
-
+
+
+
+ foundation
+
+
+ libtel_call_manager.z.so
+
+
+
+
+ 4005
+ libtel_call_manager.z.so
+ true
+ false
+ 1
+
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/call/foundation.xml b/local_coverage/resident_service/config/call/foundation.xml
similarity index 97%
rename from localCoverage/resident_service/config/call/foundation.xml
rename to local_coverage/resident_service/config/call/foundation.xml
index d25e2e2c395836bc2b5ebbe3bab8682504be9489..77adc89f8b4b4218cc64a0ad77fa555f4e9bc785 100644
--- a/localCoverage/resident_service/config/call/foundation.xml
+++ b/local_coverage/resident_service/config/call/foundation.xml
@@ -1,157 +1,157 @@
-
-
-
- foundation
-
- /system/lib64/libcesfwk_services.z.so
- libans.z.so
- libbatteryservice.z.so
- libdisplaymgrservice.z.so
- libpowermgrservice.z.so
- libtel_state_registry.z.so
- /system/lib64/libabilityms.z.so
- /system/lib64/libdataobsms.z.so
- /system/lib64/libupms.z.so
- /system/lib64/libappms.z.so
- /system/lib64/libfms.z.so
- /system/lib64/libbms.z.so
- libwms.z.so
-
-
- 401
- /system/lib64/libbms.z.so
- 1301
- 60000
- true
- false
- 1
- CoreStartPhase
-
-
- 4606
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 4607
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 3299
- /system/lib64/libcesfwk_services.z.so
-
-
- true
- false
- 1
-
-
- 3203
- libans.z.so
- 1301
- 3299
- 5000
- true
- false
- 1
-
-
- 3302
- libbatteryservice.z.so
- true
- false
- 1
-
-
- 3308
- libdisplaymgrservice.z.so
-
-
- true
- false
- 1
-
-
- 3301
- libpowermgrservice.z.so
- true
- false
- 1
-
-
- 4009
- libtel_state_registry.z.so
- true
- false
- 1
-
-
- 180
- /system/lib64/libabilityms.z.so
-
-
- true
- false
- 1
-
-
- 182
- /system/lib64/libdataobsms.z.so
-
-
- true
- false
- 1
-
-
- 183
- /system/lib64/libupms.z.so
-
-
- true
- false
- 1
-
-
- 501
- /system/lib64/libappms.z.so
-
-
- true
- false
- 1
-
-
- 403
- /system/lib64/libfms.z.so
-
-
- true
- false
- 1
-
+
+
+
+ foundation
+
+ /system/lib64/libcesfwk_services.z.so
+ libans.z.so
+ libbatteryservice.z.so
+ libdisplaymgrservice.z.so
+ libpowermgrservice.z.so
+ libtel_state_registry.z.so
+ /system/lib64/libabilityms.z.so
+ /system/lib64/libdataobsms.z.so
+ /system/lib64/libupms.z.so
+ /system/lib64/libappms.z.so
+ /system/lib64/libfms.z.so
+ /system/lib64/libbms.z.so
+ libwms.z.so
+
+
+ 401
+ /system/lib64/libbms.z.so
+ 1301
+ 60000
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4606
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4607
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 3299
+ /system/lib64/libcesfwk_services.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3203
+ libans.z.so
+ 1301
+ 3299
+ 5000
+ true
+ false
+ 1
+
+
+ 3302
+ libbatteryservice.z.so
+ true
+ false
+ 1
+
+
+ 3308
+ libdisplaymgrservice.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3301
+ libpowermgrservice.z.so
+ true
+ false
+ 1
+
+
+ 4009
+ libtel_state_registry.z.so
+ true
+ false
+ 1
+
+
+ 180
+ /system/lib64/libabilityms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 182
+ /system/lib64/libdataobsms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 183
+ /system/lib64/libupms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 501
+ /system/lib64/libappms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 403
+ /system/lib64/libfms.z.so
+
+
+ true
+ false
+ 1
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/fms/fms.cfg b/local_coverage/resident_service/config/fms/fms.cfg
similarity index 97%
rename from localCoverage/resident_service/config/fms/fms.cfg
rename to local_coverage/resident_service/config/fms/fms.cfg
index fa67a1c5987c258d4135bff9580175b02d02f03e..dbdea1d172c783503f4ca60940a81be33ad31504 100644
--- a/localCoverage/resident_service/config/fms/fms.cfg
+++ b/local_coverage/resident_service/config/fms/fms.cfg
@@ -1,50 +1,50 @@
-{
- "jobs": [{
- "name": "services:fms",
- "cmds": [
- "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
- "mkdir /data/storage/el1/bundle 0711 system system",
- "mkdir /data/storage/el2/base 0711 system system",
- "mkdir /data/storage/el2/database 0711 system system",
- "mkdir /data/service/el1/public/notification 0711 foundation system",
- "mkdir /data/service/el1/public/database 0711 ddms ddms",
- "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
- "chown radio system /sys/power/wake_lock",
- "chown radio system /sys/power/wake_unlock",
- "chmod 0664 /sys/power/wakeup_count"
- ]
- },{
- "name": "services:restartfoundation",
- "cmds": [
- "reset appspawn",
- "reset accountmgr"
- ]
- }
- ],
- "services": [{
- "name": "fms",
- "path": ["/system/bin/sa_main", "/system/profile/fms.xml"],
- "critical": [1, 1, 60],
- "importance": -20,
- "uid": "foundation",
- "permission": [
- "ohos.permission.INPUT_MONITORING",
- "ohos.permission.PERMISSION_USED_STATS",
- "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
- "ohos.permission.DISTRIBUTED_DATASYNC",
- "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
- "ohos.permission.INSTALL_BUNDLE",
- "ohos.permission.MICROPHONE"
- ],
- "gid": ["system"],
- "caps": ["SYS_PTRACE", "KILL"],
- "jobs": {
- "on-start": "services:fms",
- "on-restart": "services:restartfoundation"
- },
- "secon": "u:r:foundation:s0"
- }
- ]
+{
+ "jobs": [{
+ "name": "services:fms",
+ "cmds": [
+ "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
+ "mkdir /data/storage/el1/bundle 0711 system system",
+ "mkdir /data/storage/el2/base 0711 system system",
+ "mkdir /data/storage/el2/database 0711 system system",
+ "mkdir /data/service/el1/public/notification 0711 foundation system",
+ "mkdir /data/service/el1/public/database 0711 ddms ddms",
+ "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
+ "chown radio system /sys/power/wake_lock",
+ "chown radio system /sys/power/wake_unlock",
+ "chmod 0664 /sys/power/wakeup_count"
+ ]
+ },{
+ "name": "services:restartfoundation",
+ "cmds": [
+ "reset appspawn",
+ "reset accountmgr"
+ ]
+ }
+ ],
+ "services": [{
+ "name": "fms",
+ "path": ["/system/bin/sa_main", "/system/profile/fms.xml"],
+ "critical": [1, 1, 60],
+ "importance": -20,
+ "uid": "foundation",
+ "permission": [
+ "ohos.permission.INPUT_MONITORING",
+ "ohos.permission.PERMISSION_USED_STATS",
+ "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
+ "ohos.permission.DISTRIBUTED_DATASYNC",
+ "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
+ "ohos.permission.INSTALL_BUNDLE",
+ "ohos.permission.MICROPHONE"
+ ],
+ "gid": ["system"],
+ "caps": ["SYS_PTRACE", "KILL"],
+ "jobs": {
+ "on-start": "services:fms",
+ "on-restart": "services:restartfoundation"
+ },
+ "secon": "u:r:foundation:s0"
+ }
+ ]
}
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/fms/fms.xml b/local_coverage/resident_service/config/fms/fms.xml
similarity index 97%
rename from localCoverage/resident_service/config/fms/fms.xml
rename to local_coverage/resident_service/config/fms/fms.xml
index e5f521122231cab248ee8154e62a0677b2ceb9ed..bd7a5cfb44d4b6ebdc40927f782c47ae85a6cfba 100644
--- a/localCoverage/resident_service/config/fms/fms.xml
+++ b/local_coverage/resident_service/config/fms/fms.xml
@@ -1,33 +1,33 @@
-
-
-
- foundation
-
-
- /system/lib64/libfms.z.so
-
-
-
-
- 403
- /system/lib64/libfms.z.so
-
- true
- false
- 1
-
-
+
+
+
+ foundation
+
+
+ /system/lib64/libfms.z.so
+
+
+
+
+ 403
+ /system/lib64/libfms.z.so
+
+ true
+ false
+ 1
+
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/fms/foundation.xml b/local_coverage/resident_service/config/fms/foundation.xml
similarity index 97%
rename from localCoverage/resident_service/config/fms/foundation.xml
rename to local_coverage/resident_service/config/fms/foundation.xml
index b4514eb020e506a8ef6893ed1518e5b02738923a..a34b1ba49707f76096e5918455f1c47d77b4fa77 100644
--- a/localCoverage/resident_service/config/fms/foundation.xml
+++ b/local_coverage/resident_service/config/fms/foundation.xml
@@ -1,156 +1,156 @@
-
-
-
- foundation
-
- /system/lib64/libcesfwk_services.z.so
- libans.z.so
- libbatteryservice.z.so
- libdisplaymgrservice.z.so
- libpowermgrservice.z.so
- libtel_call_manager.z.so
- libtel_state_registry.z.so
- /system/lib64/libabilityms.z.so
- /system/lib64/libdataobsms.z.so
- /system/lib64/libupms.z.so
- /system/lib64/libappms.z.so
- /system/lib64/libbms.z.so
-
- libwms.z.so
-
-
- 401
- /system/lib64/libbms.z.so
- 1301
- 60000
- true
- false
- 1
- CoreStartPhase
-
-
- 4606
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 4607
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 3299
- /system/lib64/libcesfwk_services.z.so
-
-
- true
- false
- 1
-
-
- 3203
- libans.z.so
- 1301
- 3299
- 5000
- true
- false
- 1
-
-
- 3302
- libbatteryservice.z.so
- true
- false
- 1
-
-
- 3308
- libdisplaymgrservice.z.so
-
-
- true
- false
- 1
-
-
- 3301
- libpowermgrservice.z.so
- true
- false
- 1
-
-
- 4005
- libtel_call_manager.z.so
- true
- false
- 1
-
-
- 4009
- libtel_state_registry.z.so
- true
- false
- 1
-
-
- 180
- /system/lib64/libabilityms.z.so
-
-
- true
- false
- 1
-
-
- 182
- /system/lib64/libdataobsms.z.so
-
-
- true
- false
- 1
-
-
- 183
- /system/lib64/libupms.z.so
-
-
- true
- false
- 1
-
-
- 501
- /system/lib64/libappms.z.so
-
-
- true
- false
- 1
-
+
+
+
+ foundation
+
+ /system/lib64/libcesfwk_services.z.so
+ libans.z.so
+ libbatteryservice.z.so
+ libdisplaymgrservice.z.so
+ libpowermgrservice.z.so
+ libtel_call_manager.z.so
+ libtel_state_registry.z.so
+ /system/lib64/libabilityms.z.so
+ /system/lib64/libdataobsms.z.so
+ /system/lib64/libupms.z.so
+ /system/lib64/libappms.z.so
+ /system/lib64/libbms.z.so
+
+ libwms.z.so
+
+
+ 401
+ /system/lib64/libbms.z.so
+ 1301
+ 60000
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4606
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4607
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 3299
+ /system/lib64/libcesfwk_services.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3203
+ libans.z.so
+ 1301
+ 3299
+ 5000
+ true
+ false
+ 1
+
+
+ 3302
+ libbatteryservice.z.so
+ true
+ false
+ 1
+
+
+ 3308
+ libdisplaymgrservice.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3301
+ libpowermgrservice.z.so
+ true
+ false
+ 1
+
+
+ 4005
+ libtel_call_manager.z.so
+ true
+ false
+ 1
+
+
+ 4009
+ libtel_state_registry.z.so
+ true
+ false
+ 1
+
+
+ 180
+ /system/lib64/libabilityms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 182
+ /system/lib64/libdataobsms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 183
+ /system/lib64/libupms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 501
+ /system/lib64/libappms.z.so
+
+
+ true
+ false
+ 1
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/notification/foundation.xml b/local_coverage/resident_service/config/notification/foundation.xml
similarity index 97%
rename from localCoverage/resident_service/config/notification/foundation.xml
rename to local_coverage/resident_service/config/notification/foundation.xml
index 1951918c690fac8c85822f309524079f57c76d1b..02406de124b77db6e7138b3a6e9b46d1372a1991 100644
--- a/localCoverage/resident_service/config/notification/foundation.xml
+++ b/local_coverage/resident_service/config/notification/foundation.xml
@@ -1,144 +1,144 @@
-
-
-
- foundation
-
- libbatteryservice.z.so
- libdisplaymgrservice.z.so
- libpowermgrservice.z.so
- libtel_call_manager.z.so
- libtel_state_registry.z.so
- /system/lib64/libabilityms.z.so
- /system/lib64/libdataobsms.z.so
- /system/lib64/libupms.z.so
- /system/lib64/libappms.z.so
- /system/lib64/libfms.z.so
- /system/lib64/libbms.z.so
- libwms.z.so
-
-
- 401
- /system/lib64/libbms.z.so
- 1301
- 60000
- true
- false
- 1
- CoreStartPhase
-
-
- 4606
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 4607
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 3302
- libbatteryservice.z.so
- true
- false
- 1
-
-
- 3308
- libdisplaymgrservice.z.so
-
-
- true
- false
- 1
-
-
- 3301
- libpowermgrservice.z.so
- true
- false
- 1
-
-
- 4005
- libtel_call_manager.z.so
- true
- false
- 1
-
-
- 4009
- libtel_state_registry.z.so
- true
- false
- 1
-
-
- 180
- /system/lib64/libabilityms.z.so
-
-
- true
- false
- 1
-
-
- 182
- /system/lib64/libdataobsms.z.so
-
-
- true
- false
- 1
-
-
- 183
- /system/lib64/libupms.z.so
-
-
- true
- false
- 1
-
-
- 501
- /system/lib64/libappms.z.so
-
-
- true
- false
- 1
-
-
- 403
- /system/lib64/libfms.z.so
-
-
- true
- false
- 1
-
+
+
+
+ foundation
+
+ libbatteryservice.z.so
+ libdisplaymgrservice.z.so
+ libpowermgrservice.z.so
+ libtel_call_manager.z.so
+ libtel_state_registry.z.so
+ /system/lib64/libabilityms.z.so
+ /system/lib64/libdataobsms.z.so
+ /system/lib64/libupms.z.so
+ /system/lib64/libappms.z.so
+ /system/lib64/libfms.z.so
+ /system/lib64/libbms.z.so
+ libwms.z.so
+
+
+ 401
+ /system/lib64/libbms.z.so
+ 1301
+ 60000
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4606
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4607
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 3302
+ libbatteryservice.z.so
+ true
+ false
+ 1
+
+
+ 3308
+ libdisplaymgrservice.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3301
+ libpowermgrservice.z.so
+ true
+ false
+ 1
+
+
+ 4005
+ libtel_call_manager.z.so
+ true
+ false
+ 1
+
+
+ 4009
+ libtel_state_registry.z.so
+ true
+ false
+ 1
+
+
+ 180
+ /system/lib64/libabilityms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 182
+ /system/lib64/libdataobsms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 183
+ /system/lib64/libupms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 501
+ /system/lib64/libappms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 403
+ /system/lib64/libfms.z.so
+
+
+ true
+ false
+ 1
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/notification/notification.cfg b/local_coverage/resident_service/config/notification/notification.cfg
similarity index 97%
rename from localCoverage/resident_service/config/notification/notification.cfg
rename to local_coverage/resident_service/config/notification/notification.cfg
index 19528f26aa3befa4779cc75b50ce4f1170c73f5c..1f63d8126b9634143c96211dbbb089cb8d54c488 100644
--- a/localCoverage/resident_service/config/notification/notification.cfg
+++ b/local_coverage/resident_service/config/notification/notification.cfg
@@ -1,50 +1,50 @@
-{
- "jobs": [{
- "name": "services:notification",
- "cmds": [
- "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
- "mkdir /data/storage/el1/bundle 0711 system system",
- "mkdir /data/storage/el2/base 0711 system system",
- "mkdir /data/storage/el2/database 0711 system system",
- "mkdir /data/service/el1/public/notification 0711 foundation system",
- "mkdir /data/service/el1/public/database 0711 ddms ddms",
- "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
- "chown radio system /sys/power/wake_lock",
- "chown radio system /sys/power/wake_unlock",
- "chmod 0664 /sys/power/wakeup_count"
- ]
- },{
- "name": "services:restartfoundation",
- "cmds": [
- "reset appspawn",
- "reset accountmgr"
- ]
- }
- ],
- "services": [{
- "name": "notification",
- "path": ["/system/bin/sa_main", "/system/profile/notification.xml"],
- "critical": [1, 1, 60],
- "importance": -20,
- "uid": "foundation",
- "permission": [
- "ohos.permission.INPUT_MONITORING",
- "ohos.permission.PERMISSION_USED_STATS",
- "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
- "ohos.permission.DISTRIBUTED_DATASYNC",
- "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
- "ohos.permission.INSTALL_BUNDLE",
- "ohos.permission.MICROPHONE"
- ],
- "gid": ["system"],
- "caps": ["SYS_PTRACE", "KILL"],
- "jobs": {
- "on-start": "services:notification",
- "on-restart": "services:restartfoundation"
- },
- "secon": "u:r:foundation:s0"
- }
- ]
+{
+ "jobs": [{
+ "name": "services:notification",
+ "cmds": [
+ "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
+ "mkdir /data/storage/el1/bundle 0711 system system",
+ "mkdir /data/storage/el2/base 0711 system system",
+ "mkdir /data/storage/el2/database 0711 system system",
+ "mkdir /data/service/el1/public/notification 0711 foundation system",
+ "mkdir /data/service/el1/public/database 0711 ddms ddms",
+ "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
+ "chown radio system /sys/power/wake_lock",
+ "chown radio system /sys/power/wake_unlock",
+ "chmod 0664 /sys/power/wakeup_count"
+ ]
+ },{
+ "name": "services:restartfoundation",
+ "cmds": [
+ "reset appspawn",
+ "reset accountmgr"
+ ]
+ }
+ ],
+ "services": [{
+ "name": "notification",
+ "path": ["/system/bin/sa_main", "/system/profile/notification.xml"],
+ "critical": [1, 1, 60],
+ "importance": -20,
+ "uid": "foundation",
+ "permission": [
+ "ohos.permission.INPUT_MONITORING",
+ "ohos.permission.PERMISSION_USED_STATS",
+ "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
+ "ohos.permission.DISTRIBUTED_DATASYNC",
+ "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
+ "ohos.permission.INSTALL_BUNDLE",
+ "ohos.permission.MICROPHONE"
+ ],
+ "gid": ["system"],
+ "caps": ["SYS_PTRACE", "KILL"],
+ "jobs": {
+ "on-start": "services:notification",
+ "on-restart": "services:restartfoundation"
+ },
+ "secon": "u:r:foundation:s0"
+ }
+ ]
}
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/notification/notification.xml b/local_coverage/resident_service/config/notification/notification.xml
similarity index 97%
rename from localCoverage/resident_service/config/notification/notification.xml
rename to local_coverage/resident_service/config/notification/notification.xml
index cc6ad897955ee0835f6e2d6d3faa86ad9e7fabac..72b739478ab2428406e4252139925bc076282482 100644
--- a/localCoverage/resident_service/config/notification/notification.xml
+++ b/local_coverage/resident_service/config/notification/notification.xml
@@ -1,44 +1,44 @@
-
-
-
- foundation
-
-
- /system/lib64/libcesfwk_services.z.so
- libans.z.so
-
-
-
- 3299
- /system/lib64/libcesfwk_services.z.so
-
-
- true
- false
- 1
-
-
- 3203
- libans.z.so
- 1301
- 3299
- 5000
- true
- false
- 1
-
-
+
+
+
+ foundation
+
+
+ /system/lib64/libcesfwk_services.z.so
+ libans.z.so
+
+
+
+ 3299
+ /system/lib64/libcesfwk_services.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3203
+ libans.z.so
+ 1301
+ 3299
+ 5000
+ true
+ false
+ 1
+
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/power/foundation.xml b/local_coverage/resident_service/config/power/foundation.xml
similarity index 97%
rename from localCoverage/resident_service/config/power/foundation.xml
rename to local_coverage/resident_service/config/power/foundation.xml
index 38a0e7f18b543ae785cff7ce94362d235f174864..b35a8c07b0f2e94177d1739df17238496652695b 100644
--- a/localCoverage/resident_service/config/power/foundation.xml
+++ b/local_coverage/resident_service/config/power/foundation.xml
@@ -1,139 +1,139 @@
-
-
-
- foundation
-
- /system/lib64/libcesfwk_services.z.so
- libans.z.so
- libtel_call_manager.z.so
- libtel_state_registry.z.so
- /system/lib64/libabilityms.z.so
- /system/lib64/libdataobsms.z.so
- /system/lib64/libupms.z.so
- /system/lib64/libappms.z.so
- /system/lib64/libfms.z.so
- /system/lib64/libbms.z.so
- libwms.z.so
-
-
- 401
- /system/lib64/libbms.z.so
- 1301
- 60000
- true
- false
- 1
- CoreStartPhase
-
-
- 4606
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 4607
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 3299
- /system/lib64/libcesfwk_services.z.so
-
-
- true
- false
- 1
-
-
- 3203
- libans.z.so
- 1301
- 3299
- 5000
- true
- false
- 1
-
-
- 4005
- libtel_call_manager.z.so
- true
- false
- 1
-
-
- 4009
- libtel_state_registry.z.so
- true
- false
- 1
-
-
- 180
- /system/lib64/libabilityms.z.so
-
-
- true
- false
- 1
-
-
- 182
- /system/lib64/libdataobsms.z.so
-
-
- true
- false
- 1
-
-
- 183
- /system/lib64/libupms.z.so
-
-
- true
- false
- 1
-
-
- 501
- /system/lib64/libappms.z.so
-
-
- true
- false
- 1
-
-
- 403
- /system/lib64/libfms.z.so
-
-
- true
- false
- 1
-
+
+
+
+ foundation
+
+ /system/lib64/libcesfwk_services.z.so
+ libans.z.so
+ libtel_call_manager.z.so
+ libtel_state_registry.z.so
+ /system/lib64/libabilityms.z.so
+ /system/lib64/libdataobsms.z.so
+ /system/lib64/libupms.z.so
+ /system/lib64/libappms.z.so
+ /system/lib64/libfms.z.so
+ /system/lib64/libbms.z.so
+ libwms.z.so
+
+
+ 401
+ /system/lib64/libbms.z.so
+ 1301
+ 60000
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4606
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4607
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 3299
+ /system/lib64/libcesfwk_services.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3203
+ libans.z.so
+ 1301
+ 3299
+ 5000
+ true
+ false
+ 1
+
+
+ 4005
+ libtel_call_manager.z.so
+ true
+ false
+ 1
+
+
+ 4009
+ libtel_state_registry.z.so
+ true
+ false
+ 1
+
+
+ 180
+ /system/lib64/libabilityms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 182
+ /system/lib64/libdataobsms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 183
+ /system/lib64/libupms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 501
+ /system/lib64/libappms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 403
+ /system/lib64/libfms.z.so
+
+
+ true
+ false
+ 1
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/power/power.cfg b/local_coverage/resident_service/config/power/power.cfg
similarity index 97%
rename from localCoverage/resident_service/config/power/power.cfg
rename to local_coverage/resident_service/config/power/power.cfg
index 216fd2778f69cb78d539373ab315a96a09584c1d..d7c97e9e0e7d2635e95fa63e865b1fab8b5a744d 100644
--- a/localCoverage/resident_service/config/power/power.cfg
+++ b/local_coverage/resident_service/config/power/power.cfg
@@ -1,50 +1,50 @@
-{
- "jobs": [{
- "name": "services:power",
- "cmds": [
- "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
- "mkdir /data/storage/el1/bundle 0711 system system",
- "mkdir /data/storage/el2/base 0711 system system",
- "mkdir /data/storage/el2/database 0711 system system",
- "mkdir /data/service/el1/public/notification 0711 foundation system",
- "mkdir /data/service/el1/public/database 0711 ddms ddms",
- "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
- "chown radio system /sys/power/wake_lock",
- "chown radio system /sys/power/wake_unlock",
- "chmod 0664 /sys/power/wakeup_count"
- ]
- },{
- "name": "services:restartfoundation",
- "cmds": [
- "reset appspawn",
- "reset accountmgr"
- ]
- }
- ],
- "services": [{
- "name": "power",
- "path": ["/system/bin/sa_main", "/system/profile/power.xml"],
- "critical": [1, 1, 60],
- "importance": -20,
- "uid": "foundation",
- "permission": [
- "ohos.permission.INPUT_MONITORING",
- "ohos.permission.PERMISSION_USED_STATS",
- "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
- "ohos.permission.DISTRIBUTED_DATASYNC",
- "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
- "ohos.permission.INSTALL_BUNDLE",
- "ohos.permission.MICROPHONE"
- ],
- "gid": ["system"],
- "caps": ["SYS_PTRACE", "KILL"],
- "jobs": {
- "on-start": "services:power",
- "on-restart": "services:restartfoundation"
- },
- "secon": "u:r:foundation:s0"
- }
- ]
+{
+ "jobs": [{
+ "name": "services:power",
+ "cmds": [
+ "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
+ "mkdir /data/storage/el1/bundle 0711 system system",
+ "mkdir /data/storage/el2/base 0711 system system",
+ "mkdir /data/storage/el2/database 0711 system system",
+ "mkdir /data/service/el1/public/notification 0711 foundation system",
+ "mkdir /data/service/el1/public/database 0711 ddms ddms",
+ "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
+ "chown radio system /sys/power/wake_lock",
+ "chown radio system /sys/power/wake_unlock",
+ "chmod 0664 /sys/power/wakeup_count"
+ ]
+ },{
+ "name": "services:restartfoundation",
+ "cmds": [
+ "reset appspawn",
+ "reset accountmgr"
+ ]
+ }
+ ],
+ "services": [{
+ "name": "power",
+ "path": ["/system/bin/sa_main", "/system/profile/power.xml"],
+ "critical": [1, 1, 60],
+ "importance": -20,
+ "uid": "foundation",
+ "permission": [
+ "ohos.permission.INPUT_MONITORING",
+ "ohos.permission.PERMISSION_USED_STATS",
+ "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
+ "ohos.permission.DISTRIBUTED_DATASYNC",
+ "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
+ "ohos.permission.INSTALL_BUNDLE",
+ "ohos.permission.MICROPHONE"
+ ],
+ "gid": ["system"],
+ "caps": ["SYS_PTRACE", "KILL"],
+ "jobs": {
+ "on-start": "services:power",
+ "on-restart": "services:restartfoundation"
+ },
+ "secon": "u:r:foundation:s0"
+ }
+ ]
}
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/power/power.xml b/local_coverage/resident_service/config/power/power.xml
similarity index 97%
rename from localCoverage/resident_service/config/power/power.xml
rename to local_coverage/resident_service/config/power/power.xml
index 04e901a21682c5190103e4f3d241509f36ca5eb1..20a473b1b1f3c6d96e8b28d285a799d1658fe45a 100644
--- a/localCoverage/resident_service/config/power/power.xml
+++ b/local_coverage/resident_service/config/power/power.xml
@@ -1,64 +1,64 @@
-
-
-
- foundation
-
-
- libbatteryservice.z.so
- libdisplaymgrservice.z.so
- libpowermgrservice.z.so
- libthermalservice.z.so
- libbatterystats_service.z.so
-
-
-
-
- 3302
- libbatteryservice.z.so
- true
- false
- 1
-
-
- 3308
- libdisplaymgrservice.z.so
- true
- false
- 1
-
-
- 3301
- libpowermgrservice.z.so
- true
- false
- 1
-
-
- 3303
- libthermalservice.z.so
- true
- false
- 1
-
-
- 3304
- libbatterystats_service.z.so
- true
- false
- 1
-
-
+
+
+
+ foundation
+
+
+ libbatteryservice.z.so
+ libdisplaymgrservice.z.so
+ libpowermgrservice.z.so
+ libthermalservice.z.so
+ libbatterystats_service.z.so
+
+
+
+
+ 3302
+ libbatteryservice.z.so
+ true
+ false
+ 1
+
+
+ 3308
+ libdisplaymgrservice.z.so
+ true
+ false
+ 1
+
+
+ 3301
+ libpowermgrservice.z.so
+ true
+ false
+ 1
+
+
+ 3303
+ libthermalservice.z.so
+ true
+ false
+ 1
+
+
+ 3304
+ libbatterystats_service.z.so
+ true
+ false
+ 1
+
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/state/foundation.xml b/local_coverage/resident_service/config/state/foundation.xml
similarity index 97%
rename from localCoverage/resident_service/config/state/foundation.xml
rename to local_coverage/resident_service/config/state/foundation.xml
index 864ada0fb74db8c1bd21f9f5765588e6328158e1..e2271096eb05c3c3704ea254513db22c65e9c813 100644
--- a/localCoverage/resident_service/config/state/foundation.xml
+++ b/local_coverage/resident_service/config/state/foundation.xml
@@ -1,157 +1,157 @@
-
-
-
- foundation
-
- /system/lib64/libcesfwk_services.z.so
- libans.z.so
- libbatteryservice.z.so
- libdisplaymgrservice.z.so
- libpowermgrservice.z.so
- libtel_call_manager.z.so
- /system/lib64/libabilityms.z.so
- /system/lib64/libdataobsms.z.so
- /system/lib64/libupms.z.so
- /system/lib64/libappms.z.so
- /system/lib64/libfms.z.so
- /system/lib64/libbms.z.so
- libwms.z.so
-
-
- 401
- /system/lib64/libbms.z.so
- 1301
- 60000
- true
- false
- 1
- CoreStartPhase
-
-
- 4606
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 4607
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 3299
- /system/lib64/libcesfwk_services.z.so
-
-
- true
- false
- 1
-
-
- 3203
- libans.z.so
- 1301
- 3299
- 5000
- true
- false
- 1
-
-
- 3302
- libbatteryservice.z.so
- true
- false
- 1
-
-
- 3308
- libdisplaymgrservice.z.so
-
-
- true
- false
- 1
-
-
- 3301
- libpowermgrservice.z.so
- true
- false
- 1
-
-
- 4005
- libtel_call_manager.z.so
- true
- false
- 1
-
-
- 180
- /system/lib64/libabilityms.z.so
-
-
- true
- false
- 1
-
-
- 182
- /system/lib64/libdataobsms.z.so
-
-
- true
- false
- 1
-
-
- 183
- /system/lib64/libupms.z.so
-
-
- true
- false
- 1
-
-
- 501
- /system/lib64/libappms.z.so
-
-
- true
- false
- 1
-
-
- 403
- /system/lib64/libfms.z.so
-
-
- true
- false
- 1
-
+
+
+
+ foundation
+
+ /system/lib64/libcesfwk_services.z.so
+ libans.z.so
+ libbatteryservice.z.so
+ libdisplaymgrservice.z.so
+ libpowermgrservice.z.so
+ libtel_call_manager.z.so
+ /system/lib64/libabilityms.z.so
+ /system/lib64/libdataobsms.z.so
+ /system/lib64/libupms.z.so
+ /system/lib64/libappms.z.so
+ /system/lib64/libfms.z.so
+ /system/lib64/libbms.z.so
+ libwms.z.so
+
+
+ 401
+ /system/lib64/libbms.z.so
+ 1301
+ 60000
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4606
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4607
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 3299
+ /system/lib64/libcesfwk_services.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3203
+ libans.z.so
+ 1301
+ 3299
+ 5000
+ true
+ false
+ 1
+
+
+ 3302
+ libbatteryservice.z.so
+ true
+ false
+ 1
+
+
+ 3308
+ libdisplaymgrservice.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3301
+ libpowermgrservice.z.so
+ true
+ false
+ 1
+
+
+ 4005
+ libtel_call_manager.z.so
+ true
+ false
+ 1
+
+
+ 180
+ /system/lib64/libabilityms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 182
+ /system/lib64/libdataobsms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 183
+ /system/lib64/libupms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 501
+ /system/lib64/libappms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 403
+ /system/lib64/libfms.z.so
+
+
+ true
+ false
+ 1
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/state/state.cfg b/local_coverage/resident_service/config/state/state.cfg
similarity index 97%
rename from localCoverage/resident_service/config/state/state.cfg
rename to local_coverage/resident_service/config/state/state.cfg
index 95c3172518556f13d90d8169d2e3d497f03352bb..a3d88b21b5e333b99a2d8ed6dd273e315db27cd1 100644
--- a/localCoverage/resident_service/config/state/state.cfg
+++ b/local_coverage/resident_service/config/state/state.cfg
@@ -1,50 +1,50 @@
-{
- "jobs": [{
- "name": "services:state",
- "cmds": [
- "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
- "mkdir /data/storage/el1/bundle 0711 system system",
- "mkdir /data/storage/el2/base 0711 system system",
- "mkdir /data/storage/el2/database 0711 system system",
- "mkdir /data/service/el1/public/notification 0711 foundation system",
- "mkdir /data/service/el1/public/database 0711 ddms ddms",
- "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
- "chown radio system /sys/power/wake_lock",
- "chown radio system /sys/power/wake_unlock",
- "chmod 0664 /sys/power/wakeup_count"
- ]
- },{
- "name": "services:restartfoundation",
- "cmds": [
- "reset appspawn",
- "reset accountmgr"
- ]
- }
- ],
- "services": [{
- "name": "state",
- "path": ["/system/bin/sa_main", "/system/profile/state.xml"],
- "critical": [1, 1, 60],
- "importance": -20,
- "uid": "foundation",
- "permission": [
- "ohos.permission.INPUT_MONITORING",
- "ohos.permission.PERMISSION_USED_STATS",
- "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
- "ohos.permission.DISTRIBUTED_DATASYNC",
- "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
- "ohos.permission.INSTALL_BUNDLE",
- "ohos.permission.MICROPHONE"
- ],
- "gid": ["system"],
- "caps": ["SYS_PTRACE", "KILL"],
- "jobs": {
- "on-start": "services:state",
- "on-restart": "services:restartfoundation"
- },
- "secon": "u:r:foundation:s0"
- }
- ]
+{
+ "jobs": [{
+ "name": "services:state",
+ "cmds": [
+ "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
+ "mkdir /data/storage/el1/bundle 0711 system system",
+ "mkdir /data/storage/el2/base 0711 system system",
+ "mkdir /data/storage/el2/database 0711 system system",
+ "mkdir /data/service/el1/public/notification 0711 foundation system",
+ "mkdir /data/service/el1/public/database 0711 ddms ddms",
+ "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
+ "chown radio system /sys/power/wake_lock",
+ "chown radio system /sys/power/wake_unlock",
+ "chmod 0664 /sys/power/wakeup_count"
+ ]
+ },{
+ "name": "services:restartfoundation",
+ "cmds": [
+ "reset appspawn",
+ "reset accountmgr"
+ ]
+ }
+ ],
+ "services": [{
+ "name": "state",
+ "path": ["/system/bin/sa_main", "/system/profile/state.xml"],
+ "critical": [1, 1, 60],
+ "importance": -20,
+ "uid": "foundation",
+ "permission": [
+ "ohos.permission.INPUT_MONITORING",
+ "ohos.permission.PERMISSION_USED_STATS",
+ "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
+ "ohos.permission.DISTRIBUTED_DATASYNC",
+ "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
+ "ohos.permission.INSTALL_BUNDLE",
+ "ohos.permission.MICROPHONE"
+ ],
+ "gid": ["system"],
+ "caps": ["SYS_PTRACE", "KILL"],
+ "jobs": {
+ "on-start": "services:state",
+ "on-restart": "services:restartfoundation"
+ },
+ "secon": "u:r:foundation:s0"
+ }
+ ]
}
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/state/state.xml b/local_coverage/resident_service/config/state/state.xml
similarity index 97%
rename from localCoverage/resident_service/config/state/state.xml
rename to local_coverage/resident_service/config/state/state.xml
index 511d52f5298b4fec2207cf5f7b5754fbc9614b8e..8f3bef8f10cbe383bb0d6e56bc8c43ccabbc704d 100644
--- a/localCoverage/resident_service/config/state/state.xml
+++ b/local_coverage/resident_service/config/state/state.xml
@@ -1,33 +1,33 @@
-
-
-
-
- foundation
-
-
- libtel_state_registry.z.so
-
-
-
-
- 4009
- libtel_state_registry.z.so
- true
- false
- 1
-
-
+
+
+
+
+ foundation
+
+
+ libtel_state_registry.z.so
+
+
+
+
+ 4009
+ libtel_state_registry.z.so
+ true
+ false
+ 1
+
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/wms/foundation.xml b/local_coverage/resident_service/config/wms/foundation.xml
similarity index 97%
rename from localCoverage/resident_service/config/wms/foundation.xml
rename to local_coverage/resident_service/config/wms/foundation.xml
index 9cc08186b2ef05e54d55dac26bf2d2af2a436601..2baf1842789e7f75c269843deda789acb45bbbd3 100644
--- a/localCoverage/resident_service/config/wms/foundation.xml
+++ b/local_coverage/resident_service/config/wms/foundation.xml
@@ -1,146 +1,146 @@
-
-
-
- foundation
-
- /system/lib64/libcesfwk_services.z.so
- libans.z.so
- libbatteryservice.z.so
- libdisplaymgrservice.z.so
- libpowermgrservice.z.so
- libtel_call_manager.z.so
- libtel_state_registry.z.so
- /system/lib64/libabilityms.z.so
- /system/lib64/libdataobsms.z.so
- /system/lib64/libupms.z.so
- /system/lib64/libappms.z.so
- /system/lib64/libfms.z.so
- /system/lib64/libbms.z.so
-
-
-
-
- 401
- /system/lib64/libbms.z.so
- 1301
- 60000
- true
- false
- 1
- CoreStartPhase
-
-
- 3299
- /system/lib64/libcesfwk_services.z.so
-
-
- true
- false
- 1
-
-
- 3203
- libans.z.so
- 1301
- 3299
- 5000
- true
- false
- 1
-
-
- 3302
- libbatteryservice.z.so
- true
- false
- 1
-
-
- 3308
- libdisplaymgrservice.z.so
-
-
- true
- false
- 1
-
-
- 3301
- libpowermgrservice.z.so
- true
- false
- 1
-
-
- 4005
- libtel_call_manager.z.so
- true
- false
- 1
-
-
- 4009
- libtel_state_registry.z.so
- true
- false
- 1
-
-
- 180
- /system/lib64/libabilityms.z.so
-
-
- true
- false
- 1
-
-
- 182
- /system/lib64/libdataobsms.z.so
-
-
- true
- false
- 1
-
-
- 183
- /system/lib64/libupms.z.so
-
-
- true
- false
- 1
-
-
- 501
- /system/lib64/libappms.z.so
-
-
- true
- false
- 1
-
-
- 403
- /system/lib64/libfms.z.so
-
-
- true
- false
- 1
-
+
+
+
+ foundation
+
+ /system/lib64/libcesfwk_services.z.so
+ libans.z.so
+ libbatteryservice.z.so
+ libdisplaymgrservice.z.so
+ libpowermgrservice.z.so
+ libtel_call_manager.z.so
+ libtel_state_registry.z.so
+ /system/lib64/libabilityms.z.so
+ /system/lib64/libdataobsms.z.so
+ /system/lib64/libupms.z.so
+ /system/lib64/libappms.z.so
+ /system/lib64/libfms.z.so
+ /system/lib64/libbms.z.so
+
+
+
+
+ 401
+ /system/lib64/libbms.z.so
+ 1301
+ 60000
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 3299
+ /system/lib64/libcesfwk_services.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3203
+ libans.z.so
+ 1301
+ 3299
+ 5000
+ true
+ false
+ 1
+
+
+ 3302
+ libbatteryservice.z.so
+ true
+ false
+ 1
+
+
+ 3308
+ libdisplaymgrservice.z.so
+
+
+ true
+ false
+ 1
+
+
+ 3301
+ libpowermgrservice.z.so
+ true
+ false
+ 1
+
+
+ 4005
+ libtel_call_manager.z.so
+ true
+ false
+ 1
+
+
+ 4009
+ libtel_state_registry.z.so
+ true
+ false
+ 1
+
+
+ 180
+ /system/lib64/libabilityms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 182
+ /system/lib64/libdataobsms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 183
+ /system/lib64/libupms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 501
+ /system/lib64/libappms.z.so
+
+
+ true
+ false
+ 1
+
+
+ 403
+ /system/lib64/libfms.z.so
+
+
+ true
+ false
+ 1
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/wms/wms.cfg b/local_coverage/resident_service/config/wms/wms.cfg
similarity index 97%
rename from localCoverage/resident_service/config/wms/wms.cfg
rename to local_coverage/resident_service/config/wms/wms.cfg
index 8c8ccfcddd1d41a51a0fdaebb01b5d2cffd06548..468cb03792f7ea521893804e04c54354fcda53c8 100644
--- a/localCoverage/resident_service/config/wms/wms.cfg
+++ b/local_coverage/resident_service/config/wms/wms.cfg
@@ -1,50 +1,50 @@
-{
- "jobs": [{
- "name": "services:wms",
- "cmds": [
- "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
- "mkdir /data/storage/el1/bundle 0711 system system",
- "mkdir /data/storage/el2/base 0711 system system",
- "mkdir /data/storage/el2/database 0711 system system",
- "mkdir /data/service/el1/public/notification 0711 foundation system",
- "mkdir /data/service/el1/public/database 0711 ddms ddms",
- "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
- "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
- "chown radio system /sys/power/wake_lock",
- "chown radio system /sys/power/wake_unlock",
- "chmod 0664 /sys/power/wakeup_count"
- ]
- },{
- "name": "services:restartfoundation",
- "cmds": [
- "reset appspawn",
- "reset accountmgr"
- ]
- }
- ],
- "services": [{
- "name": "wms",
- "path": ["/system/bin/sa_main", "/system/profile/wms.xml"],
- "critical": [1, 1, 60],
- "importance": -20,
- "uid": "foundation",
- "permission": [
- "ohos.permission.INPUT_MONITORING",
- "ohos.permission.PERMISSION_USED_STATS",
- "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
- "ohos.permission.DISTRIBUTED_DATASYNC",
- "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
- "ohos.permission.INSTALL_BUNDLE",
- "ohos.permission.MICROPHONE"
- ],
- "gid": ["system"],
- "caps": ["SYS_PTRACE", "KILL"],
- "jobs": {
- "on-start": "services:wms",
- "on-restart": "services:restartfoundation"
- },
- "secon": "u:r:foundation:s0"
- }
- ]
+{
+ "jobs": [{
+ "name": "services:wms",
+ "cmds": [
+ "mkdir /data/service/el1/public/AbilityManagerService 0711 foundation system",
+ "mkdir /data/storage/el1/bundle 0711 system system",
+ "mkdir /data/storage/el2/base 0711 system system",
+ "mkdir /data/storage/el2/database 0711 system system",
+ "mkdir /data/service/el1/public/notification 0711 foundation system",
+ "mkdir /data/service/el1/public/database 0711 ddms ddms",
+ "mkdir /data/service/el1/public/database/bundle_manager_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/notification_service 02770 foundation ddms",
+ "mkdir /data/service/el1/public/database/form_storage 02770 foundation ddms",
+ "chown radio system /sys/power/wake_lock",
+ "chown radio system /sys/power/wake_unlock",
+ "chmod 0664 /sys/power/wakeup_count"
+ ]
+ },{
+ "name": "services:restartfoundation",
+ "cmds": [
+ "reset appspawn",
+ "reset accountmgr"
+ ]
+ }
+ ],
+ "services": [{
+ "name": "wms",
+ "path": ["/system/bin/sa_main", "/system/profile/wms.xml"],
+ "critical": [1, 1, 60],
+ "importance": -20,
+ "uid": "foundation",
+ "permission": [
+ "ohos.permission.INPUT_MONITORING",
+ "ohos.permission.PERMISSION_USED_STATS",
+ "ohos.permission.DISTRIBUTED_SOFTBUS_CENTER",
+ "ohos.permission.DISTRIBUTED_DATASYNC",
+ "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
+ "ohos.permission.INSTALL_BUNDLE",
+ "ohos.permission.MICROPHONE"
+ ],
+ "gid": ["system"],
+ "caps": ["SYS_PTRACE", "KILL"],
+ "jobs": {
+ "on-start": "services:wms",
+ "on-restart": "services:restartfoundation"
+ },
+ "secon": "u:r:foundation:s0"
+ }
+ ]
}
\ No newline at end of file
diff --git a/localCoverage/resident_service/config/wms/wms.xml b/local_coverage/resident_service/config/wms/wms.xml
similarity index 96%
rename from localCoverage/resident_service/config/wms/wms.xml
rename to local_coverage/resident_service/config/wms/wms.xml
index 826c37f4c51bfb2cc336d350d66cf53d9fa3f354..2160704dd4da1efd90001cced4d4a087b3965c58 100644
--- a/localCoverage/resident_service/config/wms/wms.xml
+++ b/local_coverage/resident_service/config/wms/wms.xml
@@ -1,45 +1,45 @@
-
-
-
- foundation
-
-
- libwms.z.so
-
-
-
-
- 4606
- libwms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
- 4607
- libdms.z.so
-
-
- true
- false
- 1
- CoreStartPhase
-
-
+
+
+
+ foundation
+
+
+ libwms.z.so
+
+
+
+
+ 4606
+ libwms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
+ 4607
+ libdms.z.so
+
+
+ true
+ false
+ 1
+ CoreStartPhase
+
+
\ No newline at end of file
diff --git a/localCoverage/resident_service/init_gcov.py b/local_coverage/resident_service/init_gcov.py
similarity index 95%
rename from localCoverage/resident_service/init_gcov.py
rename to local_coverage/resident_service/init_gcov.py
index f6ef3206ab914dbff6cd3fa6f2f91e21b0edb21e..a368845c6a4089ead019d73948295cd1d3f8cdba 100644
--- a/localCoverage/resident_service/init_gcov.py
+++ b/local_coverage/resident_service/init_gcov.py
@@ -1,368 +1,368 @@
-#!/usr/bin/env python3
-# coding=utf-8
-
-#
-# Copyright (c) 2020-2023 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-import os
-import shutil
-import subprocess
-import json
-import sys
-import time
-import xml.etree.ElementTree as ET
-from public_method import get_server_dict, get_config_ip, get_sn_list
-import stat
-
-FLAGS = os.O_WRONLY | os.O_CREAT | os.O_EXCL
-MODES = stat.S_IWUSR | stat.S_IRUSR
-
-
-def _init_sys_config():
- sys.localcoverage_path = os.path.join(current_path, "..")
- sys.path.insert(0, sys.localcoverage_path)
-
-
-def modify_init_file(developer_path, hdc_str):
- """
- /etc/init.cfg文件添加cmds
- """
- recv_path = os.path.join(developer_path, "localCoverage/resident_service/resources")
- print("%s file recv /etc/init.cfg %s" % (hdc_str, recv_path))
- coverage_command("%s file recv /etc/init.cfg %s" % (hdc_str, recv_path))
- recv_restores_path = os.path.join(recv_path, "restores_environment")
- if not os.path.exists(recv_restores_path):
- os.mkdir(recv_restores_path)
- recv_restores_name = os.path.join(recv_restores_path, "init.cfg")
- if not os.path.exists(recv_restores_name):
- coverage_command("%s file recv /etc/init.cfg %s" % (hdc_str, recv_restores_path))
- else:
- print("INFO: file exit", recv_restores_name)
-
- cfg_file_path = os.path.join(recv_path, "init.cfg")
- if os.path.exists(cfg_file_path):
- with open(cfg_file_path, "r") as fp:
- json_data = json.load(fp)
-
- for jobs_list in json_data["jobs"]:
- if jobs_list["name"] == "init":
- if jobs_list["cmds"][-1] != "export GCOV_FETCH_METHOD FM_SIGNA":
- jobs_list["cmds"].append("mkdir /data/gcov 0777 system system")
- jobs_list["cmds"].append("export GCOV_PREFIX /data/gcov")
- jobs_list["cmds"].append("export GCOV_FETCH_METHOD FM_SIGNA")
- else:
- return
- json_str = json.dumps(json_data, indent=2)
- if os.path.exists(cfg_file_path):
- os.remove(cfg_file_path)
- with os.fdopen(os.open(cfg_file_path, FLAGS, MODES), 'w') as json_file:
- json_file.write(json_str)
- else:
- print("init.cfg file not exists")
- return
- print("%s shell mount -o rw,remount / > /dev/null 2>&1" % hdc_str)
- coverage_command("%s shell mount -o rw,remount / > /dev/null 2>&1" % hdc_str)
- print(""%s target mount" % hdc_str)
- coverage_command("%s target mount" % hdc_str)
- print("%s file send %s %s" % (hdc_str, cfg_file_path, "/etc/"))
- coverage_command("%s file send %s %s" % (hdc_str, cfg_file_path, "/etc/"))
- coverage_command("%s shell param set persist.appspawn.client.timeout 120 > /dev/null 2>&1" % hdc_str)
- return
-
-
-def modify_faultloggerd_file(developer_path, hdc_str):
- _, enforce = subprocess.getstatusoutput("%s shell getenforce" % hdc_str)
- coverage_command("%s shell mount -o rw,remount /" % hdc_str)
- print("%s shell mount -o rw,remount /" % hdc_str)
- coverage_command("%s target mount" % hdc_str)
- if enforce != "Permissive":
- coverage_command("%s shell sed -i 's/enforcing/permissive/g' /system/etc/selinux/config" % hdc_str)
-
- recv_path = os.path.join(developer_path, "localCoverage/resident_service/resources")
- print("%s file recv /system/etc/init/faultloggerd.cfg %s" % (hdc_str, recv_path))
- coverage_command("%s file recv /system/etc/init/faultloggerd.cfg %s" % (hdc_str, recv_path))
-
- cfg_file_path = os.path.join(recv_path, "faultloggerd.cfg")
- if os.path.exists(cfg_file_path):
- with open(cfg_file_path, "r") as fp:
- json_data = json.load(fp)
- if len(json_data["jobs"]) == 1 and json_data["jobs"][0]["name"] != "pre-init":
- json_data["jobs"].insert(0, {
- "name": "pre-init",
- "cmds": [
- "export LD_PRELOAD libcoverage_signal_handler.z.so"
- ]
- })
- json_str = json.dumps(json_data, indent=4)
- if os.path.exists(cfg_file_path):
- os.remove(cfg_file_path)
- with os.fdopen(os.open(cfg_file_path, FLAGS, MODES), 'w') as json_file:
- json_file.write(json_str)
- print("%s file send %s %s" % (hdc_str, cfg_file_path, "/system/etc/init/"))
- coverage_command("%s file send %s %s" % (hdc_str, cfg_file_path, "/system/etc/init/"))
- else:
- print("faultloggerd.cfg file not exists.")
-
- return
-
-
-def modify_foundation_xml(serv, config_path, origin_xml) -> str:
- """
- 修改foundation.xml文件,删去拆分的进程相关
- :param serv: 拆分进程
- :param config_path: 配置文件路径
- :param origin_xml: 原foundation.xml
- :return: 修改后foundation.xml路径
- """
- lib_list = FoundationServer.lib_dict.get(serv)
-
- tree = ET.parse(origin_xml)
- root = tree.getroot()
- loadlibs = root.find("loadlibs")
-
- for lib in lib_list:
- for sa in root.findall('systemability'):
- if lib in sa.find('libpath').text:
- root.remove(sa)
- for ll in loadlibs.findall('libpath'):
- if lib in ll.text:
- loadlibs.remove(ll)
-
- tree.write(os.path.join(config_path, 'foundation.xml'), encoding='utf-8', xml_declaration=True)
- return os.path.join(config_path, 'foundation.xml')
-
-
-def modify_foundation_json(serv, config_path, origin_json) -> str:
- """
- 修改foundation.json文件,删去拆分的进程相关
- :param serv: 拆分进程
- :param config_path: 配置文件路径
- :param origin_json: 原foundation.json
- :return: 修改后foundation.json路径
- """
- lib_list = FoundationServer.lib_dict.get(serv)
-
- with open(origin_json, "r", encoding="UTF-8") as f:
- f_dict = json.load(f)
-
- tmp_list = list()
- for i in range(len(f_dict["systemability"])):
- if f_dict["systemability"][i]["libpath"] not in lib_list:
- tmp_list.append(f_dict["systemability"][i])
- f_dict["systemability"] = tmp_list
-
- new_json = os.path.join(config_path, 'foundation.json')
- if os.path.exists(new_json):
- os.remove(new_json)
- with os.fdopen(os.open(new_json, FLAGS, MODES), 'w') as f:
- json.dump(f_dict, f, indent=4)
-
- return new_json
-
-
-def create_service_json(serv, config_path, origin_json) -> str:
- """
- 创建进程json
- :param serv: 进程名
- :param config_path:配置文件所在目录
- :param origin_json: 原foundation.json
- :return: json文件路径
- """
- lib_list = FoundationServer.lib_dict.get(serv)
- with open(origin_json, "r", encoding="UTF-8") as f:
- f_dict = json.load(f)
-
- tmp_list = list()
- for lib in lib_list:
- for i in range(len(f_dict["systemability"])):
- if f_dict["systemability"][i]["libpath"] == lib:
- tmp_list.append(f_dict["systemability"][i])
- f_dict["systemability"] = tmp_list
- f_dict["process"] = "{}".format(serv)
-
- new_json = os.path.join(config_path, '{}.json'.format(serv))
- if os.path.exists(new_json):
- os.remove(new_json)
- with os.fdopen(os.open(new_json, FLAGS, MODES), 'w') as f:
- json.dump(f_dict, f, indent=4)
-
- return new_json
-
-
-def create_service_xml(serv, config_path, origin_xml) -> str:
- """
- 创建进程xml
- :param serv: 进程名
- :param config_path:配置文件所在目录
- :param origin_xml: 原foundation.xml
- :return: xml文件路径
- """
- lib_list = FoundationServer.lib_dict.get(serv)
-
- tree = ET.parse(origin_xml)
- root = tree.getroot()
- loadlibs = root.find("loadlibs")
-
- for lib in lib_list:
- for sa in root.findall('systemability'):
- if lib not in sa.find('libpath').text:
- root.remove(sa)
- for lp in loadlibs.findall('libpath'):
- if lib not in lp.text:
- loadlibs.remove(lp)
-
- tree.write(os.path.join(config_path, '{}.xml'.format(serv)), encoding='utf-8', xml_declaration=True)
- return os.path.join(config_path, '{}.xml'.format(serv))
-
-
-def create_service_cfg(serv, config_path, origin_cfg) -> str:
- """
- 创建进程cfg文件
- :param serv: 进程名
- :param config_path:配置文件所在目录
- :param origin_cfg: 原foundation.cfg
- :return: cfg文件路径
- """
- with open(origin_cfg, "r") as jf:
- json_obj = json.load(jf)
- json_obj["jobs"][0]["name"] = "services:{}".format(serv)
-
- json_obj["services"][0]["name"] = "{}".format(serv)
-
- path_list = json_obj["services"][0]["path"]
- path_list.remove("/system/profile/foundation.json")
- path_list.append("/system/profile/{}.json".format(serv))
- json_obj["services"][0]["path"] = path_list
-
- json_obj["services"][0]["jobs"]["on-start"] = "services:{}".format(serv)
-
- cfg_path = os.path.join(config_path, "{}.cfg".format(serv))
- if os.path.exists(cfg_path):
- os.remove(cfg_path)
- with os.fdopen(os.open(cfg_path, FLAGS, MODES), 'w') as r:
- json.dump(json_obj, r, indent=4)
- return cfg_path
-
-
-def remove_configs(config_path):
- """
- 清理配置文件目录下的xml和cfg文件
- :param config_path: 配置文件目录
- :return:
- """
- logger("Clear config path...", "INFO")
- shutil.rmtree(config_path)
- os.mkdir(config_path)
-
-
-def split_foundation_services(developer_path, system_info_dict, home_path, hdc_dict):
- """
- foundation.xml、XXX.xml文件推送到 /system/profile
- XXX.cfg文件推送到/etc/init/
- reboot设备,可以将服务从foundation中拆分出来,成为一个独立服务进程
- """
- config_path = os.path.join(developer_path, "localCoverage", "resident_service", "config")
- remove_configs(config_path)
-
- device_ip = hdc_dict["device_ip"]
- hdc_port = hdc_dict["device_port"]
- device_sn = hdc_dict["device_sn_str"]
-
- hdc_command(device_ip, hdc_port, device_sn, "file recv /system/profile/foundation.json {}".format(config_path))
- hdc_command(device_ip, hdc_port, device_sn, "file recv /etc/init/foundation.cfg {}".format(config_path))
-
- if os.path.exists(os.path.join(config_path, "foundation.json")):
- origin_json = os.path.join(config_path, "foundation_origin.json")
- os.rename(os.path.join(config_path, "foundation.json"), origin_json)
- else:
- logger("{} not exist, Cannot modify.".format(os.path.join(config_path, "foundation.json")), "ERROR")
- return
-
- if os.path.exists(os.path.join(config_path, "foundation.cfg")):
- origin_cfg = os.path.join(config_path, "foundation_origin.cfg")
- os.rename(os.path.join(config_path, "foundation.cfg"), origin_cfg)
- else:
- logger("{} not exist, Cannot modify.".format(os.path.join(config_path, "foundation.cfg")), "ERROR")
- return
-
- foundation_process_list = FoundationServer.lib_dict.keys()
-
- # 推送配置文件
- for _, value_list in system_info_dict.items():
- for process_str in value_list:
- if process_str in foundation_process_list:
- foundation_json = modify_foundation_json(process_str, config_path, origin_json)
- service_json = create_service_json(process_str, config_path, origin_json)
- service_cfg = create_service_cfg(process_str, config_path, origin_cfg)
-
- hdc_command(device_ip, hdc_port, device_sn, "shell rm -rf {}".format(home_path))
- hdc_command(device_ip, hdc_port, device_sn, "file send {} /system/profile/".format(foundation_json))
- hdc_command(device_ip, hdc_port, device_sn, "file send {} /system/profile/".format(service_json))
- hdc_command(device_ip, hdc_port, device_sn, "file send {} /etc/init/".format(service_cfg))
-
- return
-
-
-def modify_cfg_xml_file(developer_path, device_ip, device_sn_list,
- system_info_dict, home_path, device_port):
- if device_ip and len(device_sn_list) >= 1:
- for device_sn_str in device_sn_list:
- hdc_str = "hdc -s %s:%s -t %s" % (device_ip, device_port, device_sn_str)
- hdc_dict = {"device_ip": device_ip, "device_port": device_port, "device_sn_str": device_sn_str}
- modify_init_file(developer_path, hdc_str)
- modify_faultloggerd_file(
- developer_path, hdc_str)
- # 推送服务对应的配置文件
- split_foundation_services(developer_path, system_info_dict, home_path, hdc_dict)
- logger("{} shell reboot".format(hdc_str), "INFO")
- coverage_command("%s shell reboot > /dev/null 2>&1" % hdc_str)
- while True:
- after_sn_list = get_sn_list("hdc -s %s:%s list targets" % (device_ip, device_port))
- time.sleep(10)
- if device_sn_str in after_sn_list:
- break
- coverage_command("%s shell getenforce" % hdc_str)
- else:
- logger("user_config.xml device ip not config", "ERROR")
-
-
-if __name__ == '__main__':
- command_args = sys.argv[1]
- command_str = command_args.split("command_str=")[1].replace(",", " ")
- current_path = os.getcwd()
- _init_sys_config()
- from localCoverage.utils import coverage_command, \
- logger, hdc_command, FoundationServer
-
- root_path = current_path.split("/test/testfwk/developer_test")[0]
- developer_test_path = os.path.join(root_path, "test/testfwk/developer_test")
- home_paths = '/'.join(root_path.split("/")[:3])
-
- # 获取user_config中的device ip
- ip, port, sn = get_config_ip(os.path.join(developer_test_path, "config/user_config.xml"))
- if not port:
- port = "8710"
- sn_list = []
- if sn:
- sn_list.extend(sn.replace(" ", "").split(";"))
- else:
- sn_list = get_sn_list("hdc -s %s:%s list targets" % (ip, port))
-
- # 获取子系统部件与服务的关系
- system_dict, _, _ = get_server_dict(command_str)
-
- # 修改设备init.cfg, faultloggerd.cfg等文件
- modify_cfg_xml_file(developer_test_path, ip, sn_list,
- system_dict, home_paths, port)
+#!/usr/bin/env python3
+# coding=utf-8
+
+#
+# Copyright (c) 2020-2023 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import os
+import shutil
+import subprocess
+import json
+import sys
+import time
+import xml.etree.ElementTree as ET
+from public_method import get_server_dict, get_config_ip, get_sn_list
+import stat
+
+FLAGS = os.O_WRONLY | os.O_CREAT | os.O_EXCL
+MODES = stat.S_IWUSR | stat.S_IRUSR
+
+
+def _init_sys_config():
+ sys.localcoverage_path = os.path.join(current_path, "..")
+ sys.path.insert(0, sys.localcoverage_path)
+
+
+def modify_init_file(developer_path, hdc_str):
+ """
+ /etc/init.cfg文件添加cmds
+ """
+ recv_path = os.path.join(developer_path, "local_coverage/resident_service/resources")
+ print("%s file recv /etc/init.cfg %s" % (hdc_str, recv_path))
+ coverage_command("%s file recv /etc/init.cfg %s" % (hdc_str, recv_path))
+ recv_restores_path = os.path.join(recv_path, "restores_environment")
+ if not os.path.exists(recv_restores_path):
+ os.mkdir(recv_restores_path)
+ recv_restores_name = os.path.join(recv_restores_path, "init.cfg")
+ if not os.path.exists(recv_restores_name):
+ coverage_command("%s file recv /etc/init.cfg %s" % (hdc_str, recv_restores_path))
+ else:
+ print("INFO: file exit", recv_restores_name)
+
+ cfg_file_path = os.path.join(recv_path, "init.cfg")
+ if os.path.exists(cfg_file_path):
+ with open(cfg_file_path, "r") as fp:
+ json_data = json.load(fp)
+
+ for jobs_list in json_data["jobs"]:
+ if jobs_list["name"] == "init":
+ if jobs_list["cmds"][-1] != "export GCOV_FETCH_METHOD FM_SIGNA":
+ jobs_list["cmds"].append("mkdir /data/gcov 0777 system system")
+ jobs_list["cmds"].append("export GCOV_PREFIX /data/gcov")
+ jobs_list["cmds"].append("export GCOV_FETCH_METHOD FM_SIGNA")
+ else:
+ return
+ json_str = json.dumps(json_data, indent=2)
+ if os.path.exists(cfg_file_path):
+ os.remove(cfg_file_path)
+ with os.fdopen(os.open(cfg_file_path, FLAGS, MODES), 'w') as json_file:
+ json_file.write(json_str)
+ else:
+ print("init.cfg file not exists")
+ return
+ print("%s shell mount -o rw,remount / > /dev/null 2>&1" % hdc_str)
+ coverage_command("%s shell mount -o rw,remount / > /dev/null 2>&1" % hdc_str)
+ print("%s target mount" % hdc_str)
+ coverage_command("%s target mount" % hdc_str)
+ print("%s file send %s %s" % (hdc_str, cfg_file_path, "/etc/"))
+ coverage_command("%s file send %s %s" % (hdc_str, cfg_file_path, "/etc/"))
+ coverage_command("%s shell param set persist.appspawn.client.timeout 120 > /dev/null 2>&1" % hdc_str)
+ return
+
+
+def modify_faultloggerd_file(developer_path, hdc_str):
+ _, enforce = subprocess.getstatusoutput("%s shell getenforce" % hdc_str)
+ coverage_command("%s shell mount -o rw,remount /" % hdc_str)
+ print("%s shell mount -o rw,remount /" % hdc_str)
+ coverage_command("%s target mount" % hdc_str)
+ if enforce != "Permissive":
+ coverage_command("%s shell sed -i 's/enforcing/permissive/g' /system/etc/selinux/config" % hdc_str)
+
+ recv_path = os.path.join(developer_path, "local_coverage/resident_service/resources")
+ print("%s file recv /system/etc/init/faultloggerd.cfg %s" % (hdc_str, recv_path))
+ coverage_command("%s file recv /system/etc/init/faultloggerd.cfg %s" % (hdc_str, recv_path))
+
+ cfg_file_path = os.path.join(recv_path, "faultloggerd.cfg")
+ if os.path.exists(cfg_file_path):
+ with open(cfg_file_path, "r") as fp:
+ json_data = json.load(fp)
+ if len(json_data["jobs"]) == 1 and json_data["jobs"][0]["name"] != "pre-init":
+ json_data["jobs"].insert(0, {
+ "name": "pre-init",
+ "cmds": [
+ "export LD_PRELOAD libcoverage_signal_handler.z.so"
+ ]
+ })
+ json_str = json.dumps(json_data, indent=4)
+ if os.path.exists(cfg_file_path):
+ os.remove(cfg_file_path)
+ with os.fdopen(os.open(cfg_file_path, FLAGS, MODES), 'w') as json_file:
+ json_file.write(json_str)
+ print("%s file send %s %s" % (hdc_str, cfg_file_path, "/system/etc/init/"))
+ coverage_command("%s file send %s %s" % (hdc_str, cfg_file_path, "/system/etc/init/"))
+ else:
+ print("faultloggerd.cfg file not exists.")
+
+ return
+
+
+def modify_foundation_xml(serv, config_path, origin_xml) -> str:
+ """
+ 修改foundation.xml文件,删去拆分的进程相关
+ :param serv: 拆分进程
+ :param config_path: 配置文件路径
+ :param origin_xml: 原foundation.xml
+ :return: 修改后foundation.xml路径
+ """
+ lib_list = FoundationServer.lib_dict.get(serv)
+
+ tree = ET.parse(origin_xml)
+ root = tree.getroot()
+ loadlibs = root.find("loadlibs")
+
+ for lib in lib_list:
+ for sa in root.findall('systemability'):
+ if lib in sa.find('libpath').text:
+ root.remove(sa)
+ for ll in loadlibs.findall('libpath'):
+ if lib in ll.text:
+ loadlibs.remove(ll)
+
+ tree.write(os.path.join(config_path, 'foundation.xml'), encoding='utf-8', xml_declaration=True)
+ return os.path.join(config_path, 'foundation.xml')
+
+
+def modify_foundation_json(serv, config_path, origin_json) -> str:
+ """
+ 修改foundation.json文件,删去拆分的进程相关
+ :param serv: 拆分进程
+ :param config_path: 配置文件路径
+ :param origin_json: 原foundation.json
+ :return: 修改后foundation.json路径
+ """
+ lib_list = FoundationServer.lib_dict.get(serv)
+
+ with open(origin_json, "r", encoding="UTF-8") as f:
+ f_dict = json.load(f)
+
+ tmp_list = list()
+ for i in range(len(f_dict["systemability"])):
+ if f_dict["systemability"][i]["libpath"] not in lib_list:
+ tmp_list.append(f_dict["systemability"][i])
+ f_dict["systemability"] = tmp_list
+
+ new_json = os.path.join(config_path, 'foundation.json')
+ if os.path.exists(new_json):
+ os.remove(new_json)
+ with os.fdopen(os.open(new_json, FLAGS, MODES), 'w') as f:
+ json.dump(f_dict, f, indent=4)
+
+ return new_json
+
+
+def create_service_json(serv, config_path, origin_json) -> str:
+ """
+ 创建进程json
+ :param serv: 进程名
+ :param config_path:配置文件所在目录
+ :param origin_json: 原foundation.json
+ :return: json文件路径
+ """
+ lib_list = FoundationServer.lib_dict.get(serv)
+ with open(origin_json, "r", encoding="UTF-8") as f:
+ f_dict = json.load(f)
+
+ tmp_list = list()
+ for lib in lib_list:
+ for i in range(len(f_dict["systemability"])):
+ if f_dict["systemability"][i]["libpath"] == lib:
+ tmp_list.append(f_dict["systemability"][i])
+ f_dict["systemability"] = tmp_list
+ f_dict["process"] = "{}".format(serv)
+
+ new_json = os.path.join(config_path, '{}.json'.format(serv))
+ if os.path.exists(new_json):
+ os.remove(new_json)
+ with os.fdopen(os.open(new_json, FLAGS, MODES), 'w') as f:
+ json.dump(f_dict, f, indent=4)
+
+ return new_json
+
+
+def create_service_xml(serv, config_path, origin_xml) -> str:
+ """
+ 创建进程xml
+ :param serv: 进程名
+ :param config_path:配置文件所在目录
+ :param origin_xml: 原foundation.xml
+ :return: xml文件路径
+ """
+ lib_list = FoundationServer.lib_dict.get(serv)
+
+ tree = ET.parse(origin_xml)
+ root = tree.getroot()
+ loadlibs = root.find("loadlibs")
+
+ for lib in lib_list:
+ for sa in root.findall('systemability'):
+ if lib not in sa.find('libpath').text:
+ root.remove(sa)
+ for lp in loadlibs.findall('libpath'):
+ if lib not in lp.text:
+ loadlibs.remove(lp)
+
+ tree.write(os.path.join(config_path, '{}.xml'.format(serv)), encoding='utf-8', xml_declaration=True)
+ return os.path.join(config_path, '{}.xml'.format(serv))
+
+
+def create_service_cfg(serv, config_path, origin_cfg) -> str:
+ """
+ 创建进程cfg文件
+ :param serv: 进程名
+ :param config_path:配置文件所在目录
+ :param origin_cfg: 原foundation.cfg
+ :return: cfg文件路径
+ """
+ with open(origin_cfg, "r") as jf:
+ json_obj = json.load(jf)
+ json_obj["jobs"][0]["name"] = "services:{}".format(serv)
+
+ json_obj["services"][0]["name"] = "{}".format(serv)
+
+ path_list = json_obj["services"][0]["path"]
+ path_list.remove("/system/profile/foundation.json")
+ path_list.append("/system/profile/{}.json".format(serv))
+ json_obj["services"][0]["path"] = path_list
+
+ json_obj["services"][0]["jobs"]["on-start"] = "services:{}".format(serv)
+
+ cfg_path = os.path.join(config_path, "{}.cfg".format(serv))
+ if os.path.exists(cfg_path):
+ os.remove(cfg_path)
+ with os.fdopen(os.open(cfg_path, FLAGS, MODES), 'w') as r:
+ json.dump(json_obj, r, indent=4)
+ return cfg_path
+
+
+def remove_configs(config_path):
+ """
+ 清理配置文件目录下的xml和cfg文件
+ :param config_path: 配置文件目录
+ :return:
+ """
+ logger("Clear config path...", "INFO")
+ shutil.rmtree(config_path)
+ os.mkdir(config_path)
+
+
+def split_foundation_services(developer_path, system_info_dict, home_path, hdc_dict):
+ """
+ foundation.xml、XXX.xml文件推送到 /system/profile
+ XXX.cfg文件推送到/etc/init/
+ reboot设备,可以将服务从foundation中拆分出来,成为一个独立服务进程
+ """
+ config_path = os.path.join(developer_path, "local_coverage", "resident_service", "config")
+ remove_configs(config_path)
+
+ device_ip = hdc_dict["device_ip"]
+ hdc_port = hdc_dict["device_port"]
+ device_sn = hdc_dict["device_sn_str"]
+
+ hdc_command(device_ip, hdc_port, device_sn, "file recv /system/profile/foundation.json {}".format(config_path))
+ hdc_command(device_ip, hdc_port, device_sn, "file recv /etc/init/foundation.cfg {}".format(config_path))
+
+ if os.path.exists(os.path.join(config_path, "foundation.json")):
+ origin_json = os.path.join(config_path, "foundation_origin.json")
+ os.rename(os.path.join(config_path, "foundation.json"), origin_json)
+ else:
+ logger("{} not exist, Cannot modify.".format(os.path.join(config_path, "foundation.json")), "ERROR")
+ return
+
+ if os.path.exists(os.path.join(config_path, "foundation.cfg")):
+ origin_cfg = os.path.join(config_path, "foundation_origin.cfg")
+ os.rename(os.path.join(config_path, "foundation.cfg"), origin_cfg)
+ else:
+ logger("{} not exist, Cannot modify.".format(os.path.join(config_path, "foundation.cfg")), "ERROR")
+ return
+
+ foundation_process_list = FoundationServer.lib_dict.keys()
+
+ # 推送配置文件
+ for _, value_list in system_info_dict.items():
+ for process_str in value_list:
+ if process_str in foundation_process_list:
+ foundation_json = modify_foundation_json(process_str, config_path, origin_json)
+ service_json = create_service_json(process_str, config_path, origin_json)
+ service_cfg = create_service_cfg(process_str, config_path, origin_cfg)
+
+ hdc_command(device_ip, hdc_port, device_sn, "shell rm -rf {}".format(home_path))
+ hdc_command(device_ip, hdc_port, device_sn, "file send {} /system/profile/".format(foundation_json))
+ hdc_command(device_ip, hdc_port, device_sn, "file send {} /system/profile/".format(service_json))
+ hdc_command(device_ip, hdc_port, device_sn, "file send {} /etc/init/".format(service_cfg))
+
+ return
+
+
+def modify_cfg_xml_file(developer_path, device_ip, device_sn_list,
+ system_info_dict, home_path, device_port):
+ if device_ip and len(device_sn_list) >= 1:
+ for device_sn_str in device_sn_list:
+ hdc_str = "hdc -s %s:%s -t %s" % (device_ip, device_port, device_sn_str)
+ hdc_dict = {"device_ip": device_ip, "device_port": device_port, "device_sn_str": device_sn_str}
+ modify_init_file(developer_path, hdc_str)
+ modify_faultloggerd_file(
+ developer_path, hdc_str)
+ # 推送服务对应的配置文件
+ split_foundation_services(developer_path, system_info_dict, home_path, hdc_dict)
+ logger("{} shell reboot".format(hdc_str), "INFO")
+ coverage_command("%s shell reboot > /dev/null 2>&1" % hdc_str)
+ while True:
+ after_sn_list = get_sn_list("hdc -s %s:%s list targets" % (device_ip, device_port))
+ time.sleep(10)
+ if device_sn_str in after_sn_list:
+ break
+ coverage_command("%s shell getenforce" % hdc_str)
+ else:
+ logger("user_config.xml device ip not config", "ERROR")
+
+
+if __name__ == '__main__':
+ command_args = sys.argv[1]
+ command_str = command_args.split("command_str=")[1].replace(",", " ")
+ current_path = os.getcwd()
+ _init_sys_config()
+ from local_coverage.utils import coverage_command, \
+ logger, hdc_command, FoundationServer
+
+ root_path = current_path.split("/test/testfwk/developer_test")[0]
+ developer_test_path = os.path.join(root_path, "test/testfwk/developer_test")
+ home_paths = '/'.join(root_path.split("/")[:3])
+
+ # 获取user_config中的device ip
+ ip, port, sn = get_config_ip(os.path.join(developer_test_path, "config/user_config.xml"))
+ if not port:
+ port = "8710"
+ sn_list = []
+ if sn:
+ sn_list.extend(sn.replace(" ", "").split(";"))
+ else:
+ sn_list = get_sn_list("hdc -s %s:%s list targets" % (ip, port))
+
+ # 获取子系统部件与服务的关系
+ system_dict, _, _ = get_server_dict(command_str)
+
+ # 修改设备init.cfg, faultloggerd.cfg等文件
+ modify_cfg_xml_file(developer_test_path, ip, sn_list,
+ system_dict, home_paths, port)
diff --git a/localCoverage/resident_service/public_method.py b/local_coverage/resident_service/public_method.py
similarity index 96%
rename from localCoverage/resident_service/public_method.py
rename to local_coverage/resident_service/public_method.py
index 7714459dd062f69e1139b326b24c6c243ef02c73..1cca15678c53b4daa9f495e1d97e679776b24d1c 100644
--- a/localCoverage/resident_service/public_method.py
+++ b/local_coverage/resident_service/public_method.py
@@ -1,143 +1,143 @@
-#!/usr/bin/env python3
-# coding=utf-8
-
-#
-# Copyright (c) 2020-2023 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-import os
-import subprocess
-import json
-import xml.etree.ElementTree as ET
-
-
-def get_config_ip(filepath):
- ip_config = ""
- sn = ""
- port = ""
- try:
- data_dic = {}
- if os.path.exists(filepath):
- tree = ET.parse(filepath)
- root = tree.getroot()
- for node in root.findall("environment/device"):
- if node.attrib["type"] != "usb-hdc":
- continue
- for sub in node:
- data_dic[sub.tag] = sub.text if sub.text else ""
- ip_config = data_dic.get("ip", "")
- sn = data_dic.get("sn", "")
- port = data_dic.get("port", "")
- except ET.ParseError as xml_exception:
- print("occurs exception:{}".format(xml_exception.args))
-
- return ip_config, port, sn
-
-
-def get_sn_list(command):
- device_sn_list = []
- # 执行查询设备sn号命令并获取执行结果
- proc = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- strout = proc.stdout.read()
- if isinstance(strout, bytes):
- strout = strout.decode("utf-8", "ignore")
- for line in strout.split("\n"):
- line = line.strip().replace('\t', ' ')
- if line != "":
- device_sn_list.append(line)
-
- return device_sn_list
-
-
-def get_all_part_service():
- current_path = os.getcwd()
- root_path = current_path.split("/test/testfwk/developer_test")[0]
- developer_path = os.path.join(root_path, "test/testfwk/developer_test")
- system_part_service_path = os.path.join(
- developer_path, "localCoverage/resident_service/system_part_service.json")
- if os.path.exists(system_part_service_path):
- with open(system_part_service_path, "r") as system_text:
- system_text_json = json.load(system_text)
- system_info_dict = system_text_json["system_info_dict"]
- services_component_dict = system_text_json["services_component_dict"]
- component_gcda_dict = system_text_json["component_gcda_dict"]
- return system_info_dict, services_component_dict, component_gcda_dict
- print("%s not exists.", system_part_service_path)
- return {}, {}, {}
-
-
-def get_system_dict_to_server_name(server_name: str, system_info_dict):
- for system, server_list in system_info_dict.items():
- if server_name in server_list:
- system_info_dict_after = {
- system: [server_name]
- }
- return system_info_dict_after
- return {}
-
-
-def get_server_dict(command):
- system_info_dict, services_component_dict, component_gcda_dict = get_all_part_service()
- system_info_dict_after = {}
- services_component_dict_after = {}
- component_gcda_dict_after = {}
- server_name = None
- if " -ts " in command:
- _, testsuite = command.split(" -ts ")
- if testsuite in services_component_dict.get("dinput"):
- services_component_dict_after = {
- "dinput": [testsuite]
- }
- server_name = "dinput"
- elif testsuite in services_component_dict.get("softbus_server"):
- services_component_dict_after = {
- "softbus_server": [testsuite]
- }
- server_name = "softbus_server"
- if server_name:
- system_info_dict_after = get_system_dict_to_server_name(server_name, system_info_dict)
- component_gcda_dict_after = {
- server_name: component_gcda_dict.get(server_name)
- }
- elif " -tp " in command:
- component_name = command.split(" -tp ")[-1].split(" ")[0]
- for server, component_list in services_component_dict.items():
- if component_name in component_list:
- if server in ["dinput", "softbus_server"]:
- break
- services_component_dict_after = {
- server: [component_name]
- }
- server_name = server
- break
- if server_name:
- system_info_dict_after = get_system_dict_to_server_name(server_name, system_info_dict)
- component_gcda_dict_after = {
- server_name: component_gcda_dict.get(server_name)
- }
- elif " -ss " in command:
- system_name = command.split(" -ss ")[-1].split(" ")[0]
- server_list = system_info_dict.get(system_name) if system_info_dict.get(system_name) else []
- system_info_dict_after = {
- system_name: server_list
- }
- for server_name in server_list:
- services_component_dict_after.update({
- server_name: services_component_dict.get(server_name)
- })
- component_gcda_dict_after.update({
- server_name: component_gcda_dict.get(server_name)
- })
- return system_info_dict_after, services_component_dict_after, component_gcda_dict_after
+#!/usr/bin/env python3
+# coding=utf-8
+
+#
+# Copyright (c) 2020-2023 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import os
+import subprocess
+import json
+import xml.etree.ElementTree as ET
+
+
+def get_config_ip(filepath):
+ ip_config = ""
+ sn = ""
+ port = ""
+ try:
+ data_dic = {}
+ if os.path.exists(filepath):
+ tree = ET.parse(filepath)
+ root = tree.getroot()
+ for node in root.findall("environment/device"):
+ if node.attrib["type"] != "usb-hdc":
+ continue
+ for sub in node:
+ data_dic[sub.tag] = sub.text if sub.text else ""
+ ip_config = data_dic.get("ip", "")
+ sn = data_dic.get("sn", "")
+ port = data_dic.get("port", "")
+ except ET.ParseError as xml_exception:
+ print("occurs exception:{}".format(xml_exception.args))
+
+ return ip_config, port, sn
+
+
+def get_sn_list(command):
+ device_sn_list = []
+ # 执行查询设备sn号命令并获取执行结果
+ proc = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ strout = proc.stdout.read()
+ if isinstance(strout, bytes):
+ strout = strout.decode("utf-8", "ignore")
+ for line in strout.split("\n"):
+ line = line.strip().replace('\t', ' ')
+ if line != "":
+ device_sn_list.append(line)
+
+ return device_sn_list
+
+
+def get_all_part_service():
+ current_path = os.getcwd()
+ root_path = current_path.split("/test/testfwk/developer_test")[0]
+ developer_path = os.path.join(root_path, "test/testfwk/developer_test")
+ system_part_service_path = os.path.join(
+ developer_path, "local_coverage/resident_service/system_part_service.json")
+ if os.path.exists(system_part_service_path):
+ with open(system_part_service_path, "r") as system_text:
+ system_text_json = json.load(system_text)
+ system_info_dict = system_text_json["system_info_dict"]
+ services_component_dict = system_text_json["services_component_dict"]
+ component_gcda_dict = system_text_json["component_gcda_dict"]
+ return system_info_dict, services_component_dict, component_gcda_dict
+ print("%s not exists.", system_part_service_path)
+ return {}, {}, {}
+
+
+def get_system_dict_to_server_name(server_name: str, system_info_dict):
+ for system, server_list in system_info_dict.items():
+ if server_name in server_list:
+ system_info_dict_after = {
+ system: [server_name]
+ }
+ return system_info_dict_after
+ return {}
+
+
+def get_server_dict(command):
+ system_info_dict, services_component_dict, component_gcda_dict = get_all_part_service()
+ system_info_dict_after = {}
+ services_component_dict_after = {}
+ component_gcda_dict_after = {}
+ server_name = None
+ if " -ts " in command:
+ _, testsuite = command.split(" -ts ")
+ if testsuite in services_component_dict.get("dinput"):
+ services_component_dict_after = {
+ "dinput": [testsuite]
+ }
+ server_name = "dinput"
+ elif testsuite in services_component_dict.get("softbus_server"):
+ services_component_dict_after = {
+ "softbus_server": [testsuite]
+ }
+ server_name = "softbus_server"
+ if server_name:
+ system_info_dict_after = get_system_dict_to_server_name(server_name, system_info_dict)
+ component_gcda_dict_after = {
+ server_name: component_gcda_dict.get(server_name)
+ }
+ elif " -tp " in command:
+ component_name = command.split(" -tp ")[-1].split(" ")[0]
+ for server, component_list in services_component_dict.items():
+ if component_name in component_list:
+ if server in ["dinput", "softbus_server"]:
+ break
+ services_component_dict_after = {
+ server: [component_name]
+ }
+ server_name = server
+ break
+ if server_name:
+ system_info_dict_after = get_system_dict_to_server_name(server_name, system_info_dict)
+ component_gcda_dict_after = {
+ server_name: component_gcda_dict.get(server_name)
+ }
+ elif " -ss " in command:
+ system_name = command.split(" -ss ")[-1].split(" ")[0]
+ server_list = system_info_dict.get(system_name) if system_info_dict.get(system_name) else []
+ system_info_dict_after = {
+ system_name: server_list
+ }
+ for server_name in server_list:
+ services_component_dict_after.update({
+ server_name: services_component_dict.get(server_name)
+ })
+ component_gcda_dict_after.update({
+ server_name: component_gcda_dict.get(server_name)
+ })
+ return system_info_dict_after, services_component_dict_after, component_gcda_dict_after
diff --git a/localCoverage/resident_service/pull_service_gcda.py b/local_coverage/resident_service/pull_service_gcda.py
similarity index 95%
rename from localCoverage/resident_service/pull_service_gcda.py
rename to local_coverage/resident_service/pull_service_gcda.py
index d4c4ed0fa09cce5bb4f8ef0aab65b0cce3682c51..f7667320007c496a12e1a4a89c943f0595c27ea1 100644
--- a/localCoverage/resident_service/pull_service_gcda.py
+++ b/local_coverage/resident_service/pull_service_gcda.py
@@ -1,164 +1,164 @@
-#!/usr/bin/env python3
-# coding=utf-8
-
-#
-# Copyright (c) 2020-2023 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-import os
-import sys
-
-from public_method import get_server_dict, get_config_ip, get_sn_list
-
-
-def _init_sys_config():
- sys.localcoverage_path = os.path.join(current_path, "..")
- sys.path.insert(0, sys.localcoverage_path)
-
-
-def restore_config(device_ip, device_port, device_sn, cfg_path):
- """
- 恢复设备内配置文件
- :param device_ip:
- :param device_sn:
- :param cfg_path:
- :param device_port:
- :return:
- """
- remount_cmd = "shell mount -o rw,remount /"
- hdc_command(device_ip, device_port, device_sn, remount_cmd)
- remount_cmd_mount = "target mount"
- hdc_command(device_ip, device_port, device_sn, remount_cmd_mount)
- origin_foundation = os.path.join(cfg_path, "foundation_origin.json")
- restore_foundation_cmd = "file send {} /system/profile/foundation.json".format(origin_foundation)
- hdc_command(device_ip, device_port, device_sn, restore_foundation_cmd)
- serv_list = FoundationServer.lib_dict
- for serv in serv_list:
- rm_xml_cmd = "shell rm /system/profile/{}.json".format(serv)
- hdc_command(device_ip, device_port, device_sn, rm_xml_cmd)
- rm_cfg_cmd = "shell rm /etc/init/{}.cfg".format(serv)
- hdc_command(device_ip, device_port, device_sn, rm_cfg_cmd)
-
-
-def attach_pid(device_ip, device_sn, process_str, component_gcda_dict, developer_path,
- resident_service_path, services_str, root, device_port):
- """
- 1. 在设备里ps -ef | grep SERVICE 获取进程号
- 2. kill - '信号' pid
- """
- hdc_str = "hdc -s %s:%s -t %s" % (device_ip, device_port, device_sn)
- print("%s shell chmod 777 /data/gcov -R" % hdc_str)
- coverage_command("%s shell chmod 777 /data/gcov -R" % hdc_str)
- coverage_command("%s shell mount -o rw,remount /" % hdc_str)
- coverage_command("%s target mount" % hdc_str)
- local_sh_path = os.path.join(resident_service_path, "resources", "gcov_flush.sh")
- coverage_command("dos2unix %s" % local_sh_path)
- print("%s file send %s %s" % (hdc_str, local_sh_path, "/data/"))
- coverage_command("%s file send %s %s" % (hdc_str, local_sh_path, "/data/"))
- coverage_command("%s shell chmod 777 /data/gcov_flush.sh" % hdc_str)
- print("%s shell sh /data/gcov_flush.sh %s" % (hdc_str, services_str))
- coverage_command("%s shell sh /data/gcov_flush.sh %s" % (hdc_str, services_str))
-
- # 拉取gcda文件
- get_gcda_file(device_ip, device_sn, process_str, component_gcda_dict,
- developer_path, services_str, root, device_port)
-
-
-def get_gcda_file(device_ip, device_sn, process_str, component_gcda_dict,
- developertest_path, services_str, roots_path, device_port):
- hdc_str = "hdc -s %s:%s -t %s" % (device_ip, device_port, device_sn)
- home_path = '/'.join(roots_path.split("/")[:3])
- gcda_path = f"/data/gcov{roots_path}"
-
- component_gcda_paths = component_gcda_dict.get(process_str) if component_gcda_dict.get(process_str) else []
- for component_gcda_path in component_gcda_paths:
- gcov_root = os.path.join(gcda_path, 'out', product_name, component_gcda_path)
- gcda_file_name = os.path.basename(gcov_root)
- gcda_file_path = os.path.dirname(gcov_root)
- print("%s shell 'cd %s; tar -czf %s.tar.gz %s'" % (
- hdc_str, gcda_file_path, gcda_file_name, gcda_file_name))
- coverage_command("%s shell 'cd %s; tar -czf %s.tar.gz %s'" % (
- hdc_str, gcda_file_path, gcda_file_name, gcda_file_name
- ))
-
- local_gcda_path = os.path.dirname(
- os.path.join(developertest_path, "reports/coverage/data/cxx",
- f"{services_str}_service", component_gcda_path))
-
- if not os.path.exists(local_gcda_path):
- os.makedirs(local_gcda_path)
- tar_path = os.path.join(gcda_file_path, "%s.tar.gz" % gcda_file_name)
- print("%s file recv %s %s" % (hdc_str, tar_path, local_gcda_path))
- coverage_command("%s file recv %s %s" % (
- hdc_str, tar_path, local_gcda_path))
-
- local_tar = os.path.join(local_gcda_path, "%s.tar.gz" % gcda_file_name)
- print("tar -zxf %s -C %s > /dev/null 2>&1" % (local_tar, local_gcda_path))
- coverage_command("tar -zxf %s -C %s > /dev/null 2>&1" % (
- local_tar, local_gcda_path))
- coverage_command("rm -rf %s" % local_tar)
- print("%s shell rm -fr %s" % (hdc_str, f"/data/gcov{home_path}"))
- coverage_command("%s shell rm -fr %s" % (hdc_str, f"/data/gcov{home_path}"))
-
-
-def get_service_list(device_ip, device_sn, system_info_dict, services_component_dict,
- component_gcda_dict, developer_path, resident_service_path, root, port_nu):
-
- service_list = []
- for key, value_list in system_info_dict.items():
- for process_str in value_list:
- if process_str in services_component_dict.keys():
- service_list.append(process_str)
- else:
- return
- if len(service_list) > 0:
- for process_str in service_list:
- services_list = process_str.split("|")
- for services_str in services_list:
- attach_pid(device_ip, device_sn, process_str, component_gcda_dict,
- developer_path, resident_service_path, services_str, root, port_nu)
- return
-
-
-if __name__ == '__main__':
- command_args = sys.argv[1]
- command_str = command_args.split("command_str=")[1].replace(",", " ")
- current_path = os.getcwd()
- _init_sys_config()
- from localCoverage.utils import get_product_name, coverage_command, hdc_command, FoundationServer
-
- root_path = current_path.split("/test/testfwk/developer_test")[0]
- developer_test_path = os.path.join(root_path, "test/testfwk/developer_test")
- service_path = os.path.join(
- developer_test_path, "localCoverage/resident_service")
- config_path = os.path.join(service_path, "config")
- product_name = get_product_name(root_path)
-
- # 获取子系统部件与服务的关系
- system_dict, services_dict, component_dict = get_server_dict(command_str)
-
- ip, port, sn = get_config_ip(os.path.join(developer_test_path, "config/user_config.xml"))
- if not port:
- port = "8710"
- device_sn_list = []
- if sn:
- device_sn_list.extend(sn.replace(" ", "").split(";"))
- else:
- device_sn_list = get_sn_list("hdc -s %s:%s list targets" % (ip, port))
-
- if ip and len(device_sn_list) >= 1 and len(system_dict.keys()) >= 1:
- for sn_str in device_sn_list:
- get_service_list(ip, sn_str, system_dict, services_dict, component_dict,
- developer_test_path, service_path, root_path, port)
- restore_config(ip, port, sn_str, config_path)
+#!/usr/bin/env python3
+# coding=utf-8
+
+#
+# Copyright (c) 2020-2023 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import os
+import sys
+
+from public_method import get_server_dict, get_config_ip, get_sn_list
+
+
+def _init_sys_config():
+ sys.localcoverage_path = os.path.join(current_path, "..")
+ sys.path.insert(0, sys.localcoverage_path)
+
+
+def restore_config(device_ip, device_port, device_sn, cfg_path):
+ """
+ 恢复设备内配置文件
+ :param device_ip:
+ :param device_sn:
+ :param cfg_path:
+ :param device_port:
+ :return:
+ """
+ remount_cmd = "shell mount -o rw,remount /"
+ hdc_command(device_ip, device_port, device_sn, remount_cmd)
+ remount_cmd_mount = "target mount"
+ hdc_command(device_ip, device_port, device_sn, remount_cmd_mount)
+ origin_foundation = os.path.join(cfg_path, "foundation_origin.json")
+ restore_foundation_cmd = "file send {} /system/profile/foundation.json".format(origin_foundation)
+ hdc_command(device_ip, device_port, device_sn, restore_foundation_cmd)
+ serv_list = FoundationServer.lib_dict
+ for serv in serv_list:
+ rm_xml_cmd = "shell rm /system/profile/{}.json".format(serv)
+ hdc_command(device_ip, device_port, device_sn, rm_xml_cmd)
+ rm_cfg_cmd = "shell rm /etc/init/{}.cfg".format(serv)
+ hdc_command(device_ip, device_port, device_sn, rm_cfg_cmd)
+
+
+def attach_pid(device_ip, device_sn, process_str, component_gcda_dict, developer_path,
+ resident_service_path, services_str, root, device_port):
+ """
+ 1. 在设备里ps -ef | grep SERVICE 获取进程号
+ 2. kill - '信号' pid
+ """
+ hdc_str = "hdc -s %s:%s -t %s" % (device_ip, device_port, device_sn)
+ print("%s shell chmod 777 /data/gcov -R" % hdc_str)
+ coverage_command("%s shell chmod 777 /data/gcov -R" % hdc_str)
+ coverage_command("%s shell mount -o rw,remount /" % hdc_str)
+ coverage_command("%s target mount" % hdc_str)
+ local_sh_path = os.path.join(resident_service_path, "resources", "gcov_flush.sh")
+ coverage_command("dos2unix %s" % local_sh_path)
+ print("%s file send %s %s" % (hdc_str, local_sh_path, "/data/"))
+ coverage_command("%s file send %s %s" % (hdc_str, local_sh_path, "/data/"))
+ coverage_command("%s shell chmod 777 /data/gcov_flush.sh" % hdc_str)
+ print("%s shell sh /data/gcov_flush.sh %s" % (hdc_str, services_str))
+ coverage_command("%s shell sh /data/gcov_flush.sh %s" % (hdc_str, services_str))
+
+ # 拉取gcda文件
+ get_gcda_file(device_ip, device_sn, process_str, component_gcda_dict,
+ developer_path, services_str, root, device_port)
+
+
+def get_gcda_file(device_ip, device_sn, process_str, component_gcda_dict,
+ developertest_path, services_str, roots_path, device_port):
+ hdc_str = "hdc -s %s:%s -t %s" % (device_ip, device_port, device_sn)
+ home_path = '/'.join(roots_path.split("/")[:3])
+ gcda_path = f"/data/gcov{roots_path}"
+
+ component_gcda_paths = component_gcda_dict.get(process_str) if component_gcda_dict.get(process_str) else []
+ for component_gcda_path in component_gcda_paths:
+ gcov_root = os.path.join(gcda_path, 'out', product_name, component_gcda_path)
+ gcda_file_name = os.path.basename(gcov_root)
+ gcda_file_path = os.path.dirname(gcov_root)
+ print("%s shell 'cd %s; tar -czf %s.tar.gz %s'" % (
+ hdc_str, gcda_file_path, gcda_file_name, gcda_file_name))
+ coverage_command("%s shell 'cd %s; tar -czf %s.tar.gz %s'" % (
+ hdc_str, gcda_file_path, gcda_file_name, gcda_file_name
+ ))
+
+ local_gcda_path = os.path.dirname(
+ os.path.join(developertest_path, "reports/coverage/data/cxx",
+ f"{services_str}_service", component_gcda_path))
+
+ if not os.path.exists(local_gcda_path):
+ os.makedirs(local_gcda_path)
+ tar_path = os.path.join(gcda_file_path, "%s.tar.gz" % gcda_file_name)
+ print("%s file recv %s %s" % (hdc_str, tar_path, local_gcda_path))
+ coverage_command("%s file recv %s %s" % (
+ hdc_str, tar_path, local_gcda_path))
+
+ local_tar = os.path.join(local_gcda_path, "%s.tar.gz" % gcda_file_name)
+ print("tar -zxf %s -C %s > /dev/null 2>&1" % (local_tar, local_gcda_path))
+ coverage_command("tar -zxf %s -C %s > /dev/null 2>&1" % (
+ local_tar, local_gcda_path))
+ coverage_command("rm -rf %s" % local_tar)
+ print("%s shell rm -fr %s" % (hdc_str, f"/data/gcov{home_path}"))
+ coverage_command("%s shell rm -fr %s" % (hdc_str, f"/data/gcov{home_path}"))
+
+
+def get_service_list(device_ip, device_sn, system_info_dict, services_component_dict,
+ component_gcda_dict, developer_path, resident_service_path, root, port_nu):
+
+ service_list = []
+ for key, value_list in system_info_dict.items():
+ for process_str in value_list:
+ if process_str in services_component_dict.keys():
+ service_list.append(process_str)
+ else:
+ return
+ if len(service_list) > 0:
+ for process_str in service_list:
+ services_list = process_str.split("|")
+ for services_str in services_list:
+ attach_pid(device_ip, device_sn, process_str, component_gcda_dict,
+ developer_path, resident_service_path, services_str, root, port_nu)
+ return
+
+
+if __name__ == '__main__':
+ command_args = sys.argv[1]
+ command_str = command_args.split("command_str=")[1].replace(",", " ")
+ current_path = os.getcwd()
+ _init_sys_config()
+ from local_coverage.utils import get_product_name, coverage_command, hdc_command, FoundationServer
+
+ root_path = current_path.split("/test/testfwk/developer_test")[0]
+ developer_test_path = os.path.join(root_path, "test/testfwk/developer_test")
+ service_path = os.path.join(
+ developer_test_path, "local_coverage/resident_service")
+ config_path = os.path.join(service_path, "config")
+ product_name = get_product_name(root_path)
+
+ # 获取子系统部件与服务的关系
+ system_dict, services_dict, component_dict = get_server_dict(command_str)
+
+ ip, port, sn = get_config_ip(os.path.join(developer_test_path, "config/user_config.xml"))
+ if not port:
+ port = "8710"
+ device_sn_list = []
+ if sn:
+ device_sn_list.extend(sn.replace(" ", "").split(";"))
+ else:
+ device_sn_list = get_sn_list("hdc -s %s:%s list targets" % (ip, port))
+
+ if ip and len(device_sn_list) >= 1 and len(system_dict.keys()) >= 1:
+ for sn_str in device_sn_list:
+ get_service_list(ip, sn_str, system_dict, services_dict, component_dict,
+ developer_test_path, service_path, root_path, port)
+ restore_config(ip, port, sn_str, config_path)
diff --git a/localCoverage/resident_service/resources/gcov_flush.sh b/local_coverage/resident_service/resources/gcov_flush.sh
similarity index 100%
rename from localCoverage/resident_service/resources/gcov_flush.sh
rename to local_coverage/resident_service/resources/gcov_flush.sh
diff --git a/localCoverage/resident_service/system_part_service.json b/local_coverage/resident_service/system_part_service.json
similarity index 98%
rename from localCoverage/resident_service/system_part_service.json
rename to local_coverage/resident_service/system_part_service.json
index 87b585629c0570aab3c8a23af3cc27cc1098ac31..e6e674663b19e3c07861607905a726476a0f2d1c 100644
--- a/localCoverage/resident_service/system_part_service.json
+++ b/local_coverage/resident_service/system_part_service.json
@@ -1,115 +1,115 @@
-{
- "system_info_dict": {
- "window": ["wms"],
- "security": ["huks_service", "dlp_permission", "accesstoken_ser|privacy_service|token_sync_ser", "dlp_credential_"],
- "multimedia": ["media_lite","av_session"],
- "resourceschedule": ["device_usage_st", "resource_schedu", "bgtaskmgr_servi"],
- "account": ["accountmgr"],
- "telephony": ["telephony|riladapter_host"],
- "communication": ["netmanager", "samgr"],
- "deviceprofile": ["distributedsche"],
- "bundlemanager": ["bms"],
- "distributeddatamgr": ["pasteboard_serv"],
- "filemanagement": ["com.ohos.medialibrary.medialibrarydata.entry:FileExtensionAbility", "com.ohos.UserFile.ExternalFileManager.entry:FileExtensionAbility"],
- "miscservices": ["inputmethod_ser"],
- "hdf": [
- "hdf_devmgr|input_host|audio_host|sample_host|fingerprint_auth_host|user_auth_host|pin_auth_host|face_auth_host|nfc_host|codec_host|wifi_host|motion_host|sensor_host|riladapter_host|hwc_host|gralloc_host|camera_host|usb_host|blue_host|audio_hdi_server_host|power_host|a2dp_host|location_host|dcamera_host|daudio_host"
- ],
- "notification": ["ans"],
- "graphic": ["render_service"],
- "location": ["locationhub"],
- "time_service": ["time_service"],
- "sensors": ["sensors"],
- "msdp": ["msdp"],
- "screenlock_serv": ["screenlock_serv"],
- "dlp_credential_service_sa": ["dlp_credential_service_sa"],
- "wallpaper_servi": ["wallpaper_servi"],
- "hilogd": ["hilogd|hidumper_service"],
- "power_mgr": ["power"],
- "data_share": ["com.ohos.medialibrary.medialibrarydata"],
- "dinput": ["dinput"],
- "dsoftbus": ["softbus_server"]
- },
- "services_component_dict": {
- "wms": ["window_manager"],
- "bms": ["bundle_framework"],
- "power": ["battery_manager", "battery_statistics", "display_manager", "power_manager", "thermal_manager"],
- "huks_service": ["huks"],
- "dlp_permission": ["dlp_permission_service"],
- "media_service": ["player_framework"],
- "device_usage_st": ["device_usage_statistics"],
- "accountmgr": ["os_account"],
- "av_session": ["av_session"],
- "accesstoken_ser|privacy_service|token_sync_ser": ["access_token"],
- "telephony|riladapter_host": [
- "call_manager", "cellular_call", "cellular_data", "core_service",
- "ril_adapter", "state_registry", "ims_service", "sms_mms"
- ],
- "netmanager": ["netmanager_base", "netmanager_ext", "netstack"],
- "samgr": ["samgr"],
- "distributedsche": ["dmsfwk", "device_info_manager"],
- "resource_schedu": ["efficiency_manager"],
- "bgtaskmgr_servi": ["background_task_mgr"],
- "pasteboard_serv": ["pasteboard"],
- "com.ohos.medialibrary.medialibrarydata.entry:FileExtensionAbility|com.ohos.UserFile.ExternalFileManager.entry:FileExtensionAbility": ["filemanagement"],
- "com.ohos.medialibrary.medialibrarydata": ["data_share"],
- "inputmethod_ser": ["imf"],
- "hdf_devmgr|input_host|audio_host|sample_host|fingerprint_auth_host|user_auth_host|pin_auth_host|face_auth_host|nfc_host|codec_host|wifi_host|motion_host|sensor_host|riladapter_host|hwc_host|gralloc_host|camera_host|usb_host|blue_host|audio_hdi_server_host|power_host|a2dp_host|location_host|dcamera_host|daudio_host": [
- "drivers_peripheral_battery", "drivers_peripheral_motion", "drivers_peripheral_sensor",
- "drivers_peripheral_thermal", "hdf_core", "hidl_adapter","drivers_peripheral_input",
- "drivers_peripheral_power"
- ],
- "ans": ["distributed_notification_service"],
- "render_service": ["graphic_chipsetsdk", "graphic_2d"],
- "dlp_credential_|dlp_credential_service_sa": ["dlp_credential_service"],
- "locationhub": ["location"],
- "time_service": ["time_service"],
- "sensors": ["sensor"],
- "msdp": ["algorithm", "geofence", "movement", "timeline"],
- "screenlock_serv": ["screenlock_mgr"],
- "wallpaper_servi": ["wallpaper_mgr"],
- "hilogd|hidumper_service": ["hiviewdfx"],
- "dinput": ["distributed_input"],
- "softbus_server": [
- "BusCenterHeartbeatSdkTest", "BusCenterMetaNodeSdkTest", "BusCenterSdkTest",
- "BusCenterServerTest", "ClientBusCenterMgrTest", "ClientBusMangerTest", "SetDataChangeTest"
- ]
- },
- "component_gcda_dict": {
- "wms": ["obj/foundation/window/window_manager"],
- "huks_service": ["obj/base/security/huks"],
- "dlp_permission": ["obj/base/security/dlp_permission_service"],
- "media_service": ["obj/foundation/multimedia/player_framework"],
- "device_usage_st": ["obj/foundation/resourceschedule"],
- "accountmgr": ["obj/base/account/os_account"],
- "av_session": ["obj/foundation/multimedia/av_session"],
- "accesstoken_ser|privacy_service|token_sync_ser": ["obj/base/security/access_token"],
- "telephony|riladapter_host": ["obj/base/telephony"],
- "netmanager": ["obj/foundation/communication"],
- "samgr": ["obj/foundation/systemabilitymgr"],
- "distributedsche": ["obj/foundation/ability/dmsfwk", "obj/foundation/deviceprofile"],
- "resource_schedu": ["obj/foundation/resourceschedule/efficiency_manager"],
- "bgtaskmgr_servi": ["obj/foundation/resourceschedule/background_task_mgr"],
- "bms": ["obj/foundation/bundlemanager/bundle_framework"],
- "pasteboard_serv": ["obj/foundation/distributeddatamgr"],
- "com.ohos.medialibrary.medialibrarydata.entry:FileExtensionAbility|com.ohos.UserFile.ExternalFileManager.entry:FileExtensionAbility": ["obj/foundation/multimedia", "obj/foundation/filemanagement"],
- "inputmethod_ser": ["obj/base/inputmethod/imf"],
- "hdf_devmgr|input_host|audio_host|sample_host|fingerprint_auth_host|user_auth_host|pin_auth_host|face_auth_host|nfc_host|codec_host|wifi_host|motion_host|sensor_host|riladapter_host|hwc_host|gralloc_host|camera_host|usb_host|blue_host|audio_hdi_server_host|power_host|a2dp_host|location_host|dcamera_host|daudio_host": [
- "obj/drivers"
- ],
- "ans": ["obj/base/notification/distributed_notification_service"],
- "render_service": ["obj/foundation/graphic/graphic_2d"],
- "dlp_credential_|dlp_credential_service_sa": ["obj/base/security/dlp_credential_service"],
- "locationhub": ["obj/base/location/services"],
- "time_service": ["obj/base/time/time_service"],
- "sensors": ["obj/base/sensors"],
- "msdp": ["obj/base/msdp"],
- "screenlock_serv": ["obj/base/theme/screenlock_mgr/services"],
- "wallpaper_servi": ["obj/base/theme/wallpaper_mgr"],
- "hilogd|hidumper_service": ["obj/base/hiviewdfx"],
- "power": ["obj/base/powermgr"],
- "com.ohos.medialibrary.medialibrarydata": ["obj/foundation/distributeddatamgr/data_share"],
- "dinput": ["obj/foundation/distributedhardware/distributed_input"],
- "softbus_server": ["obj/foundation/communication/dsoftbus"]
- }
+{
+ "system_info_dict": {
+ "window": ["wms"],
+ "security": ["huks_service", "dlp_permission", "accesstoken_ser|privacy_service|token_sync_ser", "dlp_credential_"],
+ "multimedia": ["media_lite","av_session"],
+ "resourceschedule": ["device_usage_st", "resource_schedu", "bgtaskmgr_servi"],
+ "account": ["accountmgr"],
+ "telephony": ["telephony|riladapter_host"],
+ "communication": ["netmanager", "samgr"],
+ "deviceprofile": ["distributedsche"],
+ "bundlemanager": ["bms"],
+ "distributeddatamgr": ["pasteboard_serv"],
+ "filemanagement": ["com.ohos.medialibrary.medialibrarydata.entry:FileExtensionAbility", "com.ohos.UserFile.ExternalFileManager.entry:FileExtensionAbility"],
+ "miscservices": ["inputmethod_ser"],
+ "hdf": [
+ "hdf_devmgr|input_host|audio_host|sample_host|fingerprint_auth_host|user_auth_host|pin_auth_host|face_auth_host|nfc_host|codec_host|wifi_host|motion_host|sensor_host|riladapter_host|hwc_host|gralloc_host|camera_host|usb_host|blue_host|audio_hdi_server_host|power_host|a2dp_host|location_host|dcamera_host|daudio_host"
+ ],
+ "notification": ["ans"],
+ "graphic": ["render_service"],
+ "location": ["locationhub"],
+ "time_service": ["time_service"],
+ "sensors": ["sensors"],
+ "msdp": ["msdp"],
+ "screenlock_serv": ["screenlock_serv"],
+ "dlp_credential_service_sa": ["dlp_credential_service_sa"],
+ "wallpaper_servi": ["wallpaper_servi"],
+ "hilogd": ["hilogd|hidumper_service"],
+ "power_mgr": ["power"],
+ "data_share": ["com.ohos.medialibrary.medialibrarydata"],
+ "dinput": ["dinput"],
+ "dsoftbus": ["softbus_server"]
+ },
+ "services_component_dict": {
+ "wms": ["window_manager"],
+ "bms": ["bundle_framework"],
+ "power": ["battery_manager", "battery_statistics", "display_manager", "power_manager", "thermal_manager"],
+ "huks_service": ["huks"],
+ "dlp_permission": ["dlp_permission_service"],
+ "media_service": ["player_framework"],
+ "device_usage_st": ["device_usage_statistics"],
+ "accountmgr": ["os_account"],
+ "av_session": ["av_session"],
+ "accesstoken_ser|privacy_service|token_sync_ser": ["access_token"],
+ "telephony|riladapter_host": [
+ "call_manager", "cellular_call", "cellular_data", "core_service",
+ "ril_adapter", "state_registry", "ims_service", "sms_mms"
+ ],
+ "netmanager": ["netmanager_base", "netmanager_ext", "netstack"],
+ "samgr": ["samgr"],
+ "distributedsche": ["dmsfwk", "device_info_manager"],
+ "resource_schedu": ["efficiency_manager"],
+ "bgtaskmgr_servi": ["background_task_mgr"],
+ "pasteboard_serv": ["pasteboard"],
+ "com.ohos.medialibrary.medialibrarydata.entry:FileExtensionAbility|com.ohos.UserFile.ExternalFileManager.entry:FileExtensionAbility": ["filemanagement"],
+ "com.ohos.medialibrary.medialibrarydata": ["data_share"],
+ "inputmethod_ser": ["imf"],
+ "hdf_devmgr|input_host|audio_host|sample_host|fingerprint_auth_host|user_auth_host|pin_auth_host|face_auth_host|nfc_host|codec_host|wifi_host|motion_host|sensor_host|riladapter_host|hwc_host|gralloc_host|camera_host|usb_host|blue_host|audio_hdi_server_host|power_host|a2dp_host|location_host|dcamera_host|daudio_host": [
+ "drivers_peripheral_battery", "drivers_peripheral_motion", "drivers_peripheral_sensor",
+ "drivers_peripheral_thermal", "hdf_core", "hidl_adapter","drivers_peripheral_input",
+ "drivers_peripheral_power"
+ ],
+ "ans": ["distributed_notification_service"],
+ "render_service": ["graphic_chipsetsdk", "graphic_2d"],
+ "dlp_credential_|dlp_credential_service_sa": ["dlp_credential_service"],
+ "locationhub": ["location"],
+ "time_service": ["time_service"],
+ "sensors": ["sensor"],
+ "msdp": ["algorithm", "geofence", "movement", "timeline"],
+ "screenlock_serv": ["screenlock_mgr"],
+ "wallpaper_servi": ["wallpaper_mgr"],
+ "hilogd|hidumper_service": ["hiviewdfx"],
+ "dinput": ["distributed_input"],
+ "softbus_server": [
+ "BusCenterHeartbeatSdkTest", "BusCenterMetaNodeSdkTest", "BusCenterSdkTest",
+ "BusCenterServerTest", "ClientBusCenterMgrTest", "ClientBusMangerTest", "SetDataChangeTest"
+ ]
+ },
+ "component_gcda_dict": {
+ "wms": ["obj/foundation/window/window_manager"],
+ "huks_service": ["obj/base/security/huks"],
+ "dlp_permission": ["obj/base/security/dlp_permission_service"],
+ "media_service": ["obj/foundation/multimedia/player_framework"],
+ "device_usage_st": ["obj/foundation/resourceschedule"],
+ "accountmgr": ["obj/base/account/os_account"],
+ "av_session": ["obj/foundation/multimedia/av_session"],
+ "accesstoken_ser|privacy_service|token_sync_ser": ["obj/base/security/access_token"],
+ "telephony|riladapter_host": ["obj/base/telephony"],
+ "netmanager": ["obj/foundation/communication"],
+ "samgr": ["obj/foundation/systemabilitymgr"],
+ "distributedsche": ["obj/foundation/ability/dmsfwk", "obj/foundation/deviceprofile"],
+ "resource_schedu": ["obj/foundation/resourceschedule/efficiency_manager"],
+ "bgtaskmgr_servi": ["obj/foundation/resourceschedule/background_task_mgr"],
+ "bms": ["obj/foundation/bundlemanager/bundle_framework"],
+ "pasteboard_serv": ["obj/foundation/distributeddatamgr"],
+ "com.ohos.medialibrary.medialibrarydata.entry:FileExtensionAbility|com.ohos.UserFile.ExternalFileManager.entry:FileExtensionAbility": ["obj/foundation/multimedia", "obj/foundation/filemanagement"],
+ "inputmethod_ser": ["obj/base/inputmethod/imf"],
+ "hdf_devmgr|input_host|audio_host|sample_host|fingerprint_auth_host|user_auth_host|pin_auth_host|face_auth_host|nfc_host|codec_host|wifi_host|motion_host|sensor_host|riladapter_host|hwc_host|gralloc_host|camera_host|usb_host|blue_host|audio_hdi_server_host|power_host|a2dp_host|location_host|dcamera_host|daudio_host": [
+ "obj/drivers"
+ ],
+ "ans": ["obj/base/notification/distributed_notification_service"],
+ "render_service": ["obj/foundation/graphic/graphic_2d"],
+ "dlp_credential_|dlp_credential_service_sa": ["obj/base/security/dlp_credential_service"],
+ "locationhub": ["obj/base/location/services"],
+ "time_service": ["obj/base/time/time_service"],
+ "sensors": ["obj/base/sensors"],
+ "msdp": ["obj/base/msdp"],
+ "screenlock_serv": ["obj/base/theme/screenlock_mgr/services"],
+ "wallpaper_servi": ["obj/base/theme/wallpaper_mgr"],
+ "hilogd|hidumper_service": ["obj/base/hiviewdfx"],
+ "power": ["obj/base/powermgr"],
+ "com.ohos.medialibrary.medialibrarydata": ["obj/foundation/distributeddatamgr/data_share"],
+ "dinput": ["obj/foundation/distributedhardware/distributed_input"],
+ "softbus_server": ["obj/foundation/communication/dsoftbus"]
+ }
}
\ No newline at end of file
diff --git a/localCoverage/restore_comment/__init__.py b/local_coverage/restore_comment/__init__.py
similarity index 100%
rename from localCoverage/restore_comment/__init__.py
rename to local_coverage/restore_comment/__init__.py
diff --git a/localCoverage/restore_comment/after_lcov_branch.py b/local_coverage/restore_comment/after_lcov_branch.py
similarity index 92%
rename from localCoverage/restore_comment/after_lcov_branch.py
rename to local_coverage/restore_comment/after_lcov_branch.py
index 793a88ff965c15e55ad5532d03ff7d94bdbf1dcc..b7c63c55be428550a1e69ae8ea803c1553ece2eb 100644
--- a/localCoverage/restore_comment/after_lcov_branch.py
+++ b/local_coverage/restore_comment/after_lcov_branch.py
@@ -1,105 +1,105 @@
-#!/usr/bin/env python3
-# coding=utf-8
-
-#
-# Copyright (c) 2020-2023 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-import json
-import os
-import subprocess
-import stat
-
-FLAGS = os.O_WRONLY | os.O_CREAT | os.O_EXCL
-MODES = stat.S_IWUSR | stat.S_IRUSR
-
-
-def get_source_file_list(path):
- """
- 获取path路径下源文件路径列表
- """
- file_path_list = []
- file_path_list_append = file_path_list.append
- for root, dirs, files in os.walk(path):
- for file_name in files:
- file_path = os.path.join(root, file_name)
- _, suffix = os.path.splitext(file_name)
- if suffix in [".c", ".cpp", ".html"]:
- file_path_list_append(file_path)
- return file_path_list
-
-
-def recover_source_file(source_path_list, keys):
- if not source_path_list:
- print("no any source file here")
- return
-
- for path in source_path_list:
- source_dir, suffix_name = os.path.splitext(path)
- if not os.path.exists(path):
- continue
- if suffix_name != ".html" and "test" in path:
- continue
- with open(path, "r", encoding="utf-8", errors="ignore") as read_fp:
- code_lines = read_fp.readlines()
- if os.path.exists(f"{source_dir}_bk{suffix_name}"):
- os.remove(f"{source_dir}_bk{suffix_name}")
- with os.fdopen(os.open(f"{source_dir}_bk{suffix_name}", FLAGS, MODES), 'w') as write_fp:
- for line in code_lines:
- for key in keys:
- if key in line:
- write_fp.write(line.replace(key, ""))
- else:
- write_fp.write(line)
-
- os.remove(path)
- subprocess.Popen("mv %s %s" % (f"{source_dir}_bk{suffix_name}", path),
- shell=True).communicate()
-
-
-def recover_cpp_file(part_name_path):
- try:
- if os.path.exists(part_name_path):
- with open(part_name_path, "r", encoding="utf-8", errors="ignore") as fp:
- data_dict = json.load(fp)
- for key, value in data_dict.items():
- if "path" in value.keys():
- for path_str in value["path"]:
- file_path = os.path.join(root_path, path_str)
- if os.path.exists(file_path):
- cpp_list = get_source_file_list(file_path)
- recover_source_file(cpp_list, keys=[" //LCOV_EXCL_BR_LINE"])
- else:
- print("The directory does not exist.", file_path)
- os.remove(part_name_path)
- except(FileNotFoundError, AttributeError, ValueError, KeyError):
- print("recover LCOV_EXCL_BR_LINE Error")
-
-
-if __name__ == '__main__':
- current_path = os.getcwd()
- root_path = current_path.split("/test/testfwk/developer_test")[0]
- html_path = os.path.join(
- root_path,
- "test/testfwk/developer_test/localCoverage/codeCoverage/results/coverage/reports/cxx/html")
- html_arr_list = get_source_file_list(html_path)
-
- print("[************* start Recover Source File *************]")
- recover_source_file(html_arr_list, keys=[" //LCOV_EXCL_BR_LINE"])
-
- part_info_path = os.path.join(
- root_path,
- "test/testfwk/developer_test/localCoverage/restore_comment/part_config.json")
- recover_cpp_file(part_info_path)
-
- print("[************** End Recover Source File **************]")
+#!/usr/bin/env python3
+# coding=utf-8
+
+#
+# Copyright (c) 2020-2023 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import json
+import os
+import subprocess
+import stat
+
+FLAGS = os.O_WRONLY | os.O_CREAT | os.O_EXCL
+MODES = stat.S_IWUSR | stat.S_IRUSR
+
+
+def get_source_file_list(path):
+ """
+ 获取path路径下源文件路径列表
+ """
+ file_path_list = []
+ file_path_list_append = file_path_list.append
+ for root, dirs, files in os.walk(path):
+ for file_name in files:
+ file_path = os.path.join(root, file_name)
+ _, suffix = os.path.splitext(file_name)
+ if suffix in [".c", ".cpp", ".html"]:
+ file_path_list_append(file_path)
+ return file_path_list
+
+
+def recover_source_file(source_path_list, keys):
+ if not source_path_list:
+ print("no any source file here")
+ return
+
+ for path in source_path_list:
+ source_dir, suffix_name = os.path.splitext(path)
+ if not os.path.exists(path):
+ continue
+ if suffix_name != ".html" and "test" in path:
+ continue
+ with open(path, "r", encoding="utf-8", errors="ignore") as read_fp:
+ code_lines = read_fp.readlines()
+ if os.path.exists(f"{source_dir}_bk{suffix_name}"):
+ os.remove(f"{source_dir}_bk{suffix_name}")
+ with os.fdopen(os.open(f"{source_dir}_bk{suffix_name}", FLAGS, MODES), 'w') as write_fp:
+ for line in code_lines:
+ for key in keys:
+ if key in line:
+ write_fp.write(line.replace(key, ""))
+ else:
+ write_fp.write(line)
+
+ os.remove(path)
+ subprocess.Popen("mv %s %s" % (f"{source_dir}_bk{suffix_name}", path),
+ shell=True).communicate()
+
+
+def recover_cpp_file(part_name_path):
+ try:
+ if os.path.exists(part_name_path):
+ with open(part_name_path, "r", encoding="utf-8", errors="ignore") as fp:
+ data_dict = json.load(fp)
+ for key, value in data_dict.items():
+ if "path" in value.keys():
+ for path_str in value["path"]:
+ file_path = os.path.join(root_path, path_str)
+ if os.path.exists(file_path):
+ cpp_list = get_source_file_list(file_path)
+ recover_source_file(cpp_list, keys=[" //LCOV_EXCL_BR_LINE"])
+ else:
+ print("The directory does not exist.", file_path)
+ os.remove(part_name_path)
+ except(FileNotFoundError, AttributeError, ValueError, KeyError):
+ print("recover LCOV_EXCL_BR_LINE Error")
+
+
+if __name__ == '__main__':
+ current_path = os.getcwd()
+ root_path = current_path.split("/test/testfwk/developer_test")[0]
+ html_path = os.path.join(
+ root_path,
+ "test/testfwk/developer_test/local_coverage/code_coverage/results/coverage/reports/cxx/html")
+ html_arr_list = get_source_file_list(html_path)
+
+ print("[************* start Recover Source File *************]")
+ recover_source_file(html_arr_list, keys=[" //LCOV_EXCL_BR_LINE"])
+
+ part_info_path = os.path.join(
+ root_path,
+ "test/testfwk/developer_test/local_coverage/restore_comment/part_config.json")
+ recover_cpp_file(part_info_path)
+
+ print("[************** End Recover Source File **************]")
diff --git a/localCoverage/restore_comment/build_before_generate.py b/local_coverage/restore_comment/build_before_generate.py
similarity index 97%
rename from localCoverage/restore_comment/build_before_generate.py
rename to local_coverage/restore_comment/build_before_generate.py
index 4ed60017df1e031fece70c30fc39239ab5bddb8e..b35377b1b170e6881c81a17acddd1449629dfc73 100644
--- a/localCoverage/restore_comment/build_before_generate.py
+++ b/local_coverage/restore_comment/build_before_generate.py
@@ -142,10 +142,10 @@ if __name__ == '__main__':
root_path = current_path.split("/test/testfwk/developer_test")[0]
all_system_info_path = os.path.join(
root_path,
- "test/testfwk/developer_test/localCoverage/all_subsystem_config.json")
+ "test/testfwk/developer_test/local_coverage/all_subsystem_config.json")
part_info_path = os.path.join(
root_path,
- "test/testfwk/developer_test/localCoverage/restore_comment/part_config.json")
+ "test/testfwk/developer_test/local_coverage/restore_comment/part_config.json")
# 获取要修改的源代码的部件信息
get_part_config_json(part_name_list, all_system_info_path, part_info_path)
diff --git a/localCoverage/utils.py b/local_coverage/utils.py
similarity index 100%
rename from localCoverage/utils.py
rename to local_coverage/utils.py
diff --git a/src/core/build/build_manager.py b/src/core/build/build_manager.py
index 3c8ad7a310fa55309e97e90e162d13de17fd60fb..7f7b2205d1487a8ade913f31f2cf8e677febdc10 100644
--- a/src/core/build/build_manager.py
+++ b/src/core/build/build_manager.py
@@ -38,6 +38,25 @@ LOG = platform_logger("BuildManager")
##############################################################################
class BuildManager(object):
+ @classmethod
+ def build_version(cls, project_root_path, product_form):
+ if BuildTestcases(project_root_path).build_version(product_form):
+ LOG.info("The version compiled successfully.")
+ build_result = True
+ else:
+ LOG.info("The version compilation failed, please modify.")
+ build_result = False
+ return build_result
+
+ @classmethod
+ def build_gn_file(cls, project_root_path, product_form):
+ if BuildTestcases(project_root_path).build_gn_file(product_form):
+ LOG.info("The gn compiled successfully.")
+ build_result = True
+ else:
+ LOG.info("The gn compilation failed, please modify.")
+ build_result = False
+ return build_result
@classmethod
def _make_gn_file(cls, filepath, target_list):
@@ -120,7 +139,52 @@ class BuildManager(object):
LOG.info("Test case compilation failed, please modify.")
return build_result
- # 编译入口
+ def build_testcases(self, project_root_path, param):
+ if not os.path.exists(project_root_path):
+ LOG.error("%s is not exists." % project_root_path)
+ return False
+
+ LOG.info("--------------------------------------------------")
+ LOG.info("Building parameter:")
+ LOG.info("productform = %s" % param.productform)
+ LOG.info("testtype = %s" % str(param.testtype))
+ LOG.info("partname_list = %s" % str(param.partname_list))
+ LOG.info("testmodule = %s" % param.testmodule)
+ LOG.info("testsuit = %s" % param.testsuit)
+ LOG.info("testcase = %s" % param.testcase)
+ LOG.info("--------------------------------------------------")
+
+ LOG.info("")
+ LOG.info("**************************************************")
+ LOG.info("*************** Start build testcases ************")
+ LOG.info("**************************************************")
+ LOG.info("")
+
+ build_xts_result = True
+ build_result = True
+ if "partdeps" == param.partdeps:
+ LOG.info("**********************Start prebuild testcases****************************")
+ build_deps_files_result = self._compile_deps_files(project_root_path, param)
+ if build_deps_files_result:
+ self._compile_part_deps(project_root_path, param)
+
+ if "acts" in param.testtype or "hats" in param.testtype or "hits" in param.testtype:
+ LOG.info("**********************Start build xts testcases****************************")
+ build_xts_result = self._compile_xts_test_cases(project_root_path, param)
+ else:
+ LOG.info("**********************Start build subsystem testcases****************************")
+ build_result = self._compile_testcases(project_root_path, param)
+
+ LOG.info("")
+ LOG.info("**************************************************")
+ LOG.info("*************** Ended build testcases ************")
+ LOG.info("**************************************************")
+ LOG.info("")
+
+ return build_result and build_xts_result
+
+ # 编译入口
+
def _compile_testcases(self, project_root_path, para):
# 获取所有支持的产品,3.1Release版本为["DAYU","Hi3516DV300","ohos-arm64","ohos-sdk","rk3568"]
all_product_list = scan_support_product()
@@ -191,70 +255,5 @@ class BuildManager(object):
return build_result
- @classmethod
- def build_version(cls, project_root_path, product_form):
- if BuildTestcases(project_root_path).build_version(product_form):
- LOG.info("The version compiled successfully.")
- build_result = True
- else:
- LOG.info("The version compilation failed, please modify.")
- build_result = False
- return build_result
-
- @classmethod
- def build_gn_file(cls, project_root_path, product_form):
- if BuildTestcases(project_root_path).build_gn_file(product_form):
- LOG.info("The gn compiled successfully.")
- build_result = True
- else:
- LOG.info("The gn compilation failed, please modify.")
- build_result = False
- return build_result
-
- def build_testcases(self, project_root_path, param):
- if not os.path.exists(project_root_path):
- LOG.error("%s is not exists." % project_root_path)
- return False
-
- LOG.info("--------------------------------------------------")
- LOG.info("Building parameter:")
- LOG.info("productform = %s" % param.productform)
- LOG.info("testtype = %s" % str(param.testtype))
- LOG.info("partname_list = %s" % str(param.partname_list))
- LOG.info("testmodule = %s" % param.testmodule)
- LOG.info("testsuit = %s" % param.testsuit)
- LOG.info("testcase = %s" % param.testcase)
- LOG.info("--------------------------------------------------")
-
- LOG.info("")
- LOG.info("**************************************************")
- LOG.info("*************** Start build testcases ************")
- LOG.info("**************************************************")
- LOG.info("")
-
- build_xts_result = True
- build_result = True
- if "partdeps" == param.partdeps:
- LOG.info("**********************Start prebuild testcases****************************")
- build_deps_files_result = self._compile_deps_files(project_root_path, param)
- if build_deps_files_result:
- self._compile_part_deps(project_root_path, param)
-
- if "acts" in param.testtype or "hats" in param.testtype or "hits" in param.testtype:
- LOG.info("**********************Start build xts testcases****************************")
- build_xts_result = self._compile_xts_test_cases(project_root_path, param)
- else:
- LOG.info("**********************Start build subsystem testcases****************************")
- build_result = self._compile_testcases(project_root_path, param)
-
- LOG.info("")
- LOG.info("**************************************************")
- LOG.info("*************** Ended build testcases ************")
- LOG.info("**************************************************")
- LOG.info("")
-
- return build_result and build_xts_result
-
-
##############################################################################
##############################################################################
diff --git a/src/core/build/build_testcases.py b/src/core/build/build_testcases.py
index f67db64039b0bf8370fe4cc533577374ecd4e7ab..f48101a690bb3426b7caac298128c9ddbee1119b 100644
--- a/src/core/build/build_testcases.py
+++ b/src/core/build/build_testcases.py
@@ -110,6 +110,109 @@ class BuildTestcases(object):
if os.path.exists(xts_testcase_out_dir):
shutil.rmtree(xts_testcase_out_dir)
+ def build_fuzz_testcases(self, para):
+ self._delete_testcase_dir(para.productform)
+ helper_path = os.path.join("..", "libs", "fuzzlib", "fuzzer_helper.py")
+ command = [sys.executable, helper_path, 'make',
+ 'make_temp_test', para.productform]
+ if subprocess.call(command, shell=False) == 0:
+ build_result = True
+ else:
+ build_result = False
+ self._merge_testcase_dir(para.productform)
+ return build_result
+
+ # 编译测试用例(编译命令拼接)
+ def build_testcases(self, productform, target):
+ command = []
+ if self.is_build_example:
+ command.append("--gn-args")
+ command.append("build_example=true")
+ if isinstance(target, list):
+ for test in target:
+ command.append("--build-target")
+ command.append(test + "_test")
+ elif isinstance(target, str):
+ for test in target.split(','):
+ command.append("--build-target")
+ command.append(test)
+
+ if productform == "rk3568":
+ pass
+ else:
+ command.append("--abi-type")
+ command.append("generic_generic_arm_64only")
+ command.append("--device-type")
+ command.append(get_output_path().split("/")[-1])
+ command.append("--build-variant")
+ command.append("root")
+ command.append("--ccache")
+ self._delete_testcase_dir(productform)
+ build_result = self._execute_build_command(productform, command)
+ self._merge_testcase_dir(productform)
+ return build_result
+
+ # 编译XTS测试用例
+ def build_xts_testcases(self, para):
+ self._delete_xts_testcase_dir(para)
+ xts_build_command = []
+ if para.productform == "rk3568":
+ False
+ else:
+ xts_build_test_command = ["--abi-type", "generic_generic_arm_64only", "--device-type",
+ get_output_path().split("/")[-1], "--build-variant", "root", "--gn-args",
+ "build_xts=true", "--export-para", "xts_suitename:" + para.testtype[0]]
+ if len(para.subsystem) > 0:
+ input_subsystem = ",".join(para.subsystem)
+ xts_build_test_command.append("--build-target")
+ xts_build_test_command.append(input_subsystem)
+ return False
+ if para.testsuit != "" and len(para.subsystem) == 0:
+ LOG.error("Please specify subsystem.")
+ return False
+ xts_build_command.extend(xts_build_test_command)
+ xts_build_command.append("--ccache")
+ build_result = self._execute_build_xts_command(para, xts_build_command)
+ return build_result
+
+
+ def build_deps_files(self, productform):
+ command = ["--ccache", "--gn-args", "pycache_enable=true", "--gn-args",
+ "check_deps=true", "--build-only-gn"]
+ if productform == "rk3568":
+ pass
+ else:
+ command.append("--abi-type")
+ command.append("generic_generic_arm_64only")
+ command.append("--device-type")
+ command.append(get_output_path().split("/")[-1])
+ command.append("--build-variant")
+ command.append("root")
+ return self._execute_build_deps_files_command(productform, command)
+
+ # 部件间依赖关系预处理,生成part_deps_info.json
+ def build_part_deps(self, para):
+ build_part_deps_result = self._execute_build_part_deps_command(para)
+ return build_part_deps_result
+
+ def build_gn_file(self, productform):
+ command = []
+ if self.is_build_example:
+ command.append("--gn-args")
+ command.append("build_example=true")
+ command.append("--build-only-gn")
+ command.append("--gn-args")
+ command.append(BUILD_TARGET_PLATFORM % productform)
+ return self._execute_build_command(productform, command)
+
+ def build_version(self, productform):
+ command = []
+ command.append("--build-target")
+ command.append("make_all")
+ command.append("--gn-args")
+ command.append(BUILD_TARGET_PLATFORM % productform)
+ return self._execute_build_command(productform, command)
+
def _delete_testcase_dir(self, productform):
if is_open_source_product(productform):
package_out_dir = os.path.join(
@@ -299,108 +402,5 @@ class BuildTestcases(object):
os.chdir(current_path)
return build_result
- def build_fuzz_testcases(self, para):
- self._delete_testcase_dir(para.productform)
- helper_path = os.path.join("..", "libs", "fuzzlib", "fuzzer_helper.py")
- command = [sys.executable, helper_path, 'make',
- 'make_temp_test', para.productform]
- if subprocess.call(command, shell=False) == 0:
- build_result = True
- else:
- build_result = False
- self._merge_testcase_dir(para.productform)
- return build_result
-
- # 编译测试用例(编译命令拼接)
- def build_testcases(self, productform, target):
- command = []
- if self.is_build_example:
- command.append("--gn-args")
- command.append("build_example=true")
- if isinstance(target, list):
- for test in target:
- command.append("--build-target")
- command.append(test + "_test")
- elif isinstance(target, str):
- for test in target.split(','):
- command.append("--build-target")
- command.append(test)
-
- if productform == "rk3568":
- pass
- else:
- command.append("--abi-type")
- command.append("generic_generic_arm_64only")
- command.append("--device-type")
- command.append(get_output_path().split("/")[-1])
- command.append("--build-variant")
- command.append("root")
- command.append("--ccache")
- self._delete_testcase_dir(productform)
- build_result = self._execute_build_command(productform, command)
- self._merge_testcase_dir(productform)
- return build_result
-
- # 编译XTS测试用例
- def build_xts_testcases(self, para):
- self._delete_xts_testcase_dir(para)
- xts_build_command = []
- if para.productform == "rk3568":
- False
- else:
- xts_build_test_command = ["--abi-type", "generic_generic_arm_64only", "--device-type",
- get_output_path().split("/")[-1], "--build-variant", "root", "--gn-args",
- "build_xts=true", "--export-para", "xts_suitename:" + para.testtype[0]]
- if len(para.subsystem) > 0:
- input_subsystem = ",".join(para.subsystem)
- xts_build_test_command.append("--build-target")
- xts_build_test_command.append(input_subsystem)
- return False
- if para.testsuit != "" and len(para.subsystem) == 0:
- LOG.error("Please specify subsystem.")
- return False
- xts_build_command.extend(xts_build_test_command)
- xts_build_command.append("--ccache")
- build_result = self._execute_build_xts_command(para, xts_build_command)
- return build_result
-
-
- def build_deps_files(self, productform):
- command = ["--ccache", "--gn-args", "pycache_enable=true", "--gn-args",
- "check_deps=true", "--build-only-gn"]
- if productform == "rk3568":
- pass
- else:
- command.append("--abi-type")
- command.append("generic_generic_arm_64only")
- command.append("--device-type")
- command.append(get_output_path().split("/")[-1])
- command.append("--build-variant")
- command.append("root")
- return self._execute_build_deps_files_command(productform, command)
-
- # 部件间依赖关系预处理,生成part_deps_info.json
- def build_part_deps(self, para):
- build_part_deps_result = self._execute_build_part_deps_command(para)
- return build_part_deps_result
-
- def build_gn_file(self, productform):
- command = []
- if self.is_build_example:
- command.append("--gn-args")
- command.append("build_example=true")
- command.append("--build-only-gn")
- command.append("--gn-args")
- command.append(BUILD_TARGET_PLATFORM % productform)
- return self._execute_build_command(productform, command)
-
- def build_version(self, productform):
- command = []
- command.append("--build-target")
- command.append("make_all")
- command.append("--gn-args")
- command.append(BUILD_TARGET_PLATFORM % productform)
- return self._execute_build_command(productform, command)
-
##############################################################################
##############################################################################
diff --git a/src/core/build/select_targets.py b/src/core/build/select_targets.py
index a4112323260a06b5060966d48c6964f21841cce2..90cef6fc21004f974d615e29233f2f7282c44dcb 100755
--- a/src/core/build/select_targets.py
+++ b/src/core/build/select_targets.py
@@ -82,6 +82,54 @@ class SelectTargets(object):
part_path_dic[part_name] = part_path_list
return part_path_dic
+ def get_build_targets(self, productform, typelist, partlist, testmodule):
+ target_list = []
+
+ if productform == "" or len(typelist) == 0:
+ LOG.warning("Error: productform or typelist is empty.")
+ return []
+
+ if len(partlist) == 0 and testmodule != "":
+ LOG.warning(
+ "The part cannot be empty When the module is not empty.")
+ return []
+ # productform不为空,typelist(test type[UT,MST,ST,PERF,ALL])不为空
+ # partlist和testmodule为空,通过testtype获取部件列表
+ if len(partlist) == 0 and testmodule == "":
+ target_list = self._get_target_list_by_type(productform, typelist)
+ return target_list
+ # productform不为空,typelist(test type[UT,MST,ST,PERF,ALL])不为空
+ # partlist不为空,testmodule为空,通过testtype、partlist一起获取部件列表
+ if len(partlist) != 0 and testmodule == "":
+ target_list = self._get_target_list_by_part(productform, typelist,
+ partlist)
+ return target_list
+ # productform不为空,typelist(test type[UT,MST,ST,PERF,ALL])不为空
+ # partlist不为空,testmodule不为空,通过testtype、partlist、testmodule一起获取部件列表
+ if len(partlist) != 0 and testmodule != "":
+ target_list = self._get_target_list_by_module(productform,
+ typelist,
+ partlist,
+ testmodule)
+
+ return target_list
+
+ # 通过infos_for_testfwk.json文件获取所有子部件信息编译目录信息:
+ # [{“部件名1”:[~/OpenHarmony/out/rk3568/module_list_files/部件名1]}]
+ # 然后遍历这些目录中的mlf文件,获取其中定义的label,返回label集合
+ # 遍历时通过testmodule控制遍历的部件指定模块目录,如果不定义,则遍历子部件下面所有模块目录
+ # 遍历时通过partlist控制遍历指定部件目录,如果不定义,则遍历infos_for_testfwk.json文件中定义的所有子部件目录
+ def filter_build_targets(self, para):
+ productform = para.productform
+ typelist = para.testtype
+ partlist = para.partname_list
+ testmodule = para.testmodule
+
+ print("partlist = %s" % str(partlist))
+ target_list = self.get_build_targets(productform, typelist,
+ partlist, testmodule)
+ return target_list
+
def _get_target_list_from_path(self, typelist, check_path):
target_list = []
if os.path.exists(check_path):
@@ -146,54 +194,5 @@ class SelectTargets(object):
target_list.extend(temp_list)
return target_list
- def get_build_targets(self, productform, typelist, partlist, testmodule):
- target_list = []
-
- if productform == "" or len(typelist) == 0:
- LOG.warning("Error: productform or typelist is empty.")
- return []
-
- if len(partlist) == 0 and testmodule != "":
- LOG.warning(
- "The part cannot be empty When the module is not empty.")
- return []
- # productform不为空,typelist(test type[UT,MST,ST,PERF,ALL])不为空
- # partlist和testmodule为空,通过testtype获取部件列表
- if len(partlist) == 0 and testmodule == "":
- target_list = self._get_target_list_by_type(productform, typelist)
- return target_list
- # productform不为空,typelist(test type[UT,MST,ST,PERF,ALL])不为空
- # partlist不为空,testmodule为空,通过testtype、partlist一起获取部件列表
- if len(partlist) != 0 and testmodule == "":
- target_list = self._get_target_list_by_part(productform, typelist,
- partlist)
- return target_list
- # productform不为空,typelist(test type[UT,MST,ST,PERF,ALL])不为空
- # partlist不为空,testmodule不为空,通过testtype、partlist、testmodule一起获取部件列表
- if len(partlist) != 0 and testmodule != "":
- target_list = self._get_target_list_by_module(productform,
- typelist,
- partlist,
- testmodule)
-
- return target_list
-
- # 通过infos_for_testfwk.json文件获取所有子部件信息编译目录信息:
- # [{“部件名1”:[~/OpenHarmony/out/rk3568/module_list_files/部件名1]}]
- # 然后遍历这些目录中的mlf文件,获取其中定义的label,返回label集合
- # 遍历时通过testmodule控制遍历的部件指定模块目录,如果不定义,则遍历子部件下面所有模块目录
- # 遍历时通过partlist控制遍历指定部件目录,如果不定义,则遍历infos_for_testfwk.json文件中定义的所有子部件目录
- def filter_build_targets(self, para):
- productform = para.productform
- typelist = para.testtype
- partlist = para.partname_list
- testmodule = para.testmodule
-
- print("partlist = %s" % str(partlist))
- target_list = self.get_build_targets(productform, typelist,
- partlist, testmodule)
- return target_list
-
-
##############################################################################
##############################################################################
diff --git a/src/core/command/console.py b/src/core/command/console.py
index 84624f77399c99d647158ad53f81ca60d058c278..68f9a982fd759949ab9a32ce13267e1e6bba15b8 100755
--- a/src/core/command/console.py
+++ b/src/core/command/console.py
@@ -65,47 +65,6 @@ class Console(object):
def __init__(self):
pass
-
- def handler_ctrl_c(self, signalnum, frame):
- pass
-
- def handler_ctrl_z(self, signalnum, frame):
- pass
-
- def console(self, args):
- """
- Main xDevice console providing user with the interface to interact
- """
- EnvironmentManager()
- if args is None or len(args) < 2:
- self.wizard_dic = show_wizard_mode()
- print(self.wizard_dic)
- if self._build_version(self.wizard_dic["productform"]):
- self._console()
- else:
- LOG.error("Build version failed, exit test framework.")
- else:
- self.command_parser(" ".join(args[1:]))
-
- # 命令执行总入口
- def _console(self):
- if platform.system() != 'Windows':
- signal.signal(signal.SIGTSTP, self.handler_ctrl_z) # ctrl+x linux
- signal.signal(signal.SIGINT, self.handler_ctrl_c) # ctrl+c
-
- while True:
- try:
- # 获取用户命令输入
- usr_input = input(">>> ")
- if usr_input == "":
- continue
- # 用户输入命令解析
- self.command_parser(usr_input)
- except SystemExit:
- LOG.info("Program exit normally!")
- return
- except (IOError, EOFError, KeyboardInterrupt) as error:
- LOG.exception("Input Error: %s" % error)
@staticmethod
def _parse_combination_param(combination_value):
@@ -323,49 +282,6 @@ class Console(object):
return options, unparsed, valid_param
- def command_parser(self, args):
- try:
- # 将用户输入的指令按空格拆分成字符串数组
- para_list = args.split()
- options, _, valid_param = self.argument_parser(para_list)
- if options is None or not valid_param:
- LOG.warning("options is None.")
- return
-
- # 根据命令行的命令选择不同的方法执行
- command = options.action
- if command == "":
- LOG.warning("action is empty.")
- return
-
- if "productform" in self.wizard_dic.keys():
- productform = self.wizard_dic["productform"]
- options.productform = productform
- else:
- productform = options.productform
-
- if command.startswith(ToolCommandType.TOOLCMD_KEY_HELP):
- self._process_command_help(para_list)
- elif command.startswith(ToolCommandType.TOOLCMD_KEY_SHOW):
- self._process_command_show(para_list, productform)
- elif command.startswith(ToolCommandType.TOOLCMD_KEY_GEN):
- self._process_command_gen(command, options)
- elif command.startswith(ToolCommandType.TOOLCMD_KEY_RUN):
- # 保存原始控制命令
- options.current_raw_cmd = args
- self._process_command_run(command, options)
- elif command.startswith(ToolCommandType.TOOLCMD_KEY_QUIT):
- self._process_command_quit(command)
- elif command.startswith(ToolCommandType.TOOLCMD_KEY_LIST):
- self._process_command_device(command)
- elif command.startswith(ToolCommandType.TOOLCMD_KEY_VERSION):
- self._process_command_version(command)
- else:
- print("The %s command is not supported." % command)
- except (AttributeError, IOError, IndexError, ImportError, NameError,
- RuntimeError, SystemError, TypeError, ValueError) as exception:
- LOG.exception(exception, exc_info=False)
-
@classmethod
def _params_pre_processing(cls, para_list):
if len(para_list) <= 1 or (
@@ -477,6 +393,90 @@ class Console(object):
product_form)
return build_result
+ def handler_ctrl_c(self, signalnum, frame):
+ pass
+
+ def handler_ctrl_z(self, signalnum, frame):
+ pass
+
+ def console(self, args):
+ """
+ Main xDevice console providing user with the interface to interact
+ """
+ EnvironmentManager()
+ if args is None or len(args) < 2:
+ self.wizard_dic = show_wizard_mode()
+ print(self.wizard_dic)
+ if self._build_version(self.wizard_dic["productform"]):
+ self._console()
+ else:
+ LOG.error("Build version failed, exit test framework.")
+ else:
+ self.command_parser(" ".join(args[1:]))
+
+ def command_parser(self, args):
+ try:
+ # 将用户输入的指令按空格拆分成字符串数组
+ para_list = args.split()
+ options, _, valid_param = self.argument_parser(para_list)
+ if options is None or not valid_param:
+ LOG.warning("options is None.")
+ return
+
+ # 根据命令行的命令选择不同的方法执行
+ command = options.action
+ if command == "":
+ LOG.warning("action is empty.")
+ return
+
+ if "productform" in self.wizard_dic.keys():
+ productform = self.wizard_dic["productform"]
+ options.productform = productform
+ else:
+ productform = options.productform
+
+ if command.startswith(ToolCommandType.TOOLCMD_KEY_HELP):
+ self._process_command_help(para_list)
+ elif command.startswith(ToolCommandType.TOOLCMD_KEY_SHOW):
+ self._process_command_show(para_list, productform)
+ elif command.startswith(ToolCommandType.TOOLCMD_KEY_GEN):
+ self._process_command_gen(command, options)
+ elif command.startswith(ToolCommandType.TOOLCMD_KEY_RUN):
+ # 保存原始控制命令
+ options.current_raw_cmd = args
+ self._process_command_run(command, options)
+ elif command.startswith(ToolCommandType.TOOLCMD_KEY_QUIT):
+ self._process_command_quit(command)
+ elif command.startswith(ToolCommandType.TOOLCMD_KEY_LIST):
+ self._process_command_device(command)
+ elif command.startswith(ToolCommandType.TOOLCMD_KEY_VERSION):
+ self._process_command_version(command)
+ else:
+ print("The %s command is not supported." % command)
+ except (AttributeError, IOError, IndexError, ImportError, NameError,
+ RuntimeError, SystemError, TypeError, ValueError) as exception:
+ LOG.exception(exception, exc_info=False)
+
+ # 命令执行总入口
+ def _console(self):
+ if platform.system() != 'Windows':
+ signal.signal(signal.SIGTSTP, self.handler_ctrl_z) # ctrl+x linux
+ signal.signal(signal.SIGINT, self.handler_ctrl_c) # ctrl+c
+
+ while True:
+ try:
+ # 获取用户命令输入
+ usr_input = input(">>> ")
+ if usr_input == "":
+ continue
+ # 用户输入命令解析
+ self.command_parser(usr_input)
+ except SystemExit:
+ LOG.info("Program exit normally!")
+ return
+ except (IOError, EOFError, KeyboardInterrupt) as error:
+ LOG.exception("Input Error: %s" % error)
+
@dataclass
class ConfigConst(object):
diff --git a/src/core/command/display.py b/src/core/command/display.py
index b7f60feabdae88b8247ee035ce443ad942ae3c92..b8de6ef887efd77ee7d36add34a6c4974725d430 100644
--- a/src/core/command/display.py
+++ b/src/core/command/display.py
@@ -201,7 +201,6 @@ def select_user_input(data_list):
return select_item_value, select_item_index
-
# 选择productform
def select_productform():
select_value = "phone"
diff --git a/src/core/command/gen.py b/src/core/command/gen.py
index 9a295e9fe6daaa763b376fddb4f0ecb5855dc4b3..fc9ed92608654b3bb9d1aa0f11aaa7034b1c69fb 100644
--- a/src/core/command/gen.py
+++ b/src/core/command/gen.py
@@ -28,7 +28,22 @@ MODES = stat.S_IWUSR | stat.S_IRUSR
LOG = platform_logger("Gen")
+
class Gen(object):
+ @classmethod
+ def fuzz_dir_generation(cls, options):
+ helper_path = os.path.join("..", "libs", "fuzzlib", "fuzzer_helper.py")
+ fuzz_path = os.path.join(sys.source_code_root_path, options.dirpath)
+ LOG.info("fuzz_path = %s" % fuzz_path)
+ if not os.path.exists(fuzz_path):
+ os.makedirs(fuzz_path)
+ LOG.info("make folder %s" % fuzz_path)
+
+ command = [sys.executable, helper_path, 'generate',
+ options.fuzzername, fuzz_path]
+ LOG.info("command %s" % command)
+ subprocess.call(command, shell=False)
+
def process_command_gen(self, options):
if (len(options.testtype) != 1) or (options.dirpath == "") or \
(options.fuzzername == ""):
@@ -52,17 +67,3 @@ class Gen(object):
for target in fuzzer_list:
if target:
gn_file.write("\"%s\",\n" % target)
-
- @classmethod
- def fuzz_dir_generation(cls, options):
- helper_path = os.path.join("..", "libs", "fuzzlib", "fuzzer_helper.py")
- fuzz_path = os.path.join(sys.source_code_root_path, options.dirpath)
- LOG.info("fuzz_path = %s" % fuzz_path)
- if not os.path.exists(fuzz_path):
- os.makedirs(fuzz_path)
- LOG.info("make folder %s" % fuzz_path)
-
- command = [sys.executable, helper_path, 'generate',
- options.fuzzername, fuzz_path]
- LOG.info("command %s" % command)
- subprocess.call(command, shell=False)
\ No newline at end of file
diff --git a/src/core/command/run.py b/src/core/command/run.py
index ee89702fa7749ac9d596519afc4ca6e1f45b5916..00eb23991f3243ad9be77c9e1d86f5684a4aa7e5 100644
--- a/src/core/command/run.py
+++ b/src/core/command/run.py
@@ -54,11 +54,109 @@ class Run(object):
def get_history(self):
return self.history_cmd_list
+ @classmethod
+ def get_target_out_path(cls, product_form):
+ target_out_path = UserConfigManager().get_test_cases_dir()
+ if target_out_path == "":
+ target_out_path = os.path.join(
+ get_build_output_path(product_form),
+ "packages",
+ product_form)
+ target_out_path = os.path.abspath(target_out_path)
+ return target_out_path
+
+ @classmethod
+ def _build_test_cases(cls, options):
+ if options.coverage:
+ LOG.info("Coverage testing, no need to compile testcases")
+ return True
+
+ is_build_testcase = UserConfigManager().get_user_config_flag(
+ "build", "testcase")
+ project_root_path = sys.source_code_root_path
+ if is_build_testcase and project_root_path != "":
+ from core.build.build_manager import BuildManager
+ build_manager = BuildManager()
+ return build_manager.build_testcases(project_root_path, options)
+ else:
+ return True
+
+ @classmethod
+ def _check_test_dictionary(cls, test_dictionary):
+ is_valid_status = False
+ key_list = sorted(test_dictionary.keys())
+ for key in key_list:
+ file_list = test_dictionary[key]
+ if len(file_list) > 0:
+ is_valid_status = True
+ break
+ return is_valid_status
+
+ @classmethod
+ def get_tests_out_path(cls, product_form):
+ testcase_path = UserConfigManager().get_test_cases_dir()
+ if testcase_path == "":
+ all_product_list = scan_support_product()
+ if product_form in all_product_list:
+ if is_open_source_product(product_form):
+ testcase_path = os.path.abspath(os.path.join(
+ get_build_output_path(product_form),
+ "tests"))
+ else:
+ testcase_path = os.path.abspath(os.path.join(
+ get_build_output_path(product_form),
+ "tests"))
+ else:
+ testcase_path = os.path.join(
+ get_build_output_path(product_form), "tests")
+ LOG.info("testcase_path=%s" % testcase_path)
+ return testcase_path
+
+ @classmethod
+ def get_xts_tests_out_path(cls, product_form, testtype):
+ xts_testcase_path = UserConfigManager().get_test_cases_dir()
+ if xts_testcase_path == "":
+ xts_testcase_path = os.path.abspath(os.path.join(
+ get_build_output_path(product_form),
+ "suites",
+ testtype[0],
+ "testcases"))
+ LOG.info("xts_testcase_path=%s" % xts_testcase_path)
+ return xts_testcase_path
+
+ @classmethod
+ def get_external_deps_out_path(cls, product_form):
+ external_deps_path = os.path.abspath(os.path.join(
+ get_build_output_path(product_form),
+ "part_deps_info",
+ "part_deps_info.json"))
+ LOG.info("external_deps_path=%s" % external_deps_path)
+ return external_deps_path
+
+ @classmethod
+ def get_coverage_outpath(cls, options):
+ coverage_out_path = ""
+ if options.coverage:
+ coverage_out_path = get_build_output_path(options.productform)
+ if coverage_out_path == "":
+ coverage_out_path = UserConfigManager().get_user_config(
+ "coverage").get("outpath", "")
+ if coverage_out_path == "":
+ LOG.error("Coverage test: coverage_outpath is empty.")
+ return coverage_out_path
+
+ @classmethod
+ def get_part_deps_list(cls, productform, testpart):
+ #获取预处理部件间依赖的编译结果路径
+ external_deps_path = cls.get_external_deps_out_path(productform)
+ external_deps_path_list = TestCaseManager().get_part_deps_files(external_deps_path, testpart)
+ return external_deps_path_list
+
def process_command_run(self, command, options):
current_raw_cmd = ",".join(list(map(str, options.current_raw_cmd.split(" "))))
if options.coverage and platform.system() != "Windows":
if not options.pullgcda:
- push_cov_path = os.path.join(sys.framework_root_dir, "localCoverage/push_coverage_so/push_coverage.py")
+ push_cov_path = os.path.join(sys.framework_root_dir, "local_coverage/push_coverage_so/push_coverage.py")
if os.path.exists(push_cov_path):
if str(options.testpart) == "[]" and str(options.subsystem) == "[]":
LOG.info("No subsystem or part input. Not push coverage so.")
@@ -76,7 +174,7 @@ class Run(object):
else:
print(f"{push_cov_path} not exists.")
- init_gcov_path = os.path.join(sys.framework_root_dir, "localCoverage/resident_service/init_gcov.py")
+ init_gcov_path = os.path.join(sys.framework_root_dir, "local_coverage/resident_service/init_gcov.py")
if os.path.exists(init_gcov_path):
subprocess.run("python3 %s command_str=%s" % (
init_gcov_path, current_raw_cmd), shell=True)
@@ -139,8 +237,7 @@ class Run(object):
#打印历史记录
if options.historylist:
print("The latest command history is: %d" % len(self.history_cmd_list))
- for index in range(0, len(self.history_cmd_list)):
- cmd_record = self.history_cmd_list[index]
+ for index, cmd_record in enumerate(self.history_cmd_list):
print("%d. [%s] - [%s]::[%s]" % (index + 1, cmd_record["time"],
cmd_record["raw_cmd"], cmd_record["result"]))
return
@@ -234,7 +331,7 @@ class Run(object):
if not check_ditributetest_environment():
return
- output_test = get_test_case(test_dict["CXX"])
+ output_test = get_test_case(test_dict.get("CXX", None))
if not output_test:
return
@@ -308,14 +405,14 @@ class Run(object):
if options.coverage and platform.system() != "Windows":
pull_service_gcov_path = os.path.join(
- sys.framework_root_dir, "localCoverage/resident_service/pull_service_gcda.py")
+ sys.framework_root_dir, "local_coverage/resident_service/pull_service_gcda.py")
if os.path.exists(pull_service_gcov_path):
subprocess.run("python3 %s command_str=%s" % (pull_service_gcov_path, current_raw_cmd), shell=True)
else:
print(f"{pull_service_gcov_path} not exists.")
if not options.pullgcda:
- cov_main_file_path = os.path.join(sys.framework_root_dir, "localCoverage/coverage_tools.py")
+ cov_main_file_path = os.path.join(sys.framework_root_dir, "local_coverage/coverage_tools.py")
testpart = ",".join(list(map(str, options.partname_list)))
if os.path.exists(cov_main_file_path):
subprocess.run("python3 %s testpart=%s" % (
@@ -324,107 +421,6 @@ class Run(object):
print(f"{cov_main_file_path} not exists.")
return
- ##############################################################
- ##############################################################
-
- @classmethod
- def get_target_out_path(cls, product_form):
- target_out_path = UserConfigManager().get_test_cases_dir()
- if target_out_path == "":
- target_out_path = os.path.join(
- get_build_output_path(product_form),
- "packages",
- product_form)
- target_out_path = os.path.abspath(target_out_path)
- return target_out_path
-
- @classmethod
- def _build_test_cases(cls, options):
- if options.coverage:
- LOG.info("Coverage testing, no need to compile testcases")
- return True
-
- is_build_testcase = UserConfigManager().get_user_config_flag(
- "build", "testcase")
- project_root_path = sys.source_code_root_path
- if is_build_testcase and project_root_path != "":
- from core.build.build_manager import BuildManager
- build_manager = BuildManager()
- return build_manager.build_testcases(project_root_path, options)
- else:
- return True
-
- @classmethod
- def _check_test_dictionary(cls, test_dictionary):
- is_valid_status = False
- key_list = sorted(test_dictionary.keys())
- for key in key_list:
- file_list = test_dictionary[key]
- if len(file_list) > 0:
- is_valid_status = True
- break
- return is_valid_status
-
- @classmethod
- def get_tests_out_path(cls, product_form):
- testcase_path = UserConfigManager().get_test_cases_dir()
- if testcase_path == "":
- all_product_list = scan_support_product()
- if product_form in all_product_list:
- if is_open_source_product(product_form):
- testcase_path = os.path.abspath(os.path.join(
- get_build_output_path(product_form),
- "tests"))
- else:
- testcase_path = os.path.abspath(os.path.join(
- get_build_output_path(product_form),
- "tests"))
- else:
- testcase_path = os.path.join(
- get_build_output_path(product_form), "tests")
- LOG.info("testcase_path=%s" % testcase_path)
- return testcase_path
-
- @classmethod
- def get_xts_tests_out_path(cls, product_form, testtype):
- xts_testcase_path = UserConfigManager().get_test_cases_dir()
- if xts_testcase_path == "":
- xts_testcase_path = os.path.abspath(os.path.join(
- get_build_output_path(product_form),
- "suites",
- testtype[0],
- "testcases"))
- LOG.info("xts_testcase_path=%s" % xts_testcase_path)
- return xts_testcase_path
-
- @classmethod
- def get_external_deps_out_path(cls, product_form):
- external_deps_path = os.path.abspath(os.path.join(
- get_build_output_path(product_form),
- "part_deps_info",
- "part_deps_info.json"))
- LOG.info("external_deps_path=%s" % external_deps_path)
- return external_deps_path
-
- @classmethod
- def get_coverage_outpath(cls, options):
- coverage_out_path = ""
- if options.coverage:
- coverage_out_path = get_build_output_path(options.productform)
- if coverage_out_path == "":
- coverage_out_path = UserConfigManager().get_user_config(
- "coverage").get("outpath", "")
- if coverage_out_path == "":
- LOG.error("Coverage test: coverage_outpath is empty.")
- return coverage_out_path
-
- @classmethod
- def get_part_deps_list(cls, productform, testpart):
- #获取预处理部件间依赖的编译结果路径
- external_deps_path = cls.get_external_deps_out_path(productform)
- external_deps_path_list = TestCaseManager().get_part_deps_files(external_deps_path, testpart)
- return external_deps_path_list
-
def get_xts_test_dict(self, options):
# 获取XTS测试用例编译结果路径
xts_test_case_path = self.get_xts_tests_out_path(options.productform, options.testtype)
@@ -443,5 +439,3 @@ class Run(object):
test_dict = TestCaseManager().get_test_files(test_case_path, options)
return test_dict
-
-
diff --git a/src/core/config/config_manager.py b/src/core/config/config_manager.py
index 492a717283cd0a5ef3182560f45b97d7a8e8572d..47690ac87164f10facaa07b5f4d7a372514554c7 100755
--- a/src/core/config/config_manager.py
+++ b/src/core/config/config_manager.py
@@ -175,6 +175,17 @@ class UserConfigManager(object):
self.filepath = os.path.abspath(
os.path.join(CONFIG_PATH, config_file))
+ @classmethod
+ def content_strip(cls, content):
+ return content.strip()
+
+ @classmethod
+ def _verify_duplicate(cls, items):
+ if len(set(items)) != len(items):
+ LOG.warning("find duplicate sn config, configuration incorrect")
+ return False
+ return True
+
def get_user_config_list(self, tag_name):
data_dic = {}
try:
@@ -189,25 +200,6 @@ class UserConfigManager(object):
LOG.error(("Parse %s fail!" % self.filepath) + xml_exception.args)
return data_dic
- @classmethod
- def content_strip(cls, content):
- return content.strip()
-
- @classmethod
- def _verify_duplicate(cls, items):
- if len(set(items)) != len(items):
- LOG.warning("find duplicate sn config, configuration incorrect")
- return False
- return True
-
- def _handle_str(self, content):
- config_list = map(self.content_strip, content.split(';'))
- config_list = [item for item in config_list if item]
- if config_list:
- if not self._verify_duplicate(config_list):
- return []
- return config_list
-
def get_sn_list(self):
sn_select_list = []
try:
@@ -280,6 +272,14 @@ class UserConfigManager(object):
if testcase_path != "":
testcase_path = os.path.abspath(testcase_path)
return testcase_path
+
+ def _handle_str(self, content):
+ config_list = map(self.content_strip, content.split(';'))
+ config_list = [item for item in config_list if item]
+ if config_list:
+ if not self._verify_duplicate(config_list):
+ return []
+ return config_list
class BuildConfigManager(object):
diff --git a/src/core/config/resource_manager.py b/src/core/config/resource_manager.py
index d5562ea1d111c93d4a8e9d938df6acc2d5f9b959..cbf1763499f0faec59101abaf517121e516a0e59 100755
--- a/src/core/config/resource_manager.py
+++ b/src/core/config/resource_manager.py
@@ -33,6 +33,110 @@ class ResourceManager(object):
def __init__(self):
pass
+ @staticmethod
+ def find_node_by_target(file_path, targe_tname):
+ node = None
+ try:
+ if os.path.exists(file_path):
+ tree = ElementTree.parse(file_path)
+ root = tree.getroot()
+ targets = root.iter("target")
+ for target in targets:
+ curr_dic = target.attrib
+ if curr_dic.get("name") == targe_tname or \
+ targe_tname.startswith(curr_dic.get("name")):
+ node = target
+ break
+ except ElementTree.ParseError as xml_exception:
+ LOG.error("resource_test.xml parsing failed." +
+ xml_exception.args)
+ return node
+
+ @classmethod
+ def _get_file_name_extension(cls, filepath):
+ _, fullname = os.path.split(filepath)
+ filename, ext = os.path.splitext(fullname)
+ LOG.debug("file path:{}".format(filepath))
+ return filename, ext
+
+ @classmethod
+ def get_dir_name(cls, dir_path):
+ dir_name = ""
+ if os.path.isdir(dir_path) and dir_path[-1] != ".":
+ dir_name_list = dir_path.rstrip(os.sep).split(os.sep)
+ if len(dir_name_list) > 1:
+ dir_name = dir_name_list[-1]
+ return dir_name
+
+ @classmethod
+ def get_env_data(cls, environment_list):
+ env_data_dic = {}
+ device_name = ""
+ option_dic = {}
+
+ for item in environment_list:
+ if "type" in item.keys():
+ if device_name != "":
+ temp_dic = option_dic.copy()
+ env_data_dic[device_name] = temp_dic
+ device_name = ""
+ option_dic.clear()
+ device_name = item["type"]
+
+ if "name" in item.keys():
+ name = item["name"]
+ value = item["value"]
+ option_dic[name] = value
+
+ if device_name != "":
+ temp_dic = option_dic.copy()
+ env_data_dic[device_name] = temp_dic
+ device_name = ""
+ option_dic.clear()
+ LOG.debug("get environment data finish")
+ return env_data_dic
+
+ @staticmethod
+ def get_resource_xml_file_path(test_suit_file_path):
+ current_dir = os.path.dirname(test_suit_file_path)
+ while True:
+ if current_dir.endswith(os.sep + "tests"):
+ current_dir = ""
+ break
+ if current_dir == "/" or current_dir.endswith(":\\"):
+ current_dir = ""
+ break
+ if os.path.exists(os.path.join(current_dir, "resource")):
+ break
+ current_dir = os.path.dirname(current_dir)
+
+ if current_dir != "":
+ xml_filepath = os.path.join(
+ current_dir,
+ "resource",
+ ConfigFileConst.RESOURCECONFIG_FILEPATH)
+ if not os.path.exists(xml_filepath):
+ xml_filepath = os.path.join(
+ current_dir,
+ "resource",
+ ConfigFileConst.CASE_RESOURCE_FILEPATH)
+ else:
+ xml_filepath = ""
+ LOG.info("xml_filepath = %s" % xml_filepath)
+ return xml_filepath
+
+ @classmethod
+ def get_nodeattrib_data(cls, data_dic):
+ curr_timeout = ""
+ if "nodeattrib" in data_dic.keys():
+ LOG.info("++++++++++++++nodeattrib+++++++++++++++")
+ nodeattrib_list = data_dic["nodeattrib"]
+ if len(nodeattrib_list) != 0:
+ node_item_dic = nodeattrib_list[0]
+ if "timeout" in node_item_dic:
+ curr_timeout = node_item_dic["timeout"]
+ return curr_timeout
+
def get_resource_data_dic(self, testsuit_filepath):
resource_dir = ""
data_dic = {}
@@ -90,44 +194,9 @@ class ResourceManager(object):
return data_dic
- @staticmethod
- def find_node_by_target(file_path, targe_tname):
- node = None
- try:
- if os.path.exists(file_path):
- tree = ElementTree.parse(file_path)
- root = tree.getroot()
- targets = root.iter("target")
- for target in targets:
- curr_dic = target.attrib
- if curr_dic.get("name") == targe_tname or \
- targe_tname.startswith(curr_dic.get("name")):
- node = target
- break
- except ElementTree.ParseError as xml_exception:
- LOG.error("resource_test.xml parsing failed." +
- xml_exception.args)
- return node
-
##########################################################################
##########################################################################
- @classmethod
- def _get_file_name_extension(cls, filepath):
- _, fullname = os.path.split(filepath)
- filename, ext = os.path.splitext(fullname)
- LOG.debug("file path:{}".format(filepath))
- return filename, ext
-
- @classmethod
- def get_dir_name(cls, dir_path):
- dir_name = ""
- if os.path.isdir(dir_path) and dir_path[-1] != ".":
- dir_name_list = dir_path.rstrip(os.sep).split(os.sep)
- if len(dir_name_list) > 1:
- dir_name = dir_name_list[-1]
- return dir_name
-
def process_resource_file(self, resource_dir, preparer_list, device):
for item in preparer_list:
if "name" not in item.keys():
@@ -185,75 +254,6 @@ class ResourceManager(object):
command = command.strip()
self.lite_device.execute_command_with_timeout(command, case_type=DeviceTestType.lite_cpp_test)
- @classmethod
- def get_env_data(cls, environment_list):
- env_data_dic = {}
- device_name = ""
- option_dic = {}
-
- for item in environment_list:
- if "type" in item.keys():
- if device_name != "":
- temp_dic = option_dic.copy()
- env_data_dic[device_name] = temp_dic
- device_name = ""
- option_dic.clear()
- device_name = item["type"]
-
- if "name" in item.keys():
- name = item["name"]
- value = item["value"]
- option_dic[name] = value
-
- if device_name != "":
- temp_dic = option_dic.copy()
- env_data_dic[device_name] = temp_dic
- device_name = ""
- option_dic.clear()
- LOG.debug("get environment data finish")
- return env_data_dic
-
- @staticmethod
- def get_resource_xml_file_path(test_suit_file_path):
- current_dir = os.path.dirname(test_suit_file_path)
- while True:
- if current_dir.endswith(os.sep + "tests"):
- current_dir = ""
- break
- if current_dir == "/" or current_dir.endswith(":\\"):
- current_dir = ""
- break
- if os.path.exists(os.path.join(current_dir, "resource")):
- break
- current_dir = os.path.dirname(current_dir)
-
- if current_dir != "":
- xml_filepath = os.path.join(
- current_dir,
- "resource",
- ConfigFileConst.RESOURCECONFIG_FILEPATH)
- if not os.path.exists(xml_filepath):
- xml_filepath = os.path.join(
- current_dir,
- "resource",
- ConfigFileConst.CASE_RESOURCE_FILEPATH)
- else:
- xml_filepath = ""
- LOG.info("xml_filepath = %s" % xml_filepath)
- return xml_filepath
-
- @classmethod
- def get_nodeattrib_data(cls, data_dic):
- curr_timeout = ""
- if "nodeattrib" in data_dic.keys():
- LOG.info("++++++++++++++nodeattrib+++++++++++++++")
- nodeattrib_list = data_dic["nodeattrib"]
- if len(nodeattrib_list) != 0:
- node_item_dic = nodeattrib_list[0]
- if "timeout" in node_item_dic:
- curr_timeout = node_item_dic["timeout"]
- return curr_timeout
-
def get_environment_data(self, data_dic):
env_data_dic = {}
if "environment" in data_dic.keys():
diff --git a/src/core/driver/drivers.py b/src/core/driver/drivers.py
index c27b902aa0ee3ff54d310464b3805d74c2bf7ccb..ec07b4bfbb7feaed70ccd483da8480b86a37b330 100644
--- a/src/core/driver/drivers.py
+++ b/src/core/driver/drivers.py
@@ -66,9 +66,6 @@ FLAGS = os.O_WRONLY | os.O_CREAT | os.O_EXCL
MODES = stat.S_IWUSR | stat.S_IRUSR
-##############################################################################
-##############################################################################
-
class CollectingOutputReceiver:
def __init__(self):
self.output = ""
@@ -88,18 +85,6 @@ class DisplayOutputReceiver:
self.output = ""
self.unfinished_line = ""
- def _process_output(self, output, end_mark="\n"):
- content = output
- if self.unfinished_line:
- content = "".join((self.unfinished_line, content))
- self.unfinished_line = ""
- lines = content.split(end_mark)
- if content.endswith(end_mark):
- return lines[:-1]
- else:
- self.unfinished_line = lines[-1]
- return lines[:-1]
-
def __read__(self, output):
self.output = "%s%s" % (self.output, output)
lines = self._process_output(output)
@@ -114,6 +99,18 @@ class DisplayOutputReceiver:
def __done__(self, result_code="", message=""):
pass
+ def _process_output(self, output, end_mark="\n"):
+ content = output
+ if self.unfinished_line:
+ content = "".join((self.unfinished_line, content))
+ self.unfinished_line = ""
+ lines = content.split(end_mark)
+ if content.endswith(end_mark):
+ return lines[:-1]
+ else:
+ self.unfinished_line = lines[-1]
+ return lines[:-1]
+
@dataclass
class GTestConst(object):
@@ -310,9 +307,6 @@ def _create_fuzz_result_file(filepath, filename, error_message):
return
-##############################################################################
-##############################################################################
-
class ResultManager(object):
def __init__(self, testsuit_path, config):
self.testsuite_path = testsuit_path
@@ -381,32 +375,6 @@ class ResultManager(object):
return result_file_path
- def _obtain_fuzz_corpus(self):
- command = f"cd {DEFAULT_TEST_PATH}; tar czf {self.testsuite_name}_corpus.tar.gz corpus;"
- self.config.device.execute_shell_command(command)
- result_save_path = get_result_savepath(self.testsuite_path, self.result_rootpath)
- LOG.info(f"fuzz_dir = {result_save_path}")
- self.device.pull_file(f"{DEFAULT_TEST_PATH}/{self.testsuite_name}_corpus.tar.gz", result_save_path)
-
- def _obtain_benchmark_result(self):
- benchmark_root_dir = os.path.abspath(
- os.path.join(self.result_rootpath, "benchmark"))
- benchmark_dir = os.path.abspath(
- os.path.join(benchmark_root_dir,
- self.get_result_sub_save_path(),
- self.testsuite_name))
-
- if not os.path.exists(benchmark_dir):
- os.makedirs(benchmark_dir)
-
- LOG.info("benchmark_dir = %s" % benchmark_dir)
- self.device.pull_file(os.path.join(self.device_testpath,
- "%s.json" % self.testsuite_name), benchmark_dir)
- if not os.path.exists(os.path.join(benchmark_dir,
- "%s.json" % self.testsuite_name)):
- os.rmdir(benchmark_dir)
- return benchmark_dir
-
def get_result_sub_save_path(self):
find_key = os.sep + "benchmark" + os.sep
file_dir, _ = os.path.split(self.testsuite_path)
@@ -525,10 +493,33 @@ class ResultManager(object):
if target_name != OBJ:
subprocess.Popen("mv %s %s" % (os.path.join(cxx_cov_path, target_name),
os.path.join(cxx_cov_path, OBJ)), shell=True).communicate()
+
+ def _obtain_fuzz_corpus(self):
+ command = f"cd {DEFAULT_TEST_PATH}; tar czf {self.testsuite_name}_corpus.tar.gz corpus;"
+ self.config.device.execute_shell_command(command)
+ result_save_path = get_result_savepath(self.testsuite_path, self.result_rootpath)
+ LOG.info(f"fuzz_dir = {result_save_path}")
+ self.device.pull_file(f"{DEFAULT_TEST_PATH}/{self.testsuite_name}_corpus.tar.gz", result_save_path)
+ def _obtain_benchmark_result(self):
+ benchmark_root_dir = os.path.abspath(
+ os.path.join(self.result_rootpath, "benchmark"))
+ benchmark_dir = os.path.abspath(
+ os.path.join(benchmark_root_dir,
+ self.get_result_sub_save_path(),
+ self.testsuite_name))
+
+ if not os.path.exists(benchmark_dir):
+ os.makedirs(benchmark_dir)
+
+ LOG.info("benchmark_dir = %s" % benchmark_dir)
+ self.device.pull_file(os.path.join(self.device_testpath,
+ "%s.json" % self.testsuite_name), benchmark_dir)
+ if not os.path.exists(os.path.join(benchmark_dir,
+ "%s.json" % self.testsuite_name)):
+ os.rmdir(benchmark_dir)
+ return benchmark_dir
-##############################################################################
-##############################################################################
@Plugin(type=Plugin.DRIVER, id=DeviceTestType.cpp_test)
class CppTestDriver(IDriver):
@@ -591,6 +582,30 @@ class CppTestDriver(IDriver):
self.config.device.device_log_collector.stop_hilog_task(
log_tar_file_name, module_name=request.get_module_name())
+ @staticmethod
+ def _alter_init(name):
+ with open(name, "rb") as f:
+ lines = f.read()
+ str_content = lines.decode("utf-8")
+
+ pattern_sharp = '^\s*#.*$(\n|\r\n)'
+ pattern_star = '/\*.*?\*/(\n|\r\n)+'
+ pattern_xml = '(\n|\r\n)+'
+
+ if re.match(pattern_sharp, str_content, flags=re.M):
+ striped_content = re.sub(pattern_sharp, '', str_content, flags=re.M)
+ elif re.findall(pattern_star, str_content, flags=re.S):
+ striped_content = re.sub(pattern_star, '', str_content, flags=re.S)
+ elif re.findall(pattern_xml, str_content, flags=re.S):
+ striped_content = re.sub(pattern_xml, '', str_content, flags=re.S)
+ else:
+ striped_content = str_content
+
+ striped_bt = striped_content.encode("utf-8")
+ if os.path.exists(name):
+ os.remove(name)
+ with os.fdopen(os.open(name, FLAGS, MODES), 'wb') as f:
+ f.write(striped_bt)
def _init_gtest(self):
self.config.device.connector_command("target mount")
@@ -714,31 +729,6 @@ class CppTestDriver(IDriver):
resource_dir,
self.config.device)
- @staticmethod
- def _alter_init(name):
- with open(name, "rb") as f:
- lines = f.read()
- str_content = lines.decode("utf-8")
-
- pattern_sharp = '^\s*#.*$(\n|\r\n)'
- pattern_star = '/\*.*?\*/(\n|\r\n)+'
- pattern_xml = '(\n|\r\n)+'
-
- if re.match(pattern_sharp, str_content, flags=re.M):
- striped_content = re.sub(pattern_sharp, '', str_content, flags=re.M)
- elif re.findall(pattern_star, str_content, flags=re.S):
- striped_content = re.sub(pattern_star, '', str_content, flags=re.S)
- elif re.findall(pattern_xml, str_content, flags=re.S):
- striped_content = re.sub(pattern_xml, '', str_content, flags=re.S)
- else:
- striped_content = str_content
-
- striped_bt = striped_content.encode("utf-8")
- if os.path.exists(name):
- os.remove(name)
- with os.fdopen(os.open(name, FLAGS, MODES), 'wb') as f:
- f.write(striped_bt)
-
def _push_corpus_cov_if_exist(self, suite_file):
corpus_path = suite_file.split("fuzztest")[-1].strip(os.sep)
cov_file = os.path.join(
@@ -819,9 +809,6 @@ class CppTestDriver(IDriver):
return test_para
-##############################################################################
-##############################################################################
-
@Plugin(type=Plugin.DRIVER, id=DeviceTestType.jsunit_test)
class JSUnitTestDriver(IDriver):
"""
@@ -837,7 +824,7 @@ class JSUnitTestDriver(IDriver):
# log
self.hilog = None
self.hilog_proc = None
-
+
def __check_environment__(self, device_options):
pass
@@ -903,156 +890,6 @@ class JSUnitTestDriver(IDriver):
self.config.device.device_log_collector.remove_log_address(None, self.hilog)
self.config.device.device_log_collector.stop_catch_device_log(self.hilog_proc)
- def _init_jsunit_test(self):
- self.config.device.connector_command("target mount")
- self.config.device.execute_shell_command(
- "rm -rf %s" % self.config.target_test_path)
- self.config.device.execute_shell_command(
- "mkdir -p %s" % self.config.target_test_path)
- self.config.device.execute_shell_command(
- "mount -o rw,remount,rw /")
-
- def _run_jsunit(self, suite_file, device_log_file):
- filename = os.path.basename(suite_file)
- _, suffix_name = os.path.splitext(filename)
-
- resource_manager = ResourceManager()
- resource_data_dic, resource_dir = resource_manager.get_resource_data_dic(suite_file)
- if suffix_name == ".hap":
- json_file_path = suite_file.replace(".hap", ".json")
- if os.path.exists(json_file_path):
- timeout = self._get_json_shell_timeout(json_file_path)
- else:
- timeout = ResourceManager.get_nodeattrib_data(resource_data_dic)
- else:
- timeout = ResourceManager.get_nodeattrib_data(resource_data_dic)
- resource_manager.process_preparer_data(resource_data_dic, resource_dir, self.config.device)
- main_result = self._install_hap(suite_file)
- result = ResultManager(suite_file, self.config)
- if main_result:
- self._execute_hapfile_jsunittest()
- try:
- status = False
- actiontime = JS_TIMEOUT
- times = CYCLE_TIMES
- if timeout:
- actiontime = timeout
- times = 1
- with open(device_log_file, "r", encoding='utf-8',
- errors='ignore') as file_read_pipe:
- for i in range(0, times):
- if status:
- break
- else:
- time.sleep(float(actiontime))
- start_time = int(time.time())
- while True:
- data = file_read_pipe.readline()
- if data.lower().find(_ACE_LOG_MARKER) != -1 and data.find("[end] run suites end") != -1:
- LOG.info("execute testcase successfully.")
- status = True
- break
- if int(time.time()) - start_time > 5:
- break
- finally:
- _lock_screen(self.config.device)
- self._uninstall_hap(self.package_name)
- else:
- self.result = result.get_test_results("Error: install hap failed")
- LOG.error("Error: install hap failed")
-
- resource_manager.process_cleaner_data(resource_data_dic, resource_dir, self.config.device)
-
- def generate_console_output(self, device_log_file, request):
- result_message = self.read_device_log(device_log_file)
-
- report_name = request.get_module_name()
- parsers = get_plugin(
- Plugin.PARSER, CommonParserType.jsunit)
- if parsers:
- parsers = parsers[:1]
- for listener in request.listeners:
- listener.device_sn = self.config.device.device_sn
- parser_instances = []
-
- for parser in parsers:
- parser_instance = parser.__class__()
- parser_instance.suites_name = report_name
- parser_instance.suite_name = report_name
- parser_instance.listeners = request.listeners
- parser_instances.append(parser_instance)
- handler = ShellHandler(parser_instances)
- process_command_ret(result_message, handler)
-
- def read_device_log(self, device_log_file):
- result_message = ""
- with open(device_log_file, "r", encoding='utf-8',
- errors='ignore') as file_read_pipe:
- while True:
- data = file_read_pipe.readline()
- if not data:
- break
- # only filter JSApp log
- if data.lower().find(_ACE_LOG_MARKER) != -1:
- result_message += data
- if data.find("[end] run suites end") != -1:
- break
- return result_message
-
- def _execute_hapfile_jsunittest(self):
- _unlock_screen(self.config.device)
- _unlock_device(self.config.device)
-
- try:
- return_message = self.start_hap_execute()
- except (ExecuteTerminate, DeviceError) as exception:
- return_message = str(exception.args)
-
- return return_message
-
- def _install_hap(self, suite_file):
- message = self.config.device.connector_command("install %s" % suite_file)
- message = str(message).rstrip()
- if message == "" or "success" in message:
- return_code = True
- if message != "":
- LOG.info(message)
- else:
- return_code = False
- if message != "":
- LOG.warning(message)
-
- _sleep_according_to_result(return_code)
- return return_code
-
- def start_hap_execute(self):
- try:
- command = "aa start -d 123 -a %s.MainAbility -b %s" \
- % (self.package_name, self.package_name)
- self.start_time = time.time()
- result_value = self.config.device.execute_shell_command(
- command, timeout=TIME_OUT)
-
- if "success" in str(result_value).lower():
- LOG.info("execute %s's testcase success. result value=%s"
- % (self.package_name, result_value))
- else:
- LOG.info("execute %s's testcase failed. result value=%s"
- % (self.package_name, result_value))
-
- _sleep_according_to_result(result_value)
- return_message = result_value
- except (ExecuteTerminate, DeviceError) as exception:
- return_message = exception.args
-
- return return_message
-
- def _uninstall_hap(self, package_name):
- return_message = self.config.device.execute_shell_command(
- "bm uninstall -n %s" % package_name)
- _sleep_according_to_result(return_message)
- return return_message
-
@staticmethod
def _get_acts_test_para(testcase,
testlevel,
@@ -1171,6 +1008,156 @@ class JSUnitTestDriver(IDriver):
print("file %s not exist" % hap_filepath)
return package_name, ability_name
+ def generate_console_output(self, device_log_file, request):
+ result_message = self.read_device_log(device_log_file)
+
+ report_name = request.get_module_name()
+ parsers = get_plugin(
+ Plugin.PARSER, CommonParserType.jsunit)
+ if parsers:
+ parsers = parsers[:1]
+ for listener in request.listeners:
+ listener.device_sn = self.config.device.device_sn
+ parser_instances = []
+
+ for parser in parsers:
+ parser_instance = parser.__class__()
+ parser_instance.suites_name = report_name
+ parser_instance.suite_name = report_name
+ parser_instance.listeners = request.listeners
+ parser_instances.append(parser_instance)
+ handler = ShellHandler(parser_instances)
+ process_command_ret(result_message, handler)
+
+ def read_device_log(self, device_log_file):
+ result_message = ""
+ with open(device_log_file, "r", encoding='utf-8',
+ errors='ignore') as file_read_pipe:
+ while True:
+ data = file_read_pipe.readline()
+ if not data:
+ break
+ # only filter JSApp log
+ if data.lower().find(_ACE_LOG_MARKER) != -1:
+ result_message += data
+ if data.find("[end] run suites end") != -1:
+ break
+ return result_message
+
+ def start_hap_execute(self):
+ try:
+ command = "aa start -d 123 -a %s.MainAbility -b %s" \
+ % (self.package_name, self.package_name)
+ self.start_time = time.time()
+ result_value = self.config.device.execute_shell_command(
+ command, timeout=TIME_OUT)
+
+ if "success" in str(result_value).lower():
+ LOG.info("execute %s's testcase success. result value=%s"
+ % (self.package_name, result_value))
+ else:
+ LOG.info("execute %s's testcase failed. result value=%s"
+ % (self.package_name, result_value))
+
+ _sleep_according_to_result(result_value)
+ return_message = result_value
+ except (ExecuteTerminate, DeviceError) as exception:
+ return_message = exception.args
+
+ return return_message
+
+ def _init_jsunit_test(self):
+ self.config.device.connector_command("target mount")
+ self.config.device.execute_shell_command(
+ "rm -rf %s" % self.config.target_test_path)
+ self.config.device.execute_shell_command(
+ "mkdir -p %s" % self.config.target_test_path)
+ self.config.device.execute_shell_command(
+ "mount -o rw,remount,rw /")
+
+ def _run_jsunit(self, suite_file, device_log_file):
+ filename = os.path.basename(suite_file)
+ _, suffix_name = os.path.splitext(filename)
+
+ resource_manager = ResourceManager()
+ resource_data_dic, resource_dir = resource_manager.get_resource_data_dic(suite_file)
+ if suffix_name == ".hap":
+ json_file_path = suite_file.replace(".hap", ".json")
+ if os.path.exists(json_file_path):
+ timeout = self._get_json_shell_timeout(json_file_path)
+ else:
+ timeout = ResourceManager.get_nodeattrib_data(resource_data_dic)
+ else:
+ timeout = ResourceManager.get_nodeattrib_data(resource_data_dic)
+ resource_manager.process_preparer_data(resource_data_dic, resource_dir, self.config.device)
+ main_result = self._install_hap(suite_file)
+ result = ResultManager(suite_file, self.config)
+ if main_result:
+ self._execute_hapfile_jsunittest()
+ try:
+ status = False
+ actiontime = JS_TIMEOUT
+ times = CYCLE_TIMES
+ if timeout:
+ actiontime = timeout
+ times = 1
+ with open(device_log_file, "r", encoding='utf-8',
+ errors='ignore') as file_read_pipe:
+ for i in range(0, times):
+ if status:
+ break
+ else:
+ time.sleep(float(actiontime))
+ start_time = int(time.time())
+ while True:
+ data = file_read_pipe.readline()
+ if data.lower().find(_ACE_LOG_MARKER) != -1 and data.find("[end] run suites end") != -1:
+ LOG.info("execute testcase successfully.")
+ status = True
+ break
+ if int(time.time()) - start_time > 5:
+ break
+ finally:
+ _lock_screen(self.config.device)
+ self._uninstall_hap(self.package_name)
+ else:
+ self.result = result.get_test_results("Error: install hap failed")
+ LOG.error("Error: install hap failed")
+
+ resource_manager.process_cleaner_data(resource_data_dic, resource_dir, self.config.device)
+
+ def _execute_hapfile_jsunittest(self):
+ _unlock_screen(self.config.device)
+ _unlock_device(self.config.device)
+
+ try:
+ return_message = self.start_hap_execute()
+ except (ExecuteTerminate, DeviceError) as exception:
+ return_message = str(exception.args)
+
+ return return_message
+
+ def _install_hap(self, suite_file):
+ message = self.config.device.connector_command("install %s" % suite_file)
+ message = str(message).rstrip()
+ if message == "" or "success" in message:
+ return_code = True
+ if message != "":
+ LOG.info(message)
+ else:
+ return_code = False
+ if message != "":
+ LOG.warning(message)
+
+ _sleep_according_to_result(return_code)
+ return return_code
+
+ def _uninstall_hap(self, package_name):
+ return_message = self.config.device.execute_shell_command(
+ "bm uninstall -n %s" % package_name)
+ _sleep_according_to_result(return_message)
+ return return_message
+
@Plugin(type=Plugin.DRIVER, id=DeviceTestType.oh_rust_test)
class OHRustTestDriver(IDriver):
@@ -1224,6 +1211,9 @@ class OHRustTestDriver(IDriver):
self.result = check_result_report(
request.config.report_path, self.result, self.error_message)
update_xml(request.root.source.source_file, self.result)
+
+ def __result__(self):
+ return self.result if os.path.exists(self.result) else ""
def _init_oh_rust(self):
self.config.device.connector_command("target mount")
@@ -1272,6 +1262,3 @@ class OHRustTestDriver(IDriver):
result.obtain_coverage_data()
resource_manager.process_cleaner_data(resource_data_dict, resource_dir,
self.config.device)
-
- def __result__(self):
- return self.result if os.path.exists(self.result) else ""
diff --git a/src/core/driver/lite_driver.py b/src/core/driver/lite_driver.py
index 024db50c5272203d089955138fa90b441bb2a118..1c6853823601ff61c268f8dd531cd8ba367ac201 100755
--- a/src/core/driver/lite_driver.py
+++ b/src/core/driver/lite_driver.py
@@ -124,6 +124,23 @@ class LiteUnitTest(IDriver):
return
self.log.info("lite device execute request success")
+ def __result__(self):
+ pass
+
+ def show_help_info(self):
+ """
+ show help info.
+ """
+ self.log.info("this is test driver for cpp test")
+ return
+
+ def show_driver_info(self):
+ """
+ show driver info.
+ """
+ self.log.info("this is test driver for cpp test")
+ return
+
def _mount_nfs_server(self):
#before execute each suits bin, mount nfs
self.mnt_cmd = "mount {}".format(UserConfigManager().get_user_config(
@@ -143,6 +160,7 @@ class LiteUnitTest(IDriver):
if status:
self.log.info("execute mount command success")
return
+
self.log.info("try mount %d" % (i + 2))
_, status, _ = self.lite_device.execute_command_with_timeout(
self.mnt_cmd, case_type=DeviceTestType.lite_cpp_test,
@@ -161,6 +179,7 @@ class LiteUnitTest(IDriver):
if self.nfs_dir == "":
self.log.error("no configure for nfs directory")
return False
+
self._mount_nfs_server()
_, status, _ = \
self.lite_device.execute_command_with_timeout("cd /{}".format(
@@ -169,6 +188,7 @@ class LiteUnitTest(IDriver):
if not status:
self.log.error("pre execute command failed")
return False
+
self.log.info("pre execute command success")
return True
@@ -200,6 +220,7 @@ class LiteUnitTest(IDriver):
if status:
self.log.info("test case result:\n %s" % case_result)
return
+
self.log.error("failed case: %s" % test_case)
def _get_test_para(self, testcase, testlevel):
@@ -221,6 +242,7 @@ class LiteUnitTest(IDriver):
if request.config is None:
self.log.error("test config is null")
return False
+
report_path = request.config.report_path
test_result = os.path.join(report_path, "result")
test_case = request.root.source.source_file
@@ -252,6 +274,7 @@ class LiteUnitTest(IDriver):
self.log.error("file %s not exist." % result_file)
self._clear_nfs_space()
return False
+
file_name = os.path.basename(result_file)
final_result = os.path.join(test_result, file_name)
shutil.copyfile(result_file,
@@ -284,26 +307,10 @@ class LiteUnitTest(IDriver):
timeout=5, receiver=None)
if xml_file in result:
return True
+
time.sleep(5)
return False
- def show_help_info(self):
- """
- show help info.
- """
- self.log.info("this is test driver for cpp test")
- return
-
- def show_driver_info(self):
- """
- show driver info.
- """
- self.log.info("this is test driver for cpp test")
- return
-
- def __result__(self):
- pass
-
@Plugin(type=Plugin.DRIVER, id=DeviceTestType.ctest_lite)
class CTestDriver(IDriver):
@@ -365,6 +372,9 @@ class CTestDriver(IDriver):
self.error_message,
report_name)
+ def __result__(self):
+ return self.result if os.path.exists(self.result) else ""
+
def _run_ctest(self, source=None, request=None):
if not source:
LOG.error("Error: %s don't exist." % source, error_no="00101")
@@ -435,10 +445,6 @@ class CTestDriver(IDriver):
reset_cmd = [int(item, 16) for item in reset_cmd]
return reset_cmd
- def __result__(self):
- return self.result if os.path.exists(self.result) else ""
-
-
@Plugin(type=Plugin.DRIVER, id=DeviceTestType.jsunit_test_lite)
class JSUnitTestLiteDriver(IDriver):
@@ -457,23 +463,7 @@ class JSUnitTestLiteDriver(IDriver):
def __check_config__(self, config):
pass
-
- def _get_driver_config(self, json_config):
- bundle_name = get_config_value('bundle-name',
- json_config.get_driver(), False)
- if not bundle_name:
- raise ParamError("Can't find bundle-name in config file.",
- error_no="00108")
- else:
- self.config.bundle_name = bundle_name
-
- ability = get_config_value('ability',
- json_config.get_driver(), False)
- if not ability:
- self.config.ability = "default"
- else:
- self.config.ability = ability
-
+
def __execute__(self, request):
try:
LOG.debug("Start execute xdevice extension JSUnit Test")
@@ -536,6 +526,25 @@ class JSUnitTestLiteDriver(IDriver):
self.config.device.close()
+ def __result__(self):
+ return self.result if os.path.exists(self.result) else ""
+
+ def _get_driver_config(self, json_config):
+ bundle_name = get_config_value('bundle-name',
+ json_config.get_driver(), False)
+ if not bundle_name:
+ raise ParamError("Can't find bundle-name in config file.",
+ error_no="00108")
+ else:
+ self.config.bundle_name = bundle_name
+
+ ability = get_config_value('ability',
+ json_config.get_driver(), False)
+ if not ability:
+ self.config.ability = "default"
+ else:
+ self.config.ability = ability
+
def _run_jsunit(self, request):
parser_instances = []
parsers = get_plugin(Plugin.PARSER, ParserType.jsuit_test_lite)
@@ -564,5 +573,4 @@ class JSUnitTestLiteDriver(IDriver):
"\n".join(result.split("\n")[0:-1]), "\n"))
file_name.flush()
- def __result__(self):
- return self.result if os.path.exists(self.result) else ""
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/core/driver/openharmony.py b/src/core/driver/openharmony.py
index bc7e23e0a28f5fedae08cc9e875ec3725fe3a591..fd0ea8f0d6a9816387db43e6060a914544c14293 100644
--- a/src/core/driver/openharmony.py
+++ b/src/core/driver/openharmony.py
@@ -123,20 +123,11 @@ class OHJSUnitTestRunner:
self.finished_observer.notify_task_finished()
self.retry_times -= 1
- def _get_shell_handler(self, listener):
- parsers = get_plugin(Plugin.PARSER, CommonParserType.oh_jsunit)
- if parsers:
- parsers = parsers[:1]
- parser_instances = []
- for parser in parsers:
- parser_instance = parser.__class__()
- parser_instance.suites_name = self.suites_name
- parser_instance.listeners = listener
- parser_instance.runner = self
- parser_instances.append(parser_instance)
- self.finished_observer = parser_instance
- handler = ShellHandler(parser_instances)
- return handler
+ def get_oh_test_runner_path(self):
+ if self.compile_mode == "esmodule":
+ return "/ets/testrunner/OpenHarmonyTestRunner"
+ else:
+ return "OpenHarmonyTestRunner"
def add_arg(self, name, value):
if not name or not value:
@@ -157,6 +148,21 @@ class OHJSUnitTestRunner:
else:
args_commands = "%s -s %s %s " % (args_commands, key, value)
return args_commands
+
+ def _get_shell_handler(self, listener):
+ parsers = get_plugin(Plugin.PARSER, CommonParserType.oh_jsunit)
+ if parsers:
+ parsers = parsers[:1]
+ parser_instances = []
+ for parser in parsers:
+ parser_instance = parser.__class__()
+ parser_instance.suites_name = self.suites_name
+ parser_instance.listeners = listener
+ parser_instance.runner = self
+ parser_instances.append(parser_instance)
+ self.finished_observer = parser_instance
+ handler = ShellHandler(parser_instances)
+ return handler
def _get_run_command(self):
command = ""
@@ -191,12 +197,6 @@ class OHJSUnitTestRunner:
return command
- def get_oh_test_runner_path(self):
- if self.compile_mode == "esmodule":
- return "/ets/testrunner/OpenHarmonyTestRunner"
- else:
- return "OpenHarmonyTestRunner"
-
@Plugin(type=Plugin.DRIVER, id=DeviceTestType.oh_jsunit_test)
class OHJSUnitTestDriver(IDriver):
@@ -278,6 +278,9 @@ class OHJSUnitTestDriver(IDriver):
request.config.report_path, self.result, self.error_message)
update_xml(request.root.source.source_file, self.result)
+ def __result__(self):
+ return self.result if os.path.exists(self.result) else ""
+
def _run_oh_jsunit(self, config_file, request):
try:
if not os.path.exists(config_file):
@@ -501,7 +504,3 @@ class OHJSUnitTestDriver(IDriver):
stop_catch_device_log(self.log_proc)
self.config.device.device_log_collector.\
stop_catch_device_log(self.hilog_proc)
-
- def __result__(self):
- return self.result if os.path.exists(self.result) else ""
-
diff --git a/src/core/testcase/testcase_manager.py b/src/core/testcase/testcase_manager.py
index 7d91ad277de1c587b455d40c016eccf8d367b4c9..e32b718f26885c2b178bfab6b54aca9841cd3e49 100644
--- a/src/core/testcase/testcase_manager.py
+++ b/src/core/testcase/testcase_manager.py
@@ -47,6 +47,137 @@ FILTER_SUFFIX_NAME_LIST = [".TOC", ".info", ".pyc"]
class TestCaseManager(object):
+ @classmethod
+ def get_valid_suite_file(cls, test_case_out_path, suite_file, options):
+ partlist = options.partname_list
+ testmodule = options.testmodule
+ testsuit = options.testsuit
+
+ if not suite_file.startswith(test_case_out_path):
+ return False
+
+ if testsuit != "":
+ short_name, _ = os.path.splitext(os.path.basename(suite_file))
+ testsuit_list = testsuit.split(',')
+ for test in testsuit_list:
+ if short_name.startswith(test) or \
+ testsuit.startswith(short_name):
+ return True
+ return False
+
+ is_valid_status = False
+ suitfile_subpath = suite_file.replace(test_case_out_path, "")
+ suitfile_subpath = suitfile_subpath.strip(os.sep)
+ if len(partlist) == 0:
+ if testmodule != "":
+ temp_list = suitfile_subpath.split(os.sep)
+ if len(temp_list) > 2 and testmodule == temp_list[1]:
+ is_valid_status = True
+ else:
+ is_valid_status = True
+ else:
+ for partname in partlist:
+ if testmodule != "":
+ if suitfile_subpath.startswith(
+ partname + os.sep + testmodule + os.sep):
+ is_valid_status = True
+ break
+ else:
+ if suitfile_subpath.startswith(partname + os.sep):
+ is_valid_status = True
+ break
+ return is_valid_status
+
+ @classmethod
+ def check_python_test_file(cls, suite_file):
+ if suite_file.endswith(".py"):
+ filename = os.path.basename(suite_file)
+ if filename.startswith("test_"):
+ return True
+ return False
+
+ @classmethod
+ def check_hap_test_file(cls, hap_file_path):
+ try:
+ if hap_file_path.endswith(".hap"):
+ json_file_path = hap_file_path.replace(".hap", ".json")
+ if os.path.exists(json_file_path):
+ with open(json_file_path, 'r') as json_file:
+ data_dic = json.load(json_file)
+ if not data_dic:
+ return False
+ else:
+ if "kits" in data_dic.keys():
+ kits_list = data_dic.get("kits")
+ if len(kits_list) > 0:
+ for kits_dict in kits_list:
+ if "test-file-name" not in kits_dict.keys():
+ continue
+ else:
+ return True
+ else:
+ return False
+ return False
+ except JSONDecodeError:
+ return False
+ finally:
+ print(" check hap test file finally")
+
+ @classmethod
+ def get_hap_test_driver(cls, hap_file_path):
+ data_dic = cls.get_hap_json(hap_file_path)
+ if not data_dic:
+ return ""
+ else:
+ if "driver" in data_dic.keys():
+ driver_dict = data_dic.get("driver")
+ if bool(driver_dict):
+ driver_type = driver_dict.get("type")
+ return driver_type
+ else:
+ LOG.error("%s has not set driver." % hap_file_path)
+ return ""
+ else:
+ return ""
+
+ @classmethod
+ def get_hap_json(cls, hap_file_path):
+ if hap_file_path.endswith(".hap"):
+ json_file_path = hap_file_path.replace(".hap", ".json")
+ if os.path.exists(json_file_path):
+ with open(json_file_path, 'r') as json_file:
+ data_dic = json.load(json_file)
+ return data_dic
+ else:
+ return {}
+ else:
+ return {}
+
+ @classmethod
+ def get_hap_part_json(cls, hap_file_path):
+ if hap_file_path.endswith(".hap"):
+ json_file_path = hap_file_path.replace(".hap", ".moduleInfo")
+ if os.path.exists(json_file_path):
+ with open(json_file_path, 'r') as json_file:
+ data_dic = json.load(json_file)
+ return data_dic
+ else:
+ return {}
+ else:
+ return {}
+
+ @classmethod
+ def get_part_name_test_file(cls, hap_file_path):
+ data_dic = cls.get_hap_part_json(hap_file_path)
+ if not data_dic:
+ return ""
+ else:
+ if "part" in data_dic.keys():
+ part_name = data_dic["part"]
+ return part_name
+ else:
+ return ""
+
def get_test_files(self, test_case_path, options):
LOG.info("test case path: " + test_case_path)
LOG.info("test type list: " + str(options.testtype))
@@ -219,134 +350,3 @@ class TestCaseManager(object):
if self.get_hap_test_driver(xts_suite_file) == "JSUnitTest":
xts_suit_file_dic.get("JST").append(xts_suite_file)
return xts_suit_file_dic
-
- @classmethod
- def get_valid_suite_file(cls, test_case_out_path, suite_file, options):
- partlist = options.partname_list
- testmodule = options.testmodule
- testsuit = options.testsuit
-
- if not suite_file.startswith(test_case_out_path):
- return False
-
- if testsuit != "":
- short_name, _ = os.path.splitext(os.path.basename(suite_file))
- testsuit_list = testsuit.split(',')
- for test in testsuit_list:
- if short_name.startswith(test) or \
- testsuit.startswith(short_name):
- return True
- return False
-
- is_valid_status = False
- suitfile_subpath = suite_file.replace(test_case_out_path, "")
- suitfile_subpath = suitfile_subpath.strip(os.sep)
- if len(partlist) == 0:
- if testmodule != "":
- temp_list = suitfile_subpath.split(os.sep)
- if len(temp_list) > 2 and testmodule == temp_list[1]:
- is_valid_status = True
- else:
- is_valid_status = True
- else:
- for partname in partlist:
- if testmodule != "":
- if suitfile_subpath.startswith(
- partname + os.sep + testmodule + os.sep):
- is_valid_status = True
- break
- else:
- if suitfile_subpath.startswith(partname + os.sep):
- is_valid_status = True
- break
- return is_valid_status
-
- @classmethod
- def check_python_test_file(cls, suite_file):
- if suite_file.endswith(".py"):
- filename = os.path.basename(suite_file)
- if filename.startswith("test_"):
- return True
- return False
-
- @classmethod
- def check_hap_test_file(cls, hap_file_path):
- try:
- if hap_file_path.endswith(".hap"):
- json_file_path = hap_file_path.replace(".hap", ".json")
- if os.path.exists(json_file_path):
- with open(json_file_path, 'r') as json_file:
- data_dic = json.load(json_file)
- if not data_dic:
- return False
- else:
- if "kits" in data_dic.keys():
- kits_list = data_dic.get("kits")
- if len(kits_list) > 0:
- for kits_dict in kits_list:
- if "test-file-name" not in kits_dict.keys():
- continue
- else:
- return True
- else:
- return False
- return False
- except JSONDecodeError:
- return False
- finally:
- print(" check hap test file finally")
-
- @classmethod
- def get_hap_test_driver(cls, hap_file_path):
- data_dic = cls.get_hap_json(hap_file_path)
- if not data_dic:
- return ""
- else:
- if "driver" in data_dic.keys():
- driver_dict = data_dic.get("driver")
- if bool(driver_dict):
- driver_type = driver_dict.get("type")
- return driver_type
- else:
- LOG.error("%s has not set driver." % hap_file_path)
- return ""
- else:
- return ""
-
- @classmethod
- def get_hap_json(cls, hap_file_path):
- if hap_file_path.endswith(".hap"):
- json_file_path = hap_file_path.replace(".hap", ".json")
- if os.path.exists(json_file_path):
- with open(json_file_path, 'r') as json_file:
- data_dic = json.load(json_file)
- return data_dic
- else:
- return {}
- else:
- return {}
-
- @classmethod
- def get_hap_part_json(cls, hap_file_path):
- if hap_file_path.endswith(".hap"):
- json_file_path = hap_file_path.replace(".hap", ".moduleInfo")
- if os.path.exists(json_file_path):
- with open(json_file_path, 'r') as json_file:
- data_dic = json.load(json_file)
- return data_dic
- else:
- return {}
- else:
- return {}
-
- @classmethod
- def get_part_name_test_file(cls, hap_file_path):
- data_dic = cls.get_hap_part_json(hap_file_path)
- if not data_dic:
- return ""
- else:
- if "part" in data_dic.keys():
- part_name = data_dic["part"]
- return part_name
- else:
- return ""
\ No newline at end of file
diff --git a/src/core/testkit/kit_lite.py b/src/core/testkit/kit_lite.py
index a9b7e01fef97d6ec1799a4c10de5af415545f564..5a8ba0e90af5061fef54ac0b579530ec4a3bc6ef 100755
--- a/src/core/testkit/kit_lite.py
+++ b/src/core/testkit/kit_lite.py
@@ -49,7 +49,7 @@ class DeployKit(ITestKit):
self.burn_command = ""
self.timeout = ""
self.paths = ""
-
+
def __check_config__(self, config):
self.timeout = str(int(get_config_value(
'timeout', config, is_list=False, default=0)) * 1000)
@@ -63,6 +63,39 @@ class DeployKit(ITestKit):
"burn_file:{}".format(self.timeout, self.burn_file)
raise ParamError(msg, error_no="00108")
+ def __setup__(self, device, **kwargs):
+ """
+ Execute reset command on the device by cmd serial port and then upload
+ patch file by deploy tool.
+ Parameters:
+ device: the instance of LocalController with one or more
+ ComController
+ """
+ args = kwargs
+ source_file = args.get("source_file", None)
+ self._reset(device)
+ self._send_file(device, source_file)
+
+ def __teardown__(self, device):
+ pass
+
+ def copy_file_as_temp(self, original_file, str_length):
+ """
+ To obtain a random string with specified length
+ Parameters:
+ original_file : the original file path
+ str_length: the length of random string
+ """
+ if os.path.isfile(original_file):
+ random_str = random.sample(string.ascii_letters + string.digits,
+ str_length)
+ new_temp_tool_path = '{}_{}{}'.format(
+ os.path.splitext(original_file)[0], "".join(random_str),
+ os.path.splitext(original_file)[1])
+ return shutil.copyfile(original_file, new_temp_tool_path)
+ else:
+ return ""
+
def _reset(self, device):
cmd_com = device.device.com_dict.get(ComType.cmd_com)
try:
@@ -112,36 +145,3 @@ class DeployKit(ITestKit):
device.device_allocation_state = DeviceAllocationState.unusable
raise LiteDeviceError("%s port set_up wifiiot failed" %
deploy_serial_port, error_no="00402")
-
- def __setup__(self, device, **kwargs):
- """
- Execute reset command on the device by cmd serial port and then upload
- patch file by deploy tool.
- Parameters:
- device: the instance of LocalController with one or more
- ComController
- """
- args = kwargs
- source_file = args.get("source_file", None)
- self._reset(device)
- self._send_file(device, source_file)
-
- def __teardown__(self, device):
- pass
-
- def copy_file_as_temp(self, original_file, str_length):
- """
- To obtain a random string with specified length
- Parameters:
- original_file : the original file path
- str_length: the length of random string
- """
- if os.path.isfile(original_file):
- random_str = random.sample(string.ascii_letters + string.digits,
- str_length)
- new_temp_tool_path = '{}_{}{}'.format(
- os.path.splitext(original_file)[0], "".join(random_str),
- os.path.splitext(original_file)[1])
- return shutil.copyfile(original_file, new_temp_tool_path)
- else:
- return ""
\ No newline at end of file