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
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-05-03 14:32:25 +0000
3+++ debian/changelog 2013-05-03 19:09:28 +0000
4@@ -13,6 +13,8 @@
5 * jobs/camera.txt.in: removed an extraneous requres line for gir1.2
6 scripts/camera_test: added code to determine what version of gst we're
7 using and set video type and plugin accordingly. (LP: #1100594)
8+ * scripts/network_check: added ability to specify custom target URL for
9+ debugging failures (LP: #1128017)
10
11 [ Sylvain Pineau ]
12 * jobs/suspend.txt.in, scripts/gpu_test: Remove the need of running the script
13
14=== modified file 'scripts/network_check'
15--- scripts/network_check 2012-10-25 07:37:51 +0000
16+++ scripts/network_check 2013-05-03 19:09:28 +0000
17@@ -27,6 +27,10 @@
18 Check HTTP and connection
19 """
20 parser = ArgumentParser()
21+ parser.add_argument('-u', '--url',
22+ action='store',
23+ default='http://cdimage.ubuntu.com',
24+ help='The target URL to try. Default is %(default)s')
25 parser.add_argument('-a', '--auto',
26 action='store_true',
27 default=False,
28@@ -34,7 +38,7 @@
29
30 args = parser.parse_args()
31
32- url = {"http": "http://cdimage.ubuntu.com"}
33+ url = {"http": args.url}
34
35 results = {}
36 for protocol, value in url.items():

Subscribers

People subscribed via source and target branches