[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Merge pull request #53 from aagbsn/task_manager
commit a3f42467534259f85415f65d39971e8d80296cfe
Merge: 997a747 5da092d
Author: Jacob Appelbaum <jacob@xxxxxxxxxxxxx>
Date: Mon Mar 4 15:55:26 2013 -0800
Merge pull request #53 from aagbsn/task_manager
Add a task scheduler for tests and reports
bin/ooniprobe | 14 +-
decks/short_no_root.deck | 60 ++
example_inputs/alexa-top-1k.txt | 1000 +++++++++++++++++++++++++++++++
example_inputs/tcpconnect_host_file.txt | 3 +
nettests/blocking/http_requests.py | 2 +-
nettests/blocking/tcpconnect.py | 2 +-
nettests/examples/example_simple.py | 8 +
ooni/__init__.py | 2 -
ooni/director.py | 294 +++++++++
ooni/errors.py | 134 ++++
ooni/inputunit.py | 85 ---
ooni/managers.py | 156 +++++
ooni/nettest.py | 504 ++++++++++++----
ooni/oonicli.py | 168 +++---
ooni/ratelimiting.py | 68 +++
ooni/reporter.py | 326 +++++++----
ooni/runner.py | 357 +-----------
ooni/tasks.py | 138 +++++
ooni/templates/dnst.py | 4 +-
ooni/templates/httpt.py | 2 +-
ooni/templates/tcpt.py | 3 +-
tests/mocks.py | 168 ++++++
tests/test_director.py | 58 ++
tests/test_managers.py | 215 +++++++
tests/test_nettest.py | 264 ++++++++
tests/test_reporter.py | 238 ++++++++
tests/test_safe_represent.py | 14 +
27 files changed, 3507 insertions(+), 780 deletions(-)
diff --cc ooni/reporter.py
index 1f6c3e6,c01e904..594c6b8
--- a/ooni/reporter.py
+++ b/ooni/reporter.py
@@@ -183,13 -148,19 +148,16 @@@ class OReporter(object)
else:
test_input = test.input
- test_started = test._start_time
- test_runtime = time.time() - test_started
-
- report = {'input': test_input,
- 'test_name': test_name,
- 'test_started': test_started,
- 'test_runtime': test_runtime,
- 'report': test_report}
- return defer.maybeDeferred(self.writeReportEntry, report)
+ test_report['input'] = test_input
+ test_report['test_name'] = test_name
+ test_report['test_started'] = test._start_time
+ test_report['test_runtime'] = time.time() - test._start_time
+
+ return defer.maybeDeferred(self.writeReportEntry, test_report)
+ class InvalidDestination(ReporterException):
+ pass
+
class YAMLReporter(OReporter):
"""
These are useful functions for reporting to YAML format.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits