Merge ~kissiel/plainbox-provider-checkbox:automated-switch-gpu-job into plainbox-provider-checkbox:master

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Maciej Kisielewski
Approved revision: d4238c8e0577fcdc32659ddf5147348ee8ba57ba
Merged at revision: c998cff9785c5cf41bee57ec02a422a6ce81afff
Proposed branch: ~kissiel/plainbox-provider-checkbox:automated-switch-gpu-job
Merge into: plainbox-provider-checkbox:master
Diff against target: 23 lines (+15/-0)
1 file modified
units/graphics/jobs.pxu (+15/-0)
Reviewer Review Type Date Requested Status
Paul Larson Approve
Review via email: mp+333607@code.launchpad.net

Description of the change

Add an automated job that switches the GPU and reboots the machine

Note that the job requires amdgpu-pro or nvidia gpu to run.

This MR needs https://code.launchpad.net/~kissiel/plainbox-provider-resource/+git/plainbox-provider-resource/+merge/333604 to land first.

to test it I added and used following test plan:

unit: test plan
id: REMOVE_ME
_name: 00-REMOVE ME
include:
 graphics/.*auto_switch_card.*
bootstrap_include:
 graphics_card

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

It's hard to see from the various places it could be getting globbed. Are you able to confirm that it doesn't match existing patterns to include it automatically? As long as we aren't actually using this in the automated test plans, +1.

review: Approve
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

> It's hard to see from the various places it could be getting globbed. Are you
> able to confirm that it doesn't match existing patterns to include it
> automatically? As long as we aren't actually using this in the automated test
> plans, +1.

This is why I added _auto_ as an infix. Placing it at the end would match to what TPs are using -
 e.g.: 2_switch_card_.*

There are many providers 'out there', I checked the checkbox-dev owned ones and OEM. If the accidental inclusion happens somewhere else, I will ask for forgiveness ;-)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/units/graphics/jobs.pxu b/units/graphics/jobs.pxu
2index ee0a938..9a24590 100644
3--- a/units/graphics/jobs.pxu
4+++ b/units/graphics/jobs.pxu
5@@ -524,3 +524,18 @@ estimated_duration: 1.0
6 command: [ -f $PLAINBOX_SESSION_SHARE/screen-capture-{index}.png ] && base64 $PLAINBOX_SESSION_SHARE/screen-capture-{index}.png
7 _description: Attaches the simple screen capture file of {vendor} {product}
8
9+unit: template
10+template-resource: graphics_card
11+category_id: com.canonical.plainbox::graphics
12+id: graphics/{index}_auto_switch_card_{product_slug}
13+requires:
14+ graphics_card.driver in ['nvidia', 'amdgpu-pro']
15+_summary: Switch GPU to {vendor} {product} and reboot
16+_purpose:
17+ Switch GPU to {vendor} {product} and reboot the machine
18+plugin: shell
19+user: root
20+command:
21+ {switch_to_cmd}
22+ pm_test --silent --checkbox-respawn-cmd $PLAINBOX_SESSION_SHARE/__respawn_checkbox reboot --log-level=debug --log-dir=$PLAINBOX_SESSION_SHARE
23+flags: noreturn preserve-locale

Subscribers

People subscribed via source and target branches