summaryrefslogtreecommitdiffstats
path: root/regress/percent.sh
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2020-04-03 05:14:03 +0200
committerDamien Miller <djm@mindrot.org>2020-04-03 06:46:13 +0200
commit92115ea7c3a834374720c350841fc729e7d5c8b2 (patch)
tree722cbe4a42c767136578d5cfbf3338e7dafb87cd /regress/percent.sh
parentupstream: fix format string (use %llu for uint64, not %lld). spotted by (diff)
downloadopenssh-92115ea7c3a834374720c350841fc729e7d5c8b2.tar.xz
openssh-92115ea7c3a834374720c350841fc729e7d5c8b2.zip
upstream: Add percent_expand test for 'Match Exec'.
OpenBSD-Regress-ID: a41c14fd6a0b54d66aa1e9eebfb9ec962b41232f
Diffstat (limited to '')
-rw-r--r--regress/percent.sh21
1 files changed, 16 insertions, 5 deletions
diff --git a/regress/percent.sh b/regress/percent.sh
index 84999fd0f..7e19abe8f 100644
--- a/regress/percent.sh
+++ b/regress/percent.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: percent.sh,v 1.1 2020/04/03 02:33:31 dtucker Exp $
+# $OpenBSD: percent.sh,v 1.2 2020/04/03 03:14:03 dtucker Exp $
# Placed in the Public Domain.
tid="percent expansions"
@@ -19,14 +19,24 @@ trial()
opt="$1"; arg="$2"; expect="$3"
trace "test $opt=$arg $expect"
- if [ "$opt" = "localcommand" ]; then
+ rm -f $OBJ/actual
+ case "$opt" in
+ localcommand)
${SSH} -F $OBJ/ssh_proxy -o $opt="echo '$arg' >$OBJ/actual" \
somehost true
got=`cat $OBJ/actual`
- else
+ ;;
+ matchexec)
+ (cat $OBJ/ssh_proxy && \
+ echo "Match Exec \"echo '$arg' >$OBJ/actual\"") \
+ >$OBJ/ssh_proxy_match
+ ${SSH} -F $OBJ/ssh_proxy_match remuser@somehost true || true
+ got=`cat $OBJ/actual`
+ ;;
+ *)
got=`${SSH} -F $OBJ/ssh_proxy -o $opt="$arg" -G \
remuser@somehost | awk '$1=="'$opt'"{print $2}'`
- fi
+ esac
if [ "$got" != "$expect" ]; then
fail "$opt=$arg expect $expect got $got"
else
@@ -34,7 +44,8 @@ trial()
fi
}
-for i in localcommand remotecommand controlpath identityagent forwardagent; do
+for i in matchexec localcommand remotecommand controlpath identityagent \
+ forwardagent; do
if [ "$i" = "localcommand" ]; then
HASH=94237ca18fe6b187dccf57e5593c0bb0a29cc302
REMUSER=$USER