diff options
author | Damien Miller <djm@mindrot.org> | 2018-07-20 14:53:42 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2018-07-20 14:55:29 +1000 |
commit | c59aca8adbdf7f5597084ad360a19bedb3f80970 (patch) | |
tree | 79912187691e15a3d34db3fff61f6dfdacb03def /regress/test-exec.sh | |
parent | 6ad8648e83e4f4ace37b742a05c2a6b6b872514e (diff) |
Create control sockets in clean temp directories
Adds a regress/mkdtemp tool and uses it to create empty temp
directories for tests needing control sockets.
Patch from Colin Watson via bz#2660; ok dtucker
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r-- | regress/test-exec.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index f09fe0ec4..f0e3dabfe 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -76,6 +76,9 @@ SFTP=sftp | |||
76 | SFTPSERVER=/usr/libexec/openssh/sftp-server | 76 | SFTPSERVER=/usr/libexec/openssh/sftp-server |
77 | SCP=scp | 77 | SCP=scp |
78 | 78 | ||
79 | # Set by make_tmpdir() on demand (below). | ||
80 | SSH_REGRESS_TMP= | ||
81 | |||
79 | # Interop testing | 82 | # Interop testing |
80 | PLINK=plink | 83 | PLINK=plink |
81 | PUTTYGEN=puttygen | 84 | PUTTYGEN=puttygen |
@@ -322,6 +325,12 @@ stop_sshd () | |||
322 | fi | 325 | fi |
323 | } | 326 | } |
324 | 327 | ||
328 | make_tmpdir () | ||
329 | { | ||
330 | SSH_REGRESS_TMP="$($OBJ/mkdtemp openssh-regress-XXXXXXXXXXXX)" || \ | ||
331 | fatal "failed to create temporary directory" | ||
332 | } | ||
333 | |||
325 | # helper | 334 | # helper |
326 | cleanup () | 335 | cleanup () |
327 | { | 336 | { |
@@ -332,6 +341,9 @@ cleanup () | |||
332 | kill $SSH_PID | 341 | kill $SSH_PID |
333 | fi | 342 | fi |
334 | fi | 343 | fi |
344 | if [ "x$SSH_REGRESS_TMP" != "x" ]; then | ||
345 | rm -rf "$SSH_REGRESS_TMP" | ||
346 | fi | ||
335 | stop_sshd | 347 | stop_sshd |
336 | } | 348 | } |
337 | 349 | ||