Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some issues related with the test case power-management/lid_close_suspend_open (Bugfix) #1093

Merged
merged 7 commits into from
Jul 4, 2024
17 changes: 16 additions & 1 deletion providers/base/bin/lid_close_suspend_open.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#! /usr/bin/bash
#!/usr/bin/bash

holdoff_timeout_usec=$(gdbus introspect --system --dest org.freedesktop.login1 --object-path /org/freedesktop/login1 -p | grep HoldoffTimeoutUSec | awk '{print $5}' | awk -F\; '{print $1}')
holdoff_timeout_sec=$((holdoff_timeout_usec / 1000000))

previous_sleep_log=$(journalctl --output=short-unix --since "$holdoff_timeout_sec seconds ago" -b 0 -r | grep "suspend exit")
if [[ "$holdoff_timeout_sec" != 0 && "$previous_sleep_log" != "" ]]; then
# set the previous_sleep_time
previous_sleep_time=$(echo "$previous_sleep_log" | awk -F'.' '{ print $1 }')
# sleep a period of time. wait_time = holdoff_time - wakeup_time_from_last_suspend
sleep_time=$(("$holdoff_timeout_sec" - ($(date +"%s") - "$previous_sleep_time")))
echo "DUT was resumed less than ${holdoff_timeout_sec} seconds ago. Waiting for ${sleep_time} seconds before running the test..."
sleep "$sleep_time"
fi
echo "System is ready for suspend test"

prev_suspend_number=$(cat /sys/power/suspend_stats/success)
echo "Number of successful suspends until now: $prev_suspend_number"
echo "Please close the lid and wait for 5 sec to make it suspend~"
Expand Down
8 changes: 4 additions & 4 deletions providers/base/units/graphics/test-plan.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ include:
# depending on the amount of graphic cards available on the SUT:
# suspend/suspend_advanced_auto (one GPU)
# or suspend/{{ index }}_suspend_after_switch_to_card_{{ product_slug }}_auto (two GPUs)
power-management/lid_close_suspend_open certification-status=blocker
power-management/lid certification-status=blocker
after-suspend-miscellanea/chvt
suspend/1_display_after_suspend_.*_graphics certification-status=blocker
after-suspend-graphics/1_maximum_resolution_.* certification-status=blocker
Expand All @@ -220,6 +218,8 @@ include:
after-suspend-graphics/1_video_.* certification-status=blocker
after-suspend-graphics/1_cycle_resolution_.* certification-status=non-blocker
suspend/1_xrandr_screens_after_suspend.tar.gz_auto
power-management/lid_close_suspend_open certification-status=blocker
power-management/lid certification-status=blocker
eugene-yujinwu marked this conversation as resolved.
Show resolved Hide resolved

id: after-suspend-graphics-discrete-gpu-cert-full
unit: test plan
Expand Down Expand Up @@ -296,15 +296,15 @@ _description: After suspend tests (integrated GPU, certification blockers only)
include:
after-suspend-graphics/1_auto_switch_card_.* certification-status=blocker
suspend/1_suspend_after_switch_to_card_.*_auto certification-status=blocker
power-management/lid_close_suspend_open certification-status=blocker
power-management/lid certification-status=blocker
suspend/1_gl_support_after_suspend_.*_auto certification-status=blocker
suspend/1_driver_version_after_suspend_.*_auto certification-status=blocker
suspend/1_resolution_after_suspend_.*_auto certification-status=blocker
suspend/1_display_after_suspend_.*_graphics certification-status=blocker
suspend/1_glxgears_after_suspend_.*_graphics certification-status=blocker
suspend/1_rotation_after_suspend_.*_graphics certification-status=blocker
suspend/1_video_after_suspend_.*_graphics certification-status=blocker
power-management/lid_close_suspend_open certification-status=blocker
power-management/lid certification-status=blocker

id: after-suspend-graphics-discrete-gpu-cert-blockers
unit: test plan
Expand Down
1 change: 1 addition & 0 deletions providers/base/units/power-management/jobs.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ _steps:
4. Open the lid
_verification:
Did the system suspend when the lid was closed, and resume back when the lid was opened?
Note: Systemd will not react to lid events if the DUT was just started or resumed. Please make sure the DUT has been running for long enough before running this test.
command:
lid_close_suspend_open.sh
_summary: Test the functionality of the laptop's lid sensor for suspend/resume actions.
Expand Down
Loading