From 20a9d9f05d21be79ce82e1f7a7746b1ee3a538dc Mon Sep 17 00:00:00 2001 From: hwb0703 Date: Wed, 2 Jun 2021 16:28:18 +0800 Subject: [PATCH 1/2] README.md add space --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c2bcff8..2482521 100755 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This module allows you to develop new test cases for new features, or modify exi ``` developertest/ -├── aw # Static libraries of the test framework +├── aw # Static libraries of the test framework │ ├── cxx # C++ libraries │ └── python # Python libraries ├── config # Test framework configuration -- Gitee From f5d8ceeffb5c314441ef18dbe3dbf332bbfc8e76 Mon Sep 17 00:00:00 2001 From: renxiang Date: Wed, 23 Jun 2021 16:37:06 +0800 Subject: [PATCH 2/2] modify function of parsing query device uuid in distribute test --- .../distributed/distribute/distribute.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/aw/python/distributed/distribute/distribute.py b/aw/python/distributed/distribute/distribute.py index 7af86ba..37b735f 100755 --- a/aw/python/distributed/distribute/distribute.py +++ b/aw/python/distributed/distribute/distribute.py @@ -186,19 +186,26 @@ class Distribute: return ipaddress[0] def _query_device_uuid(self, device): + """ + 1. Run the dumpsys DdmpDeviceMonitorService command to query the value of dev_nodeid. + 2. The dump information reported by the soft bus. Local device info, should be placed first. + Note: The dump information may not comply with the JSON format. + """ dumpsys_command = "dumpsys DdmpDeviceMonitorService" device_info = device.shell_with_output(dumpsys_command) if device_info == "": return "" - begin = device_info.find('{') - end = device_info.find('}') - if begin == -1 or end == -1: + begin = device_info.find("dev_nodeid") + if (begin == -1): return "" - local_device_info = device_info[begin:end + 1] - device_info_json = json.loads(local_device_info) - return device_info_json["dev_nodeid"] + end = device_info.find(",", begin) + if (end == -1): + return "" + + dev_nodeid_info = device_info[begin : end].replace('"', "") + return dev_nodeid_info.split(":")[1] def _write_device_config(self, device_info, file_path): file_dir, file_name = os.path.split(file_path) -- Gitee