Merge ~sylvain-pineau/plainbox-provider-checkbox:has_camera_manifest into plainbox-provider-checkbox:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 2f8a7b7c905c1807639bb27468fb75c0cabd063f
Merged at revision: acf3e17b79a889581a15c5108683cfd5d149f734
Proposed branch: ~sylvain-pineau/plainbox-provider-checkbox:has_camera_manifest
Merge into: plainbox-provider-checkbox:master
Diff against target: 44 lines (+14/-2)
2 files modified
units/camera/jobs.pxu (+8/-1)
units/camera/manifest.pxu (+6/-1)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Sylvain Pineau (community) Needs Resubmitting
Review via email: mp+391604@code.launchpad.net

Commit message

units:camera: Use a new manifest to trigger the camera/detect job, has_camera

Description of the change

units:camera: Use a new manifest to trigger the camera/detect job, has_camera

It should prevent camera/detect running (and failing) on hw w/o a capture device set up.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Added camera/detect{,-rpi} as depends jobs for camera/roundtrip-qrcode. Thanks jinja!

Splitting the jobs looks not so easy, one titled with mmal and the other with something else...

review: Needs Resubmitting
Revision history for this message
Jonathan Cave (jocave) wrote :

LGTM, thanks.

We need to make sure any manifests that will need this addition get it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/units/camera/jobs.pxu b/units/camera/jobs.pxu
2index 7c0b1d0..285fc2e 100644
3--- a/units/camera/jobs.pxu
4+++ b/units/camera/jobs.pxu
5@@ -2,8 +2,9 @@ plugin: shell
6 category_id: com.canonical.plainbox::camera
7 id: camera/detect
8 estimated_duration: 1.2
9+imports: from com.canonical.plainbox import manifest
10 requires:
11- device.category == 'CAPTURE'
12+ manifest.has_camera == 'True'
13 command:
14 camera_test.py detect
15 _summary: This Automated test attempts to detect a camera.
16@@ -144,6 +145,12 @@ category_id: com.canonical.plainbox::camera
17 id: camera/roundtrip-qrcode_{{ name }}
18 _summary: Test video output and camera {{ name }} by displaying and reading a qrcode
19 estimated_duration: 5.0
20+depends:
21+ {%- if category == 'MMAL' %}
22+ camera/detect-rpi
23+ {%- else %}
24+ camera/detect
25+ {% endif -%}
26 requires:
27 {%- if __on_ubuntucore__ %}
28 lsb.release >= '19.1'
29diff --git a/units/camera/manifest.pxu b/units/camera/manifest.pxu
30index de12798..ed79336 100644
31--- a/units/camera/manifest.pxu
32+++ b/units/camera/manifest.pxu
33@@ -1,4 +1,9 @@
34 unit: manifest entry
35 id: has_rpi_camera
36 _name: RaspberryPi Camera Module
37-value-type: bool
38\ No newline at end of file
39+value-type: bool
40+
41+unit: manifest entry
42+id: has_camera
43+_name: Camera/Capture Device
44+value-type: bool

Subscribers

People subscribed via source and target branches