summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2021-04-06 23:57:57 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2021-04-06 23:57:57 +0000
commitc7baeaff09dd6a812d2466b02e711024fccad379 (patch)
tree0767460263cff4ca73c032c303ecb9453f8c7f32 /regress
parent4cb539ba198f08d94aae38474a09036c721920cb (diff)
Add TEST_SSH_ELAPSED_TIMES environment variable to print the elapsed
time in seconds of each test. This depends on "date +%s" which is not specified by POSIX but is commonly implemented.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/ssh/test-exec.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/test-exec.sh b/regress/usr.bin/ssh/test-exec.sh
index 648a9ff5143..544956cc61c 100644
--- a/regress/usr.bin/ssh/test-exec.sh
+++ b/regress/usr.bin/ssh/test-exec.sh
@@ -1,9 +1,13 @@
-# $OpenBSD: test-exec.sh,v 1.78 2021/03/13 01:52:16 dtucker Exp $
+# $OpenBSD: test-exec.sh,v 1.79 2021/04/06 23:57:56 dtucker Exp $
# Placed in the Public Domain.
USER=`id -un`
#SUDO=sudo
+if [ ! -x "$TEST_SSH_ELAPSED_TIMES" ]; then
+ STARTTIME=`date '+%s'`
+fi
+
if [ ! -z "$TEST_SSH_PORT" ]; then
PORT="$TEST_SSH_PORT"
else
@@ -205,6 +209,11 @@ cleanup ()
fi
fi
stop_sshd
+ if [ ! -z "$TEST_SSH_ELAPSED_TIMES" ]; then
+ now=`date '+%s'`
+ elapsed=$(($now - $STARTTIME))
+ echo elapsed $elapsed `basename $SCRIPT .sh`
+ fi
}
start_debug_log ()