From f9c0b7ddd3cccd3af02252d9eafc09c9ad9afd5b Mon Sep 17 00:00:00 2001 From: Sylvain Pineau Date: Tue, 1 Dec 2015 00:11:27 +0100 Subject: providers:checkbox:mobilebroadband convert some local jobs to template units Only iterate on devices reported by udev. Fixes: https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1517312 --- jobs/mobilebroadband.txt.in | 100 +++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 56 deletions(-) diff --git a/jobs/mobilebroadband.txt.in b/jobs/mobilebroadband.txt.in index d28cd3a..d68002d 100644 --- a/jobs/mobilebroadband.txt.in +++ b/jobs/mobilebroadband.txt.in @@ -57,66 +57,54 @@ command: exit $EXIT_CODE _description: Creates a mobile broadband connection for a CDMA based modem and checks the connection to ensure it's working. -plugin: local -id: mobilebroadband/maximum_bandwidth_gsm +unit: template +template-unit: job +template-resource: device +template-filter: device.category == 'NETWORK' +plugin: user-interact-verify +category_id: 2013.com.canonical.plainbox::mobilebroadband +id: mobilebroadband/maximum_bandwidth_gsm_device{__index__}_{interface} +depends: mobilebroadband/gsm_connection +estimated_duration: 330.0 requires: - device.category == 'NETWORK' + device.path == '{path}' package.name == 'zenity' package.name == 'iperf' -depends: mobilebroadband/gsm_connection -command: - cat <<'EOF' | run_templates -s 'udev_resource | filter_templates -w "category=NETWORK" | 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::mobilebroadband - user: root - id: mobilebroadband/maximum_bandwidth_$2 - requires: device.path == "$1" - environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS - 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 'mobile broadband max bw $2' - estimated_duration: 330.0 - _description: - PURPOSE: - User verification of whether the observed transfer throughput is acceptable - for the type and maximum speed of each 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 devices found on the system. +environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS +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 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? -plugin: local -id: mobilebroadband/maximum_bandwidth_cdma +unit: template +template-unit: job +template-resource: device +template-filter: device.category == 'NETWORK' +plugin: user-interact-verify +category_id: 2013.com.canonical.plainbox::mobilebroadband +id: mobilebroadband/maximum_bandwidth_cdma_device{__index__}_{interface} +depends: mobilebroadband/cdma_connection +estimated_duration: 330.0 requires: - device.category == 'NETWORK' + device.path == '{path}' package.name == 'zenity' package.name == 'iperf' -depends: mobilebroadband/cdma_connection -command: - cat <<'EOF' | run_templates -s 'udev_resource | filter_templates -w "category=NETWORK" | 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::mobilebroadband - user: root - id: mobilebroadband/maximum_bandwidth_$2 - requires: device.path == "$1" - environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS - 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 'mobile broadband max bw $2' - estimated_duration: 330.0 - _description: - PURPOSE: - User verification of whether the observed transfer throughput is acceptable - for the type and maximum speed of each 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 devices found on the system. - - +environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS +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 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? -- cgit v1.2.3