summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2021-09-24 11:08:03 +1000
committerDarren Tucker <dtucker@dtucker.net>2021-09-24 11:08:03 +1000
commit9b2ee74e3aa8c461eb5552a6ebf260449bb06f7e (patch)
tree81852821e4c425ab128e4332a4b4a8cc8caaef24 /regress
parentf7039541570d4b66d76e6f574544db176d8d5c02 (diff)
Move the fgrep replacement to hostkey-rotate.sh.
The fgrep replacement for buggy greps doesn't work in the sftp-glob test so move it to just where we know it's needed.
Diffstat (limited to 'regress')
-rw-r--r--regress/hostkey-rotate.sh19
-rw-r--r--regress/test-exec.sh19
2 files changed, 19 insertions, 19 deletions
diff --git a/regress/hostkey-rotate.sh b/regress/hostkey-rotate.sh
index 2852c457..0ae0c3df 100644
--- a/regress/hostkey-rotate.sh
+++ b/regress/hostkey-rotate.sh
@@ -3,6 +3,25 @@
tid="hostkey rotate"
+#
+# GNU (f)grep <=2.18, as shipped by FreeBSD<=12 and NetBSD<=9 will occasionally
+# fail to find ssh host keys in the hostkey-rotate test. If we have those
+# versions, use awk instead.
+# See # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258616
+#
+case `grep --version 2>&1 | awk '/GNU grep/{print $4}'` in
+2.19) fgrep=good ;;
+1.*|2.?|2.?.?|2.1?) fgrep=bad ;; # stock GNU grep
+2.5.1*) fgrep=bad ;; # FreeBSD and NetBSD
+*) fgrep=good ;;
+esac
+if test "x$fgrep" = "xbad"; then
+ fgrep()
+{
+ awk 'BEGIN{e=1} {if (index($0,"'$1'")>0){e=0;print}} END{exit e}' $2
+}
+fi
+
rm -f $OBJ/hkr.* $OBJ/ssh_proxy.orig $OBJ/ssh_proxy.orig
grep -vi 'hostkey' $OBJ/sshd_proxy > $OBJ/sshd_proxy.orig
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index 5fcc3fcf..415422ef 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -79,25 +79,6 @@ if test "x${EGREP}" != "x"; then
}
fi
-#
-# GNU (f)grep <=2.18, as shipped by FreeBSD<=12 and NetBSD<=9 will occasionally
-# fail to find ssh host keys in the hostkey-rotate test. If we have those
-# versions, use awk instead.
-# See # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258616
-#
-case `grep --version 2>&1 | awk '/GNU grep/{print $4}'` in
-2.19) fgrep=good ;;
-1.*|2.?|2.?.?|2.1?) fgrep=bad ;; # stock GNU grep
-2.5.1*) fgrep=bad ;; # FreeBSD and NetBSD
-*) fgrep=good ;;
-esac
-if test "x$fgrep" = "xbad"; then
- fgrep()
-{
- awk 'BEGIN{e=1} {if (index($0,"'$1'")>0){e=0;print}} END{exit e}' $2
-}
-fi
-
SRC=`dirname ${SCRIPT}`
# defaults