summaryrefslogtreecommitdiff
path: root/units/mediacard
diff options
authorSylvain Pineau <sylvain.pineau@canonical.com>2018-05-17 17:11:34 +0200
committerSylvain Pineau <sylvain.pineau@canonical.com>2018-05-17 17:11:34 +0200
commitb3145abea3352ca785abe40556ff8d85160a34cb (patch)
treef21a55692029f23948a1ee79ca32a6677e8583ea /units/mediacard
parentb5fd2a8bc89f5bf6754a6b509eec651d5079abd9 (diff)
units:mediacard.pxu: Add __on_ubuntucore__ jinja2 condition blocks
`journalctl -u snap.udisks2.udisksd` works only on UC
Diffstat (limited to 'units/mediacard')
-rw-r--r--units/mediacard/jobs.pxu112
1 files changed, 64 insertions, 48 deletions
diff --git a/units/mediacard/jobs.pxu b/units/mediacard/jobs.pxu
index ab00396..0599e0c 100644
--- a/units/mediacard/jobs.pxu
+++ b/units/mediacard/jobs.pxu
@@ -1,13 +1,14 @@
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/mmc-insert
estimated_duration: 30.0
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard insert sdio usb scsi
- fi
+ {% endif -%}
imports: from com.canonical.plainbox import manifest
requires:
package.name == 'udisks2' or snap.name == 'udisks2'
@@ -40,16 +41,17 @@ _description:
test is run. It tests reading and writing to the MMC card.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/mmc-remove
estimated_duration: 30.0
depends: mediacard/mmc-insert
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard remove sdio usb scsi
- fi
+ {% endif -%}
user: root
_description:
PURPOSE:
@@ -63,15 +65,16 @@ _description:
automatically selected result.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/sd-insert
estimated_duration: 30.0
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard insert sdio usb scsi
- fi
+ {% endif -%}
imports: from com.canonical.plainbox import manifest
requires:
package.name == 'udisks2' or snap.name == 'udisks2'
@@ -104,16 +107,17 @@ _description:
test is run. It tests reading and writing to the SD card.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/sd-remove
estimated_duration: 30.0
depends: mediacard/sd-insert
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard remove sdio usb scsi
- fi
+ {% endif -%}
user: root
_description:
PURPOSE:
@@ -144,15 +148,16 @@ _description:
It is intended for SRU automated testing.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/sdhc-insert
estimated_duration: 30.0
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard insert sdio usb scsi
- fi
+ {% endif -%}
imports: from com.canonical.plainbox import manifest
requires:
package.name == 'udisks2' or snap.name == 'udisks2'
@@ -186,16 +191,17 @@ _description:
test is run. It tests reading and writing to the SDHC card.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/sdhc-remove
estimated_duration: 30.0
depends: mediacard/sdhc-insert
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard remove sdio usb scsi
- fi
+ {% endif -%}
user: root
_description:
PURPOSE:
@@ -209,15 +215,16 @@ _description:
automatically selected result.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/cf-insert
estimated_duration: 30.0
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard insert sdio usb scsi
- fi
+ {% endif -%}
imports: from com.canonical.plainbox import manifest
requires:
package.name == 'udisks2' or snap.name == 'udisks2'
@@ -249,16 +256,17 @@ _description:
test is run. It tests reading and writing to the CF card.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/cf-remove
depends: mediacard/cf-storage
estimated_duration: 30.0
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard remove sdio usb scsi
- fi
+ {% endif -%}
user: root
_description:
PURPOSE:
@@ -272,15 +280,16 @@ _description:
automatically selected result.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/sdxc-insert
estimated_duration: 30.0
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard insert sdio usb scsi
- fi
+ {% endif -%}
imports: from com.canonical.plainbox import manifest
requires:
package.name == 'udisks2' or snap.name == 'udisks2'
@@ -312,16 +321,17 @@ _description:
test is run. It tests reading and writing to the SDXC card.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/sdxc-remove
estimated_duration: 30.0
depends: mediacard/sdxc-insert
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard remove sdio usb scsi
- fi
+ {% endif -%}
user: root
_description:
PURPOSE:
@@ -335,15 +345,16 @@ _description:
automatically selected result.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/ms-insert
estimated_duration: 30.0
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard insert sdio usb scsi
- fi
+ {% endif -%}
imports: from com.canonical.plainbox import manifest
requires:
package.name == 'udisks2' or snap.name == 'udisks2'
@@ -375,16 +386,17 @@ _description:
test is run. It tests reading and writing to the MS card.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/ms-remove
estimated_duration: 30.0
depends: mediacard/ms-insert
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard remove sdio usb scsi
- fi
+ {% endif -%}
user: root
_description:
PURPOSE:
@@ -398,15 +410,16 @@ _description:
automatically selected result.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/msp-insert
estimated_duration: 30.0
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard insert sdio usb scsi
- fi
+ {% endif -%}
user: root
imports: from com.canonical.plainbox import manifest
requires:
@@ -438,16 +451,17 @@ _description:
test is run. It tests reading and writing to the MSP card.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/msp-remove
estimated_duration: 30.0
depends: mediacard/msp-insert
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard remove sdio usb scsi
- fi
+ {% endif -%}
user: root
_description:
PURPOSE:
@@ -461,15 +475,16 @@ _description:
automatically selected result.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/xd-insert
estimated_duration: 30.0
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kadd.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard insert sdio usb scsi
- fi
+ {% endif -%}
imports: from com.canonical.plainbox import manifest
requires:
package.name == 'udisks2' or snap.name == 'udisks2'
@@ -501,16 +516,17 @@ _description:
test is run. It tests reading and writing to the xD card.
plugin: user-interact
+template-engine: jinja2
category_id: com.canonical.plainbox::mediacard
id: mediacard/xd-remove
estimated_duration: 30.0
depends: mediacard/xd-insert
command:
- if [[ -v SNAP ]]; then
+ {%- if __on_ubuntucore__ %}
timeout 20s bash -c 'grep -m 1 -oP "\Kremove.*?mmc.*?\s" <( exec journalctl -u snap.udisks2.udisksd -f -q -S -1s ); kill $!'
- else
+ {%- else %}
removable_storage_watcher --memorycard remove sdio usb scsi
- fi
+ {% endif -%}
user: root
_description:
PURPOSE: