diff options
author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2015-12-01 00:11:18 +0100 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2015-12-01 00:11:18 +0100 |
commit | 795f41dbc30a270f8161eb6ebf5a4fab862c7a23 (patch) | |
tree | 01f6bb5d889a8880e4f6dec896902446cf3ce519 | |
parent | d2cdfc0daeacee7afda980919b380e71eb600076 (diff) |
providers:checkbox:wireless: convert some local jobs to template units
Only iterate on devices reported by udev. Fixes: https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1517312
-rw-r--r-- | jobs/wireless.txt.in | 109 |
1 files changed, 49 insertions, 60 deletions
diff --git a/jobs/wireless.txt.in b/jobs/wireless.txt.in index 540c75d..49496ee 100644 --- a/jobs/wireless.txt.in +++ b/jobs/wireless.txt.in @@ -27,7 +27,7 @@ id: wireless/info_automated requires: package.name == 'network-manager' device.category == 'WIRELESS' -command: udev_resource | filter_templates -w "category=WIRELESS"| awk "/path: / { print \$2 }"| xargs -n 1 sh -c "for i in \`ls /sys\$0/net 2>/dev/null\`; do network_info \$i; done" +command: udev_resource | filter_templates -w "category=WIRELESS" | awk "/interface: / { print \$2 }" | xargs -n 1 network_info estimated_duration: 1.2 _description: This is an automated test to gather some info on the current state of your wireless devices. If no devices are found, the test will exit with an error. @@ -587,24 +587,23 @@ _description: 802.11b protocol. This requires that you have a router pre-configured to only respond to requests on the 802.11b protocol. -plugin: local -_summary: Automated test that tests performance of each wireless network device under stress. -id: wireless/stress_performance +unit: template +template-unit: job +template-resource: device +template-filter: + device.category == 'WIRELESS' +plugin: shell +category_id: 2013.com.canonical.plainbox::wireless +id: wireless/stress_performance_device{__index__}_{interface} +estimated_duration: 330.0 requires: - device.category == 'NETWORK' -_description: Automated test that tests performance of each wireless network device under stress. -command: - cat <<'EOF' | run_templates -s 'udev_resource | filter_templates -w "category=WIRELESS" | awk "/path: / { print \$2 }" | xargs -n 1 sh -c "for i in \`ls /sys\$0/net 2>/dev/null\`; do echo \$0 \$i; done"' - plugin: shell - category_id: 2013.com.canonical.plainbox::wireless - id: wireless/stress_performance_$2 - requires: device.path == "$1" - user: root - command: network test -i $2 -t stress - estimated_duration: 330.0 - _description: - This test executes iperf to generate a load on the network device and then performs a ping test to watch for dropped packets and very large latency periods. - EOF + device.path == '{path}' + package.name == 'iperf' +environ: TEST_TARGET_IPERF +user: root +command: network test -i {interface} -t stress +_description: + This test executes iperf to generate a load on the network device {__index__} ({interface}) and then performs a ping test to watch for dropped packets and very large latency periods. plugin: shell category_id: 2013.com.canonical.plainbox::wireless @@ -645,23 +644,18 @@ estimated_duration: 1.2 _description: Test that the MAC80211 modules are loaded and wireless extensions are working. -plugin: local -id: wireless/iwconfig_info -requires: - device.category == 'WIRELESS' -command: - cat <<'EOF' | run_templates -s 'udev_resource | filter_templates -w "category=WIRELESS" | awk "/path: / { print \$2 }" | xargs -n 1 sh -c "for i in \`ls /sys\$0/net 2>/dev/null\`; do echo \$0 \$i; done"' - plugin: shell - category_id: 2013.com.canonical.plainbox::wireless - id: wireless/iwconfig_check_$2 - requires: device.path == "$1" - command: iwconfig $2 - estimated_duration: 1.2 - _description: - This test executes iwconfig requests against all the ethernet devices found on the system. - EOF +unit: template +template-unit: job +template-resource: device +template-filter: device.category == 'WIRELESS' +plugin: shell +category_id: 2013.com.canonical.plainbox::wireless +id: wireless/iwconfig_check_device{__index__}_{interface} +estimated_duration: 1.2 +requires: device.path == '{path}' +command: iwconfig {interface} _description: - This is an automated test to gather some info on the current state of your network devices. If no devices are found, the test will exit with an error. + This test executes iwconfig requests against wireless device {__index__} ({interface}). plugin: user-interact-verify category_id: 2013.com.canonical.plainbox::wireless @@ -679,32 +673,27 @@ _description: VERIFICATION: Did the hard or soft blocks show on in the dialog? -plugin: local -id: wireless/maximum_bandwidth +unit: template +template-unit: job +template-resource: device +template-filter: device.category == 'WIRELESS' +plugin: user-interact-verify +category_id: 2013.com.canonical.plainbox::wireless +id: wireless/maximum_bandwidth_device{__index__}_{interface} +estimated_duration: 120.0 requires: - device.category == 'WIRELESS' + device.path == '{path}' package.name == 'zenity' package.name == 'iperf' -command: - cat <<'EOF' | run_templates -s 'udev_resource | filter_templates -w "category=WIRELESS" | awk "/path: / { print \$2 }" | xargs -n 1 sh -c "for i in \`ls /sys\$0/net 2>/dev/null\`; do echo \$0 \$i; done"' - plugin: user-interact-verify - category_id: 2013.com.canonical.plainbox::wireless - user: root - id: wireless/maximum_bandwidth_$2 - requires: device.path == "$1" - command: network test -i $2 -t iperf 2>&1 | cat - <(echo; echo "Verify the result and click OK to decide on the outcome") | zenity --text-info --title 'wireless max bw $2' - estimated_duration: 120.0 - _description: - PURPOSE: - User verification of whether the observed transfer throughput is acceptable - for the type and maximum speed of each wireless interface. - STEPS: - 1. Click "Test". - 2. Read the network test summary and confirm that the throughput is acceptable. - 3. If needed, click "Test" again to repeat the transfer test. - VERIFICATION: - Was the reported throughput acceptable for the type and maximum speed of this interface? - EOF -_description: - This test executes a maximum throughput test against all the wireless devices found on the system. - +environ: TEST_TARGET_IPERF +user: root +command: network test -i {interface} -t iperf 2>&1 | cat - <(echo; echo "Verify the result and click OK to decide on the outcome") | zenity --text-info --title 'mobile broadband max bw {interface}' +_purpose: + User verification of whether the observed transfer throughput is acceptable + for the type and maximum speed of wireless device {__index__} ({interface}). +_steps: + 1. Click "Test". + 2. Read the network test summary and confirm that the throughput is acceptable. + 3. If needed, click "Test" again to repeat the transfer test. +_verification: + Was the reported throughput acceptable for the type and maximum speed of this interface? |