summaryrefslogtreecommitdiff
path: root/regress/test-exec.sh
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2018-07-20 14:53:42 +1000
committerDamien Miller <djm@mindrot.org>2018-07-20 14:55:29 +1000
commitc59aca8adbdf7f5597084ad360a19bedb3f80970 (patch)
tree79912187691e15a3d34db3fff61f6dfdacb03def /regress/test-exec.sh
parent6ad8648e83e4f4ace37b742a05c2a6b6b872514e (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.sh12
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
76SFTPSERVER=/usr/libexec/openssh/sftp-server 76SFTPSERVER=/usr/libexec/openssh/sftp-server
77SCP=scp 77SCP=scp
78 78
79# Set by make_tmpdir() on demand (below).
80SSH_REGRESS_TMP=
81
79# Interop testing 82# Interop testing
80PLINK=plink 83PLINK=plink
81PUTTYGEN=puttygen 84PUTTYGEN=puttygen
@@ -322,6 +325,12 @@ stop_sshd ()
322 fi 325 fi
323} 326}
324 327
328make_tmpdir ()
329{
330 SSH_REGRESS_TMP="$($OBJ/mkdtemp openssh-regress-XXXXXXXXXXXX)" || \
331 fatal "failed to create temporary directory"
332}
333
325# helper 334# helper
326cleanup () 335cleanup ()
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