Skip to content

Commit

Permalink
trying to use nice while running echo/cat
Browse files Browse the repository at this point in the history
  • Loading branch information
umfranci committed Nov 25, 2024
1 parent 630122e commit 92c17ae
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions microsoft/testsuites/cpu/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ def set_cpu_state(node: Node, cpu: str, online: bool = False) -> bool:
state = CPUState.OFFLINE
if online:
state = CPUState.ONLINE
node.tools[Echo].write_to_file(state, node.get_pure_path(file_path), sudo=True)
result = node.tools[Cat].read(file_path, force_run=True, sudo=True)
return result == state
# node.tools[Echo].write_to_file(state, node.get_pure_path(file_path), sudo=True)
# result = node.tools[Cat].read(file_path, force_run=True, sudo=True)
# return result == state

test_echo_command = f"nice --20 sh -c 'echo {state} > {node.get_pure_path(file_path)}'"
result = node.execute(test_echo_command, shell=True, no_info_log=True, sudo=True)
test_cat_command = f"nice --20 sh -c 'cat {file_path}'"
result = node.execute(test_cat_command, shell=True, no_info_log=True, sudo=True)
return result.stdout == state

0 comments on commit 92c17ae

Please sign in to comment.