[Pkg-privacy-commits] [obfsproxy] 224/353: Add an integration test for ScrambleSuit.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:02:02 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository obfsproxy.

commit bafad20e405f841148448a412d50fa918d9b5026
Author: Philipp Winter <phw at torproject.org>
Date:   Tue Feb 4 00:20:09 2014 +0100

    Add an integration test for ScrambleSuit.
---
 obfsproxy/test/tester.py | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/obfsproxy/test/tester.py b/obfsproxy/test/tester.py
index 894ba32..5e8ec1b 100644
--- a/obfsproxy/test/tester.py
+++ b/obfsproxy/test/tester.py
@@ -22,6 +22,8 @@ import time
 import traceback
 import unittest
 import sys,os
+import tempfile
+import shutil
 
 def diff(label, expected, received):
     """
@@ -271,6 +273,38 @@ class DirectObfs3(DirectTest, unittest.TestCase):
                    "127.0.0.1:%d" % ENTRY_PORT,
                    "--dest=127.0.0.1:%d" % SERVER_PORT)
 
+class DirectScrambleSuit(DirectTest, unittest.TestCase):
+    transport = "scramblesuit"
+
+    def setUp(self):
+        # First, we need to create data directories for ScrambleSuit.  It uses
+        # them to store persistent information such as session tickets and the
+        # server's long-term keys.
+        self.tmpdir_srv = tempfile.mkdtemp(prefix="server")
+        self.tmpdir_cli = tempfile.mkdtemp(prefix="client")
+
+        self.server_args = ("--data-dir=%s" % self.tmpdir_srv,
+                            "scramblesuit", "server",
+                            "127.0.0.1:%d" % SERVER_PORT,
+                            "--password=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
+                            "--dest=127.0.0.1:%d" % EXIT_PORT)
+        self.client_args = ("--data-dir=%s" % self.tmpdir_cli,
+                            "scramblesuit", "client",
+                            "127.0.0.1:%d" % ENTRY_PORT,
+                            "--password=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
+                            "--dest=127.0.0.1:%d" % SERVER_PORT)
+
+        # Now, the remaining setup steps can be done.
+        super(DirectScrambleSuit, self).setUp()
+
+    def tearDown(self):
+        # First, let the parent class shut down the test.
+        super(DirectScrambleSuit, self).tearDown()
+
+        # Now, we can clean up after ourselves.
+        shutil.rmtree(self.tmpdir_srv)
+        shutil.rmtree(self.tmpdir_cli)
+
 
 TEST_FILE = """\
 THIS IS A TEST FILE. IT'S USED BY THE INTEGRATION TESTS.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/obfsproxy.git



More information about the Pkg-privacy-commits mailing list