From 76986e66be1b1c8c5d25e0fe48dcda3c6f49aab2 Mon Sep 17 00:00:00 2001 From: Jonathan Cave Date: Mon, 17 Feb 2020 17:58:44 +0000 Subject: 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. --- units/camera/jobs.pxu | 31 ++++++++++++++++++++++++++++++- units/camera/test-plan.pxu | 1 + 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'units') 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 -- cgit v1.2.3 From a9a32710e1d401a30ef2cdfe1132d6b5258b95c5 Mon Sep 17 00:00:00 2001 From: Jonathan Cave Date: Tue, 18 Feb 2020 10:08:50 +0000 Subject: camera: add packaging units for roundtrip-qr job --- units/camera/packaging.pxu | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 units/camera/packaging.pxu (limited to 'units') diff --git a/units/camera/packaging.pxu b/units/camera/packaging.pxu new file mode 100644 index 0000000..0b90c61 --- /dev/null +++ b/units/camera/packaging.pxu @@ -0,0 +1,15 @@ +# For camera/roundtrip-qrcode_.* +unit: packaging meta-data +os-id: ubuntu +Depends: python3-zbar + +# For camera/roundtrip-qrcode_.* +unit: packaging meta-data +os-id: ubuntu +Depends: python3-pil + +# For camera/roundtrip-qrcode_.* +unit: packaging meta-data +os-id: ubuntu +Depends: python3-pyqrcode + -- cgit v1.2.3