From 44fb02aa5b6b9b454ddac5cde8233bce41e554fd Mon Sep 17 00:00:00 2001 From: eugene2021 Date: Tue, 30 Apr 2024 15:54:52 +0800 Subject: [PATCH] Change the script per the new comments from Hanhsuan --- providers/base/bin/lid_close_suspend_open.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/providers/base/bin/lid_close_suspend_open.sh b/providers/base/bin/lid_close_suspend_open.sh index 5e4ba9d3f..c497a91b9 100755 --- a/providers/base/bin/lid_close_suspend_open.sh +++ b/providers/base/bin/lid_close_suspend_open.sh @@ -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) @@ -66,4 +71,4 @@ do done echo "=============================================================" echo "Lid is not closed within $runTime!!!" -exit 1 +exit 1 \ No newline at end of file