!1596 修改用例

Merge pull request !1596 from liupeng298/master
This commit is contained in:
openharmony_ci 2024-10-16 03:00:58 +00:00 committed by Gitee
commit 7a1ff9c795
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 6 additions and 9 deletions

View File

@ -944,7 +944,7 @@ def check_cmd_time(cmd, pattern, duration, times):
if pattern is None:
subprocess.check_output(f"{GP.hdc_head} {cmd}".split())
else:
check_shell(cmd, pattern, fetch=fetchable)
assert check_shell(cmd, pattern, fetch=fetchable)
start_out = time.time() * 1000
res.append(start_out - start_in)

View File

@ -68,7 +68,6 @@ def test_small_file():
def test_node_file():
assert check_hdc_cmd(f"file recv {get_remote_path('../../../sys/power/state')} {get_local_path('state')}")
assert check_hdc_cmd(f"file recv {get_remote_path('../../../sys/firmware/fdt')} {get_local_path('fdt')}")
assert check_hdc_cmd(f"file recv {get_remote_path('../../../proc/cpuinfo')} {get_local_path('cpuinfo')}")
@pytest.mark.repeat(1)
@ -90,8 +89,8 @@ def test_running_file():
@pytest.mark.repeat(1)
def test_rate():
assert check_rate(f"file send {get_local_path('large')} {get_remote_path('it_large')}", 38000)
assert check_rate(f"file recv {get_remote_path('it_large')} {get_local_path('large_recv')}", 38000)
assert check_rate(f"file send {get_local_path('large')} {get_remote_path('it_large')}", 18000)
assert check_rate(f"file recv {get_remote_path('it_large')} {get_local_path('large_recv')}", 18000)
@pytest.mark.repeat(1)
@ -100,7 +99,7 @@ def test_file_error():
assert check_shell(
f"file send {get_local_path('small')} system/bin/hdcd",
"busy"
)
)
assert check_shell(
f"file recv",
"[Fail]There is no local and remote path"
@ -109,10 +108,6 @@ def test_file_error():
f"file send",
"[Fail]There is no local and remote path"
)
assert check_shell(
f"file send {get_local_path('large')} {get_remote_path('../../../')}",
"space left on device"
)
assert check_hdc_cmd(f"shell rm -rf {get_remote_path('../../../large')}")
assert check_hdc_cmd(f"shell param set persist.hdc.control.file false")
assert check_shell(
@ -359,12 +354,14 @@ def test_hdcd_rom():
def test_smode_r():
assert check_hdc_cmd(f'smode -r')
run_command_with_timeout("hdc wait", 5)
time.sleep(1)
assert check_shell(f"shell id", "context=u:r:sh:s0")
def test_smode():
assert check_hdc_cmd(f'smode')
run_command_with_timeout("hdc wait", 5)
time.sleep(1)
assert check_shell(f"shell id", "context=u:r:su:s0")
assert not check_hdc_cmd("ls /data/log/faultlog/faultlogger | grep hdcd", "hdcd")