diff --git a/hdc_rust/src/config.rs b/hdc_rust/src/config.rs index 5a129525284fb203ca9132a4eee9f6559f3916b8..56b618999c5ea390da5456f32f94c5ff694f7d64 100644 --- a/hdc_rust/src/config.rs +++ b/hdc_rust/src/config.rs @@ -271,7 +271,7 @@ pub enum MessageLevel { Ok, } -pub const PACKET_FLAG: &[u8] = "HW".as_bytes(); +pub const PACKET_FLAG: &[u8] = "HW".as_bytes(); // Must be 2 bytes, representing the abbreviation for hdc work pub const VER_PROTOCOL: u16 = 1; pub const ENABLE_IO_CHECK: bool = false; pub const PAYLOAD_VCODE: u8 = 0x09; diff --git a/scripts/hdc_test.py b/scripts/hdc_test.py index c05921946ce1c65504c6a3b74a3913a8a04a412f..087c7cacf3b6d67007b59780ee9ea3ff3d445a5b 100644 --- a/scripts/hdc_test.py +++ b/scripts/hdc_test.py @@ -39,7 +39,7 @@ TEST_FILE_PATH = "{}{}".format(os.path.abspath("D:/Download/sdk/"), '\\') HAP_ONE = { 'HAP_NAME': "entry-default-signed-debug.hap", - 'PACKAGE_NAME': "com.hmos.diagnosis", + 'PACKAGE_NAME': "diagnosis", } TCP_CONN = { diff --git a/src/common/define.h b/src/common/define.h index 1210ef1045f187d81a1027bd1846db433ac612ed..edae5d229978b8736e7c307a1b47234d25d6288d 100644 --- a/src/common/define.h +++ b/src/common/define.h @@ -150,7 +150,7 @@ const string SERVER_NAME = "HDCServer"; const string STRING_EMPTY = ""; const string HANDSHAKE_MESSAGE = "OHOS HDC"; // sep not char '-', not more than 11 bytes const string HANDSHAKE_FAILED = "HS FAILED"; -const string PACKET_FLAG = "HW"; // must 2bytes +const string PACKET_FLAG = "HW"; // Must be 2 bytes, representing the abbreviation for hdc work const string EMPTY_ECHO = "[Empty]"; const string MESSAGE_INFO = "[Info]"; const string MESSAGE_FAIL = "[Fail]"; diff --git a/test/scripts/testModule/test_hdc_ide_interface.py b/test/scripts/testModule/test_hdc_ide_interface.py index 5a19a678d65ce276d05a20b5d67634aec7e66618..099eada742d172a2ab322119c082f45e13bb59a4 100644 --- a/test/scripts/testModule/test_hdc_ide_interface.py +++ b/test/scripts/testModule/test_hdc_ide_interface.py @@ -25,7 +25,7 @@ from enum import Enum class OsValue(Enum): UNKNOWN = 1 - HMOS = 2 + OHOS = 2 OTHER = 3 @@ -64,15 +64,15 @@ class TestCommonSupport: cmd = f"taskkill /F /PID {pid}" subprocess.Popen(cmd, shell=False) - def is_hmos(self): # 此项依赖toybox和实际的OS + def is_ohos(self): # 此项依赖toybox和实际的OS with lock: if self.os_value != OsValue.UNKNOWN: - return self.os_value == OsValue.HMOS + return self.os_value == OsValue.OHOS if check_shell(f"shell uname -a", "HongMeng Kernel"): - self.os_value = OsValue.HMOS + self.os_value = OsValue.OHOS else: self.os_value = OsValue.OTHER - return self.os_value == OsValue.HMOS + return self.os_value == OsValue.OHOS @pytest.mark.L0 @pytest.mark.repeat(2) @@ -122,7 +122,7 @@ class TestCommonSupport: @pytest.mark.L0 @pytest.mark.repeat(2) def test_check_is_hongmeng_os(self): - if not self.is_hmos(): + if not self.is_ohos(): assert True return assert check_shell(f"shell uname -a", "HongMeng Kernel") @@ -130,7 +130,7 @@ class TestCommonSupport: @pytest.mark.L0 @pytest.mark.repeat(2) def test_check_support_ftp(self): - if not self.is_hmos(): + if not self.is_ohos(): assert True return assert not check_shell(f"shell ls -d system/bin/bftpd", "No such file or directory") @@ -148,7 +148,7 @@ class TestCommonSupport: @pytest.mark.L0 @pytest.mark.repeat(2) def test_check_support_tsan(self): - if not self.is_hmos(): + if not self.is_ohos(): assert True return assert not check_shell(f"shell ls -d system/lib64/libclang_rt.tsan.so", "No such file or directory") @@ -170,25 +170,6 @@ class TestCommonSupport: def test_check_hilog_not_support_options(self): assert check_shell(f"shell hilog -v xxx", "Invalid argument") - @pytest.mark.L0 - @pytest.mark.repeat(2) - def test_check_support_screenrecorder(self): - if not self.is_hmos(): - assert True - return - prefix = "hua" - check_shell(f"shell aa start -b com.{prefix}wei.hmos.screenrecorder" - f" -a com.{prefix}wei.hmos.screenrecorder.ServiceExtAbility" - f" --ps 'CustomizedFileName' 'test.mp4'") - time.sleep(2) - assert check_shell(f"shell mediatool query test.xxx", "The displayName format is not correct!") - assert not check_shell(f"shell mediatool query testxxx.mp4", "The displayName format is not correct!") - result = get_shell_result(f"shell mediatool query test.mp4 -u") - assert "test.mp4" in result and "file://media" in result - - check_shell(f"shell aa start -b com.{prefix}wei.hmos.screenrecorder " - f"-a com.{prefix}wei.hmos.screenrecorder.ServiceExtAbility") - @pytest.mark.L0 @pytest.mark.repeat(2) def test_check_track_jpid(self):