diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2015-04-29 05:23:28 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2015-04-29 05:23:28 +0000 |
commit | 3008e883ed6e89f83c8f9c2ee9c9544a5772c93a (patch) | |
tree | 74e1a0a964851646e0e0daa3e688d2b3fed85b79 /regress/usr.bin/ssh/cfgparse.sh | |
parent | e1da0ebdadb7a63734b457995944f56890d70a59 (diff) |
Add tests for ListenAddress/Port/AddressFamily in alternate orders.
Diffstat (limited to 'regress/usr.bin/ssh/cfgparse.sh')
-rw-r--r-- | regress/usr.bin/ssh/cfgparse.sh | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/regress/usr.bin/ssh/cfgparse.sh b/regress/usr.bin/ssh/cfgparse.sh index d86cb394cf1..35e1312bd1d 100644 --- a/regress/usr.bin/ssh/cfgparse.sh +++ b/regress/usr.bin/ssh/cfgparse.sh @@ -1,4 +1,4 @@ -# $OpenBSD: cfgparse.sh,v 1.1 2015/04/23 05:01:19 dtucker Exp $ +# $OpenBSD: cfgparse.sh,v 1.2 2015/04/29 05:23:27 dtucker Exp $ # Placed in the Public Domain. tid="config parse" @@ -13,4 +13,39 @@ verbose "reparse regress config" $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] +verbose "listenaddress order" +# expected output +cat > $OBJ/sshd_config.0 <<EOD +listenaddress 1.2.3.4:1234 +listenaddress 1.2.3.4:5678 +listenaddress [::1]:1234 +listenaddress [::1]:5678 +EOD +# test input sets. should all result in the output above. +# test 1: addressfamily and port first +cat > $OBJ/sshd_config.1 <<EOD +addressfamily any +port 1234 +port 5678 +listenaddress 1.2.3.4 +listenaddress ::1 +EOD +($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \ + grep 'listenaddress ' >$OBJ/sshd_config.2 && + diff -u $OBJ/sshd_config.0 $OBJ/sshd_config.2) || \ + fail "listenaddress order 1" +# test 2: listenaddress first +cat > $OBJ/sshd_config.1 <<EOD +listenaddress 1.2.3.4 +listenaddress ::1 +port 1234 +port 5678 +addressfamily any +EOD +($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \ + grep 'listenaddress ' >$OBJ/sshd_config.2 && + diff -u $OBJ/sshd_config.0 $OBJ/sshd_config.2) || \ + fail "listenaddress order 2" + +# cleanup +rm -f $OBJ/sshd_config.[012] |