Merge lp:~bladernr/checkbox/1128017-improve-network_check into lp:checkbox

Proposed by Jeff Lane 
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 2102
Merged at revision: 2102
Proposed branch: lp:~bladernr/checkbox/1128017-improve-network_check
Merge into: lp:checkbox
Diff against target: 36 lines (+7/-1)
2 files modified
debian/changelog (+2/-0)
scripts/network_check (+5/-1)
To merge this branch: bzr merge lp:~bladernr/checkbox/1128017-improve-network_check
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+162240@code.launchpad.net

Description of the change

Improves network_check by adding the ability to test against a URL other than cdimage.ubuntu.com. This is useful when the test simply fails and needs a bit of debug to validate that the issue is not simply that cdimage.ubuntu.com is not accessible by the user for some reason.

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

24 + help='The target URL to try. Default is %(default)s')

default is not interpolated unless you do some bit of argparse magic (grep for default in plainbox to see)

Otherwise ok

2099. By Jeff Lane 

"[r=zkrynicki][bug=1103647][author=bladernr] automatic merge by tarmac"

2100. By Brendan Donegan

"[r=zkrynicki][bug=1093718][author=brendan-donegan] automatic merge by tarmac"

Revision history for this message
Jeff Lane  (bladernr) wrote :

default is interpolated automatically IF you provide a default="foo" in the arg definition.

bladernr@klaatu:~/development/git-workspace/checkbox/scripts$ ./network_check -h
usage: network_check [-h] [-u URL] [-a]

optional arguments:
  -h, --help show this help message and exit
  -u URL, --url URL The target URL to try. Default is
                     http://cdimage.ubuntu.com
  -a, --auto Runs in Automated mode, with no visible output

note that it automatically converts %(default)s to "http://cdimage.ubuntu.com" which is set as the default here:

parser.add_argument('-u', '--url',
                        action='store',
                        default='http://cdimage.ubuntu.com',
                        help='The target URL to try. Default is %(default)s')

2101. By Jeff Lane 

"[r=brendan-donegan][bug=1100594][author=bladernr] automatic merge by tarmac"

Revision history for this message
Jeff Lane  (bladernr) wrote :

Rebased on current trunk

2102. By Jeff Lane 

scripts: network_check: Added --url option for easier debugging

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1 lovely, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2013-05-03 14:32:25 +0000
+++ debian/changelog 2013-05-03 19:09:28 +0000
@@ -13,6 +13,8 @@
13 * jobs/camera.txt.in: removed an extraneous requres line for gir1.213 * jobs/camera.txt.in: removed an extraneous requres line for gir1.2
14 scripts/camera_test: added code to determine what version of gst we're14 scripts/camera_test: added code to determine what version of gst we're
15 using and set video type and plugin accordingly. (LP: #1100594)15 using and set video type and plugin accordingly. (LP: #1100594)
16 * scripts/network_check: added ability to specify custom target URL for
17 debugging failures (LP: #1128017)
1618
17 [ Sylvain Pineau ]19 [ Sylvain Pineau ]
18 * jobs/suspend.txt.in, scripts/gpu_test: Remove the need of running the script20 * jobs/suspend.txt.in, scripts/gpu_test: Remove the need of running the script
1921
=== modified file 'scripts/network_check'
--- scripts/network_check 2012-10-25 07:37:51 +0000
+++ scripts/network_check 2013-05-03 19:09:28 +0000
@@ -27,6 +27,10 @@
27 Check HTTP and connection27 Check HTTP and connection
28 """28 """
29 parser = ArgumentParser()29 parser = ArgumentParser()
30 parser.add_argument('-u', '--url',
31 action='store',
32 default='http://cdimage.ubuntu.com',
33 help='The target URL to try. Default is %(default)s')
30 parser.add_argument('-a', '--auto',34 parser.add_argument('-a', '--auto',
31 action='store_true',35 action='store_true',
32 default=False,36 default=False,
@@ -34,7 +38,7 @@
3438
35 args = parser.parse_args()39 args = parser.parse_args()
3640
37 url = {"http": "http://cdimage.ubuntu.com"}41 url = {"http": args.url}
3842
39 results = {}43 results = {}
40 for protocol, value in url.items():44 for protocol, value in url.items():

Subscribers

People subscribed via source and target branches