canonical / canonical/checkbox

`pm-suspend` shouldn't be used to trigger suspend

Open
#437 7 comments 0 reactions 0 assignees View on GitHub
enhancement Importance: Critical Triaged
Dominant language
Python
Stars
52
Forks
81
Avg merge
2d 17h
Merged PRs (30d)
69

Description

### Enhancement Proposal

I was recently browsing the tests and came across https://github.com/canonical/checkbox/blame/main/providers/base/bin/sleep_test.py#L147 using `pm-suspend` for triggering suspend cycles.

`pm-utils` is long dead upstream and modern Ubuntu installations use systemd to trigger suspend cycles (ie `systemctl suspend`). The routine that systemd uses is different than `pm-suspend` in that systemd will trigger the lock screen and also cause displays to use DPMS to turn off.

The sequence of events that pm-utils uses doesn't guarantee this, and it could lead to difficult to identify sequencing bugs in GPU drivers. As Ubuntu natively uses systemd, it would be better to migrate the test suite to actually test using systemd.

Contributor guide

Open the contributing guide

Research direction

Inspect providers/base/bin/sleep_test.py around line 147 and read the surrounding suspend-cycle test. Check how the test suite invokes the current suspend command, then run the relevant sleep test; done means the cycle is triggered through Ubuntu's systemd path rather than pm-suspend.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python
Domain
operating-systems, testing
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.