[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r18518 - in gnunet/src/integration-tests: . confs hostkeys
From: |
gnunet |
Subject: |
[GNUnet-SVN] r18518 - in gnunet/src/integration-tests: . confs hostkeys |
Date: |
Thu, 8 Dec 2011 18:22:03 +0100 |
Author: wachs
Date: 2011-12-08 18:22:03 +0100 (Thu, 08 Dec 2011)
New Revision: 18518
Added:
gnunet/src/integration-tests/hostkeys/
gnunet/src/integration-tests/hostkeys/0000-hostkey
gnunet/src/integration-tests/hostkeys/0001-hostkey
Modified:
gnunet/src/integration-tests/confs/c_no_nat_client.conf
gnunet/src/integration-tests/test_integration_bootstrap_and_connect.py.in
Log:
-more
Modified: gnunet/src/integration-tests/confs/c_no_nat_client.conf
===================================================================
--- gnunet/src/integration-tests/confs/c_no_nat_client.conf 2011-12-08
16:16:24 UTC (rev 18517)
+++ gnunet/src/integration-tests/confs/c_no_nat_client.conf 2011-12-08
17:22:03 UTC (rev 18518)
@@ -132,6 +132,7 @@
ATS_EXEC_INTERVAL = 30000
[transport]
+#DEBUG = YES
AUTOSTART = YES
PORT = 20029
HOSTNAME = localhost
@@ -274,7 +275,7 @@
CONFIG = $DEFAULTCONFIG
BINARY = gnunet-daemon-hostlist
OPTIONS = -b
-SERVERS = http://v9.gnunet.org:58080/
+SERVERS = http://localhost:8080/
HTTP-PROXY =
[core]
Added: gnunet/src/integration-tests/hostkeys/0000-hostkey
===================================================================
(Binary files differ)
Property changes on: gnunet/src/integration-tests/hostkeys/0000-hostkey
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: gnunet/src/integration-tests/hostkeys/0001-hostkey
===================================================================
(Binary files differ)
Property changes on: gnunet/src/integration-tests/hostkeys/0001-hostkey
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified:
gnunet/src/integration-tests/test_integration_bootstrap_and_connect.py.in
===================================================================
--- gnunet/src/integration-tests/test_integration_bootstrap_and_connect.py.in
2011-12-08 16:16:24 UTC (rev 18517)
+++ gnunet/src/integration-tests/test_integration_bootstrap_and_connect.py.in
2011-12-08 17:22:03 UTC (rev 18518)
@@ -23,6 +23,7 @@
import subprocess
import re
import shutil
+import time
#
# This test tests if a fresh peer bootstraps from a hostlist server and then
@@ -31,80 +32,102 @@
#definitions
-def vpfrint (msg):
- if verbose == True:
- print msg
-
-
testname = "test_integration_bootstrap_and_connect"
verbose = True
+gnunetarm = ""
+#fix this!
+success = True
+timeout = 2
-# setup
+def vprintf (msg):
+ if verbose == True:
+ print msg
-srcdir = "../.."
-gnunet_pyexpect_dir = os.path.join (srcdir, "contrib")
-if gnunet_pyexpect_dir not in sys.path:
- sys.path.append (gnunet_pyexpect_dir)
+def setup ():
+ srcdir = "../.."
+ gnunet_pyexpect_dir = os.path.join (srcdir, "contrib")
+ if gnunet_pyexpect_dir not in sys.path:
+ sys.path.append (gnunet_pyexpect_dir)
+
+ from gnunet_pyexpect import pexpect
-from gnunet_pyexpect import pexpect
+ global gnunetarm
+ if os.name == 'posix':
+ gnunetarm = 'gnunet-arm'
+ elif os.name == 'nt':
+ gnunetarm = 'gnunet-arm.exe'
+
+ if os.name == "nt":
+ shutil.rmtree (os.path.join (os.getenv ("TEMP"), testname), True)
+ else:
+ shutil.rmtree ("/tmp/" + testname, True)
-if os.name == 'posix':
- gnunetarm = 'gnunet-arm'
-elif os.name == 'nt':
- gnunetarm = 'gnunet-arm.exe'
+def start ():
+ vprintf ("Starting bootstrap server & client")
+ try:
+ server = subprocess.Popen ([gnunetarm, '-sq', '-c',
'./confs/c_bootstrap_server.conf'])
+ server.communicate ()
+ except OSError:
+ print "Can not start bootstrap server, exiting..."
+ exit (1)
+ try:
+ client = subprocess.Popen ([gnunetarm, '-sq', '-c',
'confs/c_no_nat_client.conf'])
+ client.communicate ()
+ except OSError:
+ print "Can not start bootstrap client, exiting..."
+ exit (1)
+ vprintf ("Bootstrap server & client started")
-if os.name == "nt":
- shutil.rmtree (os.path.join (os.getenv ("TEMP"), testname), True)
-else:
- shutil.rmtree ("/tmp/" + testname, True)
+def stop ():
+ vprintf ("Shutting down bootstrap server")
+ try:
+ server = subprocess.Popen ([gnunetarm, '-eq', '-c',
'./confs/c_bootstrap_server.conf'])
+ server.communicate ()
+ except OSError:
+ print "Can not stop bootstrap server, exiting..."
+ exit (1)
+ try:
+ client = subprocess.Popen ([gnunetarm, '-eq', '-c',
'confs/c_no_nat_client.conf'])
+ client.communicate ()
+ except OSError:
+ print "Can not stop bootstrap client, exiting..."
+ exit (1)
+ vprintf ("Bootstrap server & client stopped")
-vpfrint ("Running " + testname)
+def cleanup ():
+ if os.name == "nt":
+ shutil.rmtree (os.path.join (os.getenv ("TEMP"),
"gnunet-test-fs-py-ns"), True)
+ else:
+ shutil.rmtree ("/tmp/gnunet-test-fs-py-ns", True)
+def check ():
+ global success
+ global timeout
+ count = 1
-# start nodes
+ while ((success == False) and (count < timeout)):
+ time.sleep(1)
+ count += 1
-vpfrint ("Starting bootstrap server & client")
-try:
- server = subprocess.Popen ([gnunetarm, '-sq', '-c',
'./confs/c_bootstrap_server.conf'])
- server.communicate ()
-except OSError:
- print "Can not start bootstrap server, exiting..."
- exit (1)
-try:
- client = subprocess.Popen ([gnunetarm, '-sq', '-c',
'confs/c_no_nat_client.conf'])
- client.communicate ()
-except OSError:
- print "Can not start bootstrap client, exiting..."
- exit (1)
-vpfrint ("Bootstrap server & client started")
+#
+# Test execution
+#
+vprintf ("Running " + testname)
+setup ()
+start ()
-import time
-time.sleep(5)
+check ()
-# shutdown
-vpfrint ("Shutting down bootstrap server")
-try:
- server = subprocess.Popen ([gnunetarm, '-eq', '-c',
'./confs/c_bootstrap_server.conf'])
- server.communicate ()
-except OSError:
- print "Can not stop bootstrap server, exiting..."
- exit (1)
-try:
- client = subprocess.Popen ([gnunetarm, '-eq', '-c',
'confs/c_no_nat_client.conf'])
- client.communicate ()
-except OSError:
- print "Can not stop bootstrap client, exiting..."
- exit (1)
-vpfrint ("Bootstrap server & client stopped")
+stop ()
+cleanup ()
-# clean up
-
-if os.name == "nt":
- shutil.rmtree (os.path.join (os.getenv ("TEMP"), "gnunet-test-fs-py-ns"),
True)
+if (success == False):
+ print ('Test failed')
+ exit (1)
else:
- shutil.rmtree ("/tmp/gnunet-test-fs-py-ns", True)
+ print ('Test successful')
+ exit (0)
-exit (0)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r18518 - in gnunet/src/integration-tests: . confs hostkeys,
gnunet <=