[tor-commits] [ooni-probe/master] Merge remote-tracking branch 'aagbsn/feature/add_deck_input_fetching' into feature/oonib-support

art at torproject.org art at torproject.org
Tue Aug 27 09:21:51 UTC 2013


commit 8d77ff51fe8b636027dc4c199730357a56b63a51
Merge: 51caef2 0fd667f
Author: Arturo Filastò <art at fuffa.org>
Date:   Wed Aug 21 15:07:42 2013 +0200

    Merge remote-tracking branch 'aagbsn/feature/add_deck_input_fetching' into feature/oonib-support
    
    * aagbsn/feature/add_deck_input_fetching:
      Make oonicli download inputs before starting tests.
      Adds class TestDeck
      Move input checking out of checkOptions
      Add UnableToLoadDeckInput Exception
    
    Conflicts:
    	ooni/oonicli.py

 ooni/deck.py    |  116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ooni/errors.py  |    3 +-
 ooni/nettest.py |   12 +++---
 ooni/oonicli.py |   96 +++++++++++++++++++++++++++------------------
 4 files changed, 184 insertions(+), 43 deletions(-)

diff --cc ooni/oonicli.py
index 32fc762,2a141f6..4c7dd8b
--- a/ooni/oonicli.py
+++ b/ooni/oonicli.py
@@@ -110,43 -111,6 +111,17 @@@ def runWithDirector()
  
      log.start(global_options['logfile'])
  
 +    if config.privacy.includepcap:
 +        try:
 +            checkForRoot()
 +        except errors.InsufficientPrivileges:
 +             log.err("Insufficient Privileges to capture packets."
 +                     " See ooniprobe.conf privacy.includepcap") 
 +             sys.exit(2)
 +
 +    # contains (test_cases, options, cmd_line_options)
 +    test_list = []
-     if global_options['no-collector']:
-         log.msg("Not reporting using a collector")
-         global_options['collector'] = None
- 
-     if global_options['testdeck']:
-         test_deck = yaml.safe_load(open(global_options['testdeck']))
-         for test in test_deck:
-             test_list.append(NetTestLoader(test['options']['subargs'],
-                                            test_file=test['options']['test_file']))
-     else:
-         log.debug("No test deck detected")
-         test_list.append(NetTestLoader(global_options['subargs'],
-                                        test_file=global_options['test_file']))
- 
-     # check each test's usageOptions
-     for net_test_loader in test_list:
-         try:
-             net_test_loader.checkOptions()
-         except MissingRequiredOption, option_name:
-             log.err('Missing required option: "%s"' % option_name)
-             print net_test_loader.usageOptions().getUsage()
-             sys.exit(2)
-         except usage.UsageError, e:
-             log.err(e)
-             print net_test_loader.usageOptions().getUsage()
-             sys.exit(2)
 +
      director = Director()
      d = director.start()
  





More information about the tor-commits mailing list