From 9df63071d03df2bd89d5c42691e8117b5324fa4f Mon Sep 17 00:00:00 2001 From: Maciej Kisielewski Date: Tue, 3 May 2022 22:51:45 +0000 Subject: Add: Zapper-enabled usb insertion and removal jobs --- units/zapper/jobs.pxu | 36 ++++++++++++++++++++++++++++++++++++ units/zapper/test-plan.pxu | 2 ++ 2 files changed, 38 insertions(+) diff --git a/units/zapper/jobs.pxu b/units/zapper/jobs.pxu index acf65f1..5850476 100644 --- a/units/zapper/jobs.pxu +++ b/units/zapper/jobs.pxu @@ -5,3 +5,39 @@ estimated_duration: 60 _summary: Check if the system automatically changes the resolution based on EDID environ: ZAPPER_HOST command: edid_cycle.py "$ZAPPER_HOST" + +unit: template +template-resource: zapper_capabilities +template-filter: zapper_capabilities.capability == 'USB hotplug' and zapper_capabilities.usb_version == '3' +id: usb3/zapper-usb-insert-{{ port_alias }} +template-engine: jinja2 +_summary: Zapper-driven USB insertion test on port {{ port_alias }} +requires: usb.usb3 == 'supported' +plugin: shell +user: root +environ: ZAPPER_ADDRESS +command: + {%- if __on_ubuntucore__ %} + checkbox-support-run_watcher --zapper-usb-address={{ port_alias }} insertion usb3 + {%- else %} + removable_storage_watcher.py --unmounted -m 500000000 --zapper-usb-address={{ port_alias }} insert usb + {% endif -%} +estimated_duration: 20 + +unit: template +template-resource: zapper_capabilities +template-filter: zapper_capabilities.capability == 'USB hotplug' and zapper_capabilities.usb_version == '3' +id: usb3/zapper-usb-remove-{{ port_alias }} +template-engine: jinja2 +_summary: Zapper-driven USB removal test on port {{ port_alias }} +requires: usb.usb3 == 'supported' +plugin: shell +user: root +environ: ZAPPER_ADDRESS +command: + {%- if __on_ubuntucore__ %} + checkbox-support-run_watcher --zapper-usb-address={{ port_alias }} removal usb3 + {%- else %} + removable_storage_watcher.py --unmounted -m 500000000 --zapper-usb-address={{ port_alias }} remove usb + {% endif -%} +estimated_duration: 20 diff --git a/units/zapper/test-plan.pxu b/units/zapper/test-plan.pxu index db7ded7..889fb50 100644 --- a/units/zapper/test-plan.pxu +++ b/units/zapper/test-plan.pxu @@ -12,5 +12,7 @@ _name: Tests using Zapper _description: Tests using Zapper include: monitor/zapper-edid + usb3/zapper-usb-insert-.* + usb3/zapper-usb-remove-.* bootstrap_include: zapper_capabilities -- cgit v1.2.3