diff --git a/aw/python/distributed/common/devices.py b/aw/python/distributed/common/devices.py index 71803853a2ce9850decf534a9784254117ef9ade..188beb8195760122b7d826aacb45bdee6ec6284c 100755 --- a/aw/python/distributed/common/devices.py +++ b/aw/python/distributed/common/devices.py @@ -179,7 +179,6 @@ class DeviceAdapter: time.sleep(1) return return_code - ############################################################### ############################################################### @@ -199,6 +198,7 @@ class DeviceAdapter: remote_ip, remote_port, device_sn) return device_para + @classmethod def execute_command(self, command, print_flag=True, timeout=900): try: if print_flag: @@ -211,6 +211,7 @@ class DeviceAdapter: print("results: failed") return False + @classmethod def execute_command_with_output(self, command, print_flag=True): if print_flag: print("command: " + command) @@ -248,6 +249,7 @@ class DeviceAdapter: command, QUOTATION_MARKS)) + @classmethod def check_path_legal(self, path): if path and " " in path: return "\"%s\"" % path @@ -318,7 +320,6 @@ class HDCDeviceAdapter: self.unlock_screen() self.unlock_device() - ############################################################### ############################################################### @@ -337,7 +338,8 @@ class HDCDeviceAdapter: device_para = "-s tcp:%s:%s -t %s" % ( remote_ip, remote_port, device_sn) return device_para - + + @classmethod def execute_command(self, command, print_flag=True, timeout=900): try: if print_flag: @@ -350,6 +352,7 @@ class HDCDeviceAdapter: print("results: failed") return False + @classmethod def execute_command_with_output(self, command, print_flag=True): if print_flag: print("command: " + command) @@ -384,6 +387,7 @@ class HDCDeviceAdapter: command, QUOTATION_MARKS)) + @classmethod def check_path_legal(self, path): if path and " " in path: return "\"%s\"" % path diff --git a/aw/python/distributed/common/manager.py b/aw/python/distributed/common/manager.py index 7d3f3e977d75f4ae5b3651c3dded7bf7191ba4e5..0cba2d64702705a9deb575fd4e209ba8f5a4bba4 100755 --- a/aw/python/distributed/common/manager.py +++ b/aw/python/distributed/common/manager.py @@ -79,6 +79,7 @@ class DeviceManager: setattr(self, device.name, device) return + @classmethod def get_device_info_list(self): device_info_list = [] tmp_path = os.path.join(os.environ.get('PYTEST_RESULTPATH'), "temp") diff --git a/aw/python/distributed/distribute/distribute.py b/aw/python/distributed/distribute/distribute.py index 10790d05d1050f93688c8d399e19c66f0a699b7b..29b0d8becba926d5402d9cb855be971f412c7abd 100755 --- a/aw/python/distributed/distribute/distribute.py +++ b/aw/python/distributed/distribute/distribute.py @@ -116,6 +116,7 @@ class Distribute: suite_path = os.path.join(self.suite_dir, target_name) return driver.execute(suite_path, background=False) + @classmethod def pull_result(self, device, source_path, result_save_path): _, file_name = os.path.split(source_path) device.pull_file(source_path, result_save_path) @@ -123,6 +124,7 @@ class Distribute: create_empty_result_file(result_save_path, file_name) return + @classmethod def _check_thread(self, device, thread_name): check_command = "ps -A | grep %s" % thread_name checksum = 0 @@ -164,6 +166,7 @@ class Distribute: config_major_file = os.path.join(self.suite_dir, "major.desc") self._write_device_config(config_info, config_major_file) + @classmethod def _query_device_ip(self, device): output = device.shell_with_output("getprop ro.hardware") if output == "": @@ -185,6 +188,7 @@ class Distribute: return ipaddress[0] + @classmethod def _query_device_uuid(self, device): """ 1. Run the dumpsys DdmpDeviceMonitorService command to query the value @@ -209,6 +213,7 @@ class Distribute: dev_nodeid_info = device_info[begin:end].replace('"', "") return dev_nodeid_info.split(":")[1] + @classmethod def _write_device_config(self, device_info, file_path): file_dir, file_name = os.path.split(file_path) final_file = os.path.join(file_dir, file_name.split('.')[0] + ".desc") diff --git a/examples/app_info/test/unittest/common/get_app_info/ExampleJsunit.test.js b/examples/app_info/test/unittest/common/get_app_info/ExampleJsunit.test.js index d6e92a7a6a5204f8b0718e09f72c44a045f2d572..84f768238335f1af1fdd4d7aa1bb5fd9d3a60c17 100644 --- a/examples/app_info/test/unittest/common/get_app_info/ExampleJsunit.test.js +++ b/examples/app_info/test/unittest/common/get_app_info/ExampleJsunit.test.js @@ -18,6 +18,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from ' describe("AppInfoTest", function () { beforeAll(function() { + /* * @tc.setup: setup invoked before all testcases */ @@ -25,6 +26,7 @@ describe("AppInfoTest", function () { }) afterAll(function() { + /* * @tc.teardown: teardown invoked after all testcases */ @@ -32,6 +34,7 @@ describe("AppInfoTest", function () { }) beforeEach(function() { + /* * @tc.setup: setup invoked before each testcases */ @@ -39,6 +42,7 @@ describe("AppInfoTest", function () { }) afterEach(function() { + /* * @tc.teardown: teardown invoked after each testcases */ diff --git a/libs/fuzzlib/fuzzer_helper.py b/libs/fuzzlib/fuzzer_helper.py index b8c6217419047f2c6d31f1a22b6e03b4c5b3d2f9..75efdfbb8981439f9b8092a2d048ff8d0039b318 100644 --- a/libs/fuzzlib/fuzzer_helper.py +++ b/libs/fuzzlib/fuzzer_helper.py @@ -27,6 +27,8 @@ import pipes import traceback import time import copy +import shutil +from pprint import pprint from tools.colored import Colored from tools.templates import GN_ENTRY_TEMPLATE @@ -34,8 +36,6 @@ from tools.templates import PROJECT_GN_TEMPLATE from tools.templates import PROJECT_DEMO_TEMPLATE from tools.templates import PROJECT_HEADER_TEMPLATE from tools.templates import PROJECT_XML_TEMPLATE -import shutil -from pprint import pprint from tools.run_result import RunResult CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) diff --git a/libs/fuzzlib/tools/run_result.py b/libs/fuzzlib/tools/run_result.py index 5fb2b6edc683e9f0a27568eccde9384378da423f..8898e750cbe98998659f572b2b10269aa832a62f 100644 --- a/libs/fuzzlib/tools/run_result.py +++ b/libs/fuzzlib/tools/run_result.py @@ -83,8 +83,8 @@ class RunResult(): if __name__ == "__main__": - cmd_log = "" + CMD_LOG = "" res_obj = RunResult(0, "OK") - res_obj.analysis(cmd_log, "../../../out/") + res_obj.analysis(CMD_LOG, "../../../out/") print(res_obj.crash_info) diff --git a/src/core/build/pretreat_targets.py b/src/core/build/pretreat_targets.py index 7d30c9e13f36535c69eee352b617173dca10004d..b3c537c5fbe62a9592d864e9ad561e456320acfe 100644 --- a/src/core/build/pretreat_targets.py +++ b/src/core/build/pretreat_targets.py @@ -21,8 +21,8 @@ import sys import json import shutil -from core.constants import JsTestConst from xdevice import platform_logger +from core.constants import JsTestConst LOG = platform_logger("PretreatTargets") diff --git a/src/core/command/console.py b/src/core/command/console.py index a8b38225b68b649bed148d14b360e8c1eca836a1..87bbd962aa5f4f924ba4355f4a26498caa49fe7b 100755 --- a/src/core/command/console.py +++ b/src/core/command/console.py @@ -21,9 +21,10 @@ import sys import signal import platform -from core.constants import ToolCommandType from xdevice import platform_logger from xdevice import EnvironmentManager + +from core.constants import ToolCommandType from core.command.run import Run from core.command.gen import Gen from core.command.display import display_help_info diff --git a/src/core/command/run.py b/src/core/command/run.py index d89d6577e882c39367246e97ec0e78bd5f4ee0b4..f0798873102db338b6152d90f6d53088c73a8d7b 100755 --- a/src/core/command/run.py +++ b/src/core/command/run.py @@ -20,12 +20,12 @@ import time import os import sys -from core.constants import SchedulerType from xdevice import Plugin from xdevice import get_plugin from xdevice import platform_logger from xdevice import Scheduler from xdevice import DeviceTestType +from core.constants import SchedulerType from core.utils import get_build_output_path from core.utils import scan_support_product from core.utils import is_lite_product diff --git a/src/core/testcase/testcase_manager.py b/src/core/testcase/testcase_manager.py index d0ac52af924604fa789f25c1dff2895ea3282e7c..dc1bd577866df0ee9ea78e01cef1412ea0b05b3b 100755 --- a/src/core/testcase/testcase_manager.py +++ b/src/core/testcase/testcase_manager.py @@ -18,9 +18,10 @@ import os import copy + +from xdevice import platform_logger from core.utils import get_file_list_by_postfix from core.config.config_manager import FilterConfigManager -from xdevice import platform_logger LOG = platform_logger("TestcaseManager") diff --git a/src/main/__init__.py b/src/main/__init__.py index d414ea5ceda3d5e6ef735cbf798592bf73c98851..81cae9cb7a987e10a92ec5570ad530372788ccea 100755 --- a/src/main/__init__.py +++ b/src/main/__init__.py @@ -16,8 +16,8 @@ # limitations under the License. # -from . import _init_global_config from core.command.console import Console +from . import _init_global_config __all__ = [ "Console", diff --git a/src/main/__main__.py b/src/main/__main__.py index 72a567ed64d0af2298772c6b5c5f0d69c26447cb..be624023f9c939085478a926f70d76c67adb7d76 100755 --- a/src/main/__main__.py +++ b/src/main/__main__.py @@ -17,8 +17,9 @@ # import sys -from main import Console + from xdevice import platform_logger +from main import Console LOG = platform_logger("main")