[tor-commits] [ooni-probe/master] Fix/doc format (#488)

art at torproject.org art at torproject.org
Mon May 9 20:56:55 UTC 2016


commit ddc032cbb99a248aa787bba6803fcf065e1d8b03
Author: anadahz <anadahz at users.noreply.github.com>
Date:   Mon May 2 13:16:15 2016 +0000

    Fix/doc format (#488)
    
    * Fix usage options text format
    
    The test description was not properly formatted resulting in an ugly
    display format when you list the currently installed ooniprobe nettests.
    Added punctuation to all descriptions and values for better visibility
    and consistency.
    
    * Fix punctuation placement, more aesthetic changes
    
    * Add note about third party tests
---
 ooni/nettests/blocking/bridge_reachability.py           |  4 ++--
 ooni/nettests/blocking/dns_consistency.py               |  6 +++---
 ooni/nettests/blocking/http_requests.py                 |  6 ++++--
 ooni/nettests/blocking/meek_fronted_requests.py         |  5 +++--
 ooni/nettests/blocking/tcp_connect.py                   |  2 +-
 ooni/nettests/blocking/vanilla_tor.py                   |  4 ++--
 ooni/nettests/manipulation/captiveportal.py             | 11 ++++++-----
 ooni/nettests/manipulation/dns_spoof.py                 |  6 +++---
 .../manipulation/http_header_field_manipulation.py      |  4 ++--
 ooni/nettests/manipulation/http_host.py                 | 17 +++++++++--------
 ooni/nettests/manipulation/http_invalid_request_line.py |  4 ++--
 ooni/nettests/manipulation/traceroute.py                | 12 ++++++------
 ooni/nettests/scanning/http_url_list.py                 |  7 ++++---
 ooni/nettests/third_party/lantern.py                    |  5 +++--
 ooni/nettests/third_party/netalyzr.py                   |  4 ++--
 ooni/nettests/third_party/openvpn.py                    |  3 ++-
 ooni/nettests/third_party/psiphon.py                    |  4 ++--
 ooni/oonicli.py                                         |  6 ++++--
 18 files changed, 60 insertions(+), 50 deletions(-)

diff --git a/ooni/nettests/blocking/bridge_reachability.py b/ooni/nettests/blocking/bridge_reachability.py
index 5d9dc96..2efbc42 100644
--- a/ooni/nettests/blocking/bridge_reachability.py
+++ b/ooni/nettests/blocking/bridge_reachability.py
@@ -21,7 +21,7 @@ class UsageOptions(usage.Options):
     optParameters = [
         ['timeout', 't', 120,
          'Specify the timeout after which to consider '
-         'the Tor bootstrapping process to have failed'], ]
+         'the Tor bootstrapping process to have failed.'], ]
 
 
 class BridgeReachability(nettest.NetTestCase):
@@ -36,7 +36,7 @@ class BridgeReachability(nettest.NetTestCase):
     inputFile = ['file', 'f', None,
                  'File containing bridges to test reachability for. '
                  'They should be one per line IP:ORPort or '
-                 'TransportType IP:ORPort (ex. obfs2 127.0.0.1:443)']
+                 'TransportType IP:ORPort (ex. obfs2 127.0.0.1:443).']
 
     requiredOptions = ['file']
 
diff --git a/ooni/nettests/blocking/dns_consistency.py b/ooni/nettests/blocking/dns_consistency.py
index 93a2d65..e7eef4c 100644
--- a/ooni/nettests/blocking/dns_consistency.py
+++ b/ooni/nettests/blocking/dns_consistency.py
@@ -26,11 +26,11 @@ from ooni.utils import log
 
 class UsageOptions(usage.Options):
     optParameters = [['backend', 'b', None,
-                      'The OONI backend that runs the DNS resolver'],
+                      'The OONI backend that runs the DNS resolver.'],
                      ['testresolvers', 'T', None,
-                      'File containing list of DNS resolvers to test against'],
+                      'File containing list of DNS resolvers to test against.'],
                      ['testresolver', 't', None,
-                         'Specify a single test resolver to use for testing']
+                         'Specify a single test resolver to use for testing.']
                      ]
 
 
diff --git a/ooni/nettests/blocking/http_requests.py b/ooni/nettests/blocking/http_requests.py
index 24d95cc..6f0276b 100644
--- a/ooni/nettests/blocking/http_requests.py
+++ b/ooni/nettests/blocking/http_requests.py
@@ -18,9 +18,11 @@ class UsageOptions(usage.Options):
     optParameters = [
         ['url', 'u', None, 'Specify a single URL to test.'],
         ['factor', 'f', 0.8,
-         'What factor should be used for triggering censorship (0.8 == 80%)']]
+         'What factor should be used for triggering censorship '
+         '(0.8 == 80%).']]
     optFlags = [
-        ["withoutbody", "B", "don't include HTTP response body inside of the report"],
+        ["withoutbody", "B", "don't include HTTP response body inside of the "
+         "report."],
         ]
 
 
diff --git a/ooni/nettests/blocking/meek_fronted_requests.py b/ooni/nettests/blocking/meek_fronted_requests.py
index 1a16955..960d971 100644
--- a/ooni/nettests/blocking/meek_fronted_requests.py
+++ b/ooni/nettests/blocking/meek_fronted_requests.py
@@ -9,7 +9,7 @@ from ooni.utils import log
 class UsageOptions(usage.Options):
     optParameters = [ ['expectedBody', 'B',
                          'I’m just a happy little web server.\n',
-                          'Expected body content from GET response'],
+                          'Expected body content from GET response.'],
                       ['domainName', 'D', None,
                         'Specify a single fronted domainName to test.'],
                       ['hostHeader', 'H', None,
@@ -29,7 +29,8 @@ class meekTest(httpt.HTTPTest):
 
     """
     name = "Meek fronted requests test"
-    description = "This tests for the Meek Tor pluggable transport frontend reachability"
+    description = "This tests for the Meek Tor pluggable transport "\
+                  "frontend reachability."
     version = "0.0.1"
 
     usageOptions = UsageOptions
diff --git a/ooni/nettests/blocking/tcp_connect.py b/ooni/nettests/blocking/tcp_connect.py
index 1666ce3..f2712ea 100644
--- a/ooni/nettests/blocking/tcp_connect.py
+++ b/ooni/nettests/blocking/tcp_connect.py
@@ -23,7 +23,7 @@ class TCPConnectTest(nettest.NetTestCase):
         'file',
         'f',
         None,
-        'File containing the IP:PORT combinations to be tested, one per line']
+        'File containing the IP:PORT combinations to be tested, one per line.']
 
     requiresTor = False
     requiresRoot = False
diff --git a/ooni/nettests/blocking/vanilla_tor.py b/ooni/nettests/blocking/vanilla_tor.py
index 257f21a..19c4805 100644
--- a/ooni/nettests/blocking/vanilla_tor.py
+++ b/ooni/nettests/blocking/vanilla_tor.py
@@ -20,12 +20,12 @@ class UsageOptions(usage.Options):
     optParameters = [
         ['timeout', 't', 200,
          'Specify the timeout after which to consider '
-         'the Tor bootstrapping process to have failed'], ]
+         'the Tor bootstrapping process to have failed.'], ]
 
 
 class VanillaTor(nettest.NetTestCase):
     name = "Vanilla Tor"
-    description = "A test for checking if vanilla Tor connections work"
+    description = "A test for checking if vanilla Tor connections work."
     author = "Arturo Filastò"
     version = "0.1.0"
 
diff --git a/ooni/nettests/manipulation/captiveportal.py b/ooni/nettests/manipulation/captiveportal.py
index b1cbba7..844e411 100644
--- a/ooni/nettests/manipulation/captiveportal.py
+++ b/ooni/nettests/manipulation/captiveportal.py
@@ -42,14 +42,15 @@ from ooni.utils import net
 from ooni.utils import log
 
 __plugoo__ = "captiveportal"
-__desc__ = "Captive portal detection test"
+__desc__ = "Captive portal detection test."
 
 
 class UsageOptions(usage.Options):
-    optParameters = [['asset', 'a', None, 'Asset file'],
-                     ['experiment-url', 'e', 'http://google.com/', 'Experiment URL'],
+    optParameters = [['asset', 'a', None, 'Asset file.'],
+                     ['experiment-url', 'e', 'http://google.com/',
+                      'Experiment URL.'],
                      ['user-agent', 'u', random.choice(net.userAgents),
-                      'User agent for HTTP requests']
+                      'User agent for HTTP requests.']
     ]
 
 
@@ -60,7 +61,7 @@ class CaptivePortal(httpt.HTTPTest, dnst.DNSTest):
     """
 
     name = "captiveportal"
-    description = "Captive Portal Test"
+    description = "Captive Portal Test."
     version = '0.3'
     author = "Isis Lovecruft"
     usageOptions = UsageOptions
diff --git a/ooni/nettests/manipulation/dns_spoof.py b/ooni/nettests/manipulation/dns_spoof.py
index 20dbd66..27231f6 100644
--- a/ooni/nettests/manipulation/dns_spoof.py
+++ b/ooni/nettests/manipulation/dns_spoof.py
@@ -15,10 +15,10 @@ from ooni.utils import log
 class UsageOptions(usage.Options):
     optParameters = [
         ['resolver', 'r', None,
-         'Specify the resolver that should be used for DNS queries (ip:port)'],
-        ['hostname', 'h', None, 'Specify the hostname of a censored site'],
+         'Specify the resolver that should be used for DNS queries (ip:port).'],
+        ['hostname', 'h', None, 'Specify the hostname of a censored site.'],
         ['backend', 'b', None,
-         'Specify the IP address of a good DNS resolver (ip:port)']]
+         'Specify the IP address of a good DNS resolver (ip:port).']]
 
 
 class DNSSpoof(scapyt.ScapyTest):
diff --git a/ooni/nettests/manipulation/http_header_field_manipulation.py b/ooni/nettests/manipulation/http_header_field_manipulation.py
index d063eed..6fbaf7d 100644
--- a/ooni/nettests/manipulation/http_header_field_manipulation.py
+++ b/ooni/nettests/manipulation/http_header_field_manipulation.py
@@ -32,10 +32,10 @@ def random_capitalization(string):
 class UsageOptions(usage.Options):
     optParameters = [
         ['backend', 'b', None,
-         'URL of the backend to use for sending the requests'],
+         'URL of the backend to use for sending the requests.'],
         ['headers', 'h', None,
          'Specify a yaml formatted file from which to read '
-         'the request headers to send']
+         'the request headers to send.']
         ]
 
 
diff --git a/ooni/nettests/manipulation/http_host.py b/ooni/nettests/manipulation/http_host.py
index e2b0032..2e0a8e1 100644
--- a/ooni/nettests/manipulation/http_host.py
+++ b/ooni/nettests/manipulation/http_host.py
@@ -18,12 +18,13 @@ from ooni.templates import httpt
 
 
 class UsageOptions(usage.Options):
-    optParameters = [['backend', 'b', None,
-                      'URL of the test backend to use. Should be \
-                              listening on port 80 and be a \
-                        HTTPReturnJSONHeadersHelper (ex. http://1.1.1.1)'],
-                     ['content', 'c', None, 'The file to read \
-                            from containing the content of a block page']]
+    optParameters = [
+        ['backend', 'b', None,
+         'URL of the test backend to use. Should be listening on port 80 '
+         'and be a HTTPReturnJSONHeadersHelper (ex. http://1.1.1.1).'],
+        ['content', 'c', None, 'The file to read from containing the '
+         'content of a block page.']
+        ]
 
 
 class HTTPHost(httpt.HTTPTest):
@@ -38,7 +39,7 @@ class HTTPHost(httpt.HTTPTest):
     strategies will work.
     """
     name = "HTTP Host"
-    description = "Tests a variety of different filter bypassing techniques " \
+    description = "Tests a variety of different filter bypassing techniques "\
                   "based on the HTTP Host header field."
     author = "Arturo Filastò"
     version = "0.2.4"
@@ -47,7 +48,7 @@ class HTTPHost(httpt.HTTPTest):
     usageOptions = UsageOptions
 
     inputFile = ['file', 'f', None,
-                 'List of hostnames to test for censorship']
+                 'List of hostnames to test for censorship.']
 
     requiredTestHelpers = {'backend': 'http-return-json-headers'}
     requiredOptions = ['backend', 'file']
diff --git a/ooni/nettests/manipulation/http_invalid_request_line.py b/ooni/nettests/manipulation/http_invalid_request_line.py
index 2109677..94b0b99 100644
--- a/ooni/nettests/manipulation/http_invalid_request_line.py
+++ b/ooni/nettests/manipulation/http_invalid_request_line.py
@@ -8,10 +8,10 @@ from ooni.templates import tcpt
 
 class UsageOptions(usage.Options):
     optParameters = [
-        ['backend', 'b', None, 'The OONI backend that runs a TCP echo server'],
+        ['backend', 'b', None, 'The OONI backend that runs a TCP echo server.'],
         ['backendport', 'p', 80,
          'Specify the port that the TCP echo server is running '
-         '(should only be set for debugging)']]
+         '(should only be set for debugging).']]
 
 
 class HTTPInvalidRequestLine(tcpt.TCPTest):
diff --git a/ooni/nettests/manipulation/traceroute.py b/ooni/nettests/manipulation/traceroute.py
index b9267b0..d6f1ddf 100644
--- a/ooni/nettests/manipulation/traceroute.py
+++ b/ooni/nettests/manipulation/traceroute.py
@@ -12,23 +12,23 @@ from ooni.settings import config
 
 class UsageOptions(usage.Options):
     optParameters = [
-                    ['backend', 'b', None, 'Test backend to use'],
-                    ['timeout', 't', 5, 'The timeout for the traceroute test'],
+                    ['backend', 'b', None, 'Test backend to use.'],
+                    ['timeout', 't', 5, 'The timeout for the traceroute test.'],
                     ['maxttl', 'm', 30,
-                     'The maximum value of ttl to set on packets'],
+                     'The maximum value of ttl to set on packets.'],
                     ['dstport', 'd', None,
                      'Specify a single destination port. May be repeated.'],
                     ['interval', 'i', None,
-                     'Specify the inter-packet delay in seconds'],
+                     'Specify the inter-packet delay in seconds.'],
                     ['numPackets', 'n', None,
-                     'Specify the number of packets to send per hop'],
+                     'Specify the number of packets to send per hop.'],
         ]
 
 
 class Traceroute(scapyt.BaseScapyTest):
     name = "Traceroute"
     description = "Performs a UDP, TCP, ICMP traceroute with destination port number "\
-                  "set to 0, 22, 23, 53, 80, 123, 443, 8080 and 65535"
+                  "set to 0, 22, 23, 53, 80, 123, 443, 8080 and 65535."
 
     requiredTestHelpers = {'backend': 'traceroute'}
     requiresRoot = True
diff --git a/ooni/nettests/scanning/http_url_list.py b/ooni/nettests/scanning/http_url_list.py
index e3a4957..8d268df 100644
--- a/ooni/nettests/scanning/http_url_list.py
+++ b/ooni/nettests/scanning/http_url_list.py
@@ -9,7 +9,8 @@ from ooni.utils import log
 
 class UsageOptions(usage.Options):
     optParameters = [['content', 'c', None,
-                        'The file to read from containing the content of a block page'],
+                      'The file to read from containing the content of a '
+                        'block page.'],
                      ['url', 'u', None, 'Specify a single URL to test.']
                     ]
 
@@ -31,8 +32,8 @@ class HTTPURLList(httpt.HTTPTest):
     requiresRoot = False
     requiresTor = False
 
-    inputFile = ['file', 'f', None, 
-            'List of URLS to perform GET and POST requests to']
+    inputFile = ['file', 'f', None,
+            'List of URLS to perform GET and POST requests to.']
 
     def setUp(self):
         """
diff --git a/ooni/nettests/third_party/lantern.py b/ooni/nettests/third_party/lantern.py
index 5018ccb..d6b8c7c 100644
--- a/ooni/nettests/third_party/lantern.py
+++ b/ooni/nettests/third_party/lantern.py
@@ -18,7 +18,7 @@ class UsageOptions(usage.Options):
         ['url', 'u', net.GOOGLE_HUMANS[0],
             'Specify the URL to fetch over lantern (default: http://www.google.com/humans.txt).'],
         ['expected-body', 'e', net.GOOGLE_HUMANS[1],
-            'Specify the beginning of the expected body in the response (default: ' + net.GOOGLE_HUMANS[1] + ')']
+            'Specify the beginning of the expected body in the response (default: ' + net.GOOGLE_HUMANS[1] + ').']
     ]
 
 class LanternTest(ProcessTest):
@@ -34,7 +34,8 @@ class LanternTest(ProcessTest):
     """
 
     name = "Lantern Circumvention Tool Test"
-    description = "Bootstraps Lantern, connects to a URL and verifies if it contains the expected input"
+    description = "Bootstraps Lantern, connects to a URL and verifies if it "\
+                  "contains the expected input."
     author = "Aaron Gibson"
     version = "0.1.0"
     timeout = 120
diff --git a/ooni/nettests/third_party/netalyzr.py b/ooni/nettests/third_party/netalyzr.py
index ee5c477..46bdcda 100644
--- a/ooni/nettests/third_party/netalyzr.py
+++ b/ooni/nettests/third_party/netalyzr.py
@@ -26,12 +26,12 @@ class UsageOptions(usage.Options):
     optParameters = [
         ['clipath', 'p', None, 'Specify the path to NetalyzrCLI.jar (can be '
                                'downloaded from '
-                               'http://netalyzr.icsi.berkeley.edu/NetalyzrCLI.jar)']
+                               'http://netalyzr.icsi.berkeley.edu/NetalyzrCLI.jar).']
     ]
 
 class NetalyzrWrapperTest(process.ProcessTest):
     name = "NetalyzrWrapper"
-    description = "A wrapper around the Netalyzr java command line client"
+    description = "A wrapper around the Netalyzr java command line client."
     author = "Jacob Appelbaum <jacob at appelbaum.net>"
 
     requiredOptions = ['clipath']
diff --git a/ooni/nettests/third_party/openvpn.py b/ooni/nettests/third_party/openvpn.py
index bc2f0ea..a5780b3 100644
--- a/ooni/nettests/third_party/openvpn.py
+++ b/ooni/nettests/third_party/openvpn.py
@@ -30,7 +30,8 @@ class OpenVPNTest(ProcessTest):
     """
 
     name = "OpenVPN Client Test"
-    description = "Connects to an OpenVPN server and does a HTTP GET for the specified URL"
+    description = "Connects to an OpenVPN server and does a HTTP GET for the" \
+                  "specified URL."
     author = "srvetus "
     version = "0.0.2"
     timeout = 20
diff --git a/ooni/nettests/third_party/psiphon.py b/ooni/nettests/third_party/psiphon.py
index 9e50832..f4b0033 100644
--- a/ooni/nettests/third_party/psiphon.py
+++ b/ooni/nettests/third_party/psiphon.py
@@ -16,7 +16,7 @@ class UsageOptions(usage.Options):
         ['url', 'u', net.GOOGLE_HUMANS[0],
             'Specify the URL to fetch over psiphon (default: http://www.google.com/humans.txt).'],
         ['expected-body', 'e', net.GOOGLE_HUMANS[1],
-            'Specify the beginning of the expected body in the response (default: ' + net.GOOGLE_HUMANS[1] + ')']
+            'Specify the beginning of the expected body in the response (default: ' + net.GOOGLE_HUMANS[1] + ').']
     ]
 
 class PsiphonTest(httpt.HTTPTest,  process.ProcessTest):
@@ -32,7 +32,7 @@ class PsiphonTest(httpt.HTTPTest,  process.ProcessTest):
 
     name = "Psiphon Test"
     description = ("Bootstraps Psiphon and "
-                   "does a HTTP GET for the specified URL")
+                   "does a HTTP GET for the specified URL.")
     author = "juga"
     version = "0.1.0"
     timeout = 120
diff --git a/ooni/oonicli.py b/ooni/oonicli.py
index 1ffe467..9327afc 100644
--- a/ooni/oonicli.py
+++ b/ooni/oonicli.py
@@ -82,8 +82,8 @@ This will tell you how to run ooniprobe :)
 
     def opt_spew(self):
         """
-        Print an insanely verbose log of everything that happens.  Useful
-        when debugging freezes or locks in complex code.
+        Print an insanely verbose log of everything that happens.
+        Useful when debugging freezes or locks in complex code.
         """
         from twisted.python.util import spewer
         sys.settrace(spewer)
@@ -371,6 +371,8 @@ def runWithDirector(global_options):
                     ''.join(usage.docMakeChunks(optList))
             )
             print desc
+            print "Note: Third party tests require an external "\
+                  "application to run properly."
 
         sys.exit(0)
 



More information about the tor-commits mailing list