Skip to content

Commit

Permalink
Limit the platform to perform the sleepgraph test (BugFix) (#1054)
Browse files Browse the repository at this point in the history
* Filter cpuinfo to GenuineIntel only

* Align the sleep time with Windows,
  https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby-stress-and-long-duration-validation#test-operation

Signed-off-by: Kai-Chuan Hsieh <[email protected]>
  • Loading branch information
KaiChuan-Hsieh committed Apr 2, 2024
1 parent b8c3b7f commit 0cc85c7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 12 deletions.
42 changes: 34 additions & 8 deletions providers/base/units/stress/jobs.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -603,51 +603,77 @@ _description:
VERIFICATION:
Verify the system is not frozen and the wifi and bluetooth applets are still visible and functional

unit: template
template-resource: cpuinfo
template-filter: cpuinfo.type == 'GenuineIntel'
template-unit: job
plugin:shell
category_id: com.canonical.plainbox::stress
id: stress/s2idle_pm-graph_30
id: stress/s2idle_pm-graph_30_{model_number}_{model_version}_{model_revision}
estimated_duration: 10m
requires:
executable.name == 'sleepgraph'
sleep.mem_sleep == 's2idle'
user: root
_summary: Resume from idle by using Intel pm-graph
command:
sleepgraph -m freeze -rtcwake 10 -sync -gzip -multi 30 0 -skiphtml -o "$PLAINBOX_SESSION_SHARE"/s2idle_pm-graph/s2idle-"$(date -d today +%Y-%m-%d-%H%M)"
if [ ! -f /proc/driver/nvidia/suspend ]; then
sleepgraph -m freeze -rtcwake 60 -sync -gzip -multi 30 30 -skiphtml -o "$PLAINBOX_SESSION_SHARE"/s2idle_pm-graph/s2idle-"$(date -d today +%Y-%m-%d-%H%M)"
else
echo "The platform has Nvidia driver loaded, which is not capable of running sleepgraph"
exit 1
fi

unit: template
template-resource: cpuinfo
template-filter: cpuinfo.type == 'GenuineIntel'
template-unit: job
plugin: attachment
category_id: com.canonical.plainbox::stress
id: stress/s2idle_pm-graph_30.tar.xz
id: stress/s2idle_pm-graph_30_{model_number}_{model_version}_{model_revision}.tar.xz
estimated_duration: 1
requires:
sleep.mem_sleep == 's2idle'
after:
stress/s2idle_pm-graph_30
stress/s2idle_pm-graph_30_{model_number}_{model_version}_{model_revision}
user: root
_summary: Attach pm-graph logs (s2idle)
command:
tar Jcf "$PLAINBOX_SESSION_SHARE"/s2idle_pm-graph_30.tar.xz "$PLAINBOX_SESSION_SHARE"/s2idle_pm-graph && cat "$PLAINBOX_SESSION_SHARE"/s2idle_pm-graph_30.tar.xz

unit: template
template-resource: cpuinfo
template-filter: cpuinfo.type == 'GenuineIntel'
template-unit: job
plugin:shell
category_id: com.canonical.plainbox::stress
id: stress/s3_pm-graph_30
id: stress/s3_pm-graph_30_{model_number}_{model_version}_{model_revision}
estimated_duration: 10m
requires:
executable.name == 'sleepgraph'
sleep.mem_sleep == 'deep'
user: root
_summary: Resume from suspend by using Intel pm-graph
command:
sleepgraph -m mem -rtcwake 10 -sync -gzip -multi 30 0 -skiphtml -o "$PLAINBOX_SESSION_SHARE"/s3_pm-graph/suspend-"$(date -d today +%Y-%m-%d-%H%M)"
if [ ! -f /proc/driver/nvidia/suspend ]; then
sleepgraph -m mem -rtcwake 60 -sync -gzip -multi 30 30 -skiphtml -o "$PLAINBOX_SESSION_SHARE"/s3_pm-graph/suspend-"$(date -d today +%Y-%m-%d-%H%M)"
else
echo "The platform has Nvidia driver loaded, which is not capable of running sleepgraph"
exit 1
fi

unit: template
template-resource: cpuinfo
template-filter: cpuinfo.type == 'GenuineIntel'
template-unit: job
plugin: attachment
category_id: com.canonical.plainbox::stress
id: stress/s3_pm-graph_30.tar.xz
id: stress/s3_pm-graph_30_{model_number}_{model_version}_{model_revision}.tar.xz
estimated_duration: 1
requires:
sleep.mem_sleep == 'deep'
after:
stress/s3_pm-graph_30
stress/s3_pm-graph_30_{model_number}_{model_version}_{model_revision}
user: root
_summary: Attach pm-graph logs (s3)
command:
Expand Down
10 changes: 6 additions & 4 deletions providers/base/units/stress/test-plan.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ unit: test plan
_name: pm-graph stress test
_description: pm-graph stress test
include:
stress/s2idle_pm-graph_30
stress/s2idle_pm-graph_30.tar.xz
stress/s3_pm-graph_30
stress/s3_pm-graph_30.tar.xz
stress/s2idle_pm-graph_30_.*
stress/s2idle_pm-graph_30_.*.tar.xz
stress/s3_pm-graph_30_.*
stress/s3_pm-graph_30_.*.tar.xz
bootstrap_include:
cpuinfo

0 comments on commit 0cc85c7

Please sign in to comment.