[tor-commits] [ooni-probe/master] Check to see if a required option is a test helper we can look up
art at torproject.org
art at torproject.org
Sat Nov 23 11:11:41 UTC 2013
commit ea00095a440cbf84664dfec8880715d4615ead14
Author: aagbsn <aagbsn at extc.org>
Date: Fri Nov 22 18:10:06 2013 +0000
Check to see if a required option is a test helper we can look up
---
ooni/deck.py | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/ooni/deck.py b/ooni/deck.py
index d7b2d7e..23bb9a1 100644
--- a/ooni/deck.py
+++ b/ooni/deck.py
@@ -118,15 +118,23 @@ class Deck(InputFile):
continue
net_test_loader = NetTestLoader(test['options']['subargs'],
test_file=nettest_path)
+ self.insert(net_test_loader)
#XXX: If the deck specifies the collector, we use the specified collector
# And it should also specify the test helper address to use
# net_test_loader.collector = test['options']['collector']
- net_test_loader.checkOptions()
- self.netTestLoaders.append(net_test_loader)
def insert(self, net_test_loader):
""" Add a NetTestLoader to this test deck """
- net_test_loader.checkOptions()
+ try:
+ net_test_loader.checkOptions()
+ except e.MissingRequiredOption, option_name:
+ if not self.bouncer:
+ raise
+ for rth in net_test_loader.requiredTestHelpers:
+ if option_name.message == rth['option']:
+ break
+ else:
+ raise
self.netTestLoaders.append(net_test_loader)
@defer.inlineCallbacks
More information about the tor-commits
mailing list