gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r18528 - in gnunet/src/integration-tests: . confs


From: gnunet
Subject: [GNUnet-SVN] r18528 - in gnunet/src/integration-tests: . confs
Date: Fri, 9 Dec 2011 15:48:25 +0100

Author: wachs
Date: 2011-12-09 15:48:25 +0100 (Fri, 09 Dec 2011)
New Revision: 18528

Modified:
   gnunet/src/integration-tests/confs/c_bootstrap_server.conf
   gnunet/src/integration-tests/confs/c_no_nat_client.conf
   gnunet/src/integration-tests/test_integration_bootstrap_and_connect.py.in
Log:
first test ready


Modified: gnunet/src/integration-tests/confs/c_bootstrap_server.conf
===================================================================
--- gnunet/src/integration-tests/confs/c_bootstrap_server.conf  2011-12-09 
13:34:29 UTC (rev 18527)
+++ gnunet/src/integration-tests/confs/c_bootstrap_server.conf  2011-12-09 
14:48:25 UTC (rev 18528)
@@ -262,7 +262,7 @@
 BINARY = gnunet-service-arm
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
-DEFAULTSERVICES = topology hostlist
+DEFAULTSERVICES = topology hostlist fs
 UNIXPATH = /tmp/test-service-arm-4
 UNIX_MATCH_UID = YES
 UNIX_MATCH_GID = YES

Modified: gnunet/src/integration-tests/confs/c_no_nat_client.conf
===================================================================
--- gnunet/src/integration-tests/confs/c_no_nat_client.conf     2011-12-09 
13:34:29 UTC (rev 18527)
+++ gnunet/src/integration-tests/confs/c_no_nat_client.conf     2011-12-09 
14:48:25 UTC (rev 18528)
@@ -263,7 +263,7 @@
 BINARY = gnunet-service-arm
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
-DEFAULTSERVICES = topology hostlist
+DEFAULTSERVICES = topology hostlist fs
 UNIXPATH = /tmp/test-service-arm-18
 UNIX_MATCH_UID = YES
 UNIX_MATCH_GID = YES

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-09 13:34:29 UTC (rev 18527)
+++ gnunet/src/integration-tests/test_integration_bootstrap_and_connect.py.in   
2011-12-09 14:48:25 UTC (rev 18528)
@@ -26,23 +26,21 @@
 import time
 import pexpect
 
-
-
-
 #
 # This test tests if a fresh peer bootstraps from a hostlist server and then
 # successfully connects to the server 
 #
+# Conditions for successful exit:
+# Both peers have 1 connected peer in transport, core, topology, fs
 
 #definitions
 
 testname = "test_integration_bootstrap_and_connect"
-verbose = True
+verbose = False
 gnunetarm = ""
 gnunetstatistics = ""
-#fix this!
 success = False
-timeout = 10
+timeout = 100
 
 #test conditions
 
@@ -50,12 +48,13 @@
 server_transport_connected = False
 server_topology_connected = False
 server_core_connected = False
+server_fs_connected = False
 
 client_transport_connected = False
 client_topology_connected = False
 client_core_connected = False
+client_fs_connected = False
 
-
 def vprintf (msg):
     if verbose == True:
         print msg
@@ -115,8 +114,10 @@
 def cleanup ():
        if os.name == "nt":
            shutil.rmtree (os.path.join (os.getenv ("TEMP"), 
"gnunet-test-fs-py-ns"), True)
+           shutil.rmtree (os.path.join (os.getenv ("TEMP"), 
"c_no_nat_client"), True)
        else:
-           shutil.rmtree ("/tmp/gnunet-test-fs-py-ns", True)
+           shutil.rmtree ("/tmp/c_bootstrap_server/", True)
+           shutil.rmtree ("/tmp/c_no_nat_client/", True)
 
 def check_statistics (conf, subsystem, name, value):
     from gnunet_pyexpect import pexpect
@@ -135,17 +136,74 @@
   global success
   global timeout
   global publish
+  global server_transport_connected
+  global server_topology_connected
+  global server_core_connected
+  global server_fs_connected
+  
+  global client_transport_connected
+  global client_topology_connected
+  global client_core_connected
+  global client_fs_connected
 
   count = 1
-  print 'check'
   while ((success == False) and (count <= timeout)):
-    if (True == check_statistics ('./confs/c_bootstrap_server.conf', 
'transport', '# peers connected',1)):
-        vprintf ('Server transport services is connected')
-    if (True == check_statistics ('./confs/c_no_nat_client.conf', 'transport', 
'# peers connected',1)):
-        vprintf ('Client transport services is connected')           
-    time.sleep(1)
-    count += 1 
+       # Perform checks        
+       if ((False == server_transport_connected) and (True == check_statistics 
('./confs/c_bootstrap_server.conf', 'transport', '# peers connected',1))):
+         server_transport_connected = True
+         vprintf ('Server transport services is connected')
+         
+       if ((False == client_transport_connected) and (True == check_statistics 
('./confs/c_no_nat_client.conf', 'transport', '# peers connected',1))):
+         client_transport_connected = True
+         vprintf ('Client transport services is connected')
 
+       if ((False == server_core_connected) and (True == check_statistics 
('./confs/c_bootstrap_server.conf', 'core', '# neighbour entries 
allocated',1))):
+         server_core_connected = True
+         vprintf ('Server core services is connected')
+         
+       if ((False == client_core_connected) and (True == check_statistics 
('./confs/c_no_nat_client.conf', 'core', '# neighbour entries allocated',1))):
+         client_core_connected = True
+         vprintf ('Client core services is connected')
+
+       if ((False == server_topology_connected) and (True == check_statistics 
('./confs/c_bootstrap_server.conf', 'topology', '# peers connected',1))):
+         server_topology_connected = True
+         vprintf ('Server topology services is connected')
+         
+       if ((False == client_topology_connected) and (True == check_statistics 
('./confs/c_no_nat_client.conf', 'topology', '# peers connected',1))):
+         client_topology_connected = True
+         vprintf ('Client topology services is connected')
+         
+       if ((False == client_fs_connected) and (True == check_statistics 
('./confs/c_no_nat_client.conf', 'fs', '# peers connected',1))):
+         client_fs_connected = True
+         vprintf ('Client fs services is connected')
+       if ((False == server_fs_connected) and (True == check_statistics 
('./confs/c_bootstrap_server.conf', 'fs', '# peers connected',1))):
+         server_fs_connected = True
+         vprintf ('Server fs services is connected')     
+           
+       # Check if conditions fulfilled
+       if ((True == client_transport_connected) and (True == 
server_transport_connected) and 
+       (True == client_topology_connected) and (True == 
server_topology_connected) and 
+       (True == client_core_connected) and (True == server_core_connected) and
+       (True == client_fs_connected) and (True == server_fs_connected)):
+               success = True
+               break 
+       print '.'
+       time.sleep(1)
+       count += 1
+  if (success == False):
+               if (client_transport_connected == False):
+                       print ('Client transport was NOT connected')
+               if (server_transport_connected == False):
+                       print ('Server transport was NOT connected')
+               if (client_topology_connected == False):
+                       print ('Client topology was NOT connected')
+               if (server_topology_connected == False):
+                       print ('Server topology was NOT connected')
+               if (client_core_connected == False):
+                       print ('Client core was NOT connected')
+               if (server_core_connected == False):
+                       print ('Server core was NOT connected')
+
 # 
 # Test execution
 # 
@@ -156,7 +214,7 @@
 
 check ()
 
-#stop ()
+stop ()
 cleanup ()
 
 if (success == False):




reply via email to

[Prev in Thread] Current Thread [Next in Thread]