Migrate idle suspend test cases from manual to semi-auto(DC) and auto(AC) (New)#2483
Migrate idle suspend test cases from manual to semi-auto(DC) and auto(AC) (New)#2483hanhsuan wants to merge 7 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2483 +/- ##
==========================================
+ Coverage 58.87% 58.99% +0.12%
==========================================
Files 476 477 +1
Lines 48004 48112 +108
Branches 8568 8586 +18
==========================================
+ Hits 28260 28383 +123
+ Misses 18850 18837 -13
+ Partials 894 892 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tomli380576
left a comment
There was a problem hiding this comment.
please see the inline comments, the main thing are the possible None values
2. Type hint change
the power supply mode verify
tomli380576
left a comment
There was a problem hiding this comment.
the main thing is the timestamp regex, everything else looks ok
|
|
||
| def parse_journal_suspend_times( | ||
| journal_output: str, | ||
| ) -> ("datetime | None", "datetime | None"): |
There was a problem hiding this comment.
optional: python doesn't reject this but the correct syntax is:
def parse_journal_suspend_times(
journal_output: str,
) -> "tuple[datetime | None, datetime | None]":(basically wrap the entire python3.10 version in strings)
|
|
||
| Returns None on parse failure. | ||
| """ | ||
| normalized = re.sub(r"([+-]\d{2}):(\d{2})$", r"\1\2", ts_str) |
There was a problem hiding this comment.
could you add a comment for this regex? looks like it removes the last colon from the string
| ts_re = re.compile( | ||
| r"^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{2}:\d{2})" | ||
| ) |
There was a problem hiding this comment.
This doesn't match the timestamp in journalctl --since today --no-pager -o short-iso for 22.04 and below, because they don't have the final colon in the timezone:
# doesn't match this
'2026-05-07T11:12:53+0800'
# but this will match
'2026-05-07T11:20:15+08:00'I think the easier way to do this is to just take the 1st word of each line in the journal
for line in journal_output.splitlines():
words = line.strip().split()
if len(words) < 1:
continue
ts = _parse_ts(words[0])
Description
This PR is going to migrate the manual test cases to semi-auto and auto:
id: power-management/suspend-on-AC-powerto Auto test caseid: power-management/suspend-on-battery-powerto semi-auto test caseThe new test groups three test cases
2.1. Set the rtc wake for full auto AC test only
2.2. Ensure the system is in the correct power supply mode. (DC/AC)
2.3. Verifying the suspend is starting at the right timing or not
At this point, the tolerance is higher for collecting more data to fine tune the gate in the future.
Resolved issues
Documentation
Tests
Test
laptop: https://certification.canonical.com/hardware/202001-27667/submission/484162/
desktop: https://certification.canonical.com/hardware/202603-38566/submission/486631/