diff options
Diffstat (limited to 'src/integration-tests/test_integration_disconnect.py.in')
-rwxr-xr-x | src/integration-tests/test_integration_disconnect.py.in | 19 |
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 | ||
49 | if os.name == "nt": | 49 | if os.name == "nt": |
50 | tmp = os.getenv ("TEMP") | 50 | tmp = os.getenv ("TEMP") |
51 | signals = [signal.SIGTERM, signal.SIGINT] | ||
51 | else: | 52 | else: |
52 | tmp = "/tmp" | 53 | tmp = "/tmp" |
54 | signals = [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT] | ||
55 | |||
56 | def 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 | ||
54 | def cleanup (): | 67 | def 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 | ||
59 | def success_disconnect_cont (check): | 72 | def 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) |