Skip to content

Commit

Permalink
fix getting current idle driver error (#9799)
Browse files Browse the repository at this point in the history
Signed-off-by: Xichen Lin <[email protected]>
  • Loading branch information
Xichen96 authored and mssonicbld committed Sep 14, 2023
1 parent de82df6 commit 4d929f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/platform_tests/test_idle_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

def test_idle_driver(duthosts, enum_rand_one_per_hwsku_hostname):
duthost = duthosts[enum_rand_one_per_hwsku_hostname]
idle_driver = duthost.shell('cat /sys/devices/system/cpu/cpuidle/current_driver')['stdout']
if idle_driver != "none":
idle_driver_result = duthost.shell('cat /sys/devices/system/cpu/cpuidle/current_driver', module_ignore_errors=True)
if idle_driver_result['rc'] == 0 and idle_driver_result['stdout'] != "none":
cstates = duthost.shell('sed -n "s/.*C\\([0-9]*\\).*/\\1/p" '
'/sys/devices/system/cpu/cpu*/cpuidle/state*/name')['stdout'].split()
max_cstate = max([int(cstate) for cstate in cstates])
Expand Down

0 comments on commit 4d929f8

Please sign in to comment.