[tor-commits] [ooni-probe/master] Only lookup test decks if they have not already been specified.

art at torproject.org art at torproject.org
Sat Sep 28 20:14:37 UTC 2013


commit b9bc4f0ed03c51fb4e82c57c65dacebbacd4360c
Author: Arturo Filastò <art at fuffa.org>
Date:   Wed Sep 11 18:15:36 2013 +0200

    Only lookup test decks if they have not already been specified.
---
 decks/before_i_commit.testdeck |    4 ++++
 ooni/deck.py                   |    5 +++++
 2 files changed, 9 insertions(+)

diff --git a/decks/before_i_commit.testdeck b/decks/before_i_commit.testdeck
index 69ef16c..9a3bca7 100644
--- a/decks/before_i_commit.testdeck
+++ b/decks/before_i_commit.testdeck
@@ -1,5 +1,6 @@
 - options:
     collector: null
+    no-collector: true
     help: 0
     logfile: reports/before_i_commit.log
     pcapfile: null
@@ -8,6 +9,7 @@
     test_file: manipulation/captiveportal
 - options:
     collector: null
+    no-collector: true
     help: 0
     logfile: reports/before_i_commit.log
     pcapfile: null
@@ -16,6 +18,7 @@
     test_file: blocking/dnsconsistency
 - options:
     collector: null
+    no-collector: true
     help: 0
     logfile: reports/before_i_commit.log
     pcapfile: null
@@ -23,6 +26,7 @@
     subargs: [-b, 'http://93.95.227.200', -f, example_inputs/http_host_file.txt]
     test_file: manipulation/http_host
 - options:
+    no-collector: true
     collector: null
     help: 0
     logfile: reports/before_i_commit.log
diff --git a/ooni/deck.py b/ooni/deck.py
index 5cd8773..8820d12 100644
--- a/ooni/deck.py
+++ b/ooni/deck.py
@@ -148,9 +148,14 @@ class Deck(InputFile):
         required_test_helpers = []
         for net_test_loader in self.netTestLoaders:
             for th in net_test_loader.requiredTestHelpers:
+                if th['test_class'].localOptions[th['option']]:
+                    continue
                 # {'name':'', 'option':'', 'test_class':''}
                 required_test_helpers.append(th['name'])
 
+        if not required_test_helpers:
+            defer.returnValue(None)
+
         response = yield oonibclient.lookupTestHelpers(required_test_helpers)
 
         for net_test_loader in self.netTestLoaders:





More information about the tor-commits mailing list