From: Christian Grothoff Date: Mon, 25 Jun 2012 07:17:55 +0000 (+0000) Subject: -LRN: fix integration tests X-Git-Tag: initial-import-from-subversion-38251~12838 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=31c11f6c1934bcef07e12055dc9d0484957bd5d5;p=oweals%2Fgnunet.git -LRN: fix integration tests --- diff --git a/src/integration-tests/test_integration_bootstrap_and_connect.py.in b/src/integration-tests/test_integration_bootstrap_and_connect.py.in index 0b29b460d..cd3bdbef8 100755 --- a/src/integration-tests/test_integration_bootstrap_and_connect.py.in +++ b/src/integration-tests/test_integration_bootstrap_and_connect.py.in @@ -51,14 +51,14 @@ testname = "test_integration_bootstrap_and_connect" verbose = True check_timeout = 180 +if os.name == "nt": + tmp = os.getenv ("TEMP") +else: + tmp = "/tmp" 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/c_bootstrap_server/", True) - shutil.rmtree ("/tmp/c_no_nat_client/", True) + shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), True) + shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), True) def success_cont (check): global success diff --git a/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect.py.in b/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect.py.in index 76e69b7cb..3ca0aea86 100755 --- a/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect.py.in +++ b/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect.py.in @@ -51,14 +51,14 @@ testname = "test_integration_bootstrap_and_connect" verbose = True check_timeout = 180 +if os.name == "nt": + tmp = os.getenv ("TEMP") +else: + tmp = "/tmp" 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/c_bootstrap_server/", True) - shutil.rmtree ("/tmp/c_no_nat_client/", True) + shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), True) + shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), True) def success_server_stop_cont (check): global success diff --git a/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect_nat.py.in b/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect_nat.py.in index 3269f4dc4..55982c2e4 100755 --- a/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect_nat.py.in +++ b/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect_nat.py.in @@ -51,14 +51,14 @@ testname = "test_integration_bootstrap_and_connect" verbose = True check_timeout = 180 +if os.name == "nt": + tmp = os.getenv ("TEMP") +else: + tmp = "/tmp" 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/c_bootstrap_server/", True) - shutil.rmtree ("/tmp/c_no_nat_client/", True) + shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), True) + shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), True) def success_server_stop_cont (check): global success diff --git a/src/integration-tests/test_integration_clique.py.in b/src/integration-tests/test_integration_clique.py.in index 7c3fdd8a9..6c7a5d770 100755 --- a/src/integration-tests/test_integration_clique.py.in +++ b/src/integration-tests/test_integration_clique.py.in @@ -36,6 +36,10 @@ from gnunet_testing import Check from gnunet_testing import Condition from gnunet_testing import * +if os.name == "nt": + tmp = os.getenv ("TEMP") +else: + tmp = "/tmp" #definitions @@ -45,14 +49,9 @@ check_timeout = 180 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) - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_no_nat_client_2"), True) - else: - shutil.rmtree ("/tmp/c_bootstrap_server/", True) - shutil.rmtree ("/tmp/c_no_nat_client/", True) - shutil.rmtree ("/tmp/c_no_nat_client_2/", True) + shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), True) + shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), True) + shutil.rmtree (os.path.join (tmp, "c_no_nat_client_2"), True) def success_cont (check): diff --git a/src/integration-tests/test_integration_clique_nat.py.in b/src/integration-tests/test_integration_clique_nat.py.in index 48dfa61cd..a457e8d83 100755 --- a/src/integration-tests/test_integration_clique_nat.py.in +++ b/src/integration-tests/test_integration_clique_nat.py.in @@ -37,6 +37,10 @@ from gnunet_testing import Check from gnunet_testing import Condition from gnunet_testing import * +if os.name == "nt": + tmp = os.getenv ("TEMP") +else: + tmp = "/tmp" #definitions testname = "test_integration_clique_nat" @@ -45,14 +49,9 @@ check_timeout = 180 def cleanup (): - if os.name == "nt": - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_bootstrap_server"), True) - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_no_nat_client"), True) - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_nat_client"), True) - else: - shutil.rmtree ("/tmp/c_bootstrap_server/", True) - shutil.rmtree ("/tmp/c_no_nat_client/", True) - shutil.rmtree ("/tmp/c_nat_client/", True) + shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), True) + shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), True) + shutil.rmtree (os.path.join (tmp, "c_nat_client"), True) def success_cont (check): diff --git a/src/integration-tests/test_integration_connect_on_restart.py.in b/src/integration-tests/test_integration_connect_on_restart.py.in index 7215b9bf3..0b23c8fe8 100755 --- a/src/integration-tests/test_integration_connect_on_restart.py.in +++ b/src/integration-tests/test_integration_connect_on_restart.py.in @@ -45,16 +45,15 @@ testname = "test_integration_clique" verbose = True check_timeout = 180 +if os.name == "nt": + tmp = os.getenv ("TEMP") +else: + tmp = "/tmp" def cleanup (): - if os.name == "nt": - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_bootstrap_server"), True) - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_no_nat_client"), True) - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_no_nat_client_2"), True) - else: - shutil.rmtree ("/tmp/c_bootstrap_server/", True) - shutil.rmtree ("/tmp/c_no_nat_client/", True) - shutil.rmtree ("/tmp/c_no_nat_client_2/", True) + shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), True) + shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), True) + shutil.rmtree (os.path.join (tmp, "c_no_nat_client_2"), True) def success_cont (check): diff --git a/src/integration-tests/test_integration_connection_values_tcp.py.in b/src/integration-tests/test_integration_connection_values_tcp.py.in index 8c359ff8d..efcf5c7fd 100755 --- a/src/integration-tests/test_integration_connection_values_tcp.py.in +++ b/src/integration-tests/test_integration_connection_values_tcp.py.in @@ -36,6 +36,10 @@ from gnunet_testing import Check from gnunet_testing import Condition from gnunet_testing import * +if os.name == "nt": + tmp = os.getenv ("TEMP") +else: + tmp = "/tmp" #definitions @@ -45,10 +49,7 @@ check_timeout = 180 def cleanup (): - if os.name == "nt": - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_normal_client"), True) - else: - shutil.rmtree ("/tmp/c_normal_client/", True) + shutil.rmtree (os.path.join (tmp, "c_normal_client"), True) def success_cont (check): diff --git a/src/integration-tests/test_integration_connection_values_tcp_udp.py.in b/src/integration-tests/test_integration_connection_values_tcp_udp.py.in index 4403c9092..cfb10432b 100755 --- a/src/integration-tests/test_integration_connection_values_tcp_udp.py.in +++ b/src/integration-tests/test_integration_connection_values_tcp_udp.py.in @@ -43,13 +43,13 @@ testname = "test_integration_connection_value" verbose = True check_timeout = 180 +if os.name == "nt": + tmp = os.getenv ("TEMP") +else: + tmp = "/tmp" def cleanup (): - if os.name == "nt": - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_normal_client"), True) - else: - shutil.rmtree ("/tmp/c_normal_client/", True) - + shutil.rmtree (os.path.join (tmp, "c_normal_client"), True) def success_cont (check): global success diff --git a/src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in b/src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in index 6cd061379..4e9e72e4e 100755 --- a/src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in +++ b/src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in @@ -36,6 +36,10 @@ from gnunet_testing import Check from gnunet_testing import Condition from gnunet_testing import * +if os.name == "nt": + tmp = os.getenv ("TEMP") +else: + tmp = "/tmp" #definitions @@ -45,10 +49,7 @@ check_timeout = 180 def cleanup (): - if os.name == "nt": - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_normal_client"), True) - else: - shutil.rmtree ("/tmp/c_normal_client/", True) + shutil.rmtree (os.path.join (tmp, "c_normal_client"), True) def success_cont (check): diff --git a/src/integration-tests/test_integration_disconnect.py.in b/src/integration-tests/test_integration_disconnect.py.in index afeb5a968..2a863f8b2 100755 --- a/src/integration-tests/test_integration_disconnect.py.in +++ b/src/integration-tests/test_integration_disconnect.py.in @@ -45,14 +45,14 @@ testname = "test_integration_disconnect" verbose = True check_timeout = 180 +if os.name == "nt": + tmp = os.getenv ("TEMP") +else: + tmp = "/tmp" def cleanup (): - if os.name == "nt": - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_bootstrap_server"), True) - shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_no_nat_client"), True) - else: - shutil.rmtree ("/tmp/c_bootstrap_server/", True) - shutil.rmtree ("/tmp/c_no_nat_client/", True) + shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), True) + shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), True) def success_disconnect_cont (check): diff --git a/src/integration-tests/test_integration_restart.py.in b/src/integration-tests/test_integration_restart.py.in index cdf335f51..b3d3ecd18 100755 --- a/src/integration-tests/test_integration_restart.py.in +++ b/src/integration-tests/test_integration_restart.py.in @@ -46,14 +46,14 @@ testname = "test_integration_restart" verbose = False check_timeout = 180 +if os.name == "nt": + tmp = os.getenv ("TEMP") +else: + tmp = "/tmp" 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/c_bootstrap_server/", True) - shutil.rmtree ("/tmp/c_no_nat_client/", True) + shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), True) + shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), True) def success_restart_cont (check):