aboutsummaryrefslogtreecommitdiff
path: root/src/integration-tests/test_integration_disconnect.py.in
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-12-23 13:35:18 +0000
committerLRN <lrn1986@gmail.com>2013-12-23 13:35:18 +0000
commit6d14d67719b6057939b1dd948e4e74663a1c19e8 (patch)
tree5a0ceff12c7bf8cd1e5033faa4971ef09d0574ab /src/integration-tests/test_integration_disconnect.py.in
parentf07469475bb254bae5b66a894087bad7d2d600bb (diff)
downloadgnunet-6d14d67719b6057939b1dd948e4e74663a1c19e8.tar.gz
gnunet-6d14d67719b6057939b1dd948e4e74663a1c19e8.zip
W32-compatible integartion tests, try to handle rmtree()ing of read-only files
Diffstat (limited to 'src/integration-tests/test_integration_disconnect.py.in')
-rwxr-xr-xsrc/integration-tests/test_integration_disconnect.py.in19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/integration-tests/test_integration_disconnect.py.in b/src/integration-tests/test_integration_disconnect.py.in
index 38bc7b059..eba75fb75 100755
--- a/src/integration-tests/test_integration_disconnect.py.in
+++ b/src/integration-tests/test_integration_disconnect.py.in
@@ -48,12 +48,25 @@ check_timeout = 180
48 48
49if os.name == "nt": 49if os.name == "nt":
50 tmp = os.getenv ("TEMP") 50 tmp = os.getenv ("TEMP")
51 signals = [signal.SIGTERM, signal.SIGINT]
51else: 52else:
52 tmp = "/tmp" 53 tmp = "/tmp"
54 signals = [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT]
55
56def cleanup_onerror (function, path, excinfo):
57 import stat
58 if not os.path.exists (path):
59 pass
60 elif not os.access(path, os.W_OK):
61 # Is the error an access error ?
62 os.chmod (path, stat.S_IWUSR)
63 function (path)
64 else:
65 raise
53 66
54def cleanup (): 67def cleanup ():
55 shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), True) 68 shutil.rmtree (os.path.join (tmp, "c_bootstrap_server"), False, cleanup_onerror)
56 shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), True) 69 shutil.rmtree (os.path.join (tmp, "c_no_nat_client"), False, cleanup_onerror)
57 70
58 71
59def success_disconnect_cont (check): 72def success_disconnect_cont (check):
@@ -138,7 +151,7 @@ def run ():
138 client = None 151 client = None
139 success = False 152 success = False
140 153
141 for sig in [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT]: 154 for sig in signals:
142 signal.signal(sig, SigHandler) 155 signal.signal(sig, SigHandler)
143 156
144 test = Test ('test_integration_bootstrap_and_connect.py', verbose) 157 test = Test ('test_integration_bootstrap_and_connect.py', verbose)