diff options
author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2017-09-26 10:27:20 +0200 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2017-09-26 10:27:20 +0200 |
commit | 78012795b553ba0b5ad0c2977d80d8f16831ae00 (patch) | |
tree | 72bc986d7b32d1de0d6c34fc66c30dab133a8de1 /units/usb | |
parent | 2515d92d9abd6f8fb7d13b6647e9d1f9a9a88061 (diff) |
Import plainbox-provider-checkbox_0.40.0~rc2.orig.tar.gzupstream-0.40.0_rc2patched-0.40.0_rc2-1
Diffstat (limited to 'units/usb')
-rw-r--r-- | units/usb/manifest.pxu | 4 | ||||
-rw-r--r-- | units/usb/test-plan.pxu | 89 | ||||
-rw-r--r-- | units/usb/usb-c.pxu | 189 | ||||
-rw-r--r-- | units/usb/usb.pxu | 281 |
4 files changed, 563 insertions, 0 deletions
diff --git a/units/usb/manifest.pxu b/units/usb/manifest.pxu new file mode 100644 index 0000000..914e892 --- /dev/null +++ b/units/usb/manifest.pxu @@ -0,0 +1,4 @@ +unit: manifest entry +id: has_usb_type_c +_name: USB Type-C Support +value-type: bool diff --git a/units/usb/test-plan.pxu b/units/usb/test-plan.pxu new file mode 100644 index 0000000..96ece6d --- /dev/null +++ b/units/usb/test-plan.pxu @@ -0,0 +1,89 @@ +id: usb-cert-full +unit: test plan +_name: USB tests +_description: USB tests +include: + usb/detect certification-status=blocker + usb/HID certification-status=blocker + usb/insert certification-status=blocker + usb/storage-automated certification-status=blocker + usb/remove certification-status=blocker + +id: usb3-cert-full +unit: test plan +_name: USB3 tests +_description: USB3 tests +include: + usb3/insert certification-status=blocker + usb3/storage-automated certification-status=blocker + usb3/remove certification-status=blocker + +id: usb-c-cert-full +unit: test plan +_name: USB Type-C tests +_description: USB Type-C tests +include: + usb-c/c-to-a-adapter/hid certification-status=non-blocker + usb-c/c-to-a-adapter/insert certification-status=non-blocker + usb-c/c-to-a-adapter/storage-automated certification-status=non-blocker + usb-c/c-to-a-adapter/remove certification-status=non-blocker + usb-c/hid certification-status=non-blocker + usb-c/insert certification-status=non-blocker + usb-c/storage-automated certification-status=non-blocker + usb-c/remove certification-status=non-blocker + +id: after-suspend-usb-cert-full +unit: test plan +_name: USB tests (after suspend) +_description: USB tests (after suspend) +include: + suspend/usb_insert_after_suspend certification-status=blocker + suspend/usb_storage_automated_after_suspend certification-status=blocker + suspend/usb_remove_after_suspend certification-status=blocker + +id: after-suspend-usb3-cert-full +unit: test plan +_name: USB3 tests (after suspend) +_description: USB3 tests (after suspend) +include: + suspend/usb3_insert_after_suspend certification-status=blocker + suspend/usb3_storage_automated_after_suspend certification-status=blocker + suspend/usb3_remove_after_suspend certification-status=blocker + +id: usb-cert-blockers +unit: test plan +_name: USB tests (certification blockers only) +_description: USB tests (certification blockers only) +include: + usb/detect certification-status=blocker + usb/HID certification-status=blocker + usb/insert certification-status=blocker + usb/storage-automated certification-status=blocker + usb/remove certification-status=blocker + +id: usb3-cert-blockers +unit: test plan +_name: USB3 tests (certification blockers only) +_description: USB3 tests (certification blockers only) +include: + usb3/insert certification-status=blocker + usb3/storage-automated certification-status=blocker + usb3/remove certification-status=blocker + +id: after-suspend-usb-cert-blockers +unit: test plan +_name: USB tests (after suspend, certification blockers only) +_description: USB tests (after suspend, certification blockers only) +include: + suspend/usb_insert_after_suspend certification-status=blocker + suspend/usb_storage_automated_after_suspend certification-status=blocker + suspend/usb_remove_after_suspend certification-status=blocker + +id: after-suspend-usb3-cert-blockers +unit: test plan +_name: USB3 tests (after suspend, certification blockers only) +_description: USB3 tests (after suspend, certification blockers only) +include: + suspend/usb3_insert_after_suspend certification-status=blocker + suspend/usb3_storage_automated_after_suspend certification-status=blocker + suspend/usb3_remove_after_suspend certification-status=blocker diff --git a/units/usb/usb-c.pxu b/units/usb/usb-c.pxu new file mode 100644 index 0000000..9a77664 --- /dev/null +++ b/units/usb/usb-c.pxu @@ -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: com.canonical.plainbox::usb +imports: from 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: com.canonical.plainbox::usb +imports: from 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: com.canonical.plainbox::usb +imports: from 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: com.canonical.plainbox::usb +depends: usb-c/c-to-a-adapter/insert +imports: from 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: com.canonical.plainbox::usb +imports: from 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: com.canonical.plainbox::usb +imports: from 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: com.canonical.plainbox::usb +imports: from 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: com.canonical.plainbox::usb +depends: usb-c/insert +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_usb_type_c == 'True' +estimated_duration: 30 + diff --git a/units/usb/usb.pxu b/units/usb/usb.pxu new file mode 100644 index 0000000..6615401 --- /dev/null +++ b/units/usb/usb.pxu @@ -0,0 +1,281 @@ +plugin: shell +category_id: com.canonical.plainbox::usb +id: usb/detect +requires: + cpuinfo.platform != 's390x' +estimated_duration: 1.0 +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 | sort || 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. + +plugin: user-interact-verify +category_id: com.canonical.plainbox::usb +id: usb/disk_detect +depends: usb/detect +estimated_duration: 1.0 +command: removable_storage_test -l usb +_description: + PURPOSE: + This test will check that your system detects USB storage devices. + STEPS: + 1. Plug in one or more USB keys or hard drives. + 2. Click on "Test". + VERIFICATION: + Were the drives detected? + +plugin: user-interact-verify +category_id: com.canonical.plainbox::usb +id: usb/HID +depends: usb/detect +estimated_duration: 1.0 +command: keyboard_test +_description: + PURPOSE: + This test will check that you can use a USB HID device + STEPS: + 1. Enable either a USB mouse or keyboard + 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? + +id: usb/insert +_summary: USB 2.0 storage device insertion detected +_purpose: + Check system can detect USB 2.0 storage when inserted +_steps: + 1. Press continue + 2. Connect USB 2.0 storage device +_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 usb2 + else + removable_storage_watcher insert usb + fi +category_id: com.canonical.plainbox::usb +estimated_duration: 120 + +id: usb3/insert +requires: + usb.usb3 == 'supported' +_summary: USB 3.0 storage device insertion detected +_purpose: + Check system can detect insertion of a USB 3.0 storage device +_steps: + 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. +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: com.canonical.plainbox::usb +estimated_duration: 120 + +id: usb/remove +_summary: USB 2.0 storage device removal detected +_purpose: + Check system can detect removal of a USB 2.0 storage device +_steps: + 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. +plugin: user-interact +depends: usb/insert +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: com.canonical.plainbox::usb +estimated_duration: 120 + +id: usb3/remove +_summary: USB 3.0 storage device removal detected +_purpose: + Check system can detect removal of a USB 3.0 storage device +_steps: + 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. +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: com.canonical.plainbox::usb +estimated_duration: 120 + +plugin: user-interact-verify +category_id: com.canonical.plainbox::usb +id: usb/storage-transfer +depends: usb/insert +user: root +estimated_duration: 45.0 +command: removable_storage_test -s 268400000 usb +_description: + PURPOSE: + This test will check your USB connection. + STEPS: + 1. Plug a USB HDD or thumbdrive into the computer. + 2. An icon should appear on the Launcher. + 3. Click "Test" to begin the test. + VERIFICATION: + The verification of this test is automated. Do not change the + automatically selected result. + +plugin: user-interact-verify +category_id: com.canonical.plainbox::usb +id: usb3/storage-transfer +requires: + usb.usb3 == 'supported' +depends: usb3/insert +user: root +estimated_duration: 45.0 +command: removable_storage_test -s 268400000 -m 500000000 usb +_description: + PURPOSE: + This test will check your USB 3.0 connection. + STEPS: + 1. Plug a USB 3.0 HDD or thumbdrive into a USB 3.0 port in the computer. + 2. An icon should appear on the Launcher. + 3. Click "Test" to begin the test. + VERIFICATION: + The verification of this test is automated. Do not change the + automatically selected result. + +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 +command: + if [[ -v SNAP ]]; then + checkbox-support-usb_read_write + else + removable_storage_test -s 268400000 usb + fi +category_id: com.canonical.plainbox::usb +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 +depends: usb3/insert +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: com.canonical.plainbox::usb +estimated_duration: 300 + +plugin: shell +category_id: com.canonical.plainbox::usb +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 preserve-cwd +requires: + cpuinfo.platform != 's390x' + 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: + Tests USB 2.0 or 1.1 ports on a system by doing write/read/compare tests on + randomly created data. It requires that a USB stick is plugged into an + available USB port before running the certification suite. + +plugin: shell +category_id: com.canonical.plainbox::usb +id: usb3/storage-preinserted +user: root +flags: also-after-suspend +requires: + cpuinfo.platform != 's390x' + 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: + Test USB 3.0 or 3.1 ports +_description: + Tests USB 3.0 ports on a system by doing write/read/compare tests on + randomly created data. It requires that a USB stick is plugged into an + available USB port before running the certification suite. Additionally, it + will only work with USB sticks and ports rated for USB 3.0 speeds or faster. + +plugin: manual +category_id: com.canonical.plainbox::usb +id: usb/panels +_description: + PURPOSE: + This test will check your USB connection. + STEPS: + 1. Connect a USB storage device to an external USB slot on this computer. + 2. An icon should appear on the Launcher. + 3. Confirm that the icon appears. + 4. Eject the device. + 5. Repeat with each external USB slot. + VERIFICATION: + Do all USB slots work with the device? + +plugin: shell +category_id: com.canonical.plainbox::usb +id: usb/performance +depends: usb/insert +user: root +estimated_duration: 45.00 +command: removable_storage_test -s 268400000 -p 15 usb +_description: + This test will check that your USB 2.0 port transfers data at a + minimum expected speed. |