diff options
author | PMR <pmr@pmr-lander> | 2019-09-21 10:43:07 +0200 |
---|---|---|
committer | PMR <pmr@pmr-lander> | 2019-09-21 10:43:07 +0200 |
commit | c6d07afdb7d11b84158135b097cb82f741c42487 (patch) | |
tree | 02bb32d8b3a8772e5aa01cfd00cfc87606498b3e /units | |
parent | 1b0b735fca3a3a96662aeaadc7253ae9002905c9 (diff) |
Import plainbox-provider-checkbox_0.49.0~rc3.orig.tar.gzupstream-0.49.0_rc3patched-0.49.0_rc3-1
Diffstat (limited to 'units')
82 files changed, 5581 insertions, 28 deletions
diff --git a/units/6lowpan/category.pxu b/units/6lowpan/category.pxu new file mode 100644 index 0000000..7502b2a --- /dev/null +++ b/units/6lowpan/category.pxu @@ -0,0 +1,3 @@ +unit: category +id: 6lowpan +_name: 6LoWPAN diff --git a/units/6lowpan/jobs.pxu b/units/6lowpan/jobs.pxu new file mode 100644 index 0000000..10fe86a --- /dev/null +++ b/units/6lowpan/jobs.pxu @@ -0,0 +1,11 @@ +plugin: shell +category_id: 6lowpan +id: 6lowpan/kconfig +estimated_duration: 1.2 +command: + for config in CONFIG_6LOWPAN CONFIG_IEEE802154 CONFIG_IEEE802154_6LOWPAN CONFIG_MAC802154; do + zcat /proc/config.gz | egrep "$config=(y|m)" || exit 1 + done +_summary: kernel config options for 6LoWPAN +_description: + Checks the kernel config options for 6LoWPAN / IEEE802.15.4 support diff --git a/units/6lowpan/test-plan.pxu b/units/6lowpan/test-plan.pxu new file mode 100644 index 0000000..a9b48cd --- /dev/null +++ b/units/6lowpan/test-plan.pxu @@ -0,0 +1,7 @@ +id: 6lowpan-automated +unit: test plan +_name: Automated 6LoWPAN tests +_description: Automated 6LoWPAN tests for Snappy Ubuntu Core devices +include: + 6lowpan/kconfig + diff --git a/units/audio/jobs.pxu b/units/audio/jobs.pxu index a661833..0745e5c 100644 --- a/units/audio/jobs.pxu +++ b/units/audio/jobs.pxu @@ -617,3 +617,232 @@ command: audio_settings store --file=$PLAINBOX_SESSION_SHARE/audio_settings_after_suspend_30_cycles diff $PLAINBOX_SESSION_SHARE/audio_settings_before_suspend $PLAINBOX_SESSION_SHARE/audio_settings_after_suspend_30_cycles +id: audio/detect-playback-devices +_summary: Check that at least one audio playback device exits +plugin: shell +category_id: com.canonical.plainbox::audio +flags: also-after-suspend +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_audio_playback == 'True' +command: + COUNT=$(alsa_pcm_info | grep Playback | wc -l) + echo "Count: $COUNT" + if [ $COUNT -eq 0 ]; then + exit 1 + fi +estimated_duration: 1s + +id: audio/detect-capture-devices +_summary: Check that at least one audio capture device exists +plugin: shell +category_id: com.canonical.plainbox::audio +flags: also-after-suspend +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_audio_capture == 'True' +command: + COUNT=$(alsa_pcm_info | grep Capture | wc -l) + echo "Count: $COUNT" + if [ $COUNT -eq 0 ]; then + exit 1 + fi +esimated_duration: 1s + +id: audio/alsa-playback +_summary: Playback works +_purpose: + Check if sound is played through ALSA on the default output +_steps: + 1. Make sure speakers or headphones are connect to the device + 2. Commence the test +_verification: + Did you hear the sound? +plugin: user-interact-verify +depends: audio/detect-playback-devices +user: root +environ: ALSA_CONFIG_PATH ALSADEVICE +flags: also-after-suspend +command: alsa_test playback -d 5 +category_id: com.canonical.plainbox::audio +estimated_duration: 10 + +id: audio/alsa-loopback-automated +_summary: Captured sound matches played one (automated) +_purpose: + Check if sound that is 'hearable' by capture device +plugin: shell +depends: audio/detect-playback-devices audio/detect-capture-devices +user: root +environ: ALSA_CONFIG_PATH LD_LIBRARY_PATH ALSADEVICE +flags: also-after-suspend +command: alsa_test loopback -d 5 +category_id: com.canonical.plainbox::audio +estimated_duration: 5 + +id: audio/alsa-loopback +_summary: Captured sound matches played one +_purpose: + Check if sound that is 'hearable' by capture device +_steps: + 1. Connect line-out to line-in (plug the loop-back cable) + 2. Commence the test + 3. Observe command's output +_verification: + Is the reported frequency in the 438 - 442 range +plugin: user-interact-verify +depends: audio/detect-playback-devices audio/detect-capture-devices +user: root +environ: ALSA_CONFIG_PATH LD_LIBRARY_PATH ALSADEVICE +flags: also-after-suspend +command: alsa_test loopback -d 5 +category_id: com.canonical.plainbox::audio +estimated_duration: 30 + +id: audio/pa-record-internal-mic +_summary: Record a wav file and check it using pulseaudio - internal mic +_purpose: + Check if audio input work fine through pulseaudio on internal mic +_steps: + 1. Make sure no external mic is connected to the device + 2. Make sure there's at least one output device connected to the device + 3. Workaround to run pulseaudio correctly: + sudo mkdir -p /run/user/0/snap.pulseaudio/pulse + 4. Find out corrent source, sink id: + sudo pulseaudio.pactl list + 5. Set input/output profile: + sudo pulseaudio.pactl set-card-profile 0 output:analog-stereo+input:analog-stereo + 6. Unmute and set volume of input/output: + sudo pulseaudio.pactl set-sink-mute <Sink id #, e.g. 0> 0 + sudo pulseaudio.pactl set-sink-volume <Sink id #, e.g. 0> 80% + sudo pulseaudio.pactl set-source-mute <Source id #, e.g. 0> 0 + sudo pulseaudio.pactl set-source-volume <Source id #, e.g. 0> 80% + 7. Record for 5 seconds to a wav file: + sudo timeout 5 pulseaudio.parec -v /var/snap/pulseaudio/common/test.wav + 8. Play the recorded file + sudo pulseaudio.paplay -v /var/snap/pulseaudio/common/test.wav + 9. Remove the recorded file + sudo rm /var/snap/pulseaudio/common/test.wav +_verification: + Did you hear the recorded sound correctly? +plugin: manual +flags: also-after-suspend +requires: snap.name == 'pulseaudio' +category_id: com.canonical.plainbox::audio +estimated_duration: 1m + +id: audio/pa-record-external-mic +_summary: Record a wav file and check it using pulseaudio - external mic +_purpose: + Check if audio input work fine through pulseaudio on external mic +_steps: + 1. Make sure an external mic is connected to the device + 2. Make sure there's at least one output device connected to the device + 3. Workaround to run pulseaudio correctly: + sudo mkdir -p /run/user/0/snap.pulseaudio/pulse + 4. Find out corrent source, sink id: + sudo pulseaudio.pactl list + 5. Set input/output profile: + sudo pulseaudio.pactl set-card-profile 0 output:analog-stereo+input:analog-stereo + 6. Unmute and set volume of input/output: + sudo pulseaudio.pactl set-sink-mute <Sink id #, e.g. 0> 0 + sudo pulseaudio.pactl set-sink-volume <Sink id #, e.g. 0> 80% + sudo pulseaudio.pactl set-source-mute <Source id #, e.g. 0> 0 + sudo pulseaudio.pactl set-source-volume <Source id #, e.g. 0> 80% + 7. Record for 5 seconds to a wav file: + sudo timeout 5 pulseaudio.parec -v /var/snap/pulseaudio/common/test.wav + 8. Play the recorded file + sudo pulseaudio.paplay -v /var/snap/pulseaudio/common/test.wav + 9. Remove the recorded file + sudo rm /var/snap/pulseaudio/common/test.wav +_verification: + Did you hear the recorded sound correctly? +plugin: manual +flags: also-after-suspend +requires: snap.name == 'pulseaudio' +category_id: com.canonical.plainbox::audio +estimated_duration: 1m + +id: audio/pa-playback-headphone +_summary: Play sample wav file using pulseaudio - headphone +_purpose: + Check if sound is played through pulseaudio to headphone +_steps: + 1. Make sure a headphone is connected to the device + 2. Workaround to run pulseaudio correctly: + sudo mkdir -p /run/user/0/snap.pulseaudio/pulse + 3. Find out corrent source, sink id: + sudo pulseaudio.pactl list + 4. Set input/output profile: + sudo pulseaudio.pactl set-card-profile 0 output:analog-stereo+input:analog-stereo + 5. Unmute and set volume of output: + sudo pulseaudio.pactl set-sink-mute <Sink id #, e.g. 0> 0 + sudo pulseaudio.pactl set-sink-volume <Sink id #, e.g. 0> 80% + 6. Put a test wav file in system as /var/snap/pulseaudio/common/test.wav + 7. Play the test wav file + sudo pulseaudio.paplay -v /var/snap/pulseaudio/common/test.wav + 8. Remove the test file + sudo rm /var/snap/pulseaudio/common/test.wav +_verification: + Did you hear the sound correctly? +plugin: manual +flags: also-after-suspend +requires: snap.name == 'pulseaudio' +category_id: com.canonical.plainbox::audio +estimated_duration: 1m + +id: audio/pa-playback-lineout +_summary: Play sample wav file using pulseaudio - lineout +_purpose: + Check if sound is played through pulseaudio to lineout +_steps: + 1. Make sure a output device is connected to the lineout port on device + 2. Workaround to run pulseaudio correctly: + sudo mkdir -p /run/user/0/snap.pulseaudio/pulse + 3. Find out corrent source, sink id: + sudo pulseaudio.pactl list + 4. Set input/output profile: + sudo pulseaudio.pactl set-card-profile 0 output:analog-stereo+input:analog-stereo + 5. Unmute and set volume of output: + sudo pulseaudio.pactl set-sink-mute <Sink id #, e.g. 0> 0 + sudo pulseaudio.pactl set-sink-volume <Sink id #, e.g. 0> 80% + 6. Put a test wav file in system as /var/snap/pulseaudio/common/test.wav + 7. Play the test wav file + sudo pulseaudio.paplay -v /var/snap/pulseaudio/common/test.wav + 8. Remove the test file + sudo rm /var/snap/pulseaudio/common/test.wav +_verification: + Did you hear the sound correctly? +plugin: manual +flags: also-after-suspend +requires: snap.name == 'pulseaudio' +category_id: com.canonical.plainbox::audio +estimated_duration: 1m + +id: audio/pa-playback-hdmi +_summary: Play sample wav file using pulseaudio - hdmi +_purpose: + Check if sound is played through pulseaudio to HDMI output device +_steps: + 1. Make sure a HDMI output device is connected to the device + 2. Workaround to run pulseaudio correctly: + sudo mkdir -p /run/user/0/snap.pulseaudio/pulse + 3. Find out corrent source, sink id: + sudo pulseaudio.pactl list + 4. Set input/output profile: + sudo pulseaudio.pactl set-card-profile 0 output:hdmi-stereo+input:analog-stereo + 5. Unmute and set volume of output: + sudo pulseaudio.pactl set-sink-mute <Sink id #, e.g. 0> 0 + sudo pulseaudio.pactl set-sink-volume <Sink id #, e.g. 0> 80% + 6. Put a test wav file in system as /var/snap/pulseaudio/common/test.wav + 7. Play the test wav file + sudo pulseaudio.paplay -v /var/snap/pulseaudio/common/test.wav + 8. Remove the test file + sudo rm /var/snap/pulseaudio/common/test.wav +_verification: + Did you hear the sound correctly? +plugin: manual +flags: also-after-suspend +requires: snap.name == 'pulseaudio' +category_id: com.canonical.plainbox::audio +estimated_duration: 1m diff --git a/units/audio/manifest.pxu b/units/audio/manifest.pxu new file mode 100644 index 0000000..95417f6 --- /dev/null +++ b/units/audio/manifest.pxu @@ -0,0 +1,15 @@ +# Copyright 2017 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Sylvain Pineau <sylvain.pineau@canonical.com> + +unit: manifest entry +id: has_audio_playback +_name: Audio playback +value-type: bool + +unit: manifest entry +id: has_audio_capture +_name: Audio capture +value-type: bool diff --git a/units/audio/resource.pxu b/units/audio/resource.pxu new file mode 100644 index 0000000..c7fd3b7 --- /dev/null +++ b/units/audio/resource.pxu @@ -0,0 +1,9 @@ +unit: job +id: alsa_resource +category_id: com.canonical.plainbox::audio +plugin: resource +_summary: Gather device info about alsa sound devices +_description: Gather device info about alsa sound devices +command: alsa_pcm_info +estimated_duration: 1s +flags: preserve-locale diff --git a/units/audio/test-plan.pxu b/units/audio/test-plan.pxu index a147682..f583b91 100644 --- a/units/audio/test-plan.pxu +++ b/units/audio/test-plan.pxu @@ -73,3 +73,77 @@ include: suspend/microphone-plug-detection-after-suspend certification-status=blocker suspend/playback_headphones-after-suspend certification-status=blocker suspend/alsa_record_playback_external-after-suspend certification-status=blocker + +id: audio-full +unit: test plan +_name: Audio tests +_description: QA audio tests for Snappy Ubuntu Core devices +include: +nested_part: + audio-manual + audio-automated + +id: audio-manual +unit: test plan +_name: Manual audio tests +_description: Manual audio tests for Snappy Ubuntu Core devices +include: + audio/alsa-playback + audio/alsa-loopback + +id: audio-pa-manual +unit: test plan +_name: Manual audio tests using pulseaudio +_description: Manual audio tests using pulseaudio for Snappy Ubuntu Core devices +include: + audio/pa-record-internal-mic + audio/pa-record-external-mic + audio/pa-playback-headphone + audio/pa-playback-lineout + audio/pa-playback-hdmi + +id: audio-automated +unit: test plan +_name: Automated audio tests +_description: Automated audio tests for Snappy Ubuntu Core devices +include: + audio/detect-playback-devices + audio/detect-capture-devices + audio/alsa-loopback-automated + +id: after-suspend-audio-full +unit: test plan +_name: Audio tests (after suspend) +_description: QA audio tests for Snappy Ubuntu Core devices +include: +nested_part: + after-suspend-audio-manual + after-suspend-audio-automated + +id: after-suspend-audio-manual +unit: test plan +_name: Manual audio tests (after suspend) +_description: Manual audio tests for Snappy Ubuntu Core devices +include: + after-suspend-audio/alsa-playback + after-suspend-audio/alsa-loopback + +id: after-suspend-audio-pa-manual +unit: test plan +_name: Manual audio tests using pulseaudio (after suspend) +_description: Manual audio tests using pulseaudio for Snappy Ubuntu Core devices +include: + after-suspend-audio/pa-record-internal-mic + after-suspend-audio/pa-record-external-mic + after-suspend-audio/pa-playback-headphone + after-suspend-audio/pa-playback-lineout + after-suspend-audio/pa-playback-hdmi + +id: after-suspend-audio-automated +unit: test plan +_name: Automated audio tests +_description: Automated audio tests for Snappy Ubuntu Core devices +include: + after-suspend-audio/detect-playback-devices + after-suspend-audio/detect-capture-devices + after-suspend-audio/alsa-loopback-automated diff --git a/units/bluetooth/category.pxu b/units/bluetooth/category.pxu new file mode 100644 index 0000000..7f3c06c --- /dev/null +++ b/units/bluetooth/category.pxu @@ -0,0 +1,7 @@ +unit: category +id: bluetooth_bluez5_selftests +_name: Bluetooth - BlueZ Self Tests + +unit: category +id: after-suspend-bluetooth_bluez5_selftests +_name: Suspend - Bluetooth - BlueZ Self Tests diff --git a/units/bluetooth/jobs.pxu b/units/bluetooth/jobs.pxu index 6160e76..cee3467 100644 --- a/units/bluetooth/jobs.pxu +++ b/units/bluetooth/jobs.pxu @@ -261,3 +261,134 @@ user: root flags: also-after-suspend also-after-suspend-manual category_id: com.canonical.plainbox::bluetooth estimated_duration: 10 + +unit: template +template-resource: bluez-internal-rfcomm-tests +template-unit: job +id: bluetooth/bluez-internal-rfcomm-tests_{bluez-internal-rfcomm-test} +category_id: bluetooth_bluez5_selftests +_summary: BlueZ-{bluez-internal-rfcomm-test} +_description: + Runs a specific test from the rfcomm test suite +plugin: shell +user: root +flags: also-after-suspend +command: + rfcomm-tester -p "{bluez-internal-rfcomm-test}" +requires: device.category == 'BLUETOOTH' +estimated_duration: 2.0 + +unit: template +template-resource: bluez-internal-hci-tests +template-unit: job +id: bluetooth/bluez-internal-hci-tests_{bluez-internal-hci-test} +category_id: bluetooth_bluez5_selftests +_summary: BlueZ-{bluez-internal-hci-test} +_description: + Runs a specific test from the hci test suite +plugin: shell +user: root +flags: also-after-suspend +command: + hci-tester -p "{bluez-internal-hci-test}" +requires: device.category == 'BLUETOOTH' +estimated_duration: 2.0 + +unit: template +template-resource: bluez-internal-mgmt-tests +template-unit: job +id: bluetooth/bluez-internal-mgmt-tests_{bluez-internal-mgmt-test} +category_id: bluetooth_bluez5_selftests +_summary: BlueZ-{bluez-internal-mgmt-test} +_description: + Runs a specific test from the mgmt test suite +plugin: shell +user: root +flags: also-after-suspend +command: + mgmt-tester -p "{bluez-internal-mgmt-test}" +requires: device.category == 'BLUETOOTH' +estimated_duration: 2.0 + +unit: template +template-resource: bluez-internal-uc-tests +template-unit: job +id: bluetooth/bluez-internal-uc-tests_{bluez-internal-uc-test} +category_id: bluetooth_bluez5_selftests +_summary: BlueZ-{bluez-internal-uc-test} +_description: + Runs a specific test from the user channel test suite +plugin: shell +user: root +flags: also-after-suspend +command: + userchan-tester -p "{bluez-internal-uc-test}" +requires: device.category == 'BLUETOOTH' +estimated_duration: 2.0 + +unit: template +template-resource: bluez-internal-bnep-tests +template-unit: job +id: bluetooth/bluez-internal-bnep-tests_{bluez-internal-bnep-test} +category_id: bluetooth_bluez5_selftests +_summary: BlueZ-{bluez-internal-bnep-test} +_description: + Runs a specific test from the bnep test suite +plugin: shell +user: root +flags: also-after-suspend +command: + bnep-tester -p "{bluez-internal-bnep-test}" +requires: device.category == 'BLUETOOTH' +estimated_duration: 2.0 + +id: bluetooth/keyboard +_summary: Bluetooth keyboard works +_purpose: + Check if bluetooth keyboard works +_verification: + Did the keyboard work? +plugin: user-verify +user: root +flags: also-after-suspend +command: test_bt_keyboard +category_id: com.canonical.plainbox::bluetooth +estimated_duration: 1m + +id: bluetooth/keyboard-manual +_summary: Bluetooth keyboard manual test +_purpose: + Check bluetooth input device works +_steps: + 1. Run the following command to start bluetoothctl console: + sudo bluetoothctl -a + ***Following steps are run in bluetoothctl console*** + 2. Power on the device: + power on + 3. Register agent for keyboard: + agent KeyboardOnly + default-agent + 4. Put controller in pairable mode: + pairable on + 5. Scan nearby bluetooth device: + scan on + 6. Stop Scanning after bluetooth keyboard is found: + scan off + 7. Pair bluetooth + pair [MAC address of bluetooth keyboard] + 8. Enter PIN Code on bluetooth keyboard if needed + 9. Trust the bluetooth keyboard + trust [MAC address of bluetooth keyboard] + 10. Connect to bluetooth keyboard: + connect [MAC address of bluetooth keyboard] + 11. Quit bluetoothctl console + quit + 12. Use bluetooth keyboard to input + **for headless please check the input outside the bluetooth console by using: + $ sudo cat /dev/tty1 +_verification: + Confirm characters from Bluetooth input device are displayed correctly +plugin: manual +flags: also-after-suspend-manual +category_id: com.canonical.plainbox::bluetooth +estimated_duration: 5m diff --git a/units/bluetooth/resource.pxu b/units/bluetooth/resource.pxu new file mode 100644 index 0000000..24783e2 --- /dev/null +++ b/units/bluetooth/resource.pxu @@ -0,0 +1,84 @@ +unit: job +id: bluez-internal-rfcomm-tests +plugin: resource +_summary: Gather list of tests provided by bluez rfcomm test binary +_description: + Bluez includes some internal test that exercise the stack. This resource + collects a list of the provided rfcomm tests. +requires: device.category == 'BLUETOOTH' +command: + rfcomm-tester -l | while read i + do + echo "bluez-internal-rfcomm-test: $i" + echo + done +estimated_duration: 2s +flags: preserve-locale + +unit: job +id: bluez-internal-hci-tests +plugin: resource +_summary: Gather list of tests provided by bluez hci test binary +_description: + Bluez includes some internal test that exercise the stack. This resource + collects a list of the provided hci tests. +requires: device.category == 'BLUETOOTH' +command: + hci-tester -l | while read i + do + echo "bluez-internal-hci-test: $i" + echo + done +estimated_duration: 2s +flags: preserve-locale + +unit: job +id: bluez-internal-mgmt-tests +plugin: resource +_summary: Gather list of tests provided by bluez mgmt test binary +_description: + Bluez includes some internal test that exercise the stack. This resource + collects a list of the provided mgmt tests. +requires: device.category == 'BLUETOOTH' +command: + mgmt-tester -l | while read i + do + echo "bluez-internal-mgmt-test: $i" + echo + done +estimated_duration: 2s +flags: preserve-locale + +unit: job +id: bluez-internal-uc-tests +plugin: resource +_summary: Gather list of tests provided by bluez user channel test binary +_description: + Bluez includes some internal test that exercise the stack. This resource + collects a list of the provided user channel tests. +requires: device.category == 'BLUETOOTH' +command: + userchan-tester -l | while read i + do + echo "bluez-internal-uc-test: $i" + echo + done +estimated_duration: 2s +flags: preserve-locale + +unit: job +id: bluez-internal-bnep-tests +plugin: resource +_summary: Gather list of tests provided by bluez bnep test binary +_description: + Bluez includes some internal test that exercise the stack. This resource + collects a list of the provided bnep tests. +requires: device.category == 'BLUETOOTH' +command: + bnep-tester -l | while read i + do + echo "bluez-internal-bnep-test: $i" + echo + done +estimated_duration: 2s +flags: preserve-locale diff --git a/units/bluetooth/test-plan.pxu b/units/bluetooth/test-plan.pxu index 2b1819b..69497ae 100644 --- a/units/bluetooth/test-plan.pxu +++ b/units/bluetooth/test-plan.pxu @@ -34,3 +34,119 @@ include: bluetooth4/HOGP-mouse certification-status=blocker bluetooth4/HOGP-keyboard certification-status=blocker bluetooth/audio-a2dp certification-status=blocker + +id: bluetooth-full +unit: test plan +_name: Bluetooth tests +_description: QA tests for Bluetooth +estimated_duration: 6m +include: +nested_part: + bluetooth-manual + bluez-automated + +id: bluetooth-manual +unit: test plan +_name: Manual Bluetooth tests +_description: Manual QA tests for Bluetooth +estimated_duration: 5m +include: + bluetooth/keyboard-manual + +id: bluez-automated +unit: test plan +_name: Automated tests for bluez +_description: + Automated tests for bluez +estimated_duration: 1m +include: + bluetooth/detect + bluetooth/bluez-controller-detect + bluetooth/bluez-internal-rfcomm-tests_.* + bluetooth/bluez-internal-hci-tests_.* + # Blacklist all mngt tests since they randomly fail + # (even with upstream 5.45) + # Note: The mgmt tests are not that much critical as these just test + # the management interface. + # Next line is commented out until upstream fixes the issue + # bluetooth/bluez-internal-mgmt-tests_.* + bluetooth/bluez-internal-uc-tests_.* + bluetooth/bluez-internal-bnep-tests_.* + bluetooth4/beacon_eddystone_url_.* +bootstrap_include: + device + bluez-internal-rfcomm-tests + bluez-internal-hci-tests + # Blacklist all mngt tests since they randomly fail + # (even with upstream 5.45) + # Note: The mgmt tests are not that much critical as these just test + # the management interface. + # Next line is commented out until upstream fixes the issue + # bluez-internal-mgmt-tests + bluez-internal-uc-tests + bluez-internal-bnep-tests +exclude: + # Read Country Code is deprecated + "bluetooth/bluez-internal-hci-tests_Read Country Code" + # Blacklist the following three hci tests, they randomly fail + # (even with upstream 5.45) + "bluetooth/bluez-internal-hci-tests_LE Read Local PK" + "bluetooth/bluez-internal-hci-tests_Read Local Supported Codecs" + "bluetooth/bluez-internal-hci-tests_LE Generate DHKey" + +id: after-suspend-bluetooth-full +unit: test plan +_name: Bluetooth tests (after suspend) +_description: QA tests for Bluetooth +estimated_duration: 6m +include: +nested_part: + after-suspend-bluetooth-manual + after-suspend-bluez-automated + +id: after-suspend-bluetooth-manual +unit: test plan +_name: Manual Bluetooth tests +_description: Manual QA tests for Bluetooth +estimated_duration: 5m +include: + after-suspend-manual-bluetooth/keyboard-manual + +id: after-suspend-bluez-automated +unit: test plan +_name: Automated tests for bluez +_description: + Automated tests for bluez +estimated_duration: 1m +include: + after-suspend-bluetooth/bluez-internal-rfcomm-tests_.* + after-suspend-bluetooth/bluez-internal-hci-tests_.* + # Blacklist all mngt tests since they randomly fail + # (even with upstream 5.45) + # Note: The mgmt tests are not that much critical as these just test + # the management interface. + # Next line is commented out until upstream fixes the issue + # after-suspend-bluetooth/bluez-internal-mgmt-tests_.* + after-suspend-bluetooth/bluez-internal-uc-tests_.* + after-suspend-bluetooth/bluez-internal-bnep-tests_.* + after-suspend-bluetooth4/beacon_eddystone_url_.* +bootstrap_include: + device + bluez-internal-rfcomm-tests + bluez-internal-hci-tests + # Blacklist all mngt tests since they randomly fail + # (even with upstream 5.45) + # Note: The mgmt tests are not that much critical as these just test + # the management interface. + # Next line is commented out until upstream fixes the issue + # bluez-internal-mgmt-tests + bluez-internal-uc-tests + bluez-internal-bnep-tests +exclude: + # Read Country Code is deprecated + "after-suspend-bluetooth/bluez-internal-hci-tests_Read Country Code" + # Blacklist the following three hci tests, they randomly fail + # (even with upstream 5.45) + "after-suspend-bluetooth/bluez-internal-hci-tests_LE Read Local PK" + "after-suspend-bluetooth/bluez-internal-hci-tests_Read Local Supported Codecs" + "after-suspend-bluetooth/bluez-internal-hci-tests_LE Generate DHKey" diff --git a/units/cpu/test-plan.pxu b/units/cpu/test-plan.pxu index c20efe8..365531c 100644 --- a/units/cpu/test-plan.pxu +++ b/units/cpu/test-plan.pxu @@ -46,3 +46,33 @@ include: cpu/maxfreq_test-log-attach cpu/offlining_test certification-status=blocker cpu/topology certification-status=blocker + +id: cpu-full +unit: test plan +_name: CPU tests +_description: QA CPU tests for Snappy Ubuntu Core devices +include: +nested_part: + cpu-automated + +id: cpu-manual +unit: test plan +_name: Manual CPU tests +_description: Manual QA CPU tests for Snappy Ubuntu Core devices +include: + +id: cpu-automated +unit: test plan +_name: Automated CPU tests +_description: Automated CPU tests for Snappy Ubuntu Core devices +include: + cpu/scaling_test + cpu/scaling_test-log-attach + cpu/maxfreq_test + cpu/maxfreq_test-log-attach + cpu/clocktest + cpu/offlining_test + cpu/topology + cpu/arm_vfp_support_.* + cpu/cstates + cpu/cstates_results.log diff --git a/units/disk/encryption.pxu b/units/disk/encryption.pxu index b7d41c8..dea0637 100644 --- a/units/disk/encryption.pxu +++ b/units/disk/encryption.pxu @@ -18,4 +18,31 @@ command: {%- else %} fde_tests.py desktop {% endif -%} -estimated_duration: 2.0 \ No newline at end of file +estimated_duration: 2.0 + +id: disk/encryption/check-fde-tpm +_summary: Disk decryption after TPM change +_description: + Check that the data partition cannot be decrypted (and therefore the device + cannot boot) if PCR7 value is modified. +category_id: com.canonical.plainbox::disk +estimated_duration: 45m +plugin: manual +_purpose: + The device partition is encrypted using TPM master key. To unseal the master + key from TPM, PCR7 (Platform Configuration Register 7) needs to be identical + to the value it had when the master key was sealed into TPM. Every time the + device boots, it checks PCR7 to unseal TPM and retrieves master key from TPM + to decrypt its data partition. If TPM PCR7 is modified (e.g. by flashing the + BIOS), the device won't be able to get the master key and decrypt its data + partition. +_steps: + 1. Install the image and make sure it boots and you can log in. + 2. Turn the device off and upgrade/downgrade the BIOS + 3. Make sure the BIOS is set up properly (e.g. TPM enabled, UEFI boot mode) + 4. Start the device +_verification: + Mark this test as "Passed" if the device cannot boot anymore. + Note: You must flash the BIOS back to the latest version and re-install the + image afterwards. + diff --git a/units/disk/jobs.pxu b/units/disk/jobs.pxu index b2e4301..3e0f568 100644 --- a/units/disk/jobs.pxu +++ b/units/disk/jobs.pxu @@ -90,7 +90,15 @@ requires: package.name == 'uuid-runtime' or executable.name == 'uuidgen' _summary: Disk stress_ng test for {product_slug} _description: Disk stress_ng test for {product_slug} -command: disk_stress_ng {name} --base-time 240 --really-run +command: + if [ -n "$STRESS_NG_DISK_TIME" ] + then + echo "Found STRESS_NG_DISK_TIME env var, stress_ng disk running time is now: $STRESS_NG_DISK_TIME seconds" + disk_stress_ng {name} --base-time $STRESS_NG_DISK_TIME --really-run + else + echo "STRESS_NG_DISK_TIME env var is not found, stress_ng disk running time is default value" + disk_stress_ng {name} --base-time 240 --really-run + fi unit: template template-resource: device diff --git a/units/ethernet/jobs.pxu b/units/ethernet/jobs.pxu index 103a7b3..bd7f273 100644 --- a/units/ethernet/jobs.pxu +++ b/units/ethernet/jobs.pxu @@ -407,6 +407,24 @@ _description: unit: template template-resource: device template-filter: device.category == 'NETWORK' and device.interface != 'UNKNOWN' +template-unit: job +id: ethernet/iperf3_reverse_{interface} +plugin: shell +_summary: Iperf3 stress testing for {interface} (reverse) +category_id: com.canonical.plainbox::ethernet +estimated_duration: 240.0 +user: root +environ: + TEST_TARGET_IPERF + LD_LIBRARY_PATH +command: network test -i {interface} -t iperf --iperf3 --scan-timeout 3600 --fail-threshold 50 --cpu-load-fail-threshold 90 --runtime 90 --num_runs 4 --reverse +_description: + This test uses iperf3 to ensure network devices pass data at an acceptable + minimum percentage of advertized speed (Reverse). + +unit: template +template-resource: device +template-filter: device.category == 'NETWORK' and device.interface != 'UNKNOWN' template-engine: jinja2 template-unit: job id: ethernet/check-{{ interface }}-static-configuration diff --git a/units/gadget/category.pxu b/units/gadget/category.pxu new file mode 100644 index 0000000..29d3fef --- /dev/null +++ b/units/gadget/category.pxu @@ -0,0 +1,3 @@ +unit: category +id: gadget +_name: Gadget snap tests diff --git a/units/gpio/category.pxu b/units/gpio/category.pxu new file mode 100644 index 0000000..9433850 --- /dev/null +++ b/units/gpio/category.pxu @@ -0,0 +1,9 @@ +# Copyright 2015-2018 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Maciej Kisielewski <maciej.kisielewski@canonical.com> + +unit: category +id: gpio +_name: General Purpose I/O diff --git a/units/gpio/jobs.pxu b/units/gpio/jobs.pxu new file mode 100644 index 0000000..ec1e948 --- /dev/null +++ b/units/gpio/jobs.pxu @@ -0,0 +1,38 @@ +# This job currently has a template filter so that devices which do not yet +# have a pin definition file do not generate fails, when all devices have a +# definition this could be removed +unit: template +template-resource: com.canonical.certification::model_assertion +template-filter: model_assertion.model in ("pi2", "pi3", "ubuntu-core-18-pi2", "ubuntu-core-18-pi3") +template-unit: job +id: gpio/sysfs_loopback_pairs_{model} +_summary: Test GPIO lines exposed on headers can be controlled via sysfs +plugin: shell +user: root +category_id: gpio +command: + gpio_sysfs_loopback.py {model} +estimated_duration: 20.0 +flags: preserve-locale also-after-suspend + + +# Filtering this job by the same devices as above as uses the same pin +# definition file and uses the RPi python module +unit: template +template-resource: com.canonical.certification::model_assertion +template-filter: model_assertion.model in ("pi2", "pi3", "ubuntu-core-18-pi2", "ubuntu-core-18-pi3") +template-unit: job +id: gpio/gpiomem_loopback_pairs_{model} +_summary: Test GPIO lines exposed on headers can be controlled via /dev/gpiomem +plugin: shell +user: root +category_id: gpio +command: + gpio_gpiomem_loopback.py {model} +estimated_duration: 20.0 +flags: preserve-locale also-after-suspend +# If starting to test confinement then this connection will be requried: +#requires: +# {%- if __on_ubuntucore__ %} +# connections.slot == 'snapd:gpio-memory-control' and connections.plug == 'checkbox-plano:gpio-memory-control' +# {% endif -%} diff --git a/units/gpio/test-plan.pxu b/units/gpio/test-plan.pxu new file mode 100644 index 0000000..a32be08 --- /dev/null +++ b/units/gpio/test-plan.pxu @@ -0,0 +1,40 @@ +id: gpio-full +unit: test plan +_name: GPIO tests +_description: QA GPIO tests for Ubuntu Core devices +include: +nested_part: + gpio-manual + gpio-automated + +id: gpio-manual +unit: test plan +_name: Manual GPIO tests +_description: Manual GPIO tests for Ubuntu Core devices +include: + +id: after-suspend-gpio-manual +unit: test plan +_name: Manual GPIO tests (after suspend) +_description: Manual GPIO tests for Ubuntu Core devices (after suspend) +include: + +id: gpio-automated +unit: test plan +_name: Automated GPIO tests +_description: Automated GPIO tests for Ubuntu Core devices +bootstrap_include: + model_assertion +include: + gpio/sysfs_loopback_pairs_.* + gpio/gpiomem_loopback_pairs_.* + +id: after-suspend-gpio-automated +unit: test plan +_name: Automated GPIO tests (after suspend) +_description: Automated GPIO tests for Ubuntu Core devices (after suspend) +bootstrap_include: + model_assertion +include: + after-suspend-gpio/sysfs_loopback_pairs_.* + after-suspend-gpio/gpiomem_loopback_pairs_.* diff --git a/units/graphics/test-plan.pxu b/units/graphics/test-plan.pxu index e0f2bb8..fd52dc7 100644 --- a/units/graphics/test-plan.pxu +++ b/units/graphics/test-plan.pxu @@ -31,14 +31,15 @@ _name: Graphics tests (integrated GPU) (Automated) _description: Graphics tests (integrated GPU) (Automated) include: - graphics/1_auto_switch_card_.* certification-status=blocker - graphics/xorg-version certification-status=blocker - graphics/xorg-failsafe certification-status=blocker - graphics/xorg-process certification-status=blocker - graphics/VESA_drivers_not_in_use certification-status=blocker - graphics/1_driver_version_.* certification-status=blocker - graphics/1_compiz_check_.* certification-status=blocker + graphics/1_auto_switch_card_.* certification-status=blocker + graphics/xorg-version certification-status=blocker + graphics/xorg-failsafe certification-status=blocker + graphics/xorg-process certification-status=blocker + graphics/VESA_drivers_not_in_use certification-status=blocker + graphics/1_driver_version_.* certification-status=blocker + graphics/1_compiz_check_.* certification-status=blocker graphics/1_minimum_resolution_.* + suspend/1_resolution_before_suspend_.*_auto certification-status=blocker bootstrap_include: graphics_card @@ -99,7 +100,6 @@ _name: After suspend tests (integrated GPU automated) _description: After suspend tests (integrated GPU automated) include: graphics/1_auto_switch_card_.* certification-status=blocker - suspend/1_resolution_before_suspend_.*_auto certification-status=blocker suspend/1_suspend_after_switch_to_card_.*_auto certification-status=blocker # The following after suspend jobs will automatically select the right suspend job # depending on the amount of graphic cards available on the SUT: diff --git a/units/i2c/category.pxu b/units/i2c/category.pxu new file mode 100644 index 0000000..b0020b1 --- /dev/null +++ b/units/i2c/category.pxu @@ -0,0 +1,9 @@ +# Copyright 2016 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Gavin Lin <gavin.lin@canonical.com> + +unit: category +id: i2c +_name: I2C (Inter-Integrated Circuit) diff --git a/units/i2c/jobs.pxu b/units/i2c/jobs.pxu new file mode 100644 index 0000000..db90509 --- /dev/null +++ b/units/i2c/jobs.pxu @@ -0,0 +1,45 @@ +# Copyright 2016 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Gavin Lin <gavin.lin@canonical.com> + +unit: job +id: i2c/i2c-bus-detect +_summary: Check number of detected I2C bus +_purpose: + Verify if number of detected I2C bus is as expected +_steps: + 1. This task is fully automatic, when expected i2c bus number($I2C_BUS_NUMBER) + is set, this job will verify if detected number of i2c bus is as expected. + 2. If expected i2c bus number is not set, this job will pass if system + detected there's at least one i2c bus. +command: + if [ -z ${I2C_BUS_NUMBER+x} ]; then + i2c_driver_test bus + else + i2c_driver_test bus -b $I2C_BUS_NUMBER + fi +user: root +plugin: shell +category_id: i2c +environ: I2C_BUS_NUMBER +estimated_duration: 20s +requires: manifest.has_i2c == 'True' +imports: from com.canonical.plainbox import manifest + +unit: job +id: i2c/i2c-device-detect +_summary: Check if any I2C device detected +_purpose: + Verify if there's any I2C device +_steps: + 1. This task is fully automatic, test will pass if there's at least one + i2c device detected on any I2C bus. +command: + i2c_driver_test device +user: root +plugin: shell +category_id: i2c +estimated_duration: 3m +depends: i2c/i2c-bus-detect diff --git a/units/i2c/manifest.pxu b/units/i2c/manifest.pxu new file mode 100644 index 0000000..fafbd15 --- /dev/null +++ b/units/i2c/manifest.pxu @@ -0,0 +1,10 @@ +# Copyright 2016 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Gavin Lin <gavin.lin@canonical.com> + +unit: manifest entry +id: has_i2c +_name: I2C +value-type: bool diff --git a/units/i2c/test-plan.pxu b/units/i2c/test-plan.pxu new file mode 100644 index 0000000..99e9aaf --- /dev/null +++ b/units/i2c/test-plan.pxu @@ -0,0 +1,15 @@ +id: i2c-full +unit: test plan +_name: I2c tests +_description: QA i2c tests for Snappy Ubuntu Core devices +include: +nested_part: + i2c-automated + +id: i2c-automated +unit: test plan +_name: Automated i2c tests +_description: Automated i2c tests for Snappy Ubuntu Core devices +include: + i2c/i2c-bus-detect + i2c/i2c-device-detect diff --git a/units/info/jobs.pxu b/units/info/jobs.pxu index 9ed5d33..e7ac3ea 100644 --- a/units/info/jobs.pxu +++ b/units/info/jobs.pxu @@ -459,3 +459,11 @@ category_id: com.canonical.plainbox::info estimated_duration: 0.2 _summary: attach network configuration command: network_configs + +id: parts_meta_info_attachment +plugin: attachment +category_id: com.canonical.plainbox::info +command: cat $SNAP/parts_meta_info $SNAP/checkbox-runtime/parts_meta_info || echo "no parts meta info available" +environ: SNAP +estimated_duration: 0.02 +_summary: Attaches an information about all parts that constituted this snap diff --git a/units/kernel-snap/category.pxu b/units/kernel-snap/category.pxu new file mode 100644 index 0000000..361df99 --- /dev/null +++ b/units/kernel-snap/category.pxu @@ -0,0 +1,3 @@ +unit: category +id: kernel-snap +_name: Kernel snap tests diff --git a/units/kernel-snap/jobs.pxu b/units/kernel-snap/jobs.pxu new file mode 100644 index 0000000..5b573fd --- /dev/null +++ b/units/kernel-snap/jobs.pxu @@ -0,0 +1,17 @@ + +id: kernel-snap/booted-kernel-matches-current +category_id: kernel-snap +_summary: The booted kernel image matches image in current kernel snap +_description: + On some Ubuntu Core deviecs it is necessary for the kernel image to be + extracted from the kernel snap and placed in the boot partition (notably + device using full disk encryption). This checks the images are in sync. +plugin: shell +user: root +estimated_duration: 2.0 +command: + booted_kernel_tests.py +imports: + from com.canonical.certification import ubuntu_core_features +requires: + ubuntu_core_features.force_kernel_extraction == 'True' diff --git a/units/kernel-snap/test-plan.pxu b/units/kernel-snap/test-plan.pxu new file mode 100644 index 0000000..7bd4dc8 --- /dev/null +++ b/units/kernel-snap/test-plan.pxu @@ -0,0 +1,22 @@ + +id: kernel-snap-full +unit: test plan +_name: Kernel Snap tests +_description: Kernel Snap test for Ubuntu Core devices +include: +nested_part: + kernel-snap-manual + kernel-snap-automated + +id: kernel-snap-automated +unit: test plan +_name: Automated Kernel Snap tests +_description: Automated Kernel Snap tests for Ubuntu Core devices +include: + kernel-snap/booted-kernel-matches-current + +id: kernel-snap-manual +unit: test plan +_name: Manual Kernel Snap tests +_description: Manual Kernel Snap tests for Ubuntu Core devices +include: diff --git a/units/location/category.pxu b/units/location/category.pxu new file mode 100644 index 0000000..7fe4424 --- /dev/null +++ b/units/location/category.pxu @@ -0,0 +1,3 @@ +unit: category +id: location +_name: Location Service diff --git a/units/location/jobs.pxu b/units/location/jobs.pxu new file mode 100644 index 0000000..2e854ab --- /dev/null +++ b/units/location/jobs.pxu @@ -0,0 +1,46 @@ +id: location/status +_summary: Queries the status of a service instance +command: locationd.status +category_id: location +requires: snap.name == 'locationd' +estimated_duration: 1 +flags: simple preserve-cwd also-after-suspend + +id: location/monitor +_summary: Connects to a location service instance, monitoring its activity. +command: timeout 15m bash -c 'grep -m 1 Update <( exec locationd.monitor ); kill $! 2> /dev/null' +category_id: location +requires: snap.name == 'locationd' +estimated_duration: 900 +flags: simple preserve-cwd also-after-suspend + +id: location/status-manual +_summary: Queries the status of a service instance +_purpose: + Queries the status of a service instance +_steps: + 1. Type the following command in a second terminal to run the location service status: + $ locationd.status +_verification: + Did the command succeed? +category_id: location +flags: also-after-suspend +requires: snap.name == 'locationd' +estimated_duration: 1 +plugin: manual + +id: location/monitor-manual +_summary: Connects to a location service instance, monitoring its activity. +_purpose: + Connects to a location service instance, monitoring its activity. +_steps: + 1. Type the following command in a second terminal to run the location service monitor: + $ timeout 15m bash -c 'grep -m 1 Update <( exec locationd.monitor ); kill $! 2> /dev/null' +_verification: + Did the command succeed (it can take up to 15m from a cold start)? +category_id: location +flags: also-after-suspend +requires: snap.name == 'locationd' +estimated_duration: 900 +plugin: manual + diff --git a/units/location/test-plan.pxu b/units/location/test-plan.pxu new file mode 100644 index 0000000..2b38435 --- /dev/null +++ b/units/location/test-plan.pxu @@ -0,0 +1,47 @@ +id: location-full +unit: test plan +_name: Location Service tests +_description: QA location service tests for Snappy Ubuntu Core devices +include: +nested_part: + location-automated + location-manual + +id: location-automated +unit: test plan +_name: Automated location service tests +_description: Automated location service tests for Snappy Ubuntu Core devices +include: + location/status + +id: location-manual +unit: test plan +_name: Manual location service tests +_description: Automated location service tests for Snappy Ubuntu Core devices +include: + location/status-manual + location/monitor-manual + +id: after-suspend-location-full +unit: test plan +_name: Location Service tests (after suspend) +_description: QA location service tests for Snappy Ubuntu Core devices +include: +nested_part: + after-suspend-location-automated + after-suspend-location-manual + +id: after-suspend-location-automated +unit: test plan +_name: Automated location service tests (after suspend) +_description: Automated location service tests for Snappy Ubuntu Core devices +include: + after-suspend-location/status + +id: after-suspend-location-manual +unit: test plan +_name: Manual location service tests (after suspend) +_description: Automated location service tests for Snappy Ubuntu Core devices +include: + after-suspend-location/status-manual + after-suspend-location/monitor-manual diff --git a/units/mediacard/jobs.pxu b/units/mediacard/jobs.pxu index 8ce16d6..f2b3a64 100644 --- a/units/mediacard/jobs.pxu +++ b/units/mediacard/jobs.pxu @@ -783,3 +783,21 @@ _description: VERIFICATION: Did the results of the test match the expected performance of the inserted device? +unit: template +template-resource: removable_partition +template-filter: removable_partition.bus == 'mediacard' +template-unit: job +plugin: shell +category_id: com.canonical.plainbox::mediacard +id: mediacard/storage-preinserted-{symlink_uuid} +user: root +estimated_duration: 45.0 +flags: also-after-suspend reset-locale +command: USB_RWTEST_PARTITIONS={symlink_uuid} checkbox-support-usb_read_write +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_card_reader == 'True' +_summary: Automated test of SD Card reading & writing ({symlink_uuid}) +_description: + This is a fully automated version of mediacard/sd-automated and assumes that the + system under test has a memory card device plugged in prior to checkbox execution. diff --git a/units/mediacard/test-plan.pxu b/units/mediacard/test-plan.pxu index 2ef8a01..8b267a6 100644 --- a/units/mediacard/test-plan.pxu +++ b/units/mediacard/test-plan.pxu @@ -52,3 +52,34 @@ include: suspend/sdhc-insert-after-suspend certification-status=blocker suspend/sdhc-storage-after-suspend certification-status=blocker suspend/sdhc-remove-after-suspend certification-status=blocker + +id: mediacard-full +unit: test plan +_name: Mediacard tests +_description: QA mediacard tests for Snappy Ubuntu Core devices +include: +nested_part: + mediacard-manual +# nested_part doesn't include automated test plan as its tests overlap with the +# ones from the manual one + +id: mediacard-manual +unit: test plan +_name: Manual mediacard tests +_description: Manual mediacard tests for Snappy Ubuntu Core devices +include: + mediacard/.*-insert + mediacard/.*-storage + mediacard/.*-remove + mediacard/.*-performance-manual + +id: mediacard-automated +unit: test plan +_name: Automated mediacard tests +_description: + Automated mediacard tests for Snappy Ubuntu Core devices + (not requiring udisks2) +include: + mediacard/storage-preinserted-.* +bootstrap_include: + removable_partition diff --git a/units/memory/test-plan.pxu b/units/memory/test-plan.pxu new file mode 100644 index 0000000..123d437 --- /dev/null +++ b/units/memory/test-plan.pxu @@ -0,0 +1,20 @@ +id: memory-full +unit: test plan +_name: Memory tests +_description: QA memory tests for Ubuntu Core devices +include: +nested_part: + memory-automated + +id: memory-manual +unit: test plan +_name: Manual memory tests +_description: Manual memory tests for Ubuntu Core devices +include: + +id: memory-automated +unit: test plan +_name: Automated memory tests +_description: Automated memory tests for Ubuntu Core devices +include: + memory/info diff --git a/units/miscellanea/jobs.pxu b/units/miscellanea/jobs.pxu index ca726a6..1641790 100644 --- a/units/miscellanea/jobs.pxu +++ b/units/miscellanea/jobs.pxu @@ -421,7 +421,7 @@ estimated_duration: 20.0 id: miscellanea/sosreport user: root requires: executable.name == 'sosreport' -command: sosreport --batch --tmp-dir $PLAINBOX_SESSION_SHARE +command: sosreport --batch -n lxd --tmp-dir $PLAINBOX_SESSION_SHARE _summary: Generate baseline sosreport _description: Generates a baseline sosreport of logs and system data diff --git a/units/monitor/jobs.pxu b/units/monitor/jobs.pxu index 54a86c9..df1bb95 100644 --- a/units/monitor/jobs.pxu +++ b/units/monitor/jobs.pxu @@ -311,3 +311,109 @@ _steps: _verification: Was the desktop displayed correctly with on the screen connected using a "USB Type-C to VGA" adapter in every mode? + +id: monitor/dvi +_summary: Monitor works (DVI) +_purpose: + Check output to display through DVI port +_steps: + 1. Connect display to DVI port + 2. Check the display +_verification: + Output to display works +plugin: manual +category_id: com.canonical.plainbox::monitor +estimated_duration: 300 +flags: also-after-suspend + +id: monitor/hdmi +_summary: Monitor works (HDMI) +_purpose: + Check output to display through HDMI port +_steps: + 1. Connect display to HDMI port + 2. Check the display +_verification: + Output to display works +plugin: manual +category_id: com.canonical.plainbox::monitor +estimated_duration: 300 +flags: also-after-suspend + +id: monitor/displayport +_summary: Monitor works (DisplayPort) +_purpose: + Check output to display through DisplayPort +_steps: + 1. Connect display to DisplayPort + 2. Check the display +_verification: + Output to display works +plugin: manual +category_id: com.canonical.plainbox::monitor +estimated_duration: 300 +flags: also-after-suspend + +id: monitor/dvi-to-vga +_summary: Monitor works (DVI-to-VGA) +_purpose: + Check output to display through VGA adaptor on DVI port +_steps: + 1. Connect display to VGA adaptor on DVI port + 2. Check the display +_verification: + Output to display works +plugin: manual +category_id: com.canonical.plainbox::monitor +estimated_duration: 300 +flags: also-after-suspend + +id: monitor/hdmi-to-vga +_summary: Monitor works (HDMI-to-VGA) +_purpose: + Check output to display through VGA adaptor on HDMI port +_steps: + 1. Connect display to VGA adaptor on HDMI port + 2. Check the display +_verification: + Output to display works +plugin: manual +category_id: com.canonical.plainbox::monitor +estimated_duration: 300 +flags: also-after-suspend + +id: monitor/displayport_hotplug +_summary: Can hotplug monitor (DisplayPort) +plugin: manual +category_id: com.canonical.plainbox::monitor +_purpose: + This test will check the DisplayPort port and the ability to do hotplugging. +_steps: + Skip this test if your system does not have a DisplayPort port. + 1. If a display is already connected, unplug it. + 2. (Re-)Connect a display to the DisplayPort port on your system +_verification: + Was the interface displayed correctly on the screen? +flags: also-after-suspend + +id: monitor/hdmi-hotplug-automated +flags: also-after-suspend +estimated_duration: 15.0 +plugin: shell +category_id: com.canonical.plainbox::monitor +_summary: Automated HDMI hotplug test +_description: + This test will use edid injector on muxpi to check if system detect HDMI hotplug +environ: HDMI_PORT MUXPI_IP +requires: manifest.has_muxpi_hdmi == 'True' +imports: from com.canonical.plainbox import manifest +command: + export SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + timeout 60 ssh $SSH_OPTS ubuntu@$MUXPI_IP "stm -hdmi off" || exit 1 + sleep 3 + timeout 60 ssh $SSH_OPTS ubuntu@$MUXPI_IP "stm -hdmi on" || exit 1 + sleep 3 + if [ "$(cat /sys/class/drm/$HDMI_PORT/status)" != "connected" ] ;then exit 1; fi + timeout 60 ssh $SSH_OPTS ubuntu@$MUXPI_IP "stm -hdmi off" || exit 1 + sleep 3 + if [ "$(cat /sys/class/drm/$HDMI_PORT/status)" != "disconnected" ] ;then exit 1; fi diff --git a/units/monitor/manifest.pxu b/units/monitor/manifest.pxu new file mode 100644 index 0000000..650e86c --- /dev/null +++ b/units/monitor/manifest.pxu @@ -0,0 +1,11 @@ +# Copyright 2019 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Gavin Lin <gavin.lin@canonical.com> + +unit: manifest entry +id: has_muxpi_hdmi +_prompt: Is the device connected to the following?: +_name: MuxPi HDMI Port +value-type: bool diff --git a/units/monitor/test-plan.pxu b/units/monitor/test-plan.pxu index 2e635cf..5eb1f66 100644 --- a/units/monitor/test-plan.pxu +++ b/units/monitor/test-plan.pxu @@ -273,4 +273,56 @@ include: bootstrap_include: graphics_card +id: monitor-full +unit: test plan +_name: Monitor tests +_description: QA monitor tests for Snappy Ubuntu Core devices +include: +nested_part: + monitor-manual + monitor-automated + +id: monitor-manual +unit: test plan +_name: Manual monitor tests +_description: Manual monitor tests for Snappy Ubuntu Core devices +include: + monitor/dvi + monitor/hdmi + monitor/dvi-to-vga + monitor/hdmi-to-vga + monitor/displayport_hotplug + +id: monitor-automated +unit: test plan +_name: Automated monitor tests +_description: Automated monitor tests for Snappy Ubuntu Core devices +include: + monitor/hdmi-hotplug-automated +id: after-suspend-monitor-full +unit: test plan +_name: Monitor tests (after suspend) +_description: QA monitor tests for Snappy Ubuntu Core devices +include: +nested_part: + after-suspend-monitor-manual + after-suspend-monitor-automated + +id: after-suspend-monitor-manual +unit: test plan +_name: Manual monitor tests (after suspend) +_description: Manual monitor tests for Snappy Ubuntu Core devices +include: + after-suspend-monitor/dvi + after-suspend-monitor/hdmi + after-suspend-monitor/dvi-to-vga + after-suspend-monitor/hdmi-to-vga + after-suspend-monitor/displayport_hotplug + +id: after-suspend-monitor-automated +unit: test plan +_name: Automated monitor tests (after suspend) +_description: Automated monitor tests for Snappy Ubuntu Core devices +include: + after-suspend-monitor/hdmi-hotplug-automated diff --git a/units/power-management/jobs.pxu b/units/power-management/jobs.pxu index 9f8f62e..904c2f0 100644 --- a/units/power-management/jobs.pxu +++ b/units/power-management/jobs.pxu @@ -49,7 +49,7 @@ id: power-management/poweroff-log-attach estimated_duration: 1.0 command: set -o pipefail - more $PLAINBOX_SESSION_SHARE/*poweroff.1.log | cat + cat $PLAINBOX_SESSION_SHARE/*poweroff.1.log _description: This will attach any logs from the power-management/poweroff test to the results. @@ -71,7 +71,7 @@ id: power-management/reboot-log-attach estimated_duration: 1.0 command: set -o pipefail - more $PLAINBOX_SESSION_SHARE/*reboot.1.log | cat + cat $PLAINBOX_SESSION_SHARE/*reboot.1.log _description: This will attach any logs from the power-management/reboot test to the results. @@ -251,3 +251,70 @@ _description: successfully otherwise, Select 'Fail' to indicate there was a problem. VERIFICATION: Did the system shutdown and boot correctly? + +id: power-management/poweroff-manual +_summary: System can be powered off +_purpose: + Check system can poweroff successfully +_steps: + 1. Execute following command: + sudo poweroff +_verification: + System poweroff successfully +plugin: manual +category_id: com.canonical.plainbox::power-management +estimated_duration: 300 + +id: power-management/reboot-manual +_summary: System can be rebooted +_purpose: + Check system can reboot +_steps: + 1. Execute following command: + sudo reboot +_verification: + System reboot into system successfully +plugin: manual +category_id: com.canonical.plainbox::power-management +estimated_duration: 300 + +id: power-management/warm-reboot +category_id: com.canonical.plainbox::power-management +_summary: Warm reboot +_description: This tests reboots the system using the `reboot` command +unit: job +plugin: shell +command: + dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:true +user: root +flags: preserve-locale noreturn autorestart +estimated_duration: 180.0 + +id: power-management/cold-reboot +category_id: com.canonical.plainbox::power-management +_summary: Cold reboot +_description: This tests powers off the system and then powers it on using RTC +unit: job +plugin: shell +requires: rtc.state == 'supported' +command: + rtcwake --mode no -s 120 + sleep 5 + rtcwake -m show + sleep 5 + dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.PowerOff" boolean:true +user: root +flags: preserve-locale noreturn autorestart +estimated_duration: 300 + +unit: template +template-resource: model_assertion +template-unit: job +plugin: shell +category_id: com.canonical.plainbox::power-management +id: power-management/tickless_idle_{kernel} +estimated_duration: 1.0 +requires: cpuinfo.platform in ('i386', 'x86_64', 'ppc64el', 'pSeries') +_description: Check to see if CONFIG_NO_HZ is set in the kernel (this is just a simple regression check) +command: + zgrep 'CONFIG_NO_HZ=y' /snap/{kernel}/current/config-`uname -r` >/dev/null 2>&1 || ( echo "WARNING: Tickless Idle is NOT set" >&2 && exit 1 ) diff --git a/units/power-management/test-plan.pxu b/units/power-management/test-plan.pxu index 2cd1a76..bb782c1 100644 --- a/units/power-management/test-plan.pxu +++ b/units/power-management/test-plan.pxu @@ -57,3 +57,30 @@ include: power-management/poweroff-log-attach power-management/reboot certification-status=blocker power-management/reboot-log-attach + +id: power-full +unit: test plan +_name: Power tests +_description: QA power tests for Snappy Ubuntu Core devices +include: +nested_part: + power-manual + # power-automated is not part of the -full test plan as it silently + # autorestarts checkbox upon reboots thanks to a systemd unit on core. + # This could lead to multiple jobs being skipped w/o any notice + +id: power-automated +unit: test plan +_name: Automated power tests +_description: Automated power tests for Snappy Ubuntu Core devices +include: + power-management/warm-reboot + power-management/cold-reboot + +id: power-manual +unit: test plan +_name: Manual power tests +_description: Manual power tests for Snappy Ubuntu Core devices +include: + power-management/poweroff-manual + power-management/reboot-manual diff --git a/units/rtc/category.pxu b/units/rtc/category.pxu new file mode 100644 index 0000000..683e64e --- /dev/null +++ b/units/rtc/category.pxu @@ -0,0 +1,3 @@ +unit: category +id: rtc_category +_name: Real Time Clock (RTC) diff --git a/units/rtc/jobs.pxu b/units/rtc/jobs.pxu new file mode 100644 index 0000000..0740d19 --- /dev/null +++ b/units/rtc/jobs.pxu @@ -0,0 +1,16 @@ +id: rtc/battery +_summary: RTC battery tracks the time +_purpose: + RTC battery backup power can send system wakeup event +_steps: + 1. Start the test to poweroff the system (wakeup scheduled in 30s) +_verification: + RTC can wake up the system successfully +command: + rtcwake -v -m disable + rtcwake -v -m off -s 30 +plugin: user-interact +user: root +category_id: rtc_category +estimated_duration: 40 +flags: noreturn diff --git a/units/rtc/test-plan.pxu b/units/rtc/test-plan.pxu new file mode 100644 index 0000000..3b37bf0 --- /dev/null +++ b/units/rtc/test-plan.pxu @@ -0,0 +1,20 @@ +id: rtc-full +unit: test plan +_name: RTC tests +_description: QA RTC tests for Snappy Ubuntu Core devices +include: +nested_part: + rtc-manual + +id: rtc-manual +unit: test plan +_name: Manual RTC tests +_description: Manual RTC tests for Snappy Ubuntu Core devices +include: + rtc/battery + +id: rtc-automated +unit: test plan +_name: Automated RTC tests +_description: Automated RTC tests for Snappy Ubuntu Core devices +include: diff --git a/units/security/category.pxu b/units/security/category.pxu new file mode 100644 index 0000000..a29d6a7 --- /dev/null +++ b/units/security/category.pxu @@ -0,0 +1,3 @@ +unit: category +id: security +_name: Security diff --git a/units/security/test-plan.pxu b/units/security/test-plan.pxu new file mode 100644 index 0000000..594bf31 --- /dev/null +++ b/units/security/test-plan.pxu @@ -0,0 +1,31 @@ +id: kernel-security-full +unit: test plan +_name: Kernel-security tests +_description: Collection of tests from QA Regression Testing repository +include: +nested_part: + kernel-security-automated +estimated_duration: 900s + +id: kernel-security-automated +unit: test plan +_name: Automated kernel-security tests +_description: Automated kernel-security tests for Snappy Ubuntu Core devices +estimated_duration: 900s +include: + +id: tainted-kernel-security-full +unit: test plan +_name: Kernel-security tests (tainted) +_description: Kernel-security from QA Regression Testing (ignoring tainting) +include: +nested_part: + tainted-kernel-security-automated +estimated_duration: 870s + +id: tainted-kernel-security-automated +unit: test plan +_name: Automated kernel-security tests (tainted) +_description: Automated kernel-security tests (ignoring tainting) +include: +estimated_duration: 870s diff --git a/units/self/jobs.pxu b/units/self/jobs.pxu new file mode 100644 index 0000000..f085a59 --- /dev/null +++ b/units/self/jobs.pxu @@ -0,0 +1,12 @@ + +unit: template +template-engine: jinja2 +template-resource: interface +template-filter: interface.interface == 'content' and interface.type == 'plug' and interface.snap == '{{ __system_env__["SNAP_NAME"] }}' +id: self/content-plug-connected-{{ name }} +_summary: Ensure the content interface plug {{ name }} is connected +plugin: shell +command: + plug_connected_test.py {{ snap }} {{ name }} +estimated_duration: 1.0 + diff --git a/units/self/test-plan.pxu b/units/self/test-plan.pxu new file mode 100644 index 0000000..bfb3220 --- /dev/null +++ b/units/self/test-plan.pxu @@ -0,0 +1,26 @@ + +id: self-full +unit: test plan +_name: Self tests +_description: Tests to make sure the checkbox snap is setup correctly +include: +nested_part: + self-manual + self-automated + + +id: self-manual +unit: test plan +_name: Manual self tests +_description: Manual tests to make sure the checkbox snap is setup correctly +include: + + +id: self-automated +unit: test plan +_name: Automated self tests +_description: Automated tests to make sure the checkbox snap is setup correctly +include: + self/content-plug-connected-.* +bootstrap_include: + interface diff --git a/units/serial/category.pxu b/units/serial/category.pxu new file mode 100644 index 0000000..148bfe1 --- /dev/null +++ b/units/serial/category.pxu @@ -0,0 +1,3 @@ +unit: category +id: serial +_name: Serial Port diff --git a/units/serial/jobs.pxu b/units/serial/jobs.pxu new file mode 100644 index 0000000..1a82448 --- /dev/null +++ b/units/serial/jobs.pxu @@ -0,0 +1,33 @@ +id: serial/rs232-console +_summary: Serial debugging console is enabled and operational +_purpose: + Check user can log into system through serial port from another machine +_steps: + 1. Connect USB to db9 null modem adapter cable to serial port of test machine + 2. Connect the cable to USB port of another ubuntu machine (client) + 3. Install screen on client (if not done in Prerequisite) + 4. Execute following command on client: + sudo screen /dev/ttyUSB0 + 5. Start getty service on test machine: + sudo systemctl start getty@[rs232 device, ex. /dev/ttyS0].service + 6. Log into the test machine from terminal on client +_verification: + 1. Output to client is fine after getty service started + 2. Log into test machine from terminal on client successfully +plugin: manual +flags: also-after-suspend +category_id: serial +estimated_duration: 600 + +unit: template +template-resource: serial_ports_static +template-unit: job +id: serial/loopback-{dev} +_summary: Serial loopback test of {dev} +_purpose: Check if serial port is working hardwired +plugin: shell +user: root +command: serial_loopback.py {dev} +flags: preserve-locale preserve-cwd also-after-suspend +category_id: serial +estimated_duration: 3.0 diff --git a/units/serial/test-plan.pxu b/units/serial/test-plan.pxu new file mode 100644 index 0000000..2369427 --- /dev/null +++ b/units/serial/test-plan.pxu @@ -0,0 +1,45 @@ +id: serial-full +unit: test plan +_name: Serial tests +_description: QA serial tests for Snappy Ubuntu Core devices +include: +nested_part: + serial-manual + serial-automated + +id: serial-manual +unit: test plan +_name: Manual serial tests +_description: Manual serial tests for Snappy Ubuntu Core devices +include: + serial/rs232-console + +id: serial-automated +unit: test plan +_name: Automated serial tests +_description: Automated serial tests for Snappy Ubuntu Core devices +include: + serial/loopback-.* + +id: after-suspend-serial-full +unit: test plan +_name: Serial tests (after suspend) +_description: QA serial tests for Snappy Ubuntu Core devices +include: +nested_part: + after-suspend-serial-manual + after-suspend-serial-automated + +id: after-suspend-serial-manual +unit: test plan +_name: Manual serial tests (after suspend) +_description: Manual serial tests for Snappy Ubuntu Core devices +include: + after-suspend-serial/rs232-console + +id: after-suspend-serial-automated +unit: test plan +_name: Automated serial tests (after suspend) +_description: Automated serial tests for Snappy Ubuntu Core devices +include: + after-suspend-serial/loopback-.* diff --git a/units/snappy/category.pxu b/units/snappy/category.pxu new file mode 100644 index 0000000..91dd927 --- /dev/null +++ b/units/snappy/category.pxu @@ -0,0 +1,3 @@ +unit: category +id: snappy +_name: Snappy Ubuntu Core diff --git a/units/snappy/snappy.pxu b/units/snappy/snappy.pxu new file mode 100644 index 0000000..fed3f76 --- /dev/null +++ b/units/snappy/snappy.pxu @@ -0,0 +1,335 @@ +id: snappy/snap-list +_summary: Test that the snap list command is working. +_purpose: If snap list command is working then should at least find the + ubuntu-core package. +plugin: shell +command: snap_tests.py list +category_id: snappy +estimated_duration: 10s +flags: preserve-locale + +id: snappy/snap-search +template-engine: jinja2 +_summary: Test that the snap find command is working. +_purpose: + If snap find command is working then should find + {{ __checkbox_env__.get("TEST_SNAP", "test-snapd-tools") }} in the store. +plugin: shell +command: snap_tests.py search +category_id: snappy +estimated_duration: 10s +flags: preserve-locale + +id: snappy/snap-install +template-engine: jinja2 +_summary: Test the snap install command is working +_purpose: + The store should contain the + {{ __checkbox_env__.get("TEST_SNAP", "test-snapd-tools") }} snap. The test + makes sure this can be downloaded and installed on the system. +plugin: shell +command: snap_tests.py install stable +category_id: snappy +estimated_duration: 10s +flags: preserve-locale +user: root +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL + +id: snappy/snap-remove +template-engine: jinja2 +_summary: Test the snap remove command is working. +_purpose: + After having installed the + {{ __checkbox_env__.get("TEST_SNAP", "test-snapd-tools") }} snap, check it + can removed. +plugin: shell +command: snap_tests.py remove +category_id: snappy +estimated_duration: 10s +depends: snappy/snap-install +flags: preserve-locale +user: root +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL + +id: snappy/snap-refresh +_summary: Test the snap refresh command is able to update the hello snap. +_purpose: + Check hello snap can be refreshed by snap refresh +_steps: + 1. Install + snap install hello + 2. Check version number + snap list hello + 3. Update + snap refresh hello --beta + 4. Check version number + snap list hello +_verification: + Check hello version is newer using the beta channel +plugin: manual +after: snappy/snap-remove +category_id: snappy +estimated_duration: 60 + +id: snappy/snap-revert +_summary: Test the snap revert command is able to revert the hello snap. +_purpose: + Check hello snap can be reverted by snap revert +_steps: + 1. Revert + snap revert hello + 2. Check version number + snap list hello +_verification: + Check hello version is back to its stable version +plugin: manual +depends: snappy/snap-refresh +category_id: snappy +estimated_duration: 60 + +id: snappy/snap-reupdate +_summary: Test the snap refresh command is able to refresh again the hello snap. +_purpose: + Check hello snap can be refreshed after removal of the blacklisted revision +_steps: + 1. Remove reverted version (and associated data) + snap remove hello --revision=<beta_revision> + 2. Reupdate + snap refresh hello --beta + 3. Check version number + snap list hello +_verification: + Check hello version is again the one from the beta channel +plugin: manual +depends: snappy/snap-revert +category_id: snappy +estimated_duration: 60 + +id: snappy/snap-refresh-automated +template-engine: jinja2 +_summary: Test the snap refresh command is working. +_description: + The snap {{ __checkbox_env__.get("TEST_SNAP", "test-snapd-tools") }} should + be installed from the stable channel prior to starting the test. The job + refreshes to edge and compares the revision before and after. +plugin: shell +command: snap_tests.py refresh +depends: snappy/snap-install +category_id: snappy +estimated_duration: 10s +user: root +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL + +id: snappy/snap-revert-automated +template-engine: jinja2 +_summary: Test the snap revert command is working. +_description: + Runs after snap-refresh-automated and should revert the installed edge channel + snap {{ __checkbox_env__.get("TEST_SNAP", "test-snapd-tools") }} leftover + from that test to the one from stable. +plugin: shell +command: snap_tests.py revert +depends: snappy/snap-refresh-automated +category_id: snappy +estimated_duration: 10s +user: root +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL + +id: snappy/snap-reupdate-automated +template-engine: jinja2 +_summary: Test the snap refresh command works after blacklisting. +_description: + Checks that the {{ __checkbox_env__.get("TEST_SNAP", "test-snapd-tools") }} + snap can be refreshed after removal of the blacklisted revision. +plugin: shell +command: snap_tests.py reupdate +depends: snappy/snap-revert-automated +category_id: snappy +estimated_duration: 10s +user: root +environ: TEST_SNAP SNAPD_TASK_TIMEOUT SNAPD_POLL_INTERVAL + +id: snappy/os-refresh +_summary: Refresh the system using the snap tool +_purpose: + Check "core" can be refreshed by snap refresh +_steps: + 1. Check version number + snap list core + 2. Update + snap refresh core --edge + 3. Reboot the system and log in + sudo reboot + 4. Check version number + snap list core +_verification: + Check core version is newer using the edge channel +plugin: manual +category_id: snappy +estimated_duration: 400 + +id: snappy/os-refresh-with-refresh-control +_summary: Refresh the system using the snap tool +_purpose: + Check "core" can be refreshed by snap refresh +_steps: + 1. Check version number + snap list core + 2. Update + snap refresh core --edge --ignore-validation + 3. Reboot the system and log in + sudo reboot + 4. Check version number + snap list core +_verification: + Check core version is newer using the edge channel +plugin: manual +category_id: snappy +estimated_duration: 400 + +id: snappy/os-revert +_summary: Rollback system update using the snap tool +_purpose: + Check core can be reverted by snap revert +_steps: + 1. Check version number + snap list core + 2. Revert + snap revert core + 3. Reboot the system and log in + sudo reboot + 4. Check version number + snap list core +_verification: + Check core version is back to its stable version +plugin: manual +depends: snappy/os-refresh +category_id: snappy +estimated_duration: 400 + +id: snappy/os-revert-with-refresh-control +_summary: Rollback system update using the snap tool +_purpose: + Check core can be reverted by snap revert +_steps: + 1. Check version number + snap list core + 2. Revert + snap revert core + 3. Reboot the system and log in + sudo reboot + 4. Check version number + snap list core +_verification: + Check core version is back to its stable version +plugin: manual +depends: snappy/os-refresh-with-refresh-control +category_id: snappy +estimated_duration: 400 + +id: snappy/os-fail-boot +_summary: Automatically rollback after failed boot after upgrade +_purpose: + Check system will rollback to original core snap if failed to boot the updated one +_steps: + 1. Remove reverted version (and associated data) + snap remove core --revision=<edge_revision> + 2. Check that the edge revision is back in the refresh list + snap refresh --list core + 3. Update + snap refresh core --edge + 4. Modify the GRUB Environment Block to simulate a failed boot + sudo /usr/bin/grub-editenv /boot/grub/grubenv set snap_mode=trying + 5. Reboot the system and log in + sudo reboot + 6. Check version number + snap list core +_verification: + Check system is currently booting the stable core version +plugin: manual +category_id: snappy +depends: snappy/os-revert +estimated_duration: 500 + +id: snappy/os-fail-boot-with-refresh-control +_summary: Automatically rollback after failed boot after upgrade +_purpose: + Check system will rollback to original core snap if failed to boot the updated one +_steps: + 1. Remove reverted version (and associated data) + snap remove core --revision=<edge_revision> + 2. Check that the edge revision is back in the refresh list + snap refresh --list core + 3. Update + snap refresh core --edge --ignore-validation + 4. Modify the GRUB Environment Block to simulate a failed boot + sudo /usr/bin/grub-editenv /boot/grub/grubenv set snap_mode=trying + 5. Reboot the system and log in + sudo reboot + 6. Check version number + snap list core +_verification: + Check system is currently booting the stable core version +plugin: manual +category_id: snappy +depends: snappy/os-revert-with-refresh-control +estimated_duration: 500 + +id: snappy/sshd +_summary: SSH is enabled and operational +_purpose: + Check if user can access the system through ssh from other machine +_steps: + 1. Execute following command on other machine in same network + ssh [user id]@[ip address of the testing system] + 2. Enter password to login +_verification: + Can log into system through ssh from other machine +plugin: manual +category_id: snappy +estimated_duration: 120 + +id: snappy/test-store-install-beta +_summary: Snappy install command - beta channel store +_purpose: + Test the snappy install command is able to install and remove snap in beta + channel store. +plugin: shell +command: snap_tests.py install beta && snap_tests.py remove +user: root +category_id: com.canonical.certification::snappy +estimated_duration: 30s +flags: preserve-locale + +id: snappy/test-store-install-edge +_summary: Snappy install command - edge channel store +_purpose: + Test the snappy install command is able to install snap in edge + channel store. +plugin: shell +command: snap_tests.py install edge && snap_tests.py remove +user: root +category_id: com.canonical.certification::snappy +estimated_duration: 30s +flags: preserve-locale + +unit: template +template-resource: com.canonical.certification::model_assertion +template-unit: job +id: snappy/test-store-config-{store} +_summary: Test that image is using the correct snappy store configuration. +_purpose: + The image can be tied to using a particular store for the OEM. This + tests the store for the image is as expected. +plugin: shell +environ: STORE_ID +command: + echo "Expected store ID:" + echo "$STORE_ID" + echo + echo "Store ID in model assertion:" + echo "{store}" + [ "$STORE_ID" == "{store}" ] +category_id: com.canonical.certification::snappy +estimated_duration: 1.0 +flags: preserve-locale diff --git a/units/snappy/test-plan.pxu b/units/snappy/test-plan.pxu new file mode 100644 index 0000000..9efba23 --- /dev/null +++ b/units/snappy/test-plan.pxu @@ -0,0 +1,84 @@ +id: snappy-snap-full +unit: test plan +_name: Tests for snap command +_description: + QA test plan that includes generic tests for the snap command for Snappy + Ubuntu Core devices. +estimated_duration: 5m +include: +nested_part: + snappy-snap-manual + snappy-snap-automated + +id: snappy-snap-full-with-refresh-control +unit: test plan +_name: Tests for snap command +_description: + QA test plan that includes generic tests for the snap command for Snappy + Ubuntu Core devices. +estimated_duration: 5m +include: +nested_part: + snappy-snap-manual-with-refresh-control + snappy-snap-automated + +id: snappy-snap-manual +unit: test plan +_name: QA tests for snap command +_description: + QA test that includes manual tests for the snap command for Snappy Ubuntu + Core devices. +include: + snappy/snap-refresh + snappy/snap-revert + snappy/snap-reupdate + snappy/os-refresh + snappy/os-revert + snappy/os-fail-boot + snappy/sshd +mandatory_include: + snap +bootstrap_include: + model_assertion + +id: snappy-snap-manual-with-refresh-control +unit: test plan +_name: QA tests for snap command on refresh controlled stores +_description: + QA test that includes manual tests for the snap command for Snappy Ubuntu + Core devices. +include: + snappy/snap-refresh + snappy/snap-revert + snappy/snap-reupdate + snappy/os-refresh-with-refresh-control + snappy/os-revert-with-refresh-control + snappy/os-fail-boot-with-refresh-control + snappy/sshd +mandatory_include: + snap +bootstrap_include: + model_assertion + +id: snappy-snap-automated +unit: test plan +_name: Automated tests for snap command +_description: + QA test plan that includes automated tests for the snap command for Snappy + Ubuntu Core devices. +estimated_duration: 1m +include: + snappy/snap-list + snappy/snap-search + snappy/snap-install + snappy/snap-refresh-automated + snappy/snap-revert-automated + snappy/snap-reupdate-automated + snappy/snap-remove + snappy/test-store-install-beta + snappy/test-store-install-edge + snappy/test-store-config-.* +mandatory_include: + snap +bootstrap_include: + model_assertion diff --git a/units/stress/boot.pxu b/units/stress/boot.pxu new file mode 100644 index 0000000..dcc0bf5 --- /dev/null +++ b/units/stress/boot.pxu @@ -0,0 +1,262 @@ +# Copyright 2015 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Jonathan Cave <jonathan.cave@canonical.com> + + +unit: category +id: stress-tests +_name: Stress Tests + + +unit: category +id: stress-tests/cold-boot +_name: Cold-boot Stress Test + + +unit: category +id: stress-tests/warm-boot +_name: Warm-boot Stress Test + + +id: reboot-run-generator +category_id: stress-tests +_description: + Generate a set of IDs corresponding to number of iterations required in the + reboots tests. +plugin: resource +environ: STRESS_BOOT_ITERATIONS +command: + ITERATIONS=${STRESS_BOOT_ITERATIONS:-2} + for i in $(seq 2 $ITERATIONS); do + echo "reboot_id: $i" + echo "reboot_id_previous: $((i-1))" + echo + done +estimated_duration: 1s +flags: preserve-locale + + +id: init-boot-loop-data +category_id: stress-tests +_summary: Generate the baseline data set to test against +_description: This creates baseline data sets which be considered the master + copies and all further tests will be compared against these. +unit: job +plugin: shell +command: + lspci -i $SNAP/usr/share/misc/pci.ids > $PLAINBOX_SESSION_SHARE/lspci_original || true + nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > $PLAINBOX_SESSION_SHARE/wifi_original || true + checkbox-support-lsusb -f $SNAP/checkbox-runtime/var/lib/usbutils/usb.ids -s | sort > $PLAINBOX_SESSION_SHARE/lsusb_original || true +environ: LD_LIBRARY_PATH +user: root +estimated_duration: 1s +flags: preserve-locale + +id: cold-boot-loop-reboot1 +category_id: stress-tests/cold-boot +_summary: Perform cold reboot 1 +_description: This is a template that will be used to generate a stress test + of the system boot. Specifically this is how the device will be request a + reboot. +unit: job +plugin: shell +environ: STRESS_BOOT_WAKEUP_DELAY +command: rtcwake --mode off -s ${STRESS_BOOT_WAKEUP_DELAY:-120} +user: root +flags: preserve-locale noreturn autorestart +estimated_duration: 180.0 +depends: init-boot-loop-data + +id: cold-boot-loop-reboot{reboot_id} +category_id: stress-tests/cold-boot +_summary: Perform cold reboot {reboot_id} +_description: This is a template that will be used to generate a stress test + of the system boot. Specifically this is how the device will be request a + reboot. +unit: template +template-resource: reboot-run-generator +template-unit: job +plugin: shell +environ: STRESS_BOOT_WAKEUP_DELAY STRESS_BOOT_WAIT_DELAY +command: + sleep ${{STRESS_BOOT_WAIT_DELAY:-120}} + rtcwake --mode off -s ${{STRESS_BOOT_WAKEUP_DELAY:-120}} +user: root +flags: preserve-locale noreturn autorestart +estimated_duration: 180.0 +after: cold-boot-loop-test{reboot_id_previous} +depends: init-boot-loop-data + +id: cold-boot-loop-test1 +category_id: stress-tests/cold-boot +_summary: Cold boot system configuration test 1 +_description: This is a template that will be used to generate a stress test + of the system boot. Specifically this is the test that will be performed + on each cycle to verify that all hardware is detected. +unit: job +plugin: shell +environ: LD_LIBRARY_PATH +command: + lspci -i $SNAP/usr/share/misc/pci.ids > $PLAINBOX_SESSION_SHARE/lspci_test + nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > $PLAINBOX_SESSION_SHARE/wifi_test + checkbox-support-lsusb -f $SNAP/checkbox-runtime/var/lib/usbutils/usb.ids -s | sort > $PLAINBOX_SESSION_SHARE/lsusb_test + diff -u $PLAINBOX_SESSION_SHARE/lspci_original $PLAINBOX_SESSION_SHARE/lspci_test + if [ $? -ne 0 ] ; then + echo "lspci mismatch during cycle 1" + exit 1 + fi + diff -u $PLAINBOX_SESSION_SHARE/wifi_original $PLAINBOX_SESSION_SHARE/wifi_test + if [ $? -ne 0 ] ; then + echo "wifi mismatch during cycle 1" + exit 1 + fi + diff -u $PLAINBOX_SESSION_SHARE/lsusb_original $PLAINBOX_SESSION_SHARE/lsusb_test + if [ $? -ne 0 ] ; then + echo "lsusb mismatch during cycle 1" + exit 1 + fi +user: root +flags: preserve-locale +estimated_duration: 1.0 +depends: cold-boot-loop-reboot1 + +id: cold-boot-loop-test{reboot_id} +category_id: stress-tests/cold-boot +_summary: Cold boot system configuration test {reboot_id} +_description: This is a template that will be used to generate a stress test + of the system boot. Specifically this is the test that will be performed + on each cycle to verify that all hardware is detected. +unit: template +template-resource: reboot-run-generator +template-unit: job +plugin: shell +environ: LD_LIBRARY_PATH +command: + lspci -i $SNAP/usr/share/misc/pci.ids > $PLAINBOX_SESSION_SHARE/lspci_test + nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > $PLAINBOX_SESSION_SHARE/wifi_test + checkbox-support-lsusb -f $SNAP/checkbox-runtime/var/lib/usbutils/usb.ids -s | sort > $PLAINBOX_SESSION_SHARE/lsusb_test + diff -u $PLAINBOX_SESSION_SHARE/lspci_original $PLAINBOX_SESSION_SHARE/lspci_test + if [ $? -ne 0 ] ; then + echo "lspci mismatch during cycle {reboot_id}" + exit 1 + fi + diff -u $PLAINBOX_SESSION_SHARE/wifi_original $PLAINBOX_SESSION_SHARE/wifi_test + if [ $? -ne 0 ] ; then + echo "wifi mismatch during cycle {reboot_id}" + exit 1 + fi + diff -u $PLAINBOX_SESSION_SHARE/lsusb_original $PLAINBOX_SESSION_SHARE/lsusb_test + if [ $? -ne 0 ] ; then + echo "lsusb mismatch during cycle {reboot_id}" + exit 1 + fi +user: root +flags: preserve-locale +estimated_duration: 1.0 +depends: cold-boot-loop-reboot{reboot_id} + + +id: warm-boot-loop-reboot1 +category_id: stress-tests/warm-boot +_summary: Perform warm reboot 1 +_description: This is a template that will be used to generate a stress test + of the system boot. Specifically this is how the device will be request a + reboot. +unit: job +plugin: shell +command: + reboot +user: root +flags: preserve-locale noreturn autorestart +estimated_duration: 60s +depends: init-boot-loop-data + +id: warm-boot-loop-reboot{reboot_id} +category_id: stress-tests/warm-boot +_summary: Perform warm reboot {reboot_id} +_description: This is a template that will be used to generate a stress test + of the system boot. Specifically this is how the device will be request a + reboot. +unit: template +template-resource: reboot-run-generator +template-unit: job +plugin: shell +environ: STRESS_BOOT_WAIT_DELAY +command: + sleep ${{STRESS_BOOT_WAIT_DELAY:-120}} + reboot +user: root +flags: preserve-locale noreturn autorestart +estimated_duration: 60.0 +after: warm-boot-loop-test{reboot_id_previous} +depends: init-boot-loop-data + +id: warm-boot-loop-test1 +category_id: stress-tests/warm-boot +_summary: Warm boot system configuration test 1 +_description: This is a template that will be used to generate a stress test + of the system boot. Specifically this is the test that will be performed + on each cycle to verify that all hardware is detected. +unit: job +plugin: shell +environ: LD_LIBRARY_PATH +command: + lspci -i $SNAP/usr/share/misc/pci.ids > $PLAINBOX_SESSION_SHARE/lspci_test + nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > $PLAINBOX_SESSION_SHARE/wifi_test + checkbox-support-lsusb -f $SNAP/checkbox-runtime/var/lib/usbutils/usb.ids -s | sort > $PLAINBOX_SESSION_SHARE/lsusb_test + diff -u $PLAINBOX_SESSION_SHARE/lspci_original $PLAINBOX_SESSION_SHARE/lspci_test + if [ $? -ne 0 ] ; then + echo "lspci mismatch during cycle 1" + exit 1 + fi + diff -u $PLAINBOX_SESSION_SHARE/wifi_original $PLAINBOX_SESSION_SHARE/wifi_test + if [ $? -ne 0 ] ; then + echo "wifi mismatch during cycle 1" + exit 1 + fi + diff -u $PLAINBOX_SESSION_SHARE/lsusb_original $PLAINBOX_SESSION_SHARE/lsusb_test + if [ $? -ne 0 ] ; then + echo "lsusb mismatch during cycle 1" + exit 1 + fi +user: root +flags: preserve-locale +estimated_duration: 1.0 +depends: warm-boot-loop-reboot1 + +id: warm-boot-loop-test{reboot_id} +category_id: stress-tests/warm-boot +_summary: Warm boot system configuration test {reboot_id} +_description: This is a template that will be used to generate a stress test + of the system boot. Specifically this is the test that will be performed + on each cycle to verify that all hardware is detected. +unit: template +template-resource: reboot-run-generator +template-unit: job +plugin: shell +environ: LD_LIBRARY_PATH +command: + lspci -i $SNAP/usr/share/misc/pci.ids > $PLAINBOX_SESSION_SHARE/lspci_test + nmcli -t -f active,BSSID d w l | grep -oP "(?<=^yes:).*" > $PLAINBOX_SESSION_SHARE/wifi_test + checkbox-support-lsusb -f $SNAP/checkbox-runtime/var/lib/usbutils/usb.ids -s | sort > $PLAINBOX_SESSION_SHARE/lsusb_test + diff -u $PLAINBOX_SESSION_SHARE/lspci_original $PLAINBOX_SESSION_SHARE/lspci_test + if [ $? -ne 0 ] ; then + echo "lspci mismatch during cycle {reboot_id}" + exit 1 + fi + diff -u $PLAINBOX_SESSION_SHARE/wifi_original $PLAINBOX_SESSION_SHARE/wifi_test + if [ $? -ne 0 ] ; then + echo "wifi mismatch during cycle {reboot_id}" + exit 1 + fi + diff -u $PLAINBOX_SESSION_SHARE/lsusb_original $PLAINBOX_SESSION_SHARE/lsusb_test + if [ $? -ne 0 ] ; then + echo "lsusb mismatch during cycle {reboot_id}" + exit 1 + fi +user: root +flags: preserve-locale +estimated_duration: 1.0 +depends: warm-boot-loop-reboot{reboot_id} diff --git a/units/stress/jobs.pxu b/units/stress/jobs.pxu index 756d537..719e9e1 100644 --- a/units/stress/jobs.pxu +++ b/units/stress/jobs.pxu @@ -18,7 +18,15 @@ estimated_duration: 7200.0 requires: package.name == 'stress-ng' or executable.name == 'stress-ng' user: root -command: cpu_stress --runtime 7200 +command: + if [ -n "$STRESS_NG_CPU_TIME" ] + then + echo "Found STRESS_NG_CPU_TIME env var, stress_ng cpu running time is now: $STRESS_NG_CPU_TIME seconds" + cpu_stress --runtime $STRESS_NG_CPU_TIME + else + echo STRESS_NG_CPU_TIME env var is not found, stress_ng cpu running time is default value + cpu_stress --runtime 7200 + fi _summary: Stress of CPUs (very long runtime) _description: @@ -273,7 +281,7 @@ estimated_duration: 1.0 depends: stress/reboot command: set -o pipefail - more $PLAINBOX_SESSION_SHARE/*reboot.100.log | cat + cat $PLAINBOX_SESSION_SHARE/*reboot.100.log plugin: shell category_id: com.canonical.plainbox::stress @@ -294,7 +302,7 @@ id: stress/reboot_30_log depends: stress/reboot_30 command: set -o pipefail - more $PLAINBOX_SESSION_SHARE/*reboot.30.log | cat + cat $PLAINBOX_SESSION_SHARE/*reboot.30.log plugin: shell category_id: com.canonical.plainbox::stress @@ -317,7 +325,7 @@ estimated_duration: 1.0 depends: stress/poweroff command: set -o pipefail - more $PLAINBOX_SESSION_SHARE/*poweroff.100.log | cat + cat $PLAINBOX_SESSION_SHARE/*poweroff.100.log plugin: shell category_id: com.canonical.plainbox::stress @@ -339,7 +347,7 @@ id: stress/poweroff_30_log depends: stress/poweroff_30 command: set -o pipefail - more $PLAINBOX_SESSION_SHARE/*poweroff.30.log | cat + cat $PLAINBOX_SESSION_SHARE/*poweroff.30.log plugin: shell category_id: com.canonical.plainbox::stress @@ -356,7 +364,7 @@ estimated_duration: 1.0 depends: stress/reboot_30_check command: set -o pipefail - more $PLAINBOX_SESSION_SHARE/pm_log_check_reboot.30.log | cat + cat $PLAINBOX_SESSION_SHARE/pm_log_check_reboot.30.log plugin: shell category_id: com.canonical.plainbox::stress @@ -373,7 +381,7 @@ estimated_duration: 1.0 depends: stress/poweroff_30_check command: set -o pipefail - more $PLAINBOX_SESSION_SHARE/pm_log_check_poweroff.30.log | cat + cat $PLAINBOX_SESSION_SHARE/pm_log_check_poweroff.30.log plugin: shell category_id: com.canonical.plainbox::stress @@ -390,7 +398,7 @@ estimated_duration: 1.0 depends: stress/reboot_check command: set -o pipefail - more $PLAINBOX_SESSION_SHARE/pm_log_check_reboot.100.log | cat + cat $PLAINBOX_SESSION_SHARE/pm_log_check_reboot.100.log plugin: shell category_id: com.canonical.plainbox::stress @@ -407,7 +415,7 @@ estimated_duration: 1.0 depends: stress/poweroff_check command: set -o pipefail - more $PLAINBOX_SESSION_SHARE/pm_log_check_poweroff.100.log | cat + cat $PLAINBOX_SESSION_SHARE/pm_log_check_poweroff.100.log plugin: shell category_id: com.canonical.plainbox::stress diff --git a/units/stress/s3s4.pxu b/units/stress/s3s4.pxu new file mode 100644 index 0000000..9a62f8e --- /dev/null +++ b/units/stress/s3s4.pxu @@ -0,0 +1,136 @@ +# Copyright 2016 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Sylvain Pineau <sylvain.pineau@canonical.com> + +unit: category +id: stress-tests/suspend +_name: Suspend (S3) Stress Test + +unit: category +id: stress-tests/hibernate +_name: Hibernate (S4) Stress Test + + +id: stress_s3_iterations +category_id: stress-tests/suspend +_description: + Resource job meant to be used in the S3 stress templates +plugin: resource +environ: STRESS_S3_ITERATIONS +command: + echo "s3_iterations: ${STRESS_S3_ITERATIONS:-30}" +estimated_duration: 1s +flags: preserve-locale + +id: stress_s4_iterations +category_id: stress-tests/suspend +_description: + Resource job meant to be used in the S4 stress templates +plugin: resource +environ: STRESS_S4_ITERATIONS +command: + echo "s4_iterations: ${STRESS_S4_ITERATIONS:-30}" +estimated_duration: 1s +flags: preserve-locale + + +unit: template +template-resource: stress_s3_iterations +template-unit: job +plugin: shell +flags: preserve-locale +category_id: stress-tests/suspend +id: stress-tests/suspend_{s3_iterations}_cycles +imports: + from com.canonical.certification import sleep + from com.canonical.certification import rtc +requires: + sleep.mem == 'supported' + rtc.state == 'supported' +estimated_duration: 2400.0 +environ: PLAINBOX_SESSION_SHARE STRESS_S3_SLEEP_DELAY STRESS_S3_WAIT_DELAY LD_LIBRARY_PATH +user: root +command: + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" + set -o pipefail; checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles -f none -s s3 --s3-device-check --s3-device-check-delay=${{STRESS_S3_WAIT_DELAY:-45}} --s3-sleep-delay=${{STRESS_S3_SLEEP_DELAY:-30}} --s3-multiple={s3_iterations} -j $SNAP/share/fwts | tee $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles_times.log +_description: + PURPOSE: + This is an automated stress test that will force the system to suspend/resume for {s3_iterations} cycles. + +unit: template +template-resource: stress_s3_iterations +template-unit: job +plugin: shell +flags: preserve-locale +category_id: stress-tests/suspend +id: stress-tests/suspend-{s3_iterations}-cycles-log-check +after: stress-tests/suspend_{s3_iterations}_cycles +estimated_duration: 1.0 +command: [ -e $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles.log ] && sleep_test_log_check -v s3 $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles.log +_description: + Automated check of the {s3_iterations} cycles suspend log for errors detected by fwts. + +unit: template +template-resource: stress_s3_iterations +template-unit: job +plugin: attachment +flags: preserve-locale +category_id: stress-tests/suspend +id: stress-tests/suspend-{s3_iterations}-cycles-log-attach +estimated_duration: 1.0 +after: stress-tests/suspend_{s3_iterations}_cycles +command: [ -e $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles.log ] && cat $PLAINBOX_SESSION_SHARE/suspend_{s3_iterations}_cycles.log +_description: + Attaches the log from the {s3_iterations} cycles Suspend/Resume test if it exists + + +unit: template +template-resource: stress_s4_iterations +template-unit: job +plugin: shell +flags: preserve-locale +category_id: stress-tests/hibernate +id: stress-tests/hibernate_{s4_iterations}_cycles +imports: + from com.canonical.certification import sleep + from com.canonical.certification import rtc +requires: + sleep.disk == 'supported' + rtc.state == 'supported' +estimated_duration: 5400.00 +environ: PLAINBOX_SESSION_SHARE STRESS_S4_SLEEP_DELAY STRESS_S4_WAIT_DELAY LD_LIBRARY_PATH +user: root +command: + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" + checkbox-support-fwts_test -l $PLAINBOX_SESSION_SHARE/hibernate_{s4_iterations}_cycles -f none -s s4 --s4-device-check --s4-device-check-delay=${{STRESS_S4_WAIT_DELAY:-45}} --s4-sleep-delay=${{STRESS_S4_SLEEP_DELAY:-120}} --s4-multiple={s4_iterations} -j $SNAP/share/fwts +_description: + PURPOSE: + This is an automated stress test that will force the system to hibernate/resume for {s4_iterations} cycles + +unit: template +template-resource: stress_s4_iterations +template-unit: job +plugin: shell +flags: preserve-locale +category_id: stress-tests/hibernate +id: stress-tests/hibernate-{s4_iterations}-cycles-log-check +after: stress-tests/hibernate_{s4_iterations}_cycles +estimated_duration: 1.0 +command: [ -e $PLAINBOX_SESSION_SHARE/hibernate_{s4_iterations}_cycles.log ] && sleep_test_log_check -v s4 $PLAINBOX_SESSION_SHARE/hibernate_{s4_iterations}_cycles.log +_description: + Automated check of the {s4_iterations} cycles hibernate log for errors detected by fwts. + +unit: template +template-resource: stress_s4_iterations +template-unit: job +plugin: attachment +flags: preserve-locale +category_id: stress-tests/hibernate +id: stress-tests/hibernate-{s4_iterations}-cycles-log-attach +estimated_duration: 1.0 +after: stress-tests/hibernate_{s4_iterations}_cycles +command: [ -e $PLAINBOX_SESSION_SHARE/hibernate_{s4_iterations}_cycles.log ] && cat $PLAINBOX_SESSION_SHARE/hibernate_{s4_iterations}_cycles.log +_description: + Attaches the log from the {s4_iterations} cycles Hibernate/Resume test if it exists diff --git a/units/stress/stress-ng.pxu b/units/stress/stress-ng.pxu new file mode 100644 index 0000000..9cbe615 --- /dev/null +++ b/units/stress/stress-ng.pxu @@ -0,0 +1,31 @@ +unit: job +id: stress-ng-classes +plugin: resource +_summary: Gather list of test classes from stress-ng +_description: + stress-ng divides tests in to classes. Get a list of classes so can divide + up tests. Complete class list: cpu, cpu-cache, device, io, interrupt, + filesystem, memory, network, os, pipe, scheduler, vm. +command: + command -v stress-ng >/dev/null 2>&1 || { >&2 echo "stress-ng command not found"; exit 1; } + CLASSES="cpu cpu-cache memory os pipe scheduler vm" + for c in $CLASSES; do + echo "stress-ng-class: $c" + echo + done +estimated_duration: 1s +flags: preserve-locale + +unit: template +template-resource: stress-ng-classes +template-unit: job +id: stress/stress-ng-test-for-class-{stress-ng-class} +category_id: stress-tests +_summary: Run the stress-ng stressors for class {stress-ng-class} +_description: + Runs the stressors for the class defined. Tests run sequentially using the + same number of proccesses as online processors. +plugin: shell +estimated_duration: 1200.0 +command: + stress-ng --sequential 0 --class {stress-ng-class} diff --git a/units/stress/test-plan.pxu b/units/stress/test-plan.pxu index 8e7929a..7967dd5 100644 --- a/units/stress/test-plan.pxu +++ b/units/stress/test-plan.pxu @@ -88,3 +88,160 @@ include: stress/cpu_stress_ng_test certification-status=blocker memory/memory_stress_ng certification-status=blocker +id: stress-full +unit: test plan +_name: Stress tests +_description: QA stress tests for Snappy Ubuntu Core devices +include: +nested_part: + stress-automated + +id: stress-automated +unit: test plan +_name: Automated stress tests +_description: Automated stress tests for Snappy Ubuntu Core devices +include: +nested_part: + warm-boot-stress-test + cold-boot-stress-test + suspend-stress-test + hibernate-stress-test + stress-ng-automated + +unit: test plan +id: warm-boot-stress-test +_name: Warm boot stress test +_description: + Reboots the machine a pre-defined number of times and on + resumption of OS performs a hardware check to ensure all + items are still present. Reboot is immediate. +estimated_duration: 25h +bootstrap_include: + reboot-run-generator +include: + warm-boot-loop-.* +mandatory_include: + com.canonical.plainbox::manifest + package + snap + uname + lsb + cpuinfo + dpkg + dmi_attachment + sysfs_attachment + udev_attachment + lspci_attachment + lsusb_attachment + dmi + meminfo + interface + +unit: test plan +id: cold-boot-stress-test +_name: Cold boot stress test +_description: + Reboots the machine a pre-defined number of times and on + resumption of OS performs a hardware check to ensure all + items are still present. The reboot is delayed by 2 minutes + by the RTC to allow hardware to cool. +estimated_duration: 42h +bootstrap_include: + reboot-run-generator +include: + cold-boot-loop-.* +mandatory_include: + com.canonical.plainbox::manifest + package + snap + uname + lsb + cpuinfo + dpkg + dmi_attachment + sysfs_attachment + udev_attachment + lspci_attachment + lsusb_attachment + dmi + meminfo + interface + + +unit: test plan +id: suspend-stress-test +_name: Suspend (S3) stress test +_description: + Suspends the machine a pre-defined number of times and on + resume of OS performs a hardware check to ensure all + items are still present. +estimated_duration: 42h +bootstrap_include: + stress_s3_iterations +include: + stress-tests/suspend.* +mandatory_include: + com.canonical.plainbox::manifest + package + snap + uname + lsb + cpuinfo + dpkg + dmi_attachment + sysfs_attachment + udev_attachment + lspci_attachment + lsusb_attachment + dmi + meminfo + interface + +unit: test plan +id: hibernate-stress-test +_name: Hibernate (S4) stress test +_description: + Hibernates the machine a pre-defined number of times and on + resume of OS performs a hardware check to ensure all + items are still present. +estimated_duration: 42h +bootstrap_include: + stress_s4_iterations +include: + stress-tests/hibernate.* +mandatory_include: + com.canonical.plainbox::manifest + package + snap + uname + lsb + cpuinfo + dpkg + dmi_attachment + sysfs_attachment + udev_attachment + lspci_attachment + lsusb_attachment + dmi + meminfo + interface + +id: stress-ng-automated +unit: test plan +_name: Automated stress-ng tests +_description: Automated stress-ng tests for Snappy Ubuntu Core devices +include: + stress/stress-ng-test-for-class-.* + disk/disk_stress_ng_.* +bootstrap_include: + device + stress-ng-classes + +id: stress-iperf3-automated +unit: test plan +_name: Automated iperf3 tests +_description: Automated iperf3 performance test +include: + ethernet/iperf3_.* +bootstrap_include: + device diff --git a/units/suspend/suspend.pxu b/units/suspend/suspend.pxu index 0c3a942..35ba417 100644 --- a/units/suspend/suspend.pxu +++ b/units/suspend/suspend.pxu @@ -268,7 +268,14 @@ command: if [[ -v SNAP ]]; then export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/fwts" fi - set -o pipefail; checkbox-support-fwts_test -f none -l $PLAINBOX_SESSION_SHARE/suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee $PLAINBOX_SESSION_SHARE/suspend_single_times.log + # fwts s3 is not available on all architectures (i.e ARM) + if fwts --show-tests-categories | grep -q 's3 '; then + echo "Calling fwts" + set -o pipefail; checkbox-support-fwts_test -f none -l $PLAINBOX_SESSION_SHARE/suspend_single -s s3 --s3-sleep-delay=30 --s3-device-check --s3-device-check-delay=45 | tee $PLAINBOX_SESSION_SHARE/suspend_single_times.log + else + echo "Calling rtcwake" + rtcwake -m mem -s 30 + fi estimated_duration: 90.000 unit: template diff --git a/units/suspend/test-plan.pxu b/units/suspend/test-plan.pxu index edc6aaa..1d6e12f 100644 --- a/units/suspend/test-plan.pxu +++ b/units/suspend/test-plan.pxu @@ -102,3 +102,47 @@ include: keys/sleep certification-status=blocker suspend/oops_after_suspend certification-status=blocker suspend/oops_results_after_suspend.log + +id: suspend-tp +unit: test plan +_name: Suspend the system +_description: + This test plan should be nested in other test plans that require tests to be + rerun after suspending the SUT. It's a full-blown TP to help manage the + execution order, by placing it between before-suspend-tp and after-suspend-tp + in the nested_part section of the surrounding test plan. +include: + suspend/suspend_advanced_auto + +id: hibernate-tp +unit: test plan +_name: Hibernate the system +_description: + This test plan should be nested in other test plans that require tests to be + rerun after hibernating the SUT. It's a full-blown TP to help manage the + execution order, by placing it between before-hibernate-tp and + after-hibernate-tp in the nested_part section of the surrounding test plan. +include: + power-management/hibernate_advanced_auto + +id: suspend-tp-manual +unit: test plan +_name: Suspend the system (manual) +_description: + This test plan should be nested in other test plans that require tests to be + rerun after suspending the SUT. It's a full-blown TP to help manage the + execution order, by placing it between before-suspend-tp and after-suspend-tp + in the nested_part section of the surrounding test plan. +include: + suspend/suspend_advanced + +id: hibernate-tp-manual +unit: test plan +_name: Hibernate the system (manual) +_description: + This test plan should be nested in other test plans that require tests to be + rerun after hibernating the SUT. It's a full-blown TP to help manage the + execution order, by placing it between before-hibernate-tp and + after-hibernate-tp in the nested_part section of the surrounding test plan. +include: + power-management/hibernate_advanced diff --git a/units/touchpad/jobs.pxu b/units/touchpad/jobs.pxu index 2fba8ad..a7b7e35 100644 --- a/units/touchpad/jobs.pxu +++ b/units/touchpad/jobs.pxu @@ -219,14 +219,17 @@ _siblings: [{ "id": "touchpad/continuous-move-after-suspend", "depends": "suspend/suspend_advanced touchpad/continuous-move" }] -plugin: qml -category_id: com.canonical.plainbox::touchpad id: touchpad/palm-rejection -requires: dmi.product in ['Notebook','Laptop','Portable','Convertible'] -estimated_duration: 20 +plugin: user-interact +category_id: com.canonical.plainbox::touchpad +command: qmlscene -qt5 --fullscreen $PLAINBOX_PROVIDER_DATA/palm_rejection.qml 2>&1 | grep -o PASS _purpose: This test checks if touchpad ignores palm touches -qml_file: palm_rejection.qml +_steps: + Select "Test" and follow the instruction on the screen +_verification: + Cursor should not have moved. _siblings: [{ "id": "touchpad/palm-rejection-after-suspend", "depends": "suspend/suspend_advanced touchpad/palm-rejection" }] +estimated_duration: 40 diff --git a/units/tpm/category.pxu b/units/tpm/category.pxu new file mode 100644 index 0000000..612346b --- /dev/null +++ b/units/tpm/category.pxu @@ -0,0 +1,9 @@ +# Copyright 2015 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Zygmunt Krynicki <zygmunt.krynicki@canonical.com> + +unit: category +id: tpm +_name: TPM (Trusted Platform Module) diff --git a/units/tpm/manifest.pxu b/units/tpm/manifest.pxu new file mode 100644 index 0000000..cef5c86 --- /dev/null +++ b/units/tpm/manifest.pxu @@ -0,0 +1,10 @@ +# Copyright 2015 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Zygmunt Krynicki <zygmunt.krynicki@canonical.com> + +unit: manifest entry +id: has_tpm_chip +_name: TPM1.2 chip +value-type: bool diff --git a/units/tpm/sysfs.pxu b/units/tpm/sysfs.pxu new file mode 100644 index 0000000..fdbf390 --- /dev/null +++ b/units/tpm/sysfs.pxu @@ -0,0 +1,81 @@ +# Copyright 2015 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Zygmunt Krynicki <zygmunt.krynicki@canonical.com> + +unit: job +id: sysfs_tpm_count +category_id: tpm +plugin: resource +_summary: Count the number of visible TPM chips in sysfs +_description: + This job just counts the number of visible TPM chips in as reported by + tpm-sysfs-resource tool. The only resource attribute is 'count' +command: echo "count: $(tpm-sysfs-resource | grep -F 'x-sysfs-device-name' | wc -l)" +estimated_duration: 2s +flags: preserve-locale + +unit: job +id: sysfs_tpm +category_id: tpm +plugin: resource +_summary: Collect TPM information from sysfs +_description: + This job collects all the available TPM information from + /sys/class/tpm/*/device/*. +command: tpm-sysfs-resource +estimated_duration: 2s +flags: preserve-locale +# Tie this resource with the has_tpm_chip manifest entry. This way it will +# automatically get skipped (and everything along with it) when according to +# the manifest, there is no TPM chip on the DUT. +requires: manifest.has_tpm_chip == 'True' +imports: from com.canonical.plainbox import manifest + +unit: job +id: sysfs_tpm_after_taking_ownership +category_id: tpm +plugin: resource +after: action/take-ownership +_summary: Collect TPM information from sysfs (after taking ownership) +_description: + This job collects all the available TPM information from + /sys/class/tpm/*/device/*. Distinct files present there are converted to + attributes of resource records. +command: tpm-sysfs-resource +estimated_duration: 2s +flags: preserve-locale +# See note about manifest on the sysfs_tpm job above. +requires: manifest.has_tpm_chip == 'True' +imports: from com.canonical.plainbox import manifest + +unit: job +id: sysfs_tpm_after_clearing_ownership +category_id: tpm +plugin: resource +after: action/clear-ownership +_summary: Collect TPM information from sysfs (after clearing ownership) +_description: + This job collects all the available TPM information from + /sys/class/tpm/*/device/*. Distinct files present there are converted to + attributes of resource records. +command: tpm-sysfs-resource +estimated_duration: 2s +flags: preserve-locale +# See note about manifest on the sysfs_tpm job above. +requires: manifest.has_tpm_chip == 'True' +imports: from com.canonical.plainbox import manifest + +unit: job +id: sysfs_dmi +category_id: tpm +plugin: resource +_summary: Collect DMI information from sysfs +_description: + This job collects all the available DMI information from /sys/class/dmi/id/*. + The main purpose of including this job is to allow the provider to include + vendor-specific quirks by looking at the sysfs_dmi.bios_vendor attribute. +command: dmi-sysfs-resource +estimated_duration: 1s +flags: preserve-locale diff --git a/units/tpm/test-plan.pxu b/units/tpm/test-plan.pxu new file mode 100644 index 0000000..0aafb84 --- /dev/null +++ b/units/tpm/test-plan.pxu @@ -0,0 +1,56 @@ +# Copyright 2015 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Zygmunt Krynicki <zygmunt.krynicki@canonical.com> + +unit: test plan +id: tpm-manual +_name: TPM (Trusted Platform Module) Smoke Tests +_description: + This test plan contains simple tests for the TPM chip. The tests will ensure + that the TPM chip is present, is visible by the OS and that ownership over the + chip can be taken. + . + After testing, a number of logs are collected for additional analysis. +estimated_duration: 20m +include: + # First just the manifest stuff (interactive collection + resource) + com.canonical.plainbox::collect-manifest + com.canonical.plainbox::manifest + # Vendor-specific, interactive recovery process. We want to educate the tester + # how they can reset the TPM chip from unknown state using vendor-specific + # instructions. + recovery/.*/clear-tpm-chip + # Generic setup path, we want to go from any TPM state (Active, Inactive, + # Disabled) to Active where we can perform useful tests. + setup/enable-inactive-tpm + setup/enable-disabled-tpm + # The first thing we want to try is to clear the ownership of the TPM chip + # This will let us ensure that all the other tests are independent of any + # ownership or data already stored there. + action/clear-ownership + # Which might require us to reboot / poweroff the machine to complete. + action/re-enable-tpm + # Next we want to take the ownership of the chip. + action/take-ownership + # Finally, with the TPM chip owned, we can perform some simple query jobs and + # collect everything. + query/.* + +unit: test plan +id: tpm-automated +_name: Collect TPM (Trusted Platform Module) Information +_description: + This test plan contains a selection of jobs that collect various bits of + information about a TPM chip. They are designed to run with an owned TPM chip + that uses well-known (20 zero bytes) owner key. + . + This test plan is not interactive. +estimated_duration: 1m +include: + com.canonical.plainbox::manifest + # Next we want to take the ownership of the chip if it's not owned yet. + action/take-ownership + # Then collect all of the information + query/.* diff --git a/units/tpm/tpm.pxu b/units/tpm/tpm.pxu new file mode 100644 index 0000000..584dc53 --- /dev/null +++ b/units/tpm/tpm.pxu @@ -0,0 +1,285 @@ +# Copyright 2015-2016 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Zygmunt Krynicki <zygmunt.krynicki@canonical.com> + +unit: job +id: setup/enable-disabled-tpm +category_id: tpm +_summary: Use BIOS to activate a disabled TPM chip +_purpose: + This job will reconfigure the TPM chip to be in the Active state. +_steps: + To enable the TPM chip in the BIOS, write down the following instructions and + exit the testing application. + . + INSTRUCTIONS FOR ENABLING THE TPM CHIP: + . + - Commence the test to restart the machine + - Enter BIOS using machine-specific hot-key (typically F1, F2, or delete) + - Navigate to TPM menu, the precise location may depend on your BIOS version + and the make and model of your DUT. On some models it is under the + following menu: Security / Security Chip. + - Change the current setting to Active + - Save BIOS settings + - Power the machine off (NOTE: a reboot may not be sufficient) + - Power the machine back on again + - Let the machine boot + - Restart the testing application +plugin: user-interact +user: root +command: reboot +estimated_duration: 3m +flags: preserve-locale noreturn +# NOTE: This job will only run if we know we have a TPM chip (according to the +# manifest) but we don't see one in sysfs (because it's disabled). +requires: sysfs_tpm_count.count == "0" and manifest.has_tpm_chip == 'True' +imports: from com.canonical.plainbox import manifest + +unit: job +id: setup/enable-inactive-tpm +category_id: tpm +_summary: Use BIOS to activate an inactive TPM chip +_purpose: + This job will reconfigure the TPM chip to be in the Active state. +_steps: + To enable the TPM chip in the BIOS, write down the following instructions and + exit the testing application. + . + INSTRUCTIONS FOR ENABLING THE TPM CHIP: + . + - Commence the test to restart the machine + - Enter BIOS using machine-specific hot-key (typically F1, F2, or delete) + - Navigate to TPM menu, the precise location may depend on your BIOS version + and the make and model of your DUT. On some models it is under the + following menu: Security / Security Chip. + - Change the current setting to Active + - Save BIOS settings + - Power the machine off (NOTE: a reboot may not be sufficient) + - Power the machine back on again + - Let the machine boot + - Restart the testing application +plugin: user-interact +user: root +command: reboot +# NOTE: This job will only run if we know we have a TPM chip (according to the +# manifest, again) but sysfs claims it's temporarily deactivated (which is the +# confusing way to say it's inactive) +requires: sysfs_tpm_count.count != "0" and sysfs_tpm.temp_deactivated == "1" +estimated_duration: 3m +flags: preserve-locale noreturn + +unit: job +id: action/clear-ownership +category_id: tpm +_summary: Clear ownership of the TPM chip +_purpose: + This job tries to automatically clear the ownership of an owned TPM chip. It + uses well-known owner secret (20 bytes of zeros). + . + NOTE: The actual TPM chip will be cleared after the machine reboots. After + reboot the TPM will be in the default state: unowned, disabled and inactive. + Subsequent jobs will instruct test operator to enter BIOS and re-enable the + chip. +_steps: + INSTRUCTIONS FOR CLEARING THE TPM CHIP: + . + - Commence the test to reboot the machine + - Let the machine boot + - Restart the testing application +plugin: user-interact +command: + tpm.clear --log debug --well-known && reboot +requires: sysfs_tpm.owned == "1" and sysfs_tpm.enabled == "1" and sysfs_tpm.active == "1" and sysfs_tpm.temp_deactivated == "0" +estimated_duration: 5s +flags: preserve-locale preserve-cwd + +unit: job +id: action/re-enable-tpm +category_id: tpm +_summary: Re-enable TPM chip in BIOS (after clearing ownership) +_purpose: + This job will re-enable the TPM chip in the BIOS after having cleared the ownership. +_steps: + To enable the TPM chip in the BIOS, write down the following instructions and + exit the testing application. + . + INSTRUCTIONS FOR ENABLING THE TPM CHIP: + . + - Commence the test to restart the machine + - Enter BIOS using machine-specific hot-key (typically F1, F2, or delete) + - Navigate to TPM menu, the precise location may depend on your BIOS version + and the make and model of your DUT. On some models it is under the + following menu: Security / Security Chip. + - Change the current setting to Active. If it is already in the active state + then set it to Disabled and then back to Active. This might be a bug in the BIOS. + - Save BIOS settings + - Power the machine off (NOTE: a reboot may not be sufficient) + - Power the machine back on again + - Let the machine boot + - Restart the testing application +plugin: user-interact +user: root +command: reboot +requires: sysfs_tpm_after_clearing_ownership.owned == "0" and sysfs_tpm_after_clearing_ownership.enabled == "0" and sysfs_tpm_after_clearing_ownership.active == "0" and sysfs_tpm_after_clearing_ownership.temp_deactivated == "1" +estimated_duration: 3m +flags: preserve-locale noreturn + +unit: job +id: action/take-ownership +category_id: tpm +_summary: Take ownership of the TPM chip +_description: + This job tries to automatically take the ownership of an unowned TPM chip. It + uses well-known owner and SRK secretes (20 bytes of zeros). +plugin: shell +command: tpm.takeownership --log debug --owner-well-known --srk-well-known +requires: sysfs_tpm.owned == "0" and sysfs_tpm.enabled == "1" and sysfs_tpm.active == "1" and sysfs_tpm.temp_deactivated == "0" +estimated_duration: 5s +flags: preserve-locale preserve-cwd + +# A bunch of shell jobs that run various TPM commands + +unit: job +id: query/tpm_version +category_id: tpm +_summary: Collect the output of tpm_version +_description: + This job collects the output of "tpm_version" for inspection by a + Certification engineer. +plugin: shell +requires: snap.name == 'tpm' +command: tpm.version 2>&1 +estimated_duration: 1s +flags: preserve-locale preserve-cwd + +unit: job +id: query/tpm_selftest +category_id: tpm +_summary: Collect the output of tpm_selftest +_description: + This job collects the output of "tpm_selftest" for inspection by the + Certification engineer. +plugin: shell +requires: snap.name == 'tpm' +command: tpm.selftest 2>&1 +estimated_duration: 1s +flags: preserve-locale preserve-cwd + +unit: job +id: query/tpm_setactive-status +category_id: tpm +_summary: Collect the output of tpm_setactive --status --well-known +_description: + This simply collects the output of "tpm_setactive --status --well-known" for + inspection by a Certification engineer. +plugin: shell +requires: snap.name == 'tpm' +command: tpm.setactive --status --well-known 2>&1 +estimated_duration: 1s +flags: preserve-locale preserve-cwd + +unit: job +id: query/tpm_nvinfo +category_id: tpm +_summary: Collect the output of tpm_nvinfo +_description: + This simply collects the output of "tpm_nvinfo" for inspection by a + Certification engineer. +plugin: shell +requires: snap.name == 'tpm' +command: tpm.nvinfo +estimated_duration: 1s +flags: preserve-locale preserve-cwd + +unit: job +id: query/tpm_restrictpubek-status +category_id: tpm +_summary: Collect the output of tpm_restrictpubek --status --well-known +_description: + This simply collects the output of "tpm_restrictpubek --status --well-known" + for inspection by a Certification engineer. +plugin: shell +requires: snap.name == 'tpm' +command: tpm.restrictpubek --status --well-known +estimated_duration: 1s +flags: preserve-locale preserve-cwd + +unit: job +id: query/tpm_restrictsrk-status +category_id: tpm +_summary: Collect the output of tpm_restrictsrk --status --well-known +_description: + This simply collects the output of "tpm_restrictsrk --status --well-known" + for inspection by a Certification engineer. +plugin: shell +requires: snap.name == 'tpm' +command: tpm.restrictsrk --status --well-known +estimated_duration: 1s +flags: preserve-locale preserve-cwd + +unit: job +id: query/tpm_setclearable-status +category_id: tpm +_summary: Collect the output of tpm_setclearable--status --well-known +_description: + This simply collects the output of "tpm_setclearable --status --well-known" + for inspection by a Certification engineer. +plugin: shell +requires: snap.name == 'tpm' +command: tpm.setclearable --status --well-known +estimated_duration: 1s +flags: preserve-locale preserve-cwd + +unit: job +id: query/tpm_setenable-status +category_id: tpm +_summary: Collect the output of tpm_setenable --status --well-known +_description: + This simply collects the output of "tpm_setenable --status --well-known" + for inspection by a Certification engineer. +plugin: shell +requires: snap.name == 'tpm' +command: tpm.setenable --status --well-known +estimated_duration: 1s +flags: preserve-locale preserve-cwd + +unit: job +id: query/tpm_setownable-status +category_id: tpm +_summary: Collect the output of tpm_setownable --status --well-known +_description: + This simply collects the output of "tpm_setownable --status --well-known" + for inspection by a Certification engineer. +plugin: shell +requires: snap.name == 'tpm' +command: tpm.setownable --status --well-known +estimated_duration: 1s +flags: preserve-locale preserve-cwd + +unit: job +id: query/tpm_setpresence -status +category_id: tpm +_summary: Collect the output of tpm_setpresence --status --well-known +_description: + This simply collects the output of "tpm_setpresence --status --well-known" + for inspection by a Certification engineer. +plugin: shell +requires: snap.name == 'tpm' +command: tpm.setpresence --status --well-known +estimated_duration: 1s +flags: preserve-locale preserve-cwd + +unit: job +id: query/tpm_getpubek +category_id: tpm +_summary: Collect the output of tpm_getpubek --well-known +_description: + This simply collects the output of "tpm_getpubek --well-known" + for inspection by a Certification engineer. +plugin: shell +requires: snap.name == 'tpm' +command: tpm.getpubek --well-known +estimated_duration: 1s +flags: preserve-locale preserve-cwd diff --git a/units/usb/test-plan.pxu b/units/usb/test-plan.pxu index e6a9165..f177798 100644 --- a/units/usb/test-plan.pxu +++ b/units/usb/test-plan.pxu @@ -197,3 +197,136 @@ _name: After suspend automated USB 3 write/read/compare tests on storage devices _description: After suspend automated USB 3 write/read/compare tests on storage devices include: after-suspend-usb3/storage-preinserted + +id: usb-full +unit: test plan +_name: USB tests +_description: QA USB tests for Snappy Ubuntu Core devices +include: +nested_part: + usb-manual + +id: usb-manual +unit: test plan +_name: Manual USB tests +_description: Manual USB tests for Snappy Ubuntu Core devices +include: + usb/hid + usb/insert + usb/storage-automated # depends on manual one, so not automated + usb/remove + +id: usb-automated +unit: test plan +_name: Automated USB tests +_description: Automated USB tests for Snappy Ubuntu Core devices +include: + usb/storage-preinserted-.* +bootstrap_include: + removable_partition + +id: usb3-full +unit: test plan +_name: USB3 tests +_description: QA USB3 tests for Snappy Ubuntu Core devices +include: +nested_part: + usb3-manual + +id: usb3-manual +unit: test plan +_name: Manual USB3 tests +_description: Manual USB3 tests for Snappy Ubuntu Core devices +include: + usb3/insert + usb3/storage-automated # depends on manual one, so not automated + usb3/remove + +id: usb-c-full +unit: test plan +_name: USB-C tests +_description: QA USB-C tests for Snappy Ubuntu Core devices +include: +nested_part: + usb-c-manual + +id: usb-c-manual +unit: test plan +_name: Manual USB-C tests +_description: Manual USB-C tests for Snappy Ubuntu Core devices +include: + usb-c/c-to-a-adapter/hid + usb-c/c-to-a-adapter/insert + usb-c/c-to-a-adapter/storage-automated + usb-c/c-to-a-adapter/remove + usb-c/hid + usb-c/insert + usb-c/storage-automated + usb-c/remove + +id: after-suspend-usb-full +unit: test plan +_name: USB tests (after suspend) +_description: QA USB tests for Snappy Ubuntu Core devices +include: +nested_part: + after-suspend-usb-manual + +id: after-suspend-usb-manual +unit: test plan +_name: Manual USB tests (after suspend) +_description: Manual USB tests for Snappy Ubuntu Core devices +include: + after-suspend-usb/hid + after-suspend-usb/insert + after-suspend-usb/storage-automated # depends on manual one, so not automated + after-suspend-usb/remove + +id: after-suspend-usb3-full +unit: test plan +_name: USB3 tests (after suspend) +_description: QA USB3 tests for Snappy Ubuntu Core devices +include: +nested_part: + after-suspend-usb3-manual + +id: after-suspend-usb3-manual +unit: test plan +_name: Manual USB3 tests (after suspend) +_description: Manual USB3 tests for Snappy Ubuntu Core devices +include: + after-suspend-usb3/insert + after-suspend-usb3/storage-automated # depends on manual one, so not automated + after-suspend-usb3/remove + +id: after-suspend-usb-c-full +unit: test plan +_name: USB-C tests (after suspend) +_description: QA USB-C tests for Snappy Ubuntu Core devices +include: +nested_part: + after-suspend-usb-c-manual + +id: after-suspend-usb-c-manual +unit: test plan +_name: Manual USB-C tests (after suspend) +_description: Manual USB-C tests for Snappy Ubuntu Core devices +include: + after-suspend-usb-c/c-to-a-adapter/hid + after-suspend-usb-c/c-to-a-adapter/insert + after-suspend-usb-c/c-to-a-adapter/storage-automated + after-suspend-usb-c/c-to-a-adapter/remove + after-suspend-usb-c/hid + after-suspend-usb-c/insert + after-suspend-usb-c/storage-automated + after-suspend-usb-c/remove + +id: after-suspend-usb-automated +unit: test plan +_name: Automated USB tests +_description: Automated USB tests for Snappy Ubuntu Core devices +include: + after-suspend-usb/storage-preinserted-.* +bootstrap_include: + removable_partition + diff --git a/units/usb/usb.pxu b/units/usb/usb.pxu index 75cf3c9..670f649 100644 --- a/units/usb/usb.pxu +++ b/units/usb/usb.pxu @@ -290,3 +290,35 @@ 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. + +unit: template +template-resource: removable_partition +template-filter: "usb" in removable_partition.bus +template-unit: job +plugin: shell +category_id: com.canonical.plainbox::usb +id: usb/storage-preinserted-{symlink_uuid} +user: root +estimated_duration: 45.0 +flags: also-after-suspend reset-locale +command: USB_RWTEST_PARTITIONS={symlink_uuid} checkbox-support-usb_read_write +_summary: + Test USB storage on 2.0 or 1.1 ports detected by udev ({symlink_uuid}) +_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. + +id: usb/hid +_summary: USB keyboard works +_purpose: + Check USB input device works +_steps: + 1. Connect USB keyboard + 2. Input somethings with USB keyboard +_verification: + What just input is displayed correctly +plugin: manual +flags: also-after-suspend +category_id: com.canonical.plainbox::usb +estimated_duration: 60 diff --git a/units/watchdog/jobs.pxu b/units/watchdog/jobs.pxu new file mode 100644 index 0000000..2b5b236 --- /dev/null +++ b/units/watchdog/jobs.pxu @@ -0,0 +1,67 @@ +id: watchdog/systemd-config +_summary: Check if the hardware watchdog is properly configured +template-engine: jinja2 +command: + inbuilt=$(systemctl show -p RuntimeWatchdogUSec | awk -F= '{print $2}') + external=$(systemctl is-active watchdog.service) + {%- if __on_ubuntucore__ %} + if [ "$inbuilt" == "0" ]; then + echo "systemd watchdog should be enabled but reset timeout: $inbuilt" + exit 1 + fi + if [ "$external" == "active" ]; then + echo "found unexpected active watchdog.service unit" + exit 1 + fi + echo "systemd watchdog enabled, reset timeout: $inbuilt" + echo "watchdog.service is not active" + {%- else %} + if [ "$inbuilt" != "0" ]; then + echo "systemd watchdog should not be enabled but reset timeout: $inbuilt" + exit 1 + fi + if [ "$external" != "active" ]; then + echo "watchdog.service unit does not report as active" + exit 1 + fi + echo "systemd watchdog disabled" + echo "watchdog.service active" + {% endif -%} +category_id: com.canonical.plainbox::power-management +flags: simple + +id: watchdog/trigger-system-reset +depends: watchdog/systemd-config +_summary: Test that the watchdog module can trigger a system reset +_purpose: + The watchdog module should be capable of issuing a hard reset of the SUT. +_steps: + 1. Commence the test to trigger a SysRq. + 2. Once the watchdog timeout has expired (10s) the SUT should reset itself. + 3. The board will reboot and the user should resume the test session. +_verification: + Did the board reset itself? +command: + echo 1 > /proc/sys/kernel/sysrq + echo 0 > /proc/sys/kernel/panic + echo c > /proc/sysrq-trigger +flags: noreturn preserve-locale +user: root +plugin: user-interact-verify +category_id: com.canonical.plainbox::power-management +estimated_duration: 60 + +id: watchdog/trigger-system-reset-auto +depends: watchdog/systemd-config +_summary: Test that the watchdog module can trigger a system reset +command: + sync + sleep 5 + echo 1 > /proc/sys/kernel/sysrq + echo 0 > /proc/sys/kernel/panic + echo c > /proc/sysrq-trigger +flags: preserve-locale noreturn autorestart +user: root +plugin: shell +category_id: com.canonical.plainbox::power-management +estimated_duration: 60 diff --git a/units/watchdog/test-plan.pxu b/units/watchdog/test-plan.pxu new file mode 100644 index 0000000..407a273 --- /dev/null +++ b/units/watchdog/test-plan.pxu @@ -0,0 +1,27 @@ +id: watchdog-full +unit: test plan +_name: Watchdog tests +_description: + QA test plan that includes watchdog tests +estimated_duration: 1m +include: +nested_part: + watchdog-manual + +id: watchdog-manual +unit: test plan +_name: Manual watchdog tests +_description: Manual watchdog tests for Snappy Ubuntu Core devices +include: + watchdog/systemd-config + watchdog/trigger-system-reset + +id: watchdog-automated +unit: test plan +_name: Automated watchdog tests +_description: + QA test plan that includes automated watchdog tests +estimated_duration: 1s +include: + watchdog/systemd-config + watchdog/trigger-system-reset-auto diff --git a/units/wireless/category.pxu b/units/wireless/category.pxu new file mode 100644 index 0000000..c967414 --- /dev/null +++ b/units/wireless/category.pxu @@ -0,0 +1,3 @@ +unit: category +id: wifi_ap +_name: Wi-Fi access point diff --git a/units/wireless/jobs.pxu b/units/wireless/jobs.pxu index a997285..7165827 100644 --- a/units/wireless/jobs.pxu +++ b/units/wireless/jobs.pxu @@ -166,6 +166,52 @@ requires: {% endif -%} # net_if_management.device == '{{ interface }}' and net_if_management.managed_by == 'NetworkManager' +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' and device.interface != 'UNKNOWN' +template-engine: jinja2 +template-unit: job +id: wireless/wireless_connection_wpa_ax_nm_{{ interface }} +_summary: Connect to WPA-encrypted 802.11ax Wi-Fi network on {{ interface }} +_purpose: + Check system can connect to 802.11ax AP with wpa security +plugin: shell +command: + net_driver_info $NET_DRIVER_INFO + wifi_nmcli_test.py secured {{ interface }} "$WPA_AX_SSID" "$WPA_AX_PSK" +category_id: com.canonical.plainbox::wireless +estimated_duration: 30.0 +flags: preserve-locale also-after-suspend also-after-suspend-manual +requires: + wireless_sta_protocol.{{ interface }}_ax == 'supported' + {%- if __on_ubuntucore__ %} + connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager' + {% endif -%} +# net_if_management.device == '{{ interface }}' and net_if_management.managed_by == 'NetworkManager' + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' and device.interface != 'UNKNOWN' +template-engine: jinja2 +template-unit: job +id: wireless/wireless_connection_open_ax_nm_{{ interface }} +_summary: Connect to unencrypted 802.11ax Wi-Fi network on {{ interface }} +_purpose: + Check system can connect to insecure 802.11ax AP +plugin: shell +command: + net_driver_info $NET_DRIVER_INFO + wifi_nmcli_test.py open {{ interface }} "$OPEN_AX_SSID" +category_id: com.canonical.plainbox::wireless +estimated_duration: 30.0 +flags: preserve-locale also-after-suspend also-after-suspend-manual +requires: + wireless_sta_protocol.{{ interface }}_ax == 'supported' + {%- if __on_ubuntucore__ %} + connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager' + {% endif -%} +# net_if_management.device == '{{ interface }}' and net_if_management.managed_by == 'NetworkManager' + plugin: user-interact-verify category_id: com.canonical.plainbox::wireless id: wireless/wireless_connection_wpa_bg_manual diff --git a/units/wireless/test-plan.pxu b/units/wireless/test-plan.pxu index 8b4aafe..f6d6fb3 100644 --- a/units/wireless/test-plan.pxu +++ b/units/wireless/test-plan.pxu @@ -41,6 +41,8 @@ include: wireless/wireless_connection_open_n_nm_.* certification-status=blocker wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker wireless/wireless_connection_open_ac_nm_.* certification-status=blocker + wireless/wireless_connection_wpa_ax_nm_.* certification-status=blocker + wireless/wireless_connection_open_ax_nm_.* certification-status=blocker wireless/nm_connection_restore_.* id: after-suspend-wireless-cert-automated @@ -57,6 +59,8 @@ include: after-suspend-wireless/wireless_connection_open_n_nm_.* certification-status=blocker after-suspend-wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker after-suspend-wireless/wireless_connection_open_ac_nm_.* certification-status=blocker + after-suspend-wireless/wireless_connection_wpa_ax_nm_.* certification-status=blocker + after-suspend-wireless/wireless_connection_open_ax_nm_.* certification-status=blocker after-suspend-wireless/nm_connection_restore_.* id: after-suspend-manual-wireless-cert-automated @@ -73,6 +77,8 @@ include: after-suspend-manual-wireless/wireless_connection_open_n_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_open_ac_nm_.* certification-status=blocker + after-suspend-manual-wireless/wireless_connection_wpa_ax_nm_.* certification-status=blocker + after-suspend-manual-wireless/wireless_connection_open_ax_nm_.* certification-status=blocker after-suspend-manual-wireless/nm_connection_restore_.* id: wireless-cert-blockers @@ -90,6 +96,8 @@ include: wireless/wireless_connection_open_n_nm_.* certification-status=blocker wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker wireless/wireless_connection_open_ac_nm_.* certification-status=blocker + wireless/wireless_connection_wpa_ax_nm_.* certification-status=blocker + wireless/wireless_connection_open_ax_nm_.* certification-status=blocker wireless/nm_connection_restore_.* id: after-suspend-wireless-cert-blockers @@ -107,4 +115,291 @@ include: after-suspend-manual-wireless/wireless_connection_open_n_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_wpa_ac_nm_.* certification-status=blocker after-suspend-manual-wireless/wireless_connection_open_ac_nm_.* certification-status=blocker + after-suspend-manual-wireless/wireless_connection_wpa_ax_nm_.* certification-status=blocker + after-suspend-manual-wireless/wireless_connection_open_ax_nm_.* certification-status=blocker after-suspend-manual-wireless/nm_connection_restore_.* + +id: wireless-full +unit: test plan +_name: Wireless tests +_description: QA tests for wireless connections +estimated_duration: 30m +include: +nested_part: + wireless-manual + wireless-automated + +id: wireless-manual +unit: test plan +_name: Manual tests for wireless +_description: Manual tests wireless +include: + # following matchers may also include some automated jobs, this could be + # fixed with some regex magic, but the lesser evil seems to be just to + # include them as well; XXX: the test plan is not really manual-only + wireless/wireless_connection_open_ax_.* + wireless/wireless_connection_open_ac_.* + wireless/wireless_connection_open_bg_.* + wireless/wireless_connection_open_n_.* + wireless/wireless_connection_wpa_ax_.* + wireless/wireless_connection_wpa_ac_.* + wireless/wireless_connection_wpa_bg_.* + wireless/wireless_connection_wpa_n_.* + +id: wireless-automated +unit: test plan +_name: Automated tests for wireless +_description: + Automated connection tests for unencrypted or WPA-encrypted 802.11 bg, n, ac, ax + networks. +include: + wireless/detect + wireless/wireless_scanning_.* + wireless/wireless_connection_open_ax_nm_.* + wireless/wireless_connection_open_ac_nm_.* + wireless/wireless_connection_open_bg_nm_.* + wireless/wireless_connection_open_n_nm_.* + wireless/wireless_connection_wpa_ax_nm_.* + wireless/wireless_connection_wpa_ac_nm_.* + wireless/wireless_connection_wpa_bg_nm_.* + wireless/wireless_connection_wpa_n_nm_.* + # wireless/wireless_connection_open_ax_np_.* + # wireless/wireless_connection_open_ac_np_.* + # wireless/wireless_connection_open_bg_np_.* + # wireless/wireless_connection_open_n_np_.* + # wireless/wireless_connection_wpa_ax_np_.* + # wireless/wireless_connection_wpa_ac_np_.* + # wireless/wireless_connection_wpa_bg_np_.* + # wireless/wireless_connection_wpa_n_np_.* +bootstrap_include: + device + +id: wireless-netplan-automated +unit: test plan +_name: Automated tests for wireless using netplan +_description: + Automated connection tests for unencrypted or WPA-encrypted 802.11 bg, n, ac, ax + networks using netplan. +include: + wireless/detect + # wireless/wireless_scanning_.* + # wireless/wireless_connection_open_ax_nm_.* + # wireless/wireless_connection_open_ac_nm_.* + # wireless/wireless_connection_open_bg_nm_.* + # wireless/wireless_connection_open_n_nm_.* + # wireless/wireless_connection_wpa_ax_nm_.* + # wireless/wireless_connection_wpa_ac_nm_.* + # wireless/wireless_connection_wpa_bg_nm_.* + # wireless/wireless_connection_wpa_n_nm_.* + wireless/wireless_connection_open_ax_np_.* + wireless/wireless_connection_open_ac_np_.* + wireless/wireless_connection_open_bg_np_.* + wireless/wireless_connection_open_n_np_.* + wireless/wireless_connection_wpa_ax_np_.* + wireless/wireless_connection_wpa_ac_np_.* + wireless/wireless_connection_wpa_bg_np_.* + wireless/wireless_connection_wpa_n_np_.* +bootstrap_include: + device + + +# not suffixing with "-full" for backwards compatibility +id: wireless-wifi-master-mode +unit: test plan +_name: QA tests for wifi master mode +_description: + System as Access Point tests +include: + wireless/wifi_ap_.* +exclude: + wireless/wifi_ap_across_reboot_.*_setup + wireless/wifi_ap_across_reboot_.*_check +bootstrap_include: + device + wifi_interface_mode + +id: wireless-wifi-master-mode-manual +unit: test plan +_name: QA tests for wifi master mode +_description: + System as Access Point tests +include: + wireless/wifi_ap_open_b_no_sta_.*_manual + wireless/wifi_ap_open_g_no_sta_.*_manual + wireless/wifi_ap_wpa_b_no_sta_.*_manual + wireless/wifi_ap_wpa_g_no_sta_.*_manual + wireless/wifi_ap_wpa_b_with_sta_.*_manual + wireless/wifi_ap_wpa_g_with_sta_.*_manual +bootstrap_include: + device + wifi_interface_mode + +id: wireless-wifi-master-mode-auto +unit: test plan +_name: Automated tests for wifi master mode +_description: + Automated tests for using System as Access Point +include: + wireless/wifi_ap_open_b_no_sta_.*_auto + wireless/wifi_ap_open_g_no_sta_.*_auto + wireless/wifi_ap_wpa_b_no_sta_.*_auto + wireless/wifi_ap_wpa_g_no_sta_.*_auto + wireless/wifi_ap_wpa_b_with_sta_.*_auto + wireless/wifi_ap_wpa_g_with_sta_.*_auto + wireless/wifi_ap_setup_wizard_.*_auto +bootstrap_include: + device + wifi_interface_mode + +# not suffixing with "-full" for backwards compatibility +id: after-suspend-wireless-wifi-master-mode +unit: test plan +_name: QA tests for wifi master mode (after suspend) +_description: + System as Access Point tests +include: + after-suspend-wireless/wifi_ap_.* +bootstrap_include: + device + +id: after-suspend-wireless-wifi-master-mode-manual +unit: test plan +_name: QA tests for wifi master mode (after suspend) +_description: + System as Access Point tests +include: + after-suspend-wireless/wifi_ap_open_b_no_sta_.*_manual + after-suspend-wireless/wifi_ap_open_g_no_sta_.*_manual + after-suspend-wireless/wifi_ap_wpa_b_no_sta_.*_manual + after-suspend-wireless/wifi_ap_wpa_g_no_sta_.*_manual + after-suspend-wireless/wifi_ap_wpa_b_with_sta_.*_manual + after-suspend-wireless/wifi_ap_wpa_g_with_sta_.*_manual +bootstrap_include: + device + wifi_interface_mode + +id: after-suspend-wireless-wifi-master-mode-auto +unit: test plan +_name: QA tests for wifi master mode (after suspend) +_description: + System as Access Point tests +include: + after-suspend-wireless/wifi_ap_open_b_no_sta_.*_auto + after-suspend-wireless/wifi_ap_open_g_no_sta_.*_auto + after-suspend-wireless/wifi_ap_wpa_b_no_sta_.*_auto + after-suspend-wireless/wifi_ap_wpa_g_no_sta_.*_auto + after-suspend-wireless/wifi_ap_wpa_b_with_sta_.*_auto + after-suspend-wireless/wifi_ap_wpa_g_with_sta_.*_auto + after-suspend-wireless/wifi_ap_setup_wizard_.*_auto +bootstrap_include: + device + wifi_interface_mode + +id: wireless-wowlan-full +unit: test plan +_name: QA tests for WoWLAN +_description: + Wake on Wireless LAN (WoWLAN) tests +include: +nested_part: + wireless-wowlan-manual + wireless-wowlan-automated + +id: wireless-wowlan-manual +unit: test plan +_name: Manual QA tests for WoWLAN +_description: + Manual Wake on Wireless LAN (WoWLAN) tests +include: + wireless/wowlan_.* +bootstrap_include: + device + +id: wireless-wowlan-automated +unit: test plan +_name: Automated QA tests for WoWLAN +_description: + Automated Wake on Wireless LAN (WoWLAN) tests +include: + +id: after-suspend-wireless-full +unit: test plan +_name: Wireless tests (after suspend) +_description: QA tests for wireless connections +estimated_duration: 30m +include: +nested_part: + after-suspend-wireless-manual + after-suspend-wireless-automated + +id: after-suspend-wireless-manual +unit: test plan +_name: Manual tests for wireless (after suspend) +_description: Manual tests wireless +include: + # following matchers may also include some automated jobs, this could be + # fixed with some regex magic, but the lesser evil seems to be just to + # include them as well; XXX: the test plan is not really manual-only + after-suspend-wireless/wireless_connection_open_ax_.* + after-suspend-wireless/wireless_connection_open_ac_.* + after-suspend-wireless/wireless_connection_open_bg_.* + after-suspend-wireless/wireless_connection_open_n_.* + after-suspend-wireless/wireless_connection_wpa_ax_.* + after-suspend-wireless/wireless_connection_wpa_ac_.* + after-suspend-wireless/wireless_connection_wpa_bg_.* + after-suspend-wireless/wireless_connection_wpa_n_.* + after-suspend-wireless/wifi_ap_.* + +id: after-suspend-wireless-automated +unit: test plan +_name: Automated tests for wireless (after suspend) +_description: + Automated connection tests for unencrypted or WPA-encrypted 802.11 bg, n, ac, ax + networks. +include: + after-suspend-wireless/wireless_scanning_.* + after-suspend-wireless/wireless_connection_open_ax_nm_.* + after-suspend-wireless/wireless_connection_open_ac_nm_.* + after-suspend-wireless/wireless_connection_open_bg_nm_.* + after-suspend-wireless/wireless_connection_open_n_nm_.* + after-suspend-wireless/wireless_connection_wpa_ax_nm_.* + after-suspend-wireless/wireless_connection_wpa_ac_nm_.* + after-suspend-wireless/wireless_connection_wpa_bg_nm_.* + after-suspend-wireless/wireless_connection_wpa_n_nm_.* + # after-suspend-wireless/wireless_connection_open_ax_np_.* + # after-suspend-wireless/wireless_connection_open_ac_np_.* + # after-suspend-wireless/wireless_connection_open_bg_np_.* + # after-suspend-wireless/wireless_connection_open_n_np_.* + # after-suspend-wireless/wireless_connection_wpa_ax_np_.* + # after-suspend-wireless/wireless_connection_wpa_ac_np_.* + # after-suspend-wireless/wireless_connection_wpa_bg_np_.* + # after-suspend-wireless/wireless_connection_wpa_n_np_.* +bootstrap_include: + device + +id: after-suspend-wireless-netplan-automated +unit: test plan +_name: Automated tests for wireless using netplan (after suspend) +_description: + Automated connection tests for unencrypted or WPA-encrypted 802.11 bg, n, ac, ax + networks using netplan. +include: + # after-suspend-wireless/wireless_scanning_.* + # after-suspend-wireless/wireless_connection_open_ax_nm_.* + # after-suspend-wireless/wireless_connection_open_ac_nm_.* + # after-suspend-wireless/wireless_connection_open_bg_nm_.* + # after-suspend-wireless/wireless_connection_open_n_nm_.* + # after-suspend-wireless/wireless_connection_wpa_ax_nm_.* + # after-suspend-wireless/wireless_connection_wpa_ac_nm_.* + # after-suspend-wireless/wireless_connection_wpa_bg_nm_.* + # after-suspend-wireless/wireless_connection_wpa_n_nm_.* + after-suspend-wireless/wireless_connection_open_ax_np_.* + after-suspend-wireless/wireless_connection_open_ac_np_.* + after-suspend-wireless/wireless_connection_open_bg_np_.* + after-suspend-wireless/wireless_connection_open_n_np_.* + after-suspend-wireless/wireless_connection_wpa_ax_np_.* + after-suspend-wireless/wireless_connection_wpa_ac_np_.* + after-suspend-wireless/wireless_connection_wpa_bg_np_.* + after-suspend-wireless/wireless_connection_wpa_n_np_.* +bootstrap_include: + device diff --git a/units/wireless/wifi-ap.pxu b/units/wireless/wifi-ap.pxu new file mode 100644 index 0000000..df25b50 --- /dev/null +++ b/units/wireless/wifi-ap.pxu @@ -0,0 +1,1081 @@ +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_open_a_no_sta_{interface}_manual +category_id: wifi_ap +_summary: Create open 802.11a Wi-Fi AP on {interface} with no STA (Manual) +plugin: manual +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +_purpose: + Check that the system can create an open 802.11a Access Point without any STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=a + $ sudo wifi-ap.config set wifi.interface-mode=direct + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=open + 3. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 4. Attempt to connect to the AP +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_open_a_no_sta_{interface}_auto +category_id: wifi_ap +_summary: Create open 802.11a Wi-Fi AP on {interface} with no STA +plugin: shell +_description: + Check that the system can create an open 802.11a Access Point without any STA + connection on {interface} by configuring the system using wifi-ap snap and + then checking status of the interface using `iw` command. +user: root +command: + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=a + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=open + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_a_open + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_a_open)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_open_b_no_sta_{interface}_manual +category_id: wifi_ap +_summary: Create open 802.11b Wi-Fi AP on {interface} with no STA (Manual) +plugin: manual +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +_purpose: + Check that the system can create an open 802.11b Access Point without any STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=b + $ sudo wifi-ap.config set wifi.interface-mode=direct + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=open + 3. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 4. Attempt to connect to the AP +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_open_b_no_sta_{interface}_auto +category_id: wifi_ap +_summary: Create open 802.11b Wi-Fi AP on {interface} with no STA +plugin: shell +_description: + Check that the system can create an open 802.11b Access Point without any STA + connection on {interface} by configuring the system using wifi-ap snap and + then checking status of the interface using `iw` command. +user: root +command: + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=b + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=open + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_b_open + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_b_open)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_open_g_no_sta_{interface}_manual +category_id: wifi_ap +_summary: Create open 802.11g Wi-Fi AP on {interface} with no STA (Manual) +plugin: manual +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +_purpose: + Check that the system can create an open 802.11g Access Point without any STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=g + $ sudo wifi-ap.config set wifi.interface-mode=direct + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=open + 3. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 4. Attempt to connect to the AP +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_open_g_no_sta_{interface}_auto +category_id: wifi_ap +_summary: Create open 802.11g Wi-Fi AP on {interface} with no STA +plugin: shell +_description: + Check that the system can create an open 802.11g Access Point without any STA + connection on {interface} by configuring the system using wifi-ap snap and + then checking status of the interface using `iw` command. +user: root +command: + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=g + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=open + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_g_open + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_open)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_open_ad_no_sta_{interface}_manual +category_id: wifi_ap +_summary: Create open 802.11ad Wi-Fi AP on {interface} with no STA (Manual) +plugin: manual +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +_purpose: + Check that the system can create an open 802.11ad Access Point without any STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=ad + $ sudo wifi-ap.config set wifi.interface-mode=direct + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=open + 3. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 4. Attempt to connect to the AP +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_open_ad_no_sta_{interface}_auto +category_id: wifi_ap +_summary: Create open 802.11ad Wi-Fi AP on {interface} with no STA +plugin: shell +_description: + Check that the system can create an open 802.11ad Access Point without any STA + connection on {interface} by configuring the system using wifi-ap snap and + then checking status of the interface using `iw` command. +user: root +command: + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=ad + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=open + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_ad_open + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_ad_open)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_a_no_sta_{interface}_manual +category_id: wifi_ap +_summary: Create WPA2 802.11a Wi-Fi AP on {interface} with no STA (Manual) +plugin: manual +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +_purpose: + Check that the system can create a WPA2 802.11a Access Point without any STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=a + $ sudo wifi-ap.config set wifi.interface-mode=direct + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=wpa2 + $ sudo wifi-ap.config set wifi.security-passphrase=Test1234 + 3. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 4. Attempt to connect to the AP using password "Test1234" +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_a_no_sta_{interface}_auto +category_id: wifi_ap +_summary: Create WPA2 802.11a Wi-Fi AP on {interface} with no STA +plugin: shell +_description: + Check that the system can create an open 802.11a Access Point without any STA + connection on {interface} by configuring the system using wifi-ap snap and + then checking status of the interface using `iw` command. +user: root +command: + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=a + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=wpa2 + wifi-ap.config set wifi.security-passphrase=Test1234 + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_a_wpa2 + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_a_wpa2)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_b_no_sta_{interface}_manual +category_id: wifi_ap +_summary: Create WPA2 802.11b Wi-Fi AP on {interface} with no STA (Manual) +plugin: manual +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +_purpose: + Check that the system can create a WPA2 802.11b Access Point without any STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=b + $ sudo wifi-ap.config set wifi.interface-mode=direct + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=wpa2 + $ sudo wifi-ap.config set wifi.security-passphrase=Test1234 + 3. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 4. Attempt to connect to the AP using password "Test1234" +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_b_no_sta_{interface}_auto +category_id: wifi_ap +_summary: Create WPA2 802.11b Wi-Fi AP on {interface} with no STA +plugin: shell +_description: + Check that the system can create an open 802.11b Access Point without any STA + connection on {interface} by configuring the system using wifi-ap snap and + then checking status of the interface using `iw` command. +user: root +command: + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=b + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=wpa2 + wifi-ap.config set wifi.security-passphrase=Test1234 + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_b_wpa2 + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_b_wpa2)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_g_no_sta_{interface}_manual +category_id: wifi_ap +_summary: Create WPA2 802.11g Wi-Fi AP on {interface} with no STA (Manual) +plugin: manual +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +_purpose: + Check that the system can create a WPA2 802.11g Access Point without any STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=g + $ sudo wifi-ap.config set wifi.interface-mode=direct + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=wpa2 + $ sudo wifi-ap.config set wifi.security-passphrase=Test1234 + 3. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 4. Attempt to connect to the AP using password "Test1234" +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_g_no_sta_{interface}_auto +category_id: wifi_ap +_summary: Create WPA2 802.11g Wi-Fi AP on {interface} with no STA +plugin: shell +_description: + Check that the system can create an open 802.11g Access Point without any STA + connection on {interface} by configuring the system using wifi-ap snap and + then checking status of the interface using `iw` command. +user: root +command: + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=g + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=wpa2 + wifi-ap.config set wifi.security-passphrase=Test1234 + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_g_wpa2 + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_ad_no_sta_{interface}_manual +category_id: wifi_ap +_summary: Create WPA2 802.11ad Wi-Fi AP on {interface} with no STA (Manual) +plugin: manual +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +_purpose: + Check that the system can create a WPA2 802.11ad Access Point without any STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=ad + $ sudo wifi-ap.config set wifi.interface-mode=direct + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=wpa2 + $ sudo wifi-ap.config set wifi.security-passphrase=Test1234 + 3. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 4. Attempt to connect to the AP using password "Test1234" +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_ad_no_sta_{interface}_auto +category_id: wifi_ap +_summary: Create WPA2 802.11ad Wi-Fi AP on {interface} with no STA +plugin: shell +_description: + Check that the system can create an open 802.11ad Access Point without any STA + connection on {interface} by configuring the system using wifi-ap snap and + then checking status of the interface using `iw` command. +user: root +command: + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=ad + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=wpa2 + wifi-ap.config set wifi.security-passphrase=Test1234 + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_ad_wpa2 + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_ad_wpa2)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_a_with_sta_{interface} +category_id: wifi_ap +_summary: Create WPA2 802.11a Wi-Fi AP on {interface} with active STA (Manual) +plugin: user-interact-verify +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +depends: wireless/wireless_connection_open_bg_nm_{interface} +estimated_duration: 120.0 +environ: LD_LIBRARY_PATH OPEN_BG_SSID +command: + nmcli dev wifi rescan + nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX +user: root +_purpose: + Check that the system can create a WPA2 802.11a Access Point with an already active STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Connect to an 802.11b/g AP with wpa security: + Press Enter to continue + 3. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=a + $ sudo wifi-ap.config set wifi.interface-mode=virtual + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=wpa2 + $ sudo wifi-ap.config set wifi.security-passphrase=Test1234 + $ sudo wifi-ap.config set wifi.channel=$(iw dev {interface} info | grep -oP 'channel\s+\K\d+') + 4. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 5. Attempt to connect to the AP using password "Test1234" +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_a_with_sta_{interface}_auto +category_id: wifi_ap +_summary: Create WPA2 802.11a Wi-Fi Access Point on {interface} with active STA +plugin: shell +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +depends: wireless/wireless_connection_open_bg_nm_{interface} +estimated_duration: 120.0 +environ: LD_LIBRARY_PATH OPEN_BG_SSID WIFI_AP_SETUPTIME +command: + echo "Scanning for existing networks" + nmcli dev wifi rescan + echo "Connecting to existing network" + nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT + if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then + echo "FAILED to connect to STA before setting up AP" + exit 1 + fi + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=a + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=wpa2 + wifi-ap.config set wifi.security-passphrase=Test1234 + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_a_wpa2 + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_a_wpa2)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +user: root +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_b_with_sta_{interface} +category_id: wifi_ap +_summary: Create WPA2 802.11b Wi-Fi AP on {interface} with active STA (Manual) +plugin: user-interact-verify +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +depends: wireless/wireless_connection_open_bg_nm_{interface} +estimated_duration: 120.0 +environ: LD_LIBRARY_PATH $OPEN_BG_SSID +command: + nmcli dev wifi rescan + nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX +user: root +_purpose: + Check that the system can create a WPA2 802.11b Access Point with an already active STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Connect to an 802.11b/g AP with wpa security: + Press Enter to continue + 3. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=b + $ sudo wifi-ap.config set wifi.interface-mode=virtual + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=wpa2 + $ sudo wifi-ap.config set wifi.security-passphrase=Test1234 + $ sudo wifi-ap.config set wifi.channel=$(iw dev {interface} info | grep -oP 'channel\s+\K\d+') + 4. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 5. Attempt to connect to the AP using password "Test1234" +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_b_with_sta_{interface}_auto +category_id: wifi_ap +_summary: Create WPA2 802.11b Wi-Fi Access Point on {interface} with active STA +plugin: shell +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +depends: wireless/wireless_connection_open_bg_nm_{interface} +estimated_duration: 120.0 +environ: LD_LIBRARY_PATH OPEN_BG_SSID WIFI_AP_SETUPTIME +command: + echo "Scanning for existing networks" + nmcli dev wifi rescan + echo "Connecting to existing network" + nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT + if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then + echo "FAILED to connect to STA before setting up AP" + exit 1 + fi + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=b + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=wpa2 + wifi-ap.config set wifi.security-passphrase=Test1234 + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_b_wpa2 + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_b_wpa2)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +user: root +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_g_with_sta_{interface} +category_id: wifi_ap +_summary: Create WPA2 802.11g Wi-Fi AP on {interface} with active STA (Manual) +plugin: user-interact-verify +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +depends: wireless/wireless_connection_open_bg_nm_{interface} +estimated_duration: 120.0 +environ: LD_LIBRARY_PATH OPEN_BG_SSID +command: + nmcli dev wifi rescan + nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX +user: root +_purpose: + Check that the system can create a WPA2 802.11g Access Point with an already active STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Connect to an 802.11b/g AP with wpa security: + Press Enter to continue + 3. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=g + $ sudo wifi-ap.config set wifi.interface-mode=virtual + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=wpa2 + $ sudo wifi-ap.config set wifi.security-passphrase=Test1234 + $ sudo wifi-ap.config set wifi.channel=$(iw dev {interface} info | grep -oP 'channel\s+\K\d+') + 4. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 5. Attempt to connect to the AP using password "Test1234" +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_g_with_sta_{interface}_auto +category_id: wifi_ap +_summary: Create WPA2 802.11g Wi-Fi Access Point on {interface} with active STA +plugin: shell +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +depends: wireless/wireless_connection_open_bg_nm_{interface} +estimated_duration: 120.0 +environ: LD_LIBRARY_PATH OPEN_BG_SSID WIFI_AP_SETUPTIME +command: + echo "Scanning for existing networks" + nmcli dev wifi rescan + echo "Connecting to existing network" + nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT + if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then + echo "FAILED to connect to STA before setting up AP" + exit 1 + fi + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=g + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=wpa2 + wifi-ap.config set wifi.security-passphrase=Test1234 + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_g_wpa2 + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +user: root +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_ad_with_sta_{interface} +category_id: wifi_ap +_summary: Create WPA2 802.11ad Wi-Fi AP on {interface} with active STA (Manual) +plugin: user-interact-verify +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +depends: wireless/wireless_connection_open_bg_nm_{interface} +estimated_duration: 120.0 +environ: LD_LIBRARY_PATH OPEN_BG_SSID +command: + nmcli dev wifi rescan + nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX +user: root +_purpose: + Check that the system can create a WPA2 802.11ad Access Point with an already active STA connection +_steps: + 1. Delete existing wireless connections known to Network Manager: + $ nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + 2. Connect to an 802.11b/g AP with wpa security: + Press Enter to continue + 3. Configure the wifi-ap snap: + $ sudo wifi-ap.config set wifi.interface={interface} + $ sudo wifi-ap.config set wifi.operation-mode=ad + $ sudo wifi-ap.config set wifi.interface-mode=virtual + $ sudo wifi-ap.config set disabled=false + $ sudo wifi-ap.config set wifi.security=wpa2 + $ sudo wifi-ap.config set wifi.security-passphrase=Test1234 + $ sudo wifi-ap.config set wifi.channel=$(iw dev {interface} info | grep -oP 'channel\s+\K\d+') + 4. Using a suitable Wi-Fi client try to detect the presence of the AP called "Ubuntu" + 5. Attempt to connect to the AP using password "Test1234" +_verification: + Did the client connect? +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_wpa_ad_with_sta_{interface}_auto +category_id: wifi_ap +_summary: Create WPA2 802.11ad Wi-Fi Access Point on {interface} with active STA +plugin: shell +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +depends: wireless/wireless_connection_open_bg_nm_{interface} +estimated_duration: 120.0 +environ: LD_LIBRARY_PATH OPEN_BG_SSID WIFI_AP_SETUPTIME +command: + echo "Scanning for existing networks" + nmcli dev wifi rescan + echo "Connecting to existing network" + nmcli dev wifi connect $OPEN_BG_SSID ifname {interface} name WIFI_TEST_CREATED_BY_CHECKBOX + trap "nmcli dev disconnect {interface}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT + if ! nmcli -m tabular -t -f GENERAL.STATE d show {interface} |grep ^100 ; then + echo "FAILED to connect to STA before setting up AP" + exit 1 + fi + BEGIN_AP_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=ad + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=wpa2 + wifi-ap.config set wifi.security-passphrase=Test1234 + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_ad_wpa2 + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_ad_wpa2)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + echo "==== Service unit logs ====" + journalctl -q -u "*wifi-ap.management-service*" --no-pager --since "$BEGIN_AP_TEST_TS" -o cat + exit 1; + fi +user: root +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_setup_wizard_{interface}_auto +category_id: wifi_ap +_summary: Create Access Point on {interface} using wifi-ap.setup-wizard +plugin: shell +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 20.0 +user: root +command: + echo "Disabling AP" + wifi-ap.config set wifi.operation-mode=g + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.ssid=DISABLED + wifi-ap.config set disabled=true + wifi_ap_wizard.py {interface} eth0 + sleep ${{WIFI_AP_SETUPTIME:-10}} + echo "Running AP setup wizard" + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_Wizard)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then exit 0; else exit 1; fi +_description: + Check that the system can create a WPA2 802.11g Access Point using + wifi-ap.setup-wizard command on {interface}. +environ: WIFI_AP_SETUPTIME +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_across_reboot_{interface}_setup +category_id: wifi_ap +_summary: Create WPA2 802.11g Wi-Fi AP on {interface} and reboot (setup part) +plugin: shell +_description: + Check if the system maintains AP functionality after the reboot. + This job sets the AP. +user: root +command: + echo "Setting up AP" + wifi-ap.config set wifi.interface={interface} + wifi-ap.config set wifi.operation-mode=g + wifi-ap.config set wifi.interface-mode=direct + wifi-ap.config set wifi.security=wpa2 + wifi-ap.config set wifi.security-passphrase=Test1234 + wifi-ap.config set disabled=false + wifi-ap.config set wifi.ssid=Ubuntu_g_wpa2 + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + echo "Rebooting" + reboot +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale noreturn autorestart + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_across_reboot_{interface}_setup_manual +category_id: wifi_ap +_summary: Create WPA2 AP on {interface} and reboot (setup part, manual resume) +plugin: user-interact-verify +_purpose: + Check if the system maintains AP functionality after the reboot. + This job sets the AP. +_steps: + When you start the test, the system will reboot. + After the system goes back up, resume checkbox session and mark this job as + passing. + The next job will check if the Access Point setup survived the reboot. +user: root +command: + unsnap-wifi-ap.sh config set wifi.interface={interface} + unsnap-wifi-ap.sh config set wifi.operation-mode=g + unsnap-wifi-ap.sh config set wifi.interface-mode=direct + unsnap-wifi-ap.sh config set wifi.security=wpa2 + unsnap-wifi-ap.sh config set wifi.security-passphrase=Test1234 + unsnap-wifi-ap.sh config set disabled=0 + unsnap-wifi-ap.sh config set wifi.ssid=Ubuntu_g_wpa2 + sleep ${{WIFI_AP_SETUPTIME:-10}} + reboot +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale noreturn + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_across_reboot_{interface}_check +category_id: wifi_ap +_summary: Create WPA2 802.11g Wi-Fi AP on {interface} and reboot (after reboot part) +plugin: shell +_description: + Check if the system maintains AP functionality after the reboot. + This job checks if AP still works. +user: root +command: + echo "Waiting for AP to become available" + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then + echo "Network detected" + exit 0 + else + echo "FAILED to detect the network" + exit 1; + fi +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +depends: wireless/wifi_ap_across_reboot_{interface}_setup +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wifi_ap_across_reboot_{interface}_check_manual +category_id: wifi_ap +_summary: Create WPA2 AP on {interface} (after reboot part, manual resume) +plugin: shell +_description: + Check if the system maintains AP functionality after the reboot. + This job checks if AP still works. +user: root +command: + sleep ${{WIFI_AP_SETUPTIME:-10}} + RES=`iw {interface} info |grep -E "(type\ AP)|(ssid\ Ubuntu_g_wpa2)" |wc -l` + wifi-ap.config set disabled=true + if [ $RES -eq 2 ]; then exit 0; else exit 1; fi +requires: + wifi_interface_mode.{interface}_AP == 'supported' + snap.name == 'wifi-ap' +depends: wireless/wifi_ap_across_reboot_{interface}_setup_manual +estimated_duration: 120.0 +environ: WIFI_AP_SETUPTIME +flags: preserve-locale diff --git a/units/wireless/wireless-connection-manual.pxu b/units/wireless/wireless-connection-manual.pxu new file mode 100644 index 0000000..9986578 --- /dev/null +++ b/units/wireless/wireless-connection-manual.pxu @@ -0,0 +1,211 @@ +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wireless_connection_open_ax_{interface} +_summary: Connect to unencrypted 802.11ax Wi-Fi network on {interface} +_purpose: + Check system can connect to insecure 802.11ax AP +_steps: + 1. Remove all wireless configuration in /etc/network/interfaces and /etc/network/interfaces.d + 2. Commence the test +_verification: + If there's "Connection test passed" message in result, mark the test as passed. +plugin: user-interact +command: wifi_client_test -i {interface} -s "$OPEN_AX_SSID" +environ: OPEN_AX_SSID +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 90 +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wireless_connection_open_ac_{interface} +_summary: Connect to unencrypted 802.11ac Wi-Fi network on {interface} +_purpose: + Check system can connect to insecure 802.11ac AP +_steps: + 1. Remove all wireless configuration in /etc/network/interfaces and /etc/network/interfaces.d + 2. Commence the test +_verification: + If there's "Connection test passed" message in result, mark the test as passed. +plugin: user-interact +command: wifi_client_test -i {interface} -s "$OPEN_AC_SSID" +environ: OPEN_AC_SSID +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 90 +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wireless_connection_open_bg_{interface} +_summary: Connect to unencrypted 802.11b/g Wi-Fi network on {interface} +_purpose: + Check system can connect to insecure 802.11b/g AP +_steps: + 1. Remove all wireless configuration in /etc/network/interfaces and /etc/network/interfaces.d + 2. Commence the test +_verification: + If there's "Connection test passed" message in result, mark the test as passed. +plugin: user-interact +command: wifi_client_test -i {interface} -s "$OPEN_BG_SSID" +environ: OPEN_BG_SSID +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 90 +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wireless_connection_open_n_{interface} +_summary: Connect to unencrypted 802.11n Wi-Fi network on {interface} +_purpose: + Check system can connect to insecure 802.11n AP +_steps: + 1. Remove all wireless configuration in /etc/network/interfaces and /etc/network/interfaces.d + 2. Commence the test +_verification: + If there's "Connection test passed" message in result, mark the test as passed. +plugin: user-interact +command: wifi_client_test -i {interface} -s "$OPEN_N_SSID" +environ: OPEN_N_SSID +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 90 +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wireless_connection_wpa_ax_{interface} +_summary: Connect to WPA-encrypted 802.11ax Wi-Fi network on {interface} +_purpose: + Check system can connect to 802.11ax AP with wpa security +_steps: + 1. Remove all wireless configuration in /etc/network/interfaces and /etc/network/interfaces.d + 2. Commence the test +_verification: + If there's "Connection test passed" message in result, mark the test as passed. +plugin: user-interact +command: wifi_client_test -i {interface} -s "$WPA_AX_SSID" -k "$WPA_AX_PSK" +environ: WPA_AX_SSID WPA_AX_PSK +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 90 +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wireless_connection_wpa_ac_{interface} +_summary: Connect to WPA-encrypted 802.11ac Wi-Fi network on {interface} +_purpose: + Check system can connect to 802.11ac AP with wpa security +_steps: + 1. Remove all wireless configuration in /etc/network/interfaces and /etc/network/interfaces.d + 2. Commence the test +_verification: + If there's "Connection test passed" message in result, mark the test as passed. +plugin: user-interact +command: wifi_client_test -i {interface} -s "$WPA_AC_SSID" -k "$WPA_AC_PSK" +environ: WPA_AC_SSID WPA_AC_PSK +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 90 +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wireless_connection_wpa_bg_{interface} +_summary: Connect to WPA-encrypted 802.11b/g Wi-Fi network {interface} +_purpose: + Check system can connect to 802.11b/g AP with wpa security +_steps: + 1. Remove all wireless configuration in /etc/network/interfaces and /etc/network/interfaces.d + 2. Commence the test +_verification: + If there's "Connection test passed" message in result, mark the test as passed. +plugin: user-interact +command: wifi_client_test -i {interface} -s "$WPA_BG_SSID" -k "$WPA_BG_PSK" +environ: WPA_BG_SSID WPA_BG_PSK +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 90 +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-unit: job +id: wireless/wireless_connection_wpa_n_{interface} +_summary: Connect to WPA-encrypted 802.11n Wi-Fi network on {interface} +_purpose: + Check system can connect to 802.11n AP with wpa security +_steps: + 1. Remove all wireless configuration in /etc/network/interfaces and /etc/network/interfaces.d + 2. Commence the test +_verification: + If there's "Connection test passed" message in result, mark the test as passed. +plugin: user-interact +command: wifi_client_test -i {interface} -s "$WPA_N_SSID" -k "$WPA_N_PSK" +environ: WPA_N_SSID WPA_N_PSK +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 90 +flags: preserve-locale also-after-suspend + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-engine: jinja2 +template-unit: job +plugin: shell +category_id: com.canonical.plainbox::wireless +id: wireless/monitor_wireless_connection_udp_{{ interface }} +requires: + connections.slot == 'network-manager:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:network-manager' +environ: + WPA_BG_SSID + WPA_BG_PSK + TEST_TARGET_IPERF +command: + nmcli g > /dev/null + if [ $? -ne 0 ]; then + exit 1 + fi + trap "nmcli dev disconnect {{ interface }}; nmcli con delete id WIFI_TEST_CREATED_BY_CHECKBOX" EXIT + nmcli -t -f TYPE,UUID c | grep -oP "(?<=^802-11-wireless:).*" | xargs nmcli c delete + nmcli dev wifi rescan + nmcli dev wifi connect $WPA_BG_SSID password $WPA_BG_PSK ifname {{ interface }} name WIFI_TEST_CREATED_BY_CHECKBOX + iw dev {{ interface }} link + iperf3 -c $TEST_TARGET_IPERF -t 300 -i 30 -u -b 100m -p 5050 + exit $? +estimated_duration: 330.0 +_summary: Wireless connection iperf3 test +_description: + Tests the performance of a system's wireless connection through the iperf3 tool using UDP packets. + +plugin: shell +category_id: com.canonical.plainbox::wireless +id: after-suspend-wifi/wifi_resume_time_auto +estimated_duration: 1.2 +depends: suspend/suspend_advanced_auto +requires: + device.category == 'WIRELESS' +command: network_reconnect_resume_test -t 90 -d wifi +_summary: Network reconnect resume test (wifi) +_description: + Checks the length of time it takes to reconnect an existing wifi connection + after a suspend/resume cycle. diff --git a/units/wireless/wireless-connection-netplan.pxu b/units/wireless/wireless-connection-netplan.pxu index 6811b43..956f83d 100644 --- a/units/wireless/wireless-connection-netplan.pxu +++ b/units/wireless/wireless-connection-netplan.pxu @@ -3,6 +3,30 @@ template-resource: device template-filter: device.category == 'WIRELESS' template-engine: jinja2 template-unit: job +id: wireless/wireless_connection_open_ax_np_{{ interface }} +_summary: + Connect to unencrypted 802.11ax Wi-Fi network on {{ interface }} - netplan +_purpose: + Check system can connect to insecure 802.11ax AP using netplan +plugin: shell +command: + net_driver_info $NET_DRIVER_INFO + wifi_client_test_netplan.py -i {{ interface }} -s $OPEN_AX_SSID -d +user: root +environ: LD_LIBRARY_PATH OPEN_AX_SSID NET_DRIVER_INFO +category_id: com.canonical.plainbox::wireless +estimated_duration: 15 +flags: preserve-locale also-after-suspend also-after-suspend-manual +requires: + wireless_sta_protocol.{{ interface }}_ax == 'supported' +# net_if_management.device == '{{ interface }}' and net_if_management.managed_by == 'networkd' + + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-engine: jinja2 +template-unit: job id: wireless/wireless_connection_open_ac_np_{{ interface }} _summary: Connect to unencrypted 802.11ac Wi-Fi network on {{ interface }} - netplan @@ -74,6 +98,30 @@ template-resource: device template-filter: device.category == 'WIRELESS' template-engine: jinja2 template-unit: job +id: wireless/wireless_connection_wpa_ax_np_{{ interface }} +_summary: + Connect to WPA-encrypted 802.11ax Wi-Fi network on {{ interface }} - netplan +_purpose: + Check system can connect to 802.11ax AP with wpa security using netplan +plugin: shell +command: + net_driver_info $NET_DRIVER_INFO + wifi_client_test_netplan.py -i {{ interface }} -s $WPA_AX_SSID -k $WPA_AX_PSK -d +user: root +environ: LD_LIBRARY_PATH WPA_AX_SSID WPA_AX_PSK NET_DRIVER_INFO +category_id: com.canonical.plainbox::wireless +estimated_duration: 15 +flags: preserve-locale also-after-suspend also-after-suspend-manual +requires: + wireless_sta_protocol.{{ interface }}_ax == 'supported' +# net_if_management.device == '{{ interface }}' and net_if_management.managed_by == 'networkd' + + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' +template-engine: jinja2 +template-unit: job id: wireless/wireless_connection_wpa_ac_np_{{ interface }} _summary: Connect to WPA-encrypted 802.11ac Wi-Fi network on {{ interface }} - netplan diff --git a/units/wireless/wowlan.pxu b/units/wireless/wowlan.pxu new file mode 100644 index 0000000..1c11052 --- /dev/null +++ b/units/wireless/wowlan.pxu @@ -0,0 +1,165 @@ +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' and device.mac != 'UNKNOWN' +id: wireless/wowlan_S5_{interface}_wakeonlan +_summary: Wake on Wireless LAN (WoWLAN) test from S5 - {interface} - wakeonlan +_purpose: + Check that another system can wake up from S5 the SUT using WoWLAN function. +_steps: + 1. Ensure WoWLAN is enabled in BIOS. + 2. Initiate connection to an AP (using nmcli) + 3. Configure the device for WoWLAN, run the command: + $ sudo iw phy phy0 wowlan enable magic-packet + 4. Press Enter for S5 (Soft Off). + 5. From another computer on the same network run the following command: + $ wakeonlan {mac} + If wakeonlan tool is not installed run: + $ sudo apt install wakeonlan + 6. Resume Checkbox +_verification: + Did the SUT wake up from S5? +plugin: user-interact-verify +command: poweroff +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 120 +flags: preserve-locale + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' and device.mac != 'UNKNOWN' +id: wireless/wowlan_S5_{interface}_etherwake +_summary: Wake on Wireless LAN (WoWLAN) test from S5 - {interface} - etherwake +_purpose: + Check that another system can wake up from S5 the SUT using WoWLAN function. +_steps: + 1. Ensure WoWLAN is enabled in BIOS. + 2. Initiate connection to an AP (using nmcli) + 3. Configure the device for WoWLAN, run the command: + $ sudo iw phy phy0 wowlan enable magic-packet + 4. Press Enter for S5 (Soft Off). + 5. From another computer on the same network run the following command: + $ sudo etherwake {mac} + If etherwake tool is not installed run: + $ sudo apt install etherwake + 6. Resume Checkbox +_verification: + Did the SUT wake up from S5? +plugin: user-interact-verify +command: poweroff +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 120 +flags: preserve-locale + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' and device.mac != 'UNKNOWN' +id: wireless/wowlan_S4_{interface}_wakeonlan +_summary: Wake on Wireless LAN (WoWLAN) test from S4 - {interface} - wakeonlan +_purpose: + Check that another system can wake up from S4 the SUT using WoWLAN function. +_steps: + 1. Ensure WoWLAN is enabled in BIOS. + 2. Initiate connection to an AP (using nmcli) + 3. Configure the device for WoWLAN, run the command: + $ sudo iw phy phy0 wowlan enable magic-packet + 4. Press Enter to hibernate the system. + 5. From another computer on the same network run the following command: + $ wakeonlan {mac} + If wakeonlan tool is not installed run: + $ sudo apt install wakeonlan +_verification: + Did the SUT wake up from S4? +plugin: user-interact-verify +requires: + sleep.disk == 'supported' +command: systemctl hibernate +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 120 +flags: preserve-locale + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' and device.mac != 'UNKNOWN' +id: wireless/wowlan_S4_{interface}_etherwake +_summary: Wake on Wireless LAN (WoWLAN) test from S4 - {interface} - etherwake +_purpose: + Check that another system can wake up from S4 the SUT using WoWLAN function. +_steps: + 1. Ensure WoWLAN is enabled in BIOS. + 2. Initiate connection to an AP (using nmcli) + 3. Configure the device for WoWLAN, run the command: + $ sudo iw phy phy0 wowlan enable magic-packet + 4. Press Enter to hibernate the system. + 5. From another computer on the same network run the following command: + $ sudo etherwake {mac} + If etherwake tool is not installed run: + $ sudo apt install etherwake +_verification: + Did the SUT wake up from S4? +plugin: user-interact-verify +requires: + sleep.disk == 'supported' +command: systemctl hibernate +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 120 +flags: preserve-locale + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' and device.mac != 'UNKNOWN' +id: wireless/wowlan_S3_{interface}_wakeonlan +_summary: Wake on Wireless LAN (WoWLAN) test from S3 - {interface} - wakeonlan +_purpose: + Check that another system can wake up from S3 the SUT using WoWLAN function. +_steps: + 1. Ensure WoWLAN is enabled in BIOS. + 2. Initiate connection to an AP (using nmcli) + 3. Configure the device for WoWLAN, run the command: + $ sudo iw phy phy0 wowlan enable magic-packet + 4. Press Enter to suspend the system. + 5. From another computer on the same network run the following command: + $ wakeonlan {mac} + If wakeonlan tool is not installed run: + $ sudo apt install wakeonlan +_verification: + Did the SUT wake up from S3? +plugin: user-interact-verify +requires: + sleep.mem == 'supported' +command: systemctl suspend +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 120 +flags: preserve-locale + +unit: template +template-resource: device +template-filter: device.category == 'WIRELESS' and device.mac != 'UNKNOWN' +id: wireless/wowlan_S3_{interface}_etherwake +_summary: Wake on Wireless LAN (WoWLAN) test from S3 - {interface} - etherwake +_purpose: + Check that another system can wake up from S3 the SUT using WoWLAN function. +_steps: + 1. Ensure WoWLAN is enabled in BIOS. + 2. Initiate connection to an AP (using nmcli) + 3. Configure the device for WoWLAN, run the command: + $ sudo iw phy phy0 wowlan enable magic-packet + 4. Press Enter to suspend the system. + 5. From another computer on the same network run the following command: + $ sudo etherwake {mac} + If etherwake tool is not installed run: + $ sudo apt install etherwake +_verification: + Did the SUT wake up from S3? +plugin: user-interact-verify +requires: + sleep.mem == 'supported' +command: systemctl suspend +user: root +category_id: com.canonical.plainbox::wireless +estimated_duration: 120 +flags: preserve-locale \ No newline at end of file diff --git a/units/wwan/category.pxu b/units/wwan/category.pxu new file mode 100644 index 0000000..4da3915 --- /dev/null +++ b/units/wwan/category.pxu @@ -0,0 +1,3 @@ +unit: category +id: wwan +_name: Wireless Wide Area Network diff --git a/units/wwan/jobs.pxu b/units/wwan/jobs.pxu new file mode 100644 index 0000000..d18cdc3 --- /dev/null +++ b/units/wwan/jobs.pxu @@ -0,0 +1,233 @@ +# Copyright 2015 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Jonathan Cave <jonathan.cave@canonical.com> +# Po-Hsu Lin <po-hsu.lin@canonical.com> + +unit: job +id: wwan/detect +category_id: wwan +_summary: Identify if WWAN module is missing +_purpose: + Tests that there is a WWAN module present and indicates that testing of it + should follow. +plugin: shell +user: root +command: + COUNT=$(wwan_tests count) + if [ $COUNT -eq 0 ]; then + exit 1 + fi +estimated_duration: 2.0 +flags: preserve-locale also-after-suspend preserve-cwd +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_wwan_module == 'True' + snap.name == 'core' and int(snap.revision) >= 1804 or package.name == 'modemmanager' + snap.name == 'modem-manager' or package.name == 'modemmanager' + +unit: template +template-resource: wwan_resource +template-unit: job +id: wwan/gsm-connection-{manufacturer}-{model}-{hw_id}-auto +_summary: Verify a GSM broadband modem can create a data connection +_description: + Any modems discovered by the resource job that list GSM support + will be tested to ensure a data connection can be made. +plugin: shell +command: + BEGIN_CONNECTION_TEST_TS=`date '+%Y-%m-%d %H:%M:%S'` + wwan_tests 3gpp-connection $WWAN_CONTROL_IF $WWAN_NET_IF $WWAN_APN ${{WWAN_SETUPTIME:-30}} + RETVAL=$? + if [ $RETVAL -ne 0 ]; then + echo "==== Service units logs ====" + journalctl -q -u "snap.network-manager.networkmanager.service" -u "snap.modem-manager.modemmanager.service" --no-pager --since "$BEGIN_CONNECTION_TEST_TS" -o cat + exit $RETVAL + fi +environ: LD_LIBRARY_PATH WWAN_CONTROL_IF WWAN_NET_IF WWAN_APN WWAN_SETUPTIME +user: root +estimated_duration: 10.0 +category_id: wwan +flags: preserve-locale also-after-suspend preserve-cwd +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_wwan_module == 'True' + snap.name == 'core' and int(snap.revision) >= 1804 or package.name == 'modemmanager' + snap.name == 'modem-manager' or package.name == 'modemmanager' + +unit: template +template-resource: wwan_resource +template-unit: job +id: wwan/check-sim-present-{manufacturer}-{model}-{hw_id}-auto +_summary: Check if a SIM card is present in a slot connected to the modem +_description: + Check if a SIM card is present in a slot connected to the modem +plugin: shell +command: wwan_tests sim-present {hw_id} +environ: LD_LIBRARY_PATH +user: root +estimated_duration: 10.0 +category_id: wwan +flags: preserve-locale also-after-suspend preserve-cwd +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_wwan_module == 'True' + snap.name == 'core' and int(snap.revision) >= 1804 or package.name == 'modemmanager' + snap.name == 'modem-manager' or package.name == 'modemmanager' + +unit: template +template-resource: wwan_resource +template-unit: job +id: wwan/verify-sim-info-{manufacturer}-{model}-{hw_id} +depends: wwan/check-sim-present-{manufacturer}-{model}-{hw_id}-auto +_summary: Verify that the information retrieved from a SIM card is valid +_description: + Attempt to retrieve as much information as possible from a SIM present. The + user is required to verify if the output is valid. +plugin: user-interact-verify +_steps: + 1. Start the test to automatically retrieve information from the SIM card +_verification: + Check the output, if as expected then mark the test as passed. +command: wwan_tests sim-info {hw_id} +environ: LD_LIBRARY_PATH +user: root +estimated_duration: 5s +category_id: wwan +flags: preserve-locale also-after-suspend preserve-cwd +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_wwan_module == 'True' + snap.name == 'core' and int(snap.revision) >= 1804 or package.name == 'modemmanager' + snap.name == 'modem-manager' or package.name == 'modemmanager' + +id: wwan/detect-manual +plugin: manual +_summary: Check if WWAN module is available +_purpose: + Check if WWAN module is available and ready to be used. +_steps: + 1. Open another terminal on SUT (or press ctrl+z to suspend Checkbox) + 2. Run `sudo mmcli -L` command. + 3. Run `fg` to jump back to checkbox (if you're running in the same terminal) +_verification: + Check the output. Was the modem listed? +estimated_duration: 60s +flags: also-after-suspend-manual +imports: from com.canonical.plainbox import manifest +category_id: wwan +requires: + manifest.has_wwan_module == 'True' + +id: wwan/check-sim-present-manual +plugin: manual +_summary: Check if a SIM card is present in a slot connected to the modem +_purpose: + Check if a SIM card is present in a slot connected to the modem +_steps: + 1. Open another terminal on SUT (or press ctrl+z to suspend Checkbox) + 2. Run `sudo mmcli -m 0 |grep SIM + 3. Run `fg` to jump back to checkbox (if you're running in the same terminal) +_verification: + Check the output. Was the SIM information printed? +estimated_duration: 60s +flags: also-after-suspend-manual +imports: from com.canonical.plainbox import manifest +category_id: wwan +requires: + manifest.has_wwan_module == 'True' +depends: + wwan/detect-manual + +id: wwan/gsm-connection-manual +plugin: manual +template-engine: jinja2 +_summary: Verify a GSM broadband modem can create a data connection +_purpose: + Ensure that the data connection can be made +_steps: + 1. Open another terminal on SUT (or press ctrl+z to suspend Checkbox) + 2. Run `sudo nmcli c add type gsm ifname {{ __checkbox_env__.get("WWAN_CONTROL_IF", "<device name>") }} con-name GSM apn {{ __checkbox_env__.get("WWAN_APN", "<your.carrier.com>") }}` + {%- if "WWAN_CONTROL_IF" not in __checkbox_env__ %} + Replacing the <your.carrier.com> with appropriate APN name, + and <device name> with appropriate device (device can be found by + running sudo nmcli d) + {%- endif %} + {%- if "WWAN_NET_IF" not in __checkbox_env__ %} + 3. Ping Google (Run: `ping -I <ifname> 8.8.8.8 -c 5`) + {%- else %} + 3. Ping Google (Run: `ping -I {{ __checkbox_env__.get("WWAN_NET_IF") }} 8.8.8.8 -c 5`) + {%- endif %} + 4. Disconnect from the network (Run: `sudo nmcli c delete GSM`) + 5. Run `fg` to jump back to checkbox (if you're running in the same terminal) +_verification: + Did the ping came back? +estimated_duration: 120s +flags: also-after-suspend-manual +category_id: wwan +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_wwan_module == 'True' +depends: + wwan/check-sim-present-manual + +id: wwan/scan-networks-manual +plugin: manual +_summary: Verify that modem can scan for available networks +_purpose: + Ensure that the modem can scan/find available networks +_steps: + 1. Open another terminal on SUT (or press ctrl+z to suspend Checkbox) + 2. Run `sudo mmcli -m 0 --3gpp-scan --timeout=300` + 3. Run `fg` to jump back to checkbox (if you're running in the same terminal) +_verification: + Were available networks listed? +estimated_duration: 120s +flags: also-after-suspend-manual +category_id: wwan +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_wwan_module == 'True' +depends: + wwan/check-sim-present-manual + +id: wwan/gsm-connection-interrupted-manual +plugin: manual +template-engine: jinja2 +_summary: Verify a GSM broadband connection can be reconnected after the signal is lost +_purpose: + Ensure that the data connection can be revived after losing signal +_steps: + 1. Open another terminal on SUT (or press ctrl+z to suspend Checkbox) + 2. Run `sudo nmcli c add type gsm ifname {{ __checkbox_env__.get("WWAN_CONTROL_IF", "<device name>") }} con-name GSM apn {{ __checkbox_env__.get("WWAN_APN", "<your.carrier.com>") }}` + {%- if "WWAN_CONTROL_IF" not in __checkbox_env__ %} + Replacing the <your.carrier.com> with appropriate APN name, + and <device name> with appropriate device (device can be found by + running sudo nmcli d) + {%- endif %} + {%- if "WWAN_NET_IF" not in __checkbox_env__ %} + 3. Ping Google (Run: `ping -I <ifname> 8.8.8.8 -c 5`) + {%- else %} + 3. Ping Google (Run: `ping -I {{ __checkbox_env__.get("WWAN_NET_IF") }} 8.8.8.8 -c 5`) + {%- endif %} + 4. Place the system in a Faraday bag + 5. Ping Google (and verify that the connection no longer works) + 6. Remove the Faraday bag + {%- if "WWAN_NET_IF" not in __checkbox_env__ %} + 7. Ping Google (Run: `ping -I <ifname> 8.8.8.8 -c 5`) + {%- else %} + 7. Ping Google (Run: `ping -I {{ __checkbox_env__.get("WWAN_NET_IF") }} 8.8.8.8 -c 5`) + {%- endif %} + 8. Disconnect from the network (Run: `sudo nmcli r wwan off`) + 9. Run `fg` to jump back to checkbox (if you're running in the same terminal) +_verification: + Was the connection revived after plugging back in the antennae? +estimate_duration: 120s +flags: also-after-suspend-manual +category_id: wwan +imports: from com.canonical.plainbox import manifest +requires: + manifest.has_wwan_module == 'True' +depends: + wwan/check-sim-present-manual diff --git a/units/wwan/manifest.pxu b/units/wwan/manifest.pxu new file mode 100644 index 0000000..b15b01f --- /dev/null +++ b/units/wwan/manifest.pxu @@ -0,0 +1,10 @@ +# Copyright 2015 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Jonathan Cave <jonathan.cave@canonical.com> + +unit: manifest entry +id: has_wwan_module +_name: WWAN module +value-type: bool diff --git a/units/wwan/resource.pxu b/units/wwan/resource.pxu new file mode 100644 index 0000000..a0e82ff --- /dev/null +++ b/units/wwan/resource.pxu @@ -0,0 +1,17 @@ +# Copyright 2015 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Jonathan Cave <jonathan.cave@canonical.com> + + +unit: job +id: wwan_resource +category_id: wwan +plugin: resource +_summary: Gather device info about WWAN modems +_description: Gather device info about WWAN modems +command: wwan_tests --use-cli resources +user: root +estimated_duration: 3s +flags: preserve-locale diff --git a/units/wwan/test-plan.pxu b/units/wwan/test-plan.pxu new file mode 100644 index 0000000..421b68f --- /dev/null +++ b/units/wwan/test-plan.pxu @@ -0,0 +1,63 @@ +id: wwan-full +unit: test plan +_name: Wwan tests +_description: QA wwan tests for Snappy Ubuntu Core devices +include: + # Note this test require snap calling snap support + wwan/verify-sim-info-.* +nested_part: + wwan-manual + wwan-automated + +id: wwan-automated +unit: test plan +_name: Automated wwan tests +_description: Automated wwan tests for Snappy Ubuntu Core devices +include: + # Note these tests require snap calling snap support + wwan/detect + wwan/gsm-connection-.*-auto + wwan/check-sim-present-.*-auto +bootstrap_include: + wwan_resource + +id: after-suspend-wwan-full +unit: test plan +_name: Wwan tests (after suspend) +_description: QA wwan tests for Snappy Ubuntu Core devices +include: +nested_part: + after-suspend-wwan-automated + after-suspend-wwan-manual + +id: after-suspend-wwan-automated +unit: test plan +_name: Automated wwan tests (after suspend) +_description: Automated wwan tests for Snappy Ubuntu Core devices +include: + after-suspend-wwan/detect + after-suspend-wwan/gsm-connection-.*-auto +bootstrap_include: + wwan_resource + +id: wwan-manual +unit: test plan +_name: Manual wwan tests +_description: Manual wwan tests for Snappy Ubuntu Core devices +include: + wwan/detect-manual + wwan/gsm-connection-manual + wwan/check-sim-present-manual + wwan/scan-networks-manual + wwan/gsm-connection-interrupted-manual + +id: after-suspend-wwan-manual +unit: test plan +_name: Manual wwan tests (after suspend) +_description: Manual wwan tests for Snappy Ubuntu Core devices +include: + after-suspend-manual-wwan/detect-manual + after-suspend-manual-wwan/gsm-connection-manual + after-suspend-manual-wwan/check-sim-present-manual + after-suspend-manual-wwan/scan-networks-manual + after-suspend-wwan/gsm-connection-interrupted-manual |