summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2015-04-23 05:01:20 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2015-04-23 05:01:20 +0000
commitbeb5ce16122b25e33f062fc371951f8ab2a82e4c (patch)
treec38c73baa032c92e9b37629cebe7700cdde5b0ef
parent12b64aeea837ad32792be7bec436e1cfd1dccdfc (diff)
Add a simple regression test for sshd's configuration parser. Right now,
all it does is run the output of sshd -T back through itself and ensure the output is valid and invariant.
-rw-r--r--regress/usr.bin/ssh/Makefile3
-rw-r--r--regress/usr.bin/ssh/cfgparse.sh16
2 files changed, 18 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/Makefile b/regress/usr.bin/ssh/Makefile
index 8cc2fcf7984..1c2b75c8b03 100644
--- a/regress/usr.bin/ssh/Makefile
+++ b/regress/usr.bin/ssh/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.79 2015/03/16 22:46:14 djm Exp $
+# $OpenBSD: Makefile,v 1.80 2015/04/23 05:01:19 dtucker Exp $
.ifndef SKIP_UNIT
SUBDIR= unittests
@@ -50,6 +50,7 @@ LTESTS= connect \
multiplex \
reexec \
brokenkeys \
+ cfgparse \
cfgmatch \
addrmatch \
localcommand \
diff --git a/regress/usr.bin/ssh/cfgparse.sh b/regress/usr.bin/ssh/cfgparse.sh
new file mode 100644
index 00000000000..d86cb394cf1
--- /dev/null
+++ b/regress/usr.bin/ssh/cfgparse.sh
@@ -0,0 +1,16 @@
+# $OpenBSD: cfgparse.sh,v 1.1 2015/04/23 05:01:19 dtucker Exp $
+# Placed in the Public Domain.
+
+tid="config parse"
+
+verbose "reparse default config"
+($SUDO ${SSHD} -T -f /dev/null >$OBJ/sshd_config.1 &&
+ $SUDO ${SSHD} -T -f $OBJ/sshd_config.1 >$OBJ/sshd_config.2 &&
+ diff $OBJ/sshd_config.1 $OBJ/sshd_config.2) || fail "reparse default config"
+
+verbose "reparse regress config"
+($SUDO ${SSHD} -T -f $OBJ/sshd_config >$OBJ/sshd_config.1 &&
+ $SUDO ${SSHD} -T -f $OBJ/sshd_config.1 >$OBJ/sshd_config.2 &&
+ diff $OBJ/sshd_config.1 $OBJ/sshd_config.2) || fail "reparse regress config"
+
+rm -f $OBJ/sshd_config.[12]