[tor-commits] [ooni-probe/master] Fix report uploader to work with JSON

art at torproject.org art at torproject.org
Mon May 30 16:28:32 UTC 2016


commit 613a02cdfe44c14fc8a1e91003a80000617d913f
Author: Arturo Filastò <arturo at filasto.net>
Date:   Thu Feb 4 16:39:14 2016 +0100

    Fix report uploader to work with JSON
    
    * Add better exception handling to deckgen
    * We should actually be using POST since PUT is indempotent
    * Debugging of backward and forward data format compatibility
    * Better integrity checks in web_consistency
---
 ooni/nettests/blocking/web_connectivity.py | 4 +++-
 ooni/reporter.py                           | 2 --
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ooni/nettests/blocking/web_connectivity.py b/ooni/nettests/blocking/web_connectivity.py
index a61819a..6734618 100644
--- a/ooni/nettests/blocking/web_connectivity.py
+++ b/ooni/nettests/blocking/web_connectivity.py
@@ -106,6 +106,7 @@ class WebConnectivityTest(httpt.HTTPTest, dnst.DNSTest):
             },
             'http_request': {
                 'body_length': None,
+                'failure': True,
                 'headers': {}
             }
         }
@@ -238,7 +239,8 @@ class WebConnectivityTest(httpt.HTTPTest, dnst.DNSTest):
         tcp_connect = None
 
         if self.report['control_failure'] is None and \
-                self.report['http_experiment_failure'] is None:
+                self.report['http_experiment_failure'] is None and \
+                self.report['control']['http_request']['failure'] is None:
             body_length_match = self.compare_body_lengths(experiment_http_response)
 
         if self.report['control_failure'] is None:
diff --git a/ooni/reporter.py b/ooni/reporter.py
index 49df443..4318fd5 100644
--- a/ooni/reporter.py
+++ b/ooni/reporter.py
@@ -201,7 +201,6 @@ class YAMLReporter(OReporter):
             raise Exception("Failed to serialise entry")
         content += safe_dump(report_entry)
         content += '...\n'
-        report_entry.update(self.testDetails)
         self._write(content)
 
     def createReport(self):
@@ -295,7 +294,6 @@ class OONIBReporter(OReporter):
                 report_entry = entry
             else:
                 raise Exception("Failed to serialise entry")
-            report_entry.update(self.testDetails)
             content += safe_dump(report_entry)
             content += '...\n'
             return content





More information about the tor-commits mailing list