commit 695b12a59650bf7c34d18297a2b3a1f9a074fa84 Author: Arturo Filastò art@fuffa.org Date: Thu Nov 8 17:42:43 2012 +0100
Rename keyword filtering test to HTTP keyword filtering --- nettests/core/http_keyword_filtering.py | 42 +++++++++++++++++++++++++++++++ nettests/core/keyword_filtering.py | 39 ---------------------------- 2 files changed, 42 insertions(+), 39 deletions(-)
diff --git a/nettests/core/http_keyword_filtering.py b/nettests/core/http_keyword_filtering.py new file mode 100644 index 0000000..fabdba6 --- /dev/null +++ b/nettests/core/http_keyword_filtering.py @@ -0,0 +1,42 @@ +# -*- encoding: utf-8 -*- +# +# :authors: Arturo Filastò +# :licence: see LICENSE + +from ooni.templates import httpt +class HTTPKeywordFiltering(httpt.HTTPTest): + """ + This test involves performing HTTP requests containing to be tested for + censorship keywords. + + It does not detect censorship on the client, but just logs the response from the + HTTP backend server. + """ + name = "HTTP Keyword Filtering" + author = "Arturo Filastò" + version = 0.1 + + optParameters = [['backend', 'b', None, 'URL of the backend system to use for testing']] + + inputFile = ['file', 'f', None, 'List of keywords to use for censorship testing'] + + def processInputs(self): + if 'backend' in self.localOptions: + self.url = self.localOptions['backend'] + else: + raise Exception("No backend specified") + + def test_get(self): + """ + Perform a HTTP GET request to the backend containing the keyword to be + tested inside of the request body. + """ + return self.doRequest(self.url, method="GET", body=self.input) + + def test_post(self): + """ + Perform a HTTP POST request to the backend containing the keyword to be + tested inside of the request body. + """ + return self.doRequest(self.url, method="POST", body=self.input) + diff --git a/nettests/core/keyword_filtering.py b/nettests/core/keyword_filtering.py deleted file mode 100644 index 26af327..0000000 --- a/nettests/core/keyword_filtering.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- encoding: utf-8 -*- -# -# :authors: Arturo Filastò -# :licence: see LICENSE - -from ooni.templates import httpt -class KeywordFiltering(httpt.HTTPTest): - """ - This test involves performing HTTP requests containing to be tested for - censorship keywords. - """ - name = "Keyword Filtering" - author = "Arturo Filastò" - version = 0.1 - - optParameters = [['backend', 'b', None, 'URL of the backend system to use for testing']] - - inputFile = ['file', 'f', None, 'List of keywords to use for censorship testing'] - - def processInputs(self): - if 'backend' in self.localOptions: - self.url = self.localOptions['backend'] - else: - raise Exception("No backend specified") - - def test_get(self): - """ - Perform a HTTP GET request to the backend containing the keyword to be - tested inside of the request body. - """ - return self.doRequest(self.url, method="GET", body=self.input) - - def test_post(self): - """ - Perform a HTTP POST request to the backend containing the keyword to be - tested inside of the request body. - """ - return self.doRequest(self.url, method="POST", body=self.input) -