diff --git a/README.md b/README.md index c2bcff8b9c38ff71903d7f3b55490870308d4c40..2482521509187dc40b1dab3e896120654175b637 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 diff --git a/aw/python/distributed/distribute/distribute.py b/aw/python/distributed/distribute/distribute.py index 7af86bad55fecd6d1573bedc71e78cf64308d33c..37b735f12055db1ba7302b49764dd7a25ae22b1b 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)