viff

changeset 961:153c24a4a6c5

Randomize port numbers in unit tests.
author Martin Geisler <mg@daimi.au.dk>
date Thu, 02 Oct 2008 22:22:24 +0200
parents c1f4a7b57e75
children 37e05ffb25af
files viff/test/test_apps.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/viff/test/test_apps.py	Thu Oct 02 22:12:40 2008 +0200
     1.2 +++ b/viff/test/test_apps.py	Thu Oct 02 22:22:24 2008 +0200
     1.3 @@ -27,6 +27,7 @@
     1.4  from twisted.internet.defer import Deferred, gatherResults
     1.5  
     1.6  from viff.field import GF256
     1.7 +from viff.util import rand
     1.8  
     1.9  def execute(executable, *args):
    1.10      """Execute *executable* when the reactor is started."""
    1.11 @@ -53,9 +54,12 @@
    1.12          self.oldcwd = os.getcwd()
    1.13          os.chdir(path.join(root_dir, "apps"))
    1.14  
    1.15 +        port1, port2, port3 = rand.sample(xrange(10000, 30000), 3)
    1.16          p = execute("generate-config-files.py", "--prefix", "trial",
    1.17                      "--players", "3", "--threshold", "1",
    1.18 -                    "localhost:10000", "localhost:20000", "localhost:30000")
    1.19 +                    "localhost:%d" % port1,
    1.20 +                    "localhost:%d" % port2,
    1.21 +                    "localhost:%d" % port3)
    1.22          return p
    1.23  
    1.24      def tearDown(self):