diff options
author | Jonathan Cave <jonathan.cave@canonical.com> | 2020-07-28 18:37:03 +0100 |
---|---|---|
committer | Jonathan Cave <jonathan.cave@canonical.com> | 2020-07-30 14:20:05 +0100 |
commit | d860c0e4b7795c4f1fc9dff2c129434b8e8276f9 (patch) | |
tree | 753550d8e7b1cf2c0bb87c482d94502b952df238 | |
parent | 6a157f7a7ec302fb4cb4cc186ecb74c263f5a571 (diff) |
units/*: remove use of zenity dialogs
Modify any jobs still using zenity dialogs to only display the information on the command line
-rwxr-xr-x | bin/network_check.py | 18 | ||||
-rw-r--r-- | units/ethernet/jobs.pxu | 3 | ||||
-rw-r--r-- | units/graphics/jobs.pxu | 9 | ||||
-rw-r--r-- | units/graphics/legacy.pxu | 3 | ||||
-rw-r--r-- | units/miscellanea/jobs.pxu | 2 | ||||
-rw-r--r-- | units/mobilebroadband/jobs.pxu | 6 | ||||
-rw-r--r-- | units/networking/jobs.pxu | 2 |
7 files changed, 14 insertions, 29 deletions
diff --git a/bin/network_check.py b/bin/network_check.py index 20b88d56..c34ac6ce 100755 --- a/bin/network_check.py +++ b/bin/network_check.py @@ -3,7 +3,6 @@ Check that it's possible to establish a http connection against ubuntu.com """ -from subprocess import call from argparse import ArgumentParser import http.client import urllib.request @@ -51,20 +50,11 @@ def main(): % dict([(protocol, bool2str[value]) for protocol, value in results.items()])) - command = ["zenity", "--title=Network", - "--text=%s" % message] - - if all(results.values()): - command.append("--info") - else: - command.append("--error") - if not args.auto: - try: - call(command) - except OSError: - print( - "Zenity missing; unable to report test result:\n %s" % message) + if all(results.values()): + print(message) + else: + print(message, file=sys.stderr) if any(results.values()): return 0 diff --git a/units/ethernet/jobs.pxu b/units/ethernet/jobs.pxu index 8a4fddc7..22f53b64 100644 --- a/units/ethernet/jobs.pxu +++ b/units/ethernet/jobs.pxu @@ -150,11 +150,10 @@ id: ethernet/maximum_bandwidth_device{__index__}_{interface} _summary: Maximum bandwidth test of device {__index__} ({interface}) estimated_duration: 330.0 requires: - package.name == 'zenity' package.name == 'iperf' user: root environ: TEST_TARGET_IPERF -command: network.py 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 'ethernet max bw {interface}' +command: network.py test -i {interface} -t iperf 2>&1 | cat - <(echo; echo "Verify the result of the test...") _purpose: User verification of whether the observed transfer throughput is acceptable for the type and maximum speed of each ethernet interface. diff --git a/units/graphics/jobs.pxu b/units/graphics/jobs.pxu index 154f036e..bf038780 100644 --- a/units/graphics/jobs.pxu +++ b/units/graphics/jobs.pxu @@ -69,8 +69,7 @@ category_id: com.canonical.plainbox::graphics id: graphics/{index}_resolution_{product_slug} requires: device.category == 'VIDEO' - package.name == 'zenity' -command: resolution_test.py | zenity --text-info +command: resolution_test.py estimated_duration: 10.00 _summary: Test default resolution for {vendor} {product} _description: @@ -78,7 +77,7 @@ _description: This test will verify the default display resolution on the {vendor} {product} graphics card. STEPS: 1. Click "Test". - 2. Confirm that the resolution shown in the text window is acceptable for your display. + 2. Confirm that the resolution shown is acceptable for your display. VERIFICATION: Is the resolution shown acceptable for your display on {vendor} {product} graphics card? @@ -128,14 +127,14 @@ plugin: user-interact-verify category_id: com.canonical.plainbox::graphics requires: device.category == 'VIDEO' - package.name == 'zenity' command: # shellcheck disable=SC1091 source graphics_env.sh {driver} {index} maxi="$(xrandr -q |grep -A 1 "connected\( primary\)* [0-9]" |tail -1 |awk '{{print $1}}')" now="$(python3 -c 'from gi.repository import Gdk; screen=Gdk.Screen.get_default(); geo = screen.get_monitor_geometry(screen.get_primary_monitor()); print(geo.width, "x", geo.height, sep="")')" test "$maxi" != "$now" && notify="\nPlease switch to the maximum resolution \nfor every graphic tests" - zenity --info --text "Maximum resolution: $maxi\nCurrent resolution: $now $notify" + echo "Maximum resolution: $maxi" + echo "Current resolution: $now $notify" estimated_duration: 10.0 _summary: Test maximum supported resolution for {vendor} {product} _description: diff --git a/units/graphics/legacy.pxu b/units/graphics/legacy.pxu index a58e55a8..c2f2b533 100644 --- a/units/graphics/legacy.pxu +++ b/units/graphics/legacy.pxu @@ -78,8 +78,7 @@ category_id: com.canonical.plainbox::graphics id: graphics/maximum_resolution requires: device.category == 'VIDEO' - package.name == 'zenity' -command: zenity --info --text "Maximum resolution: $(xrandr -q |grep -A 1 "connected\( primary\)* [0-9]" |tail -1 |awk '{print $1}')" +command: echo "Maximum resolution: $(xrandr -q |grep -A 1 "connected\( primary\)* [0-9]" |tail -1 |awk '{print $1}')" estimated_duration: 10 _summary: Test maximum supported resolution _description: diff --git a/units/miscellanea/jobs.pxu b/units/miscellanea/jobs.pxu index 3fd3fef4..cac9647d 100644 --- a/units/miscellanea/jobs.pxu +++ b/units/miscellanea/jobs.pxu @@ -413,7 +413,7 @@ plugin: user-interact-verify category_id: com.canonical.plainbox::miscellanea estimated_duration: 5.0 id: miscellanea/device_check -command: udev_resource.py -l VIDEO NETWORK WIRELESS BLUETOOTH DISK CAPTURE ACCELEROMETER | tee >([[ $DISPLAY ]] && zenity --text-info --title="Device report") +command: udev_resource.py -l VIDEO NETWORK WIRELESS BLUETOOTH DISK CAPTURE ACCELEROMETER _summary: Device Check _purpose: Device check diff --git a/units/mobilebroadband/jobs.pxu b/units/mobilebroadband/jobs.pxu index b5ae39c1..61269062 100644 --- a/units/mobilebroadband/jobs.pxu +++ b/units/mobilebroadband/jobs.pxu @@ -68,11 +68,10 @@ id: mobilebroadband/maximum_bandwidth_gsm_device{__index__}_{interface} depends: mobilebroadband/gsm_connection estimated_duration: 330.0 requires: - package.name == 'zenity' package.name == 'iperf' environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS user: root -command: network.py 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}' +command: network.py test -i {interface} -t iperf 2>&1 | cat - <(echo; echo "Verify the result of the test...") _purpose: User verification of whether the observed transfer throughput is acceptable for the type and maximum speed of device {__index__} ({interface}). @@ -92,11 +91,10 @@ id: mobilebroadband/maximum_bandwidth_cdma_device{__index__}_{interface} depends: mobilebroadband/cdma_connection estimated_duration: 330.0 requires: - package.name == 'zenity' package.name == 'iperf' environ: TEST_TARGET_FTP TEST_TARGET_IPERF TEST_USER TEST_PASS user: root -command: network.py 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}' +command: network.py test -i {interface} -t iperf 2>&1 | cat - <(echo; echo "Verify the result of the test...") _purpose: User verification of whether the observed transfer throughput is acceptable for the type and maximum speed of device {__index__} ({interface}). diff --git a/units/networking/jobs.pxu b/units/networking/jobs.pxu index 2e481b9c..e95f3dc7 100644 --- a/units/networking/jobs.pxu +++ b/units/networking/jobs.pxu @@ -15,7 +15,7 @@ id: networking/info_device{__index__}_{interface} _summary: Network Information of device {__index__} ({interface}) estimated_duration: 1.0 command: - network_device_info.py info NETWORK --interface {interface} | zenity --text-info --title="{interface}" + network_device_info.py info NETWORK --interface {interface} _description: PURPOSE: This test will check the network device {__index__} ({interface}) |