Skip to content

Commit

Permalink
Change the script per the new comments from Hanhsuan
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-yujinwu committed Jun 21, 2024
1 parent 779c743 commit 44fb02a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions providers/base/bin/lid_close_suspend_open.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ holdoff_timeout_usec=$(gdbus introspect --system --dest org.freedesktop.login1 -
holdoff_timeout_sec=$(echo "scale=0; $holdoff_timeout_usec / 1000000" | bc)

if [ "$holdoff_timeout_sec" -ne 0 ]; then
if (journalctl --since "$holdoff_timeout_sec seconds ago" -b 0 -r | grep "suspend exit" >/dev/null 2>&1); then
echo "The system just resume from suspend, the lid event will be hold off on in $holdoff_timeout_sec seconds"
echo "Please wait for the new prompt before starting the test."
fi
while (journalctl --since "$holdoff_timeout_sec seconds ago" -b 0 -r | grep "suspend exit" >/dev/null 2>&1)
do
echo "The system just resume from suspend, please wait for $holdoff_timeout_sec seconds and continue the test"
sleep 1
echo "waiting... "
sleep 3
done
echo ""
fi

prev_suspend_number=$(cat /sys/power/suspend_stats/success)
Expand Down Expand Up @@ -66,4 +71,4 @@ do
done
echo "============================================================="
echo "Lid is not closed within $runTime!!!"
exit 1
exit 1

0 comments on commit 44fb02a

Please sign in to comment.