[tor-commits] [ooni-probe/master] Make no intersection amongst decks (#622)

art at torproject.org art at torproject.org
Fri Oct 14 19:00:56 UTC 2016


commit 16ff68c872818152784107f8f579b649f58225ce
Author: Arturo Filastò <arturo at filasto.net>
Date:   Wed Oct 12 15:50:36 2016 +0200

    Make no intersection amongst decks (#622)
    
    * Make no intersection amongst decks
    
    * Create 2 new decks that are currently quite weak, but can be expanded
    
    * Create dummy decks for all the default decks
---
 data/decks/http-invalid.yaml   |  8 ++++++++
 data/decks/im.yaml             | 14 ++++++++++++++
 data/decks/tor.yaml            | 12 ++++++++++++
 data/decks/web-full.yaml       | 23 -----------------------
 data/decks/web-no-invalid.yaml | 18 ------------------
 data/decks/web.yaml            | 18 ++++++++++++++++++
 ooni/deck/store.py             |  2 +-
 ooni/tests/test_scheduler.py   | 18 +++++++++---------
 8 files changed, 62 insertions(+), 51 deletions(-)

diff --git a/data/decks/http-invalid.yaml b/data/decks/http-invalid.yaml
new file mode 100644
index 0000000..9690376
--- /dev/null
+++ b/data/decks/http-invalid.yaml
@@ -0,0 +1,8 @@
+---
+name: HTTP Invalid Request Line
+description: This deck runs HTTP Invalid Request Line test
+schedule: "@daily"
+tasks:
+- name: Runs the HTTP Invalid Request Line test
+  ooni:
+    test_name: http_invalid_request_line
diff --git a/data/decks/im.yaml b/data/decks/im.yaml
new file mode 100644
index 0000000..7609022
--- /dev/null
+++ b/data/decks/im.yaml
@@ -0,0 +1,14 @@
+---
+name: Instant Messaging deck
+description: This test deck will check to see if instant messaging applications are working
+schedule: "@daily"
+tasks:
+- name: Checks to see if WhatsApp web is working
+  ooni:
+    test_name: web_connectivity
+    url: 'https://web.whatsapp.com/'
+
+- name: Checks to see if Facebook is working
+  ooni:
+    test_name: web_connectivity
+    url: 'https://facebook.com/'
diff --git a/data/decks/tor.yaml b/data/decks/tor.yaml
new file mode 100644
index 0000000..9d0634f
--- /dev/null
+++ b/data/decks/tor.yaml
@@ -0,0 +1,12 @@
+---
+name: Tor test deck
+description: This deck runs test related to testing the reachability of the Tor network
+schedule: "@daily"
+tasks:
+- name: Checks if the Tor client works
+  ooni:
+    test_name: vanilla_tor
+
+- name: Runs the Meek fronted request test
+  ooni:
+    test_name: meek_fronted_requests
diff --git a/data/decks/web-full.yaml b/data/decks/web-full.yaml
deleted file mode 100644
index ccb470d..0000000
--- a/data/decks/web-full.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
----
-name: Full Web test deck
-description: This deck runs HTTP Header Field Manipulation, HTTP Invalid
-    Request Line and the Web Connectivity test
-schedule: "@daily"
-tasks:
-- name: Runs the HTTP Header Field Manipulation test
-  ooni:
-    test_name: http_header_field_manipulation
-
-- name: Runs the HTTP Invalid Request Line test
-  ooni:
-    test_name: http_invalid_request_line
-
-- name: Runs the Web Connectivity Test
-  ooni:
-    test_name: web_connectivity
-    file: $citizenlab_global_urls
-
-- name: Runs the Web Connectivity Test
-  ooni:
-    test_name: web_connectivity
-    file: $citizenlab_${probe_cc}_urls
diff --git a/data/decks/web-no-invalid.yaml b/data/decks/web-no-invalid.yaml
deleted file mode 100644
index ea93488..0000000
--- a/data/decks/web-no-invalid.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-name: Web test deck without HTTP Invalid Request Line
-description: This deck runs HTTP Header Field Manipulation, and the Web Connectivity test
-schedule: "@daily"
-tasks:
-- name: Runs the HTTP Header Field Manipulation test
-  ooni:
-    test_name: http_header_field_manipulation
-
-- name: Runs the Web Connectivity Test
-  ooni:
-    test_name: web_connectivity
-    file: $citizenlab_global_urls
-
-- name: Runs the Web Connectivity Test
-  ooni:
-    test_name: web_connectivity
-    file: $citizenlab_${probe_cc}_urls
diff --git a/data/decks/web.yaml b/data/decks/web.yaml
new file mode 100644
index 0000000..9232cec
--- /dev/null
+++ b/data/decks/web.yaml
@@ -0,0 +1,18 @@
+---
+name: Web test deck
+description: This deck runs HTTP Header Field Manipulation and the Web Connectivity test
+schedule: "@daily"
+tasks:
+- name: Runs the HTTP Header Field Manipulation test
+  ooni:
+    test_name: http_header_field_manipulation
+
+- name: Runs the Web Connectivity Test
+  ooni:
+    test_name: web_connectivity
+    file: $citizenlab_global_urls
+
+- name: Runs the Web Connectivity Test
+  ooni:
+    test_name: web_connectivity
+    file: $citizenlab_${probe_cc}_urls
diff --git a/ooni/deck/store.py b/ooni/deck/store.py
index 8fdb856..956ea37 100644
--- a/ooni/deck/store.py
+++ b/ooni/deck/store.py
@@ -13,7 +13,7 @@ from ooni.resources import check_for_update
 from ooni.settings import config
 
 # These are the decks to be run by default.
-DEFAULT_DECKS = ['web-full']
+DEFAULT_DECKS = ['web', 'tor', 'im', 'http-invalid']
 
 class InputNotFound(Exception):
     pass
diff --git a/ooni/tests/test_scheduler.py b/ooni/tests/test_scheduler.py
index e954668..c0ab5eb 100644
--- a/ooni/tests/test_scheduler.py
+++ b/ooni/tests/test_scheduler.py
@@ -15,7 +15,7 @@ from twisted.trial import unittest
 from ooni.utils import generate_filename, randomSTR, randomDate, LONG_DATE
 from ooni.tests.bases import ConfigTestCase
 
-from ooni.deck.store import DeckStore
+from ooni.deck.store import DeckStore, DEFAULT_DECKS
 from ooni.agent.scheduler import ScheduledTask, DidNotRun
 from ooni.agent.scheduler import FileSystemlockAndMutex
 from ooni.agent.scheduler import SchedulerService
@@ -182,14 +182,13 @@ def write_dummy_measurements(fh, size=100):
     return written_size
 
 
-DUMMY_WEB_FULL = """
+DUMMY_DECK = """
 ---
-name: Full Web test deck
-description: This deck runs HTTP Header Field Manipulation, HTTP Invalid
-    Request and the Web Connectivity test
+name: Dummy deck
+description: Dummy deck
 schedule: "@daily"
 tasks:
-- name: Runs the HTTP Header Field Manipulation test
+- name: Dummy bar
   ooni:
     test_name: http_header_field_manipulation
 """
@@ -232,9 +231,10 @@ class TestSchedulerService(ConfigTestCase):
         self.mock_deck.setup.return_value = defer.succeed(None)
         self.mock_deck.run.return_value = defer.succeed(None)
 
-        with open(os.path.join(self.decks_available_directory,
-                               'web-full.yaml'), 'w') as out_file:
-            out_file.write(DUMMY_WEB_FULL)
+        for deck_name in DEFAULT_DECKS:
+            with open(os.path.join(self.decks_available_directory,
+                                   '%s.yaml' % deck_name), 'w') as out_file:
+                out_file.write(DUMMY_DECK)
 
     def create_dummy_measurements(self, count=10, size=10*1024):
         for _ in range(count):





More information about the tor-commits mailing list