summaryrefslogtreecommitdiff
path: root/bin
diff options
authorSylvain Pineau <sylvain.pineau@canonical.com>2020-01-28 14:40:39 +0100
committerSylvain Pineau <sylvain.pineau@canonical.com>2020-01-28 14:43:04 +0100
commit24893b305a3a515a8fb6ee722a4bc940b361957a (patch)
tree19ec1fe508ec46c7dcb84f836a41ec9eceab3ebd /bin
parente1ab73a9c886d779b0cf4ad15f712ae0a0e9d30e (diff)
bin:pm_test: Fix the suspend count method to take into account s2idle
Many new platforms [1] default to s2idle sleep/suspend instead of deep causing fwts logs to record this suspend type rather than the test name "s3": Completed s2idle cycle(s) But pm_test was only looking for: Completed S3 cycle(s) Fixes: lp:1794644 [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1808957
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pm_test8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/pm_test b/bin/pm_test
index 1ac0c53..b03e680 100755
--- a/bin/pm_test
+++ b/bin/pm_test
@@ -256,8 +256,12 @@ class PowerManagementOperation():
fwts_log_path = os.path.join(self.args.log_dir, 'fwts.log')
try:
with open(fwts_log_path, 'rt') as f:
- magic_line = 'Completed S3 cycle(s) \n'
- count = f.readlines().count(magic_line)
+ magic_line_s3 = 'Completed S3 cycle(s) \n'
+ magic_line_s2idle = 'Completed s2idle cycle(s) \n'
+ lines = f.readlines()
+ count_s3 = lines.count(magic_line_s3)
+ count_s2idle = lines.count(magic_line_s2idle)
+ count = count_s3 + count_s2idle
if count != total_suspends_expected:
problems = (
"Found {} occurrences of '{}'. Expected {}".format(