commit b6c84cd03ce1a4ea1bfc2e07bcad1574e298cd7a
Author: anadahz <[email protected]>
Date: Thu Feb 4 11:03:38 2016 -0300
Fix: Typo correction
---
docs/source/writing_test_helpers.rst | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/docs/source/writing_test_helpers.rst
b/docs/source/writing_test_helpers.rst
index 70d5e21..1926589 100644
--- a/docs/source/writing_test_helpers.rst
+++ b/docs/source/writing_test_helpers.rst
@@ -1,7 +1,7 @@
Writing Test Helpers
========
-OONI test helpers are used by OONI nettests to perform their meausrements.
They can be used either to establish a ground truth or to exchange information
with the probe to determine if some form of network manipulation is happening
in the network path between the probe and the backend.
+OONI test helpers are used by OONI nettests to perform their measurements.
They can be used either to establish a ground truth or to exchange information
with the probe to determine if some form of network manipulation is happening
in the network path between the probe and the backend.
Writing a Censorship Directionality Test Helper
--------------------------
@@ -17,7 +17,7 @@ Creating the test helper
ooni-backend keeps all the test-helpers in the `oonib/testhelpers directory
<https://github.com/TheTorProject/ooni-backend/tree/master/oonib/testhelpers>`_
Each individual test helper is a twisted service. Most of the current
test-helpers consists of a twisted Factory and a twisted Protocol defined in
the test helpers directory and a `stock Twisted Server
<https://twistedmatrix.com/documents/current/api/twisted.application.internet.html>`_
that is defined in the backend code. We will follow this model in the tutorial.
-Because of how simple this example test-helper is the job of our test-helper
factory is merely to deploy a single instance of our protocol each time it's
buildProtocol method is called. Because we have our factory inheret from the
base `Factory object
<https://twistedmatrix.com/trac/browser/tags/releases/twisted-15.5.0/twisted/internet/protocol.py#L27>`_
we merely have to define its ``protocol`` property to point to our protocol.::
+Because of how simple this example test-helper is the job of our test-helper
factory is merely to deploy a single instance of our protocol each time it's
buildProtocol method is called. Because we have our factory inhered from the
base `Factory object
<https://twistedmatrix.com/trac/browser/tags/releases/twisted-15.5.0/twisted/internet/protocol.py#L27>`_
we merely have to define its ``protocol`` property to point to our protocol.::
class TCPDirectionalityTestHelper(Factory):
"""
@@ -44,7 +44,7 @@ The protocol for this helper needs to do two things. First,
upon receiving encod
self.transport.write(original_string)
-In order to make this test-helper slightly more flexible we will be allowing
the backend to determine the encoding within their config file. To this end we
will have to retreive the encoding from the config file.::
+In order to make this test-helper slightly more flexible we will be allowing
the backend to determine the encoding within their config file. To this end we
will have to retrieve the encoding from the config file.::
def dataReceived(self, data):
@@ -70,9 +70,9 @@ Adding the helper to the config file
ooni-backend uses a config file located at `/etc/oonibackend.conf
<https://github.com/TheTorProject/ooni-backend/blob/master/oonib.conf.example>`_.
This file contains a `section where each test-helper can be configured.
<https://github.com/TheTorProject/ooni-backend/blob/479a1bb154037b834292ccc4b3d593d1472b44de/oonib.conf.example#L33-L65>`_.
-The test-helper will need to be given a unique identifyer so that it can be
called from the config file. In this example we use ``tcp-directionality`` as
our identifyer.
+The test-helper will need to be given a unique identifier so that it can be
called from the config file. In this example we use ``tcp-directionality`` as
our identifier.
-For a helper to be used in the ooni-backend it needs to be given an identifyer
so that it can be called from the config file::
+For a helper to be used in the ooni-backend it needs to be given an identifier
so that it can be called from the config file::
tcp-directionality:
encoding: rot13
@@ -91,7 +91,7 @@ The OONI test-helper system is a collection of `Twisted
services <https://twiste
**NOTE:** In this example I have placed the original service in the existing
tcp_helpers file. If you created your own file for your test-helper you will
have to make sure that you import that file at the top of `oonibackend.py
<https://github.com/TheTorProject/ooni-backend/blob/master/oonib/oonibackend.py>`_.
-OONI uses a `Multi Service
<https://twistedmatrix.com/documents/current/api/twisted.application.service.MultiService.html>`_
which allows them to combine all the OONI test-helpers and the
report-collector into a singlular service for easier management. The next step
for creating our test-helper is to add it to the ooni-backend `multiService
<https://github.com/TheTorProject/ooni-backend/blob/479a1bb154037b834292ccc4b3d593d1472b44de/oonib/oonibackend.py#L33>`_::
+OONI uses a `Multi Service
<https://twistedmatrix.com/documents/current/api/twisted.application.service.MultiService.html>`_
which allows them to combine all the OONI test-helpers and the
report-collector into a singular service for easier management. The next step
for creating our test-helper is to add it to the ooni-backend `multiService
<https://github.com/TheTorProject/ooni-backend/blob/479a1bb154037b834292ccc4b3d593d1472b44de/oonib/oonibackend.py#L33>`_::
# Add the helper as a child of the backends multi-service test-helper
multiService.addService(tcp_directionality_helper)
@@ -101,7 +101,7 @@ Finally, we need to start our service.::
# Start the test-helpers service
tcp_directionality_helper.startService()
-In order for our test-helper to be managed using the backend config file we
will need to modify this code to check the config file for a test-helper that
uses the identifyer we selected earlier. For the directionality helper we check
to see if our test-helper had its port specified in the config file to
determine if it should be run. I also added a default encoding in case
+In order for our test-helper to be managed using the backend config file we
will need to modify this code to check the config file for a test-helper that
uses the identifier we selected earlier. For the directionality helper we check
to see if our test-helper had its port specified in the config file to
determine if it should be run. I also added a default encoding in case
This snippet contains the final code that would be inserted into
`oonibackend.py
<https://github.com/TheTorProject/ooni-backend/blob/master/oonib/oonibackend.py>`_.::
@@ -128,7 +128,7 @@ This snippet contains the final code that would be inserted
into `oonibackend.py
Requiring the helper in a test
-------------
-If you are creating tests that rely on custom test-hepers you will want to
make sure that you do not get innacturate results because your test-helper
being missing in the ooni-backend you are testing against. You can specify
required test-helpers within a ooni-probe test by setting its
``requiredTestHelpers`` property. In this example we have made our test helper
require the tcp-directionality test that we created above.::
+If you are creating tests that rely on custom test-helpers you will want to
make sure that you do not get inaccurate results because your test-helper being
missing in the ooni-backend you are testing against. You can specify required
test-helpers within a ooni-probe test by setting its ``requiredTestHelpers``
property. In this example we have made our test helper require the
tcp-directionality test that we created above.::
class MyDirectionalityTest(nettest.NetTestCase):
""" An example test."""
_______________________________________________
tor-commits mailing list
[email protected]
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits