Merge ~jocave/plainbox-provider-resource:serial-ports-static into plainbox-provider-resource:master

Proposed by Jonathan Cave
Status: Merged
Approved by: Chris Wayne
Approved revision: 9c386dc0d546e591e457fa1408b275f5b6dd6338
Merged at revision: 1298c8523dc5e315e076117cccb78c5ba124a59f
Proposed branch: ~jocave/plainbox-provider-resource:serial-ports-static
Merge into: plainbox-provider-resource:master
Diff against target: 22 lines (+14/-0)
1 file modified
jobs/resource.pxu (+14/-0)
Reviewer Review Type Date Requested Status
Paul Larson Approve
Review via email: mp+344860@code.launchpad.net

Description of the change

Create a resource job that, when provided, converts an environment variable with whitespace seperated entries in to resource entries.

The intention is to allow the creation of templated jobs for devices that would not typically be identifiable by e.g. the udev based device resource job.

Using an environment variable as the configuration mechanism means that project snaps can specify the devices that should be tested while keeping the templated job in the generic providers.

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

So if there the env var is not supplied, then this is just a no-op?
Seems reasonable, but more magic env vars for the checkbox.conf I guess.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/jobs/resource.pxu b/jobs/resource.pxu
2index d443754..f223a41 100644
3--- a/jobs/resource.pxu
4+++ b/jobs/resource.pxu
5@@ -403,3 +403,17 @@ plugin: resource
6 estimated_duration: 2.0
7 command:
8 snapd_resource assertions serial
9+
10+id: serial_ports_static
11+_summary: Generates a serial port resource based on user supplied configuration
12+_description:
13+ A serial port resource that instead of automatically detecting the hardware
14+ relies on the user specifying the ports. This is to allow template jobs to
15+ then be instantiated.
16+plugin: resource
17+estimated_duration: 1.0
18+command:
19+ for i in $SERIAL_PORTS_STATIC; do
20+ echo "dev: $i"
21+ echo ""
22+ done

Subscribers

People subscribed via source and target branches