summaryrefslogtreecommitdiff
path: root/units
diff options
authorJonathan Cave <jonathan.cave@canonical.com>2020-02-17 17:58:44 +0000
committerJonathan Cave <jonathan.cave@canonical.com>2020-03-06 10:44:25 +0000
commit76986e66be1b1c8c5d25e0fe48dcda3c6f49aab2 (patch)
tree92f653c77a179d5b18391822e67d6db048be79eb /units
parentde6e5adb37d39bef1b9b7323505bb6adcb2cc8d2 (diff)
camera: add roundtrip-qr display/camera test
Test basic video output and camera functionality on basic console devices i.e. server or Ubuntu Core images.
Diffstat (limited to 'units')
-rw-r--r--units/camera/jobs.pxu31
-rw-r--r--units/camera/test-plan.pxu1
2 files changed, 31 insertions, 1 deletions
diff --git a/units/camera/jobs.pxu b/units/camera/jobs.pxu
index d7ad2aa..569a74b 100644
--- a/units/camera/jobs.pxu
+++ b/units/camera/jobs.pxu
@@ -130,4 +130,33 @@ command:
_description:
Takes multiple pictures based on the resolutions supported by the camera and
validates their size and that they are of a valid format.
-user: root \ No newline at end of file
+user: root
+
+unit: template
+template-engine: jinja2
+template-resource: device
+template-filter: device.category in ('CAPTURE', 'MMAL') and device.name != ''
+template-unit: job
+plugin: shell
+category_id: com.canonical.plainbox::camera
+id: camera/roundtrip-qrcode_{{ name }}
+_summary: Test video output and camera {{ name }} by displaying and reading a qrcode
+estimated_duration: 5.0
+requires:
+ {%- if __on_ubuntucore__ %}
+ lsb.release >= '19.1'
+ {%- else %}
+ lsb.release >= '19.1'
+ package.name == 'python3-zbar'
+ package.name == 'python3-pyqrcode'
+ package.name == 'python3-pil'
+ {% endif -%}
+command:
+ roundtrip_qr.py {{ name }}
+_description:
+ Generates a QRcode representing a random string of ascii letters. This is
+ written to tty1 using ascii escape codes. Either the PiCamera python module or
+ a gstreamer pipeline is used to capture an image of the display. An attempt
+ to decode a QRcode in the image is then made and data compared against the
+ random string.
+user: root
diff --git a/units/camera/test-plan.pxu b/units/camera/test-plan.pxu
index c3b8378..d69706c 100644
--- a/units/camera/test-plan.pxu
+++ b/units/camera/test-plan.pxu
@@ -84,5 +84,6 @@ estimated_duration: 1h30m
include:
camera/multiple-resolution-images-_.*
camera/multiple-resolution-images-rpi_.*
+ camera/roundtrip-qrcode_.*
bootstrap_include:
device