diff options
author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2018-09-25 09:04:21 +0200 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2018-09-25 09:04:21 +0200 |
commit | cf516d543ae166e122ee849ff9219718eb4ab3be (patch) | |
tree | 5c54d27b32bbbf855b696ef096981a11f1cad705 | |
parent | b06e07d924415ede481e628c5d712642e0789980 (diff) |
units:camera: Use template jobs to drive V4L devices
Using templates will help to test systems with multiple webcams. Example: IR + HD webcams. Note: - After-suspend-manual flags added to the new jobs.
-rw-r--r-- | units/camera/jobs.pxu | 58 | ||||
-rw-r--r-- | units/camera/test-plan.pxu | 35 | ||||
-rw-r--r-- | units/led/jobs.pxu | 15 | ||||
-rw-r--r-- | units/led/test-plan.pxu | 8 | ||||
-rw-r--r-- | units/suspend/suspend.pxu | 65 |
5 files changed, 72 insertions, 109 deletions
diff --git a/units/camera/jobs.pxu b/units/camera/jobs.pxu index 4219462..b1e4b9c 100644 --- a/units/camera/jobs.pxu +++ b/units/camera/jobs.pxu @@ -8,65 +8,95 @@ command: camera_test detect _description: This Automated test attempts to detect a camera. +unit: template +template-resource: device +template-filter: device.category == 'CAPTURE' and device.name != '' +template-unit: job plugin: user-interact-verify category_id: com.canonical.plainbox::camera -id: camera/display +id: camera/display_{name} +_summary: Webcam video display test for {product_slug} estimated_duration: 120.0 depends: camera/detect -requires: - device.category == 'CAPTURE' command: - camera_test display + camera_test display -d /dev/{name} _description: PURPOSE: - This test will check that the built-in camera works + This test will check that the {product_slug} camera works STEPS: 1. Click on Test to display a video capture from the camera for ten seconds. VERIFICATION: Did you see the video capture? +unit: template +template-resource: device +template-filter: device.category == 'CAPTURE' and device.name != '' +template-unit: job +plugin: user-interact-verify +category_id: com.canonical.plainbox::camera +id: camera/led_{name} +_summary: Webcam LED test for {product_slug} +estimated_duration: 120.0 +depends: camera/detect +command: + camera_test led -d /dev/{name} +_description: + PURPOSE: + This test will check that the {product_slug} camera LED works + STEPS: + 1. Select Test to activate camera + 2. Camera LED should light for a few seconds + VERIFICATION: + Did the camera LED light? + +unit: template +template-resource: device +template-filter: device.category == 'CAPTURE' and device.name != '' +template-unit: job plugin: user-interact-verify template-engine: jinja2 category_id: com.canonical.plainbox::camera -id: camera/still +id: camera/still_{{ name }} +_summary: Webcam still image capture test for {{ product_slug }} estimated_duration: 120.0 depends: camera/detect requires: {%- if __on_ubuntucore__ %} executable.name == 'fswebcam' - device.category == 'CAPTURE' {%- else %} package.name == 'gir1.2-gst-plugins-base-1.0' package.name == 'eog' package.name == 'fswebcam' or package.name == 'gir1.2-gst-plugins-base-1.0' - device.category == 'CAPTURE' {% endif -%} command: - camera_test still + camera_test still -d /dev/{{ name }} _description: PURPOSE: - This test will check that the built-in camera works + This test will check that the {{ product_slug }} works STEPS: 1. Click on Test to display a still image from the camera for ten seconds. VERIFICATION: Did you see the image? +unit: template +template-resource: device +template-filter: device.category == 'CAPTURE' and device.name != '' +template-unit: job plugin: shell template-engine: jinja2 category_id: com.canonical.plainbox::camera -id: camera/multiple-resolution-images +id: camera/multiple-resolution-images_{{ name }} +_summary: Webcam multiple resolution capture test for {{ product_slug }} estimated_duration: 1.2 depends: camera/detect requires: {%- if __on_ubuntucore__ %} executable.name == 'fswebcam' - device.category == 'CAPTURE' {%- else %} package.name == 'fswebcam' or package.name == 'gir1.2-gst-plugins-base-1.0' - device.category == 'CAPTURE' {% endif -%} command: - camera_test resolutions + camera_test resolutions -d /dev/{{ name }} _description: Takes multiple pictures based on the resolutions supported by the camera and validates their size and that they are of a valid format. diff --git a/units/camera/test-plan.pxu b/units/camera/test-plan.pxu index e4302be..578a7ce 100644 --- a/units/camera/test-plan.pxu +++ b/units/camera/test-plan.pxu @@ -14,40 +14,49 @@ _name: Camera tests (Manual) _description: Camera tests (Manual) include: - camera/still certification-status=blocker - camera/display certification-status=blocker - + camera/still_.* certification-status=blocker + camera/display_.* certification-status=blocker +bootstrap_include: + device id: after-suspend-camera-cert-full unit: test plan _name: Camera tests (after suspend) _description: Camera tests (after suspend) include: - camera/display_after_suspend certification-status=blocker - camera/still_after_suspend certification-status=blocker + after-suspend-manual-camera/still_.* certification-status=blocker + after-suspend-manual-camera/display_.* certification-status=blocker +bootstrap_include: + device id: camera-cert-automated unit: test plan _name: Camera tests (automated) _description: Camera tests (automated) include: - camera/detect certification-status=blocker - camera/multiple-resolution-images certification-status=blocker + camera/detect certification-status=blocker + camera/multiple-resolution-images_.* certification-status=blocker +bootstrap_include: + device id: camera-cert-blockers unit: test plan _name: Camera tests (certification blockers only) _description: Camera tests (certification blockers only) include: - camera/detect certification-status=blocker - camera/still certification-status=blocker - camera/display certification-status=blocker - camera/multiple-resolution-images certification-status=blocker + camera/detect certification-status=blocker + camera/still_.* certification-status=blocker + camera/display_.* certification-status=blocker + camera/multiple-resolution-images_.* certification-status=blocker +bootstrap_include: + device id: after-suspend-camera-cert-blockers unit: test plan _name: Camera tests (after suspend, certification blockers only) _description: Camera tests (after suspend, certification blockers only) include: - camera/display_after_suspend certification-status=blocker - camera/still_after_suspend certification-status=blocker + after-suspend-manual-camera/still_.* certification-status=blocker + after-suspend-manual-camera/display_.* certification-status=blocker +bootstrap_include: + device diff --git a/units/led/jobs.pxu b/units/led/jobs.pxu index 15d3065..2c2ea16 100644 --- a/units/led/jobs.pxu +++ b/units/led/jobs.pxu @@ -171,21 +171,6 @@ plugin: manual category_id: led estimated_duration: 180 -plugin: user-interact-verify -category_id: led -id: led/camera -estimated_duration: 20.0 -depends: camera/detect -command: camera_test led -_description: - PURPOSE: - Camera LED verification - STEPS: - 1. Select Test to activate camera - 2. Camera LED should light for a few seconds - VERIFICATION: - Did the camera LED light? - plugin: manual category_id: led id: led/touchpad diff --git a/units/led/test-plan.pxu b/units/led/test-plan.pxu index 88d38a6..0329717 100644 --- a/units/led/test-plan.pxu +++ b/units/led/test-plan.pxu @@ -25,10 +25,12 @@ include: led/battery-charged led/battery-charging led/battery-low - led/camera + camera/led_.* led/caps-lock led/power led/touchpad +bootstrap_include: + device id: led-cert-automated unit: test plan @@ -50,10 +52,12 @@ include: suspend/led_after_suspend/battery-charged suspend/led_after_suspend/battery-charging suspend/led_after_suspend/battery-low - suspend/led_after_suspend/camera + after-suspend-manual-camera/led_.* suspend/led_after_suspend/caps-lock suspend/led_after_suspend/power suspend/led_after_suspend/touchpad +bootstrap_include: + device id: led-full unit: test plan diff --git a/units/suspend/suspend.pxu b/units/suspend/suspend.pxu index 1ab5829..0c3a942 100644 --- a/units/suspend/suspend.pxu +++ b/units/suspend/suspend.pxu @@ -1449,23 +1449,6 @@ _description: VERIFICATION: Did the bluetooth LED turn off and on twice after resuming from suspend? -plugin: user-interact-verify -category_id: com.canonical.plainbox::suspend -id: suspend/led_after_suspend/camera -estimated_duration: 120.0 -depends: - camera/detect - suspend/suspend_advanced -command: camera_test led -_description: - PURPOSE: - Validate that the camera LED still works as expected after resuming from suspend - STEPS: - 1. Select Test to activate camera - 2. Camera LED should light for a few seconds - VERIFICATION: - Did the camera LED still turn on and off after resuming from suspend? - plugin: manual category_id: com.canonical.plainbox::suspend id: suspend/led_after_suspend/touchpad @@ -2090,54 +2073,6 @@ _description: VERIFICATION: Does tap recognition work? -plugin: user-interact-verify -category_id: com.canonical.plainbox::suspend -id: camera/display_after_suspend -estimated_duration: 120.0 -depends: suspend/suspend_advanced -requires: - device.category == 'CAPTURE' -command: camera_test display -_description: - PURPOSE: - This test will check that the built-in camera works after suspend - STEPS: - 1. Click on Test to display a video capture from the camera for ten seconds. - VERIFICATION: - Did you see the video capture? - -plugin: user-interact-verify -category_id: com.canonical.plainbox::suspend -id: camera/still_after_suspend -estimated_duration: 120.0 -depends: camera/display_after_suspend -requires: - package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' - package.name == 'eog' - package.name == 'fswebcam' or package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' - device.category == 'CAPTURE' -command: camera_test still -_description: - PURPOSE: - This test will check that the built-in camera works after suspend - STEPS: - 1. Click on Test to display a still image from the camera for ten seconds. - VERIFICATION: - Did you see the image? - -plugin: shell -category_id: com.canonical.plainbox::suspend -id: camera/multiple_resolution_after_suspend -estimated_duration: 1.2 -depends: camera/still_after_suspend -requires: - package.name == 'fswebcam' or package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0' - device.category == 'CAPTURE' -command: camera_test resolutions -_description: - Takes multiple pictures based on the resolutions supported by the camera and - validates their size and that they are of a valid format after suspend - unit: template template-resource: device template-filter: device.category == 'MOUSE' or device.category == 'TOUCHPAD' or device.category == 'TOUCHSCREEN' |