summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2015-06-30 16:05:40 +1000
committerDamien Miller <djm@mindrot.org>2015-06-30 16:05:40 +1000
commit52fb6b9b034fcfd24bf88cc7be313e9c31de9889 (patch)
treeb10596cd645ccc658b081781a50fe2aa02fc434b
parent512caddf590857af6aa12218461b5c0441028cf5 (diff)
skip IPv6-related portions on hosts without IPv6
with Tim Rice
-rw-r--r--regress/cfgparse.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/regress/cfgparse.sh b/regress/cfgparse.sh
index 7f377d887..736f38976 100644
--- a/regress/cfgparse.sh
+++ b/regress/cfgparse.sh
@@ -3,6 +3,11 @@
3 3
4tid="config parse" 4tid="config parse"
5 5
6# This is a reasonable proxy for IPv6 support.
7if ! config_defined HAVE_STRUCT_IN6_ADDR ; then
8 SKIP_IPV6=yes
9fi
10
6# We need to use the keys generated for the regression test because sshd -T 11# We need to use the keys generated for the regression test because sshd -T
7# will fail if we're not running with SUDO (no permissions for real keys) or 12# will fail if we're not running with SUDO (no permissions for real keys) or
8# if we are # running tests on a system that has never had sshd installed 13# if we are # running tests on a system that has never had sshd installed
@@ -26,9 +31,12 @@ verbose "listenaddress order"
26cat > $OBJ/sshd_config.0 <<EOD 31cat > $OBJ/sshd_config.0 <<EOD
27listenaddress 1.2.3.4:1234 32listenaddress 1.2.3.4:1234
28listenaddress 1.2.3.4:5678 33listenaddress 1.2.3.4:5678
34EOD
35[ X${SKIP_IPV6} = Xyes ] || cat >> $OBJ/sshd_config.0 <<EOD
29listenaddress [::1]:1234 36listenaddress [::1]:1234
30listenaddress [::1]:5678 37listenaddress [::1]:5678
31EOD 38EOD
39
32# test input sets. should all result in the output above. 40# test input sets. should all result in the output above.
33# test 1: addressfamily and port first 41# test 1: addressfamily and port first
34cat > $OBJ/sshd_config.1 <<EOD 42cat > $OBJ/sshd_config.1 <<EOD
@@ -37,8 +45,11 @@ addressfamily any
37port 1234 45port 1234
38port 5678 46port 5678
39listenaddress 1.2.3.4 47listenaddress 1.2.3.4
48EOD
49[ X${SKIP_IPV6} = Xyes ] || cat >> $OBJ/sshd_config.1 <<EOD
40listenaddress ::1 50listenaddress ::1
41EOD 51EOD
52
42($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \ 53($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \
43 grep 'listenaddress ' >$OBJ/sshd_config.2 && 54 grep 'listenaddress ' >$OBJ/sshd_config.2 &&
44 diff $OBJ/sshd_config.0 $OBJ/sshd_config.2) || \ 55 diff $OBJ/sshd_config.0 $OBJ/sshd_config.2) || \
@@ -47,11 +58,14 @@ EOD
47cat > $OBJ/sshd_config.1 <<EOD 58cat > $OBJ/sshd_config.1 <<EOD
48${SSHD_KEYS} 59${SSHD_KEYS}
49listenaddress 1.2.3.4 60listenaddress 1.2.3.4
50listenaddress ::1
51port 1234 61port 1234
52port 5678 62port 5678
53addressfamily any 63addressfamily any
54EOD 64EOD
65[ X${SKIP_IPV6} = Xyes ] || cat >> $OBJ/sshd_config.1 <<EOD
66listenaddress ::1
67EOD
68
55($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \ 69($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \
56 grep 'listenaddress ' >$OBJ/sshd_config.2 && 70 grep 'listenaddress ' >$OBJ/sshd_config.2 &&
57 diff $OBJ/sshd_config.0 $OBJ/sshd_config.2) || \ 71 diff $OBJ/sshd_config.0 $OBJ/sshd_config.2) || \