summaryrefslogtreecommitdiff
path: root/jobs
diff options
authorSylvain Pineau <sylvain.pineau@canonical.com>2017-07-03 10:21:47 +0200
committerSylvain Pineau <sylvain.pineau@canonical.com>2017-07-03 10:21:47 +0200
commit984e777c401d9ea7213e41050344c79c51c6acc4 (patch)
tree4750eed27bb9cb807a002daa8791cf568ce5e6ce /jobs
parent32296da516de311c567b53adde57538b894bfc9c (diff)
Update usb jobs to work on snappy
Move all usb type C tests to a new file for readability
Diffstat (limited to 'jobs')
-rw-r--r--jobs/usb-c.txt.in189
-rw-r--r--jobs/usb.txt.in320
2 files changed, 300 insertions, 209 deletions
diff --git a/jobs/usb-c.txt.in b/jobs/usb-c.txt.in
new file mode 100644
index 0000000..b0a8d9e
--- /dev/null
+++ b/jobs/usb-c.txt.in
@@ -0,0 +1,189 @@
+id: usb-c/c-to-a-adapter/hid
+_summary: USB HID work on USB Type-C port using a "USB Type-C to Type-A" adapter
+_purpose:
+ This test will check that you can use a USB HID device plugged in a USB
+ Type-C port using a "USB Type-C to Type-A" adapter
+_steps:
+ 1. Enable either a USB mouse or keyboard by plugging it in the USB Type-C port using a "USB Type-C to Type-A" adapter
+ 2. For mice, perform actions such as moving the pointer, right and left button clicks and double clicks
+ 3. For keyboards, switch to another tty and type some text
+_verification:
+ Did the device work as expected?
+plugin: manual
+flags: also-after-suspend
+category_id: 2013.com.canonical.plainbox::usb
+imports: from 2013.com.canonical.plainbox import manifest
+requires: manifest.has_usb_type_c == 'True'
+estimated_duration: 60
+
+id: usb-c/c-to-a-adapter/insert
+_purpose:
+ This test will check that the system correctly detects the insertion of
+ a USB 3 storage device in a USB Type-C connector using a "Type-C to Type-A"
+ adapter
+_steps:
+ 1. Commence the test
+ 2. Connect a USB 3 storage device to a USB Type-C port using a
+ "Type-C to Type-A" adapter
+ 3. Do not unplug the device after the test.
+_verification:
+ The verification of this test is automated. Do not change the
+ automatically selected result.
+plugin: user-interact
+flags: also-after-suspend
+user: root
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-run_watcher insertion usb3
+ else
+ removable_storage_watcher -m 500000000 insert usb
+ fi
+category_id: 2013.com.canonical.plainbox::usb
+imports: from 2013.com.canonical.plainbox import manifest
+requires:
+ usb.usb3 == 'supported'
+ manifest.has_usb_type_c == 'True'
+estimated_duration: 30
+
+id: usb-c/c-to-a-adapter/storage-automated
+_description:
+ This test is automated and executes after the usb-c/c-to-a-adapter/insert test
+ is run.
+plugin: shell
+flags: also-after-suspend
+user: root
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-usb_read_write
+ else
+ removable_storage_test -s 268400000 -m 500000000 usb --driver xhci_hcd
+ fi
+category_id: 2013.com.canonical.plainbox::usb
+imports: from 2013.com.canonical.plainbox import manifest
+requires:
+ manifest.has_usb_type_c == 'True'
+depends: usb-c/c-to-a-adapter/insert
+estimated_duration: 60
+
+id: usb-c/c-to-a-adapter/remove
+_purpose:
+ This test will check that the system correctly detects the removal of
+ a USB 3 storage device connected to a USB Type-C port using a "USB Type-C
+ to Type-A" adapter.
+_steps:
+ 1. Commence the test
+ 2. Disconnect a USB 3 storage device to a USB Type-C port using a
+ "Type-C to Type-A" adapter
+_verification:
+ The verification of this test is automated. Do not change the
+ automatically selected result.
+plugin: user-interact
+flags: also-after-suspend
+user: root
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-run_watcher removal usb3
+ else
+ removable_storage_watcher -m 500000000 remove usb
+ fi
+category_id: 2013.com.canonical.plainbox::usb
+depends: usb-c/c-to-a-adapter/insert
+imports: from 2013.com.canonical.plainbox import manifest
+requires:
+ manifest.has_usb_type_c == 'True'
+estimated_duration: 30
+
+id: usb-c/hid
+_summary: USB HID work on USB Type-C port
+_purpose:
+ This test will check that you can use a USB HID device plugged in a USB
+ Type-C port
+_steps:
+ 1. Enable either a USB mouse or keyboard by plugging it in the USB Type-C port
+ 2. For mice, perform actions such as moving the pointer, right and left button clicks and double clicks
+ 3. For keyboards, switch to another tty and type some text
+_verification:
+ Did the device work as expected?
+plugin: manual
+flags: also-after-suspend
+category_id: 2013.com.canonical.plainbox::usb
+imports: from 2013.com.canonical.plainbox import manifest
+requires: manifest.has_usb_type_c == 'True'
+estimated_duration: 60
+
+id: usb-c/insert
+_summary: USB 3.0 storage device insertion detected on USB Type-C port
+_purpose:
+ This test will check that the system correctly detects the insertion of
+ a USB 3 storage device in a USB Type-C connector
+_steps:
+ 1. Commence the test
+ 2. Connect a USB 3 storage device to a USB Type-C port
+ 3. Do not unplug the device after the test.
+_verification:
+ The verification of this test is automated. Do not change the
+ automatically selected result.
+plugin: user-interact
+flags: also-after-suspend
+user: root
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-run_watcher insertion usb3
+ else
+ removable_storage_watcher -m 500000000 insert usb
+ fi
+category_id: 2013.com.canonical.plainbox::usb
+imports: from 2013.com.canonical.plainbox import manifest
+requires:
+ usb.usb3 == 'supported'
+ manifest.has_usb_type_c == 'True'
+estimated_duration: 30
+
+id: usb-c/storage-automated
+_summary: USB 3.0 storage device read & write works on USB Type-C port
+_description:
+ This test is automated and executes after the usb-c/insert test
+ is run.
+plugin: shell
+flags: also-after-suspend
+user: root
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-usb_read_write
+ else
+ removable_storage_test -s 268400000 -m 500000000 usb --driver xhci_hcd
+ fi
+category_id: 2013.com.canonical.plainbox::usb
+imports: from 2013.com.canonical.plainbox import manifest
+requires:
+ manifest.has_usb_type_c == 'True'
+depends: usb-c/insert
+estimated_duration: 60
+
+id: usb-c/remove
+_summary: USB 3.0 storage device removal detected on USB Type-C port
+_purpose:
+ This test will check that the system correctly detects the removal of
+ a USB 3 storage device connected to a USB Type-C port.
+_steps:
+ 1. Commence the test
+ 2. Disconnect a USB 3 storage device to a USB Type-C port
+_verification:
+ The verification of this test is automated. Do not change the
+ automatically selected result.
+plugin: user-interact
+flags: also-after-suspend
+user: root
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-run_watcher removal usb3
+ else
+ removable_storage_watcher -m 500000000 remove usb
+ fi
+category_id: 2013.com.canonical.plainbox::usb
+depends: usb-c/insert
+imports: from 2013.com.canonical.plainbox import manifest
+requires:
+ manifest.has_usb_type_c == 'True'
+estimated_duration: 30
+
diff --git a/jobs/usb.txt.in b/jobs/usb.txt.in
index 1db807d..a11bea1 100644
--- a/jobs/usb.txt.in
+++ b/jobs/usb.txt.in
@@ -7,7 +7,13 @@ plugin: shell
category_id: 2013.com.canonical.plainbox::usb
id: usb/detect
estimated_duration: 1.0
-command: set -o pipefail; lsusb 2>/dev/null | sed 's/.*\(ID .*\)/\1/' | head -n 4 || echo "No USB devices were detected" >&2
+command:
+ set -o pipefail
+ if [[ -v SNAP ]]; then
+ lsusb.py -f $SNAP/var/lib/usbutils/usb.ids 2>/dev/null | sed 's/.*\(ID .*\)/\1/' | head -n 4 || echo "No USB devices were detected" >&2
+ else
+ lsusb 2>/dev/null | sed 's/.*\(ID .*\)/\1/' | head -n 4 || echo "No USB devices were detected" >&2
+ fi
_summary: Display USB devices attached to SUT
_description: Detects and shows USB devices attached to this system.
@@ -42,197 +48,96 @@ _description:
VERIFICATION:
Did the device work as expected?
-plugin: user-interact-verify
-category_id: 2013.com.canonical.plainbox::usb
-id: usb-c/c-to-a-adapter/hid
-imports: from 2013.com.canonical.plainbox import manifest
-requires: manifest.has_usb_type_c == 'True'
-depends: usb/detect
-estimated_duration: 10.0
-command: keyboard_test
-_purpose:
- This test will check that you can use a USB HID device plugged in a USB
- Type-C port using a "USB Type-C to Type-A" adapter
-_steps:
- 1. Enable either a USB mouse or keyboard by plugging it in the USB Type-C port using a "USB Type-C to Type-A" adapter
- 2. For mice, perform actions such as moving the pointer, right and left button clicks and double clicks
- 3. For keyboards, commence the test to launch a small tool. Type some text and close the tool.
-_verification:
- Did the device work as expected?
-
-plugin: user-interact-verify
-category_id: 2013.com.canonical.plainbox::usb
-id: usb-c/hid
-imports: from 2013.com.canonical.plainbox import manifest
-requires: manifest.has_usb_type_c == 'True'
-depends: usb/detect
-estimated_duration: 10.0
-command: keyboard_test
+id: usb/insert
+_summary: USB 2.0 storage device insertion detected
_purpose:
- This test will check that you can use a USB HID device plugged in a USB
- Type-C port
+ Check system can detect USB 2.0 storage when inserted
_steps:
- 1. Enable either a USB mouse or keyboard by plugging it in the USB Type-C port
- 2. For mice, perform actions such as moving the pointer, right and left button clicks and double clicks
- 3. For keyboards, commence the test to launch a small tool. Type some text and close the tool.
+ 1. Press continue
+ 2. Connect USB 2.0 storage device
_verification:
- Did the device work as expected?
-
+ The verification of this test is automated.
+ Do not change the automatically selected result.
plugin: user-interact
+flags: also-after-suspend
+user: root
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-run_watcher insertion usb2
+ else
+ removable_storage_watcher insert usb
+ fi
category_id: 2013.com.canonical.plainbox::usb
-id: usb/insert
-depends: usb/detect
-estimated_duration: 10.0
-command: removable_storage_watcher insert usb
-_description:
- PURPOSE:
- This test will check that the system correctly detects the insertion of
- a USB storage device
- STEPS:
- 1. Click "Test" and insert a USB storage device
- (Note: this test will time-out after 20 seconds.)
- 2. Do not unplug the device after the test.
- VERIFICATION:
- The verification of this test is automated. Do not change the
- automatically selected result.
+estimated_duration: 120
-plugin: user-interact
-category_id: 2013.com.canonical.plainbox::usb
id: usb3/insert
requires:
usb.usb3 == 'supported'
-estimated_duration: 10.0
-command: removable_storage_watcher -m 500000000 insert usb
-_description:
- PURPOSE:
- This test will check that the system correctly detects the insertion of
- a USB 3.0 storage device
- STEPS:
- 1. Click "Test" and insert a USB 3.0 storage device in a USB 3.0 port.
- (Note: this test will time-out after 20 seconds.)
- 2. Do not unplug the device after the test.
- VERIFICATION:
- The verification of this test is automated. Do not change the
- automatically selected result.
-
-plugin: user-interact
-category_id: 2013.com.canonical.plainbox::usb
-id: usb-c/c-to-a-adapter/insert
-imports: from 2013.com.canonical.plainbox import manifest
-requires:
- usb.usb3 == 'supported'
- manifest.has_usb_type_c == 'True'
-estimated_duration: 10.0
-command: removable_storage_watcher -m 500000000 insert usb
+_summary: USB 3.0 storage device insertion detected
_purpose:
- This test will check that the system correctly detects the insertion of
- a USB 3 storage device in a USB Type-C connector using a "Type-C to Type-A"
- adapter
+ Check system can detect insertion of a USB 3.0 storage device
_steps:
- 1. Click "Test" and insert a USB 3 storage device in a USB Type-C port
- using a "USB Type-C to Type-A" adapter.
- (Note: this test will time-out after 20 seconds.)
- 2. Do not unplug the device after the test.
+ 1. Press continue
+ 2. Connect USB 3.0 storage device
_verification:
- The verification of this test is automated. Do not change the
- automatically selected result.
-
+ The verification of this test is automated.
+ Do not change the automatically selected result.
plugin: user-interact
+user: root
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-run_watcher insertion usb3
+ else
+ removable_storage_watcher -m 500000000 insert usb
+ fi
category_id: 2013.com.canonical.plainbox::usb
-id: usb-c/insert
-imports: from 2013.com.canonical.plainbox import manifest
-requires:
- usb.usb3 == 'supported'
- manifest.has_usb_type_c == 'True'
-estimated_duration: 10.0
-command: removable_storage_watcher -m 500000000 insert usb
+estimated_duration: 120
+
+id: usb/remove
+_summary: USB 2.0 storage device removal detected
_purpose:
- This test will check that the system correctly detects the insertion of
- a USB 3 storage device in a USB Type-C connector
+ Check system can detect removal of a USB 2.0 storage device
_steps:
- 1. Click "Test" and insert a USB 3 storage device in a USB Type-C port.
- (Note: this test will time-out after 20 seconds.)
- 2. Do not unplug the device after the test.
+ 1. Press continue
+ 2. Disconnect USB 2.0 storage device
_verification:
- The verification of this test is automated. Do not change the
- automatically selected result.
-
+ The verification of this test is automated.
+ Do not change the automatically selected result.
plugin: user-interact
-category_id: 2013.com.canonical.plainbox::usb
-id: usb/remove
depends: usb/insert
-estimated_duration: 10.0
-command: removable_storage_watcher remove usb
-_description:
- PURPOSE:
- This test will check that the system correctly detects the removal of
- a USB storage device
- STEPS:
- 1. Click "Test" and remove the USB device.
- (Note: this test will time-out after 20 seconds.)
- VERIFICATION:
- The verification of this test is automated. Do not change the
- automatically selected result.
-
-plugin: user-interact
+flags: also-after-suspend
+user: root
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-run_watcher removal usb2
+ else
+ removable_storage_watcher remove usb
+ fi
category_id: 2013.com.canonical.plainbox::usb
-id: usb3/remove
-depends: usb3/insert
-requires:
- usb.usb3 == 'supported'
-estimated_duration: 10.0
-command: removable_storage_watcher -m 500000000 remove usb
-_description:
- PURPOSE:
- This test will check that the system correctly detects the removal of
- a USB 3.0 storage device
- STEPS:
- 1. Click "Test" and remove the USB 3.0 device.
- (Note: this test will time-out after 20 seconds.)
- VERIFICATION:
- The verification of this test is automated. Do not change the
- automatically selected result.
+estimated_duration: 120
-plugin: user-interact
-category_id: 2013.com.canonical.plainbox::usb
-id: usb-c/c-to-a-adapter/remove
-imports: from 2013.com.canonical.plainbox import manifest
-depends: usb-c/c-to-a-adapter/insert
-requires:
- usb.usb3 == 'supported'
- manifest.has_usb_type_c == 'True'
-estimated_duration: 10.0
-command: removable_storage_watcher -m 500000000 remove usb
+id: usb3/remove
+_summary: USB 3.0 storage device removal detected
_purpose:
- This test will check that the system correctly detects the removal of
- a USB 3 storage device connected to a USB Type-C port using a "USB Type-C
- to Type-A" adapter.
+ Check system can detect removal of a USB 3.0 storage device
_steps:
- 1. Click "Test" and remove the USB 3 device.
- (Note: this test will time-out after 20 seconds.)
+ 1. Press continue
+ 2. Disconnect USB 3.0 storage device
_verification:
- The verification of this test is automated. Do not change the
- automatically selected result.
-
+ The verification of this test is automated.
+ Do not change the automatically selected result.
plugin: user-interact
+flags: also-after-suspend
+depends: usb3/insert
+user: root
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-run_watcher removal usb3
+ else
+ removable_storage_watcher -m 500000000 remove usb
+ fi
category_id: 2013.com.canonical.plainbox::usb
-id: usb-c/remove
-imports: from 2013.com.canonical.plainbox import manifest
-depends: usb-c/insert
-requires:
- usb.usb3 == 'supported'
- manifest.has_usb_type_c == 'True'
-estimated_duration: 10.0
-command: removable_storage_watcher -m 500000000 remove usb
-_purpose:
- This test will check that the system correctly detects the removal of
- a USB 3 storage device connected to a USB Type-C port.
-_steps:
- 1. Click "Test" and remove the USB 3 device.
- (Note: this test will time-out after 20 seconds.)
-_verification:
- The verification of this test is automated. Do not change the
- automatically selected result.
+estimated_duration: 120
plugin: user-interact-verify
category_id: 2013.com.canonical.plainbox::usb
@@ -272,57 +177,47 @@ _description:
The verification of this test is automated. Do not change the
automatically selected result.
-plugin: shell
-category_id: 2013.com.canonical.plainbox::usb
id: usb/storage-automated
+_summary: USB 2.0 storage device read & write works
+_purpose:
+ Check system can read/write to USB 2.0 storage correctly
+_steps:
+ 1. This task is fully automatic and need USB 2.0 insertion test was applied first.
+_verification:
+ This task is fully automatic and will verify the result for you.
+plugin: shell
depends: usb/insert
+flags: also-after-suspend
user: root
-estimated_duration: 45.0
-command: removable_storage_test -s 268400000 usb
-_description:
- This test is automated and executes after the usb/insert test is run.
-
-plugin: shell
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-usb_read_write
+ else
+ removable_storage_test -s 268400000 usb
+ fi
category_id: 2013.com.canonical.plainbox::usb
-id: usb3/storage-automated
-requires:
- usb.usb3 == 'supported'
-depends: usb3/insert
-user: root
-estimated_duration: 45.0
-command: removable_storage_test -s 268400000 -m 500000000 usb --driver xhci_hcd
-_description:
- This test is automated and executes after the usb3/insert test is run.
+estimated_duration: 300
+id: usb3/storage-automated
+_summary: USB 3.0 storage device read & write works
+_purpose:
+ Check system can read/write to USB 3.0 storage devices correctly
+_steps:
+ 1. This task is fully automatic and need USB 3.0 insertion test was applied first.
+_verification:
+ This task is fully automatic and will verify the result for you.
plugin: shell
-category_id: 2013.com.canonical.plainbox::usb
-id: usb-c/c-to-a-adapter/storage-automated
-imports: from 2013.com.canonical.plainbox import manifest
-requires:
- usb.usb3 == 'supported'
- manifest.has_usb_type_c == 'True'
-depends: usb-c/c-to-a-adapter/insert
+depends: usb3/insert
+flags: also-after-suspend
user: root
-estimated_duration: 45.0
-command: removable_storage_test -s 268400000 -m 500000000 usb --driver xhci_hcd
-_description:
- This test is automated and executes after the usb-c/c-to-a-adapter/insert test
- is run.
-
-plugin: shell
+command:
+ if [[ -v SNAP ]]; then
+ checkbox-support-usb_read_write
+ else
+ removable_storage_test -s 268400000 -m 500000000 usb --driver xhci_hcd
+ fi
category_id: 2013.com.canonical.plainbox::usb
-id: usb-c/storage-automated
-imports: from 2013.com.canonical.plainbox import manifest
-requires:
- usb.usb3 == 'supported'
- manifest.has_usb_type_c == 'True'
-depends: usb-c/insert
-user: root
-estimated_duration: 45.0
-command: removable_storage_test -s 268400000 -m 500000000 usb --driver xhci_hcd
-_description:
- This test is automated and executes after the usb-c/insert test
- is run.
+estimated_duration: 300
plugin: shell
category_id: 2013.com.canonical.plainbox::usb
@@ -330,6 +225,10 @@ id: usb/storage-preinserted
user: root
estimated_duration: 45.0
command: removable_storage_test -l usb && removable_storage_test -s 268400000 usb
+flags: also-after-suspend
+requires:
+ package.name == 'udisks2' or snap.name == 'udisks2'
+ package.name == 'udisks2' or (snap.name == 'core' and int(snap.revision) >= 1804)
_summary:
Test USB 2.0 or 1.1 ports
_description:
@@ -341,8 +240,11 @@ plugin: shell
category_id: 2013.com.canonical.plainbox::usb
id: usb3/storage-preinserted
user: root
+flags: also-after-suspend
requires:
usb.usb3 == 'supported'
+ package.name == 'udisks2' or snap.name == 'udisks2'
+ package.name == 'udisks2' or (snap.name == 'core' and int(snap.revision) >= 1804)
estimated_duration: 45.0
command: removable_storage_test -l usb && removable_storage_test -s 268400000 -m 500000000 usb --driver xhci_hcd
_summary: