[openssh-commits] [openssh] 01/01: upstream: Add TEST_REGRESS_CACHE_DIR.

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Jul 4 19:41:50 AEST 2022


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 35ef2b3b6ef198f8574904a45780487ec2f17858
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Mon Jul 4 09:10:31 2022 +0000

    upstream: Add TEST_REGRESS_CACHE_DIR.
    
    If set, it is used to cache regress test names that have succeeded and
    skip those on a re-run.
    
    OpenBSD-Regress-ID: a7570dd29a58df59f2cca647c3c2ec989b49f247
---
 regress/test-exec.sh | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index 9fb02d1c..45b11734 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,4 +1,4 @@
-#	$OpenBSD: test-exec.sh,v 1.89 2022/01/06 22:14:25 dtucker Exp $
+#	$OpenBSD: test-exec.sh,v 1.90 2022/07/04 09:10:31 dtucker Exp $
 #	Placed in the Public Domain.
 
 #SUDO=sudo
@@ -250,6 +250,30 @@ if [ "x$TEST_REGRESS_LOGFILE" = "x" ]; then
 	TEST_REGRESS_LOGFILE=$OBJ/regress.log
 fi
 
+# If set, keep track of successful tests and skip them them if we've
+# previously completed that test.
+if [ "x$TEST_REGRESS_CACHE_DIR" != "x" ]; then
+	if [ ! -d "$TEST_REGRESS_CACHE_DIR" ]; then
+		mkdir -p "$TEST_REGRESS_CACHE_DIR"
+	fi
+	TEST="`basename $SCRIPT .sh`"
+	CACHE="${TEST_REGRESS_CACHE_DIR}/${TEST}.cache"
+	for i in ${SSH} ${SSHD} ${SSHAGENT} ${SSHADD} ${SSHKEYGEN} ${SCP} \
+	    ${SFTP} ${SFTPSERVER} ${SSHKEYSCAN}; do
+		case $i in
+		/*)	bin="$i" ;;
+		*)	bin="`which $i`" ;;
+		esac
+		if [ "$bin" -nt "$CACHE" ]; then
+			rm -f "$CACHE"
+		fi
+	done
+	if [ -f "$CACHE" ]; then
+		echo ok cached $CACHE
+		exit 0
+	fi
+fi
+
 # truncate logfiles
 >$TEST_SSH_LOGFILE
 >$TEST_SSHD_LOGFILE
@@ -763,6 +787,9 @@ fi
 
 if [ $RESULT -eq 0 ]; then
 	verbose ok $tid
+	if [ "x$CACHE" != "x" ]; then
+		touch "$CACHE"
+	fi
 else
 	echo failed $tid
 fi

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list