On Tue, 30 Jun 2015, Damien Miller wrote: | On Mon, 29 Jun 2015, Tim Rice wrote: | | > On Tue, 30 Jun 2015, Damien Miller wrote: | > | > | I think we should just disable the test if the host doesn't support IPv6. | > | | > | diff --git a/regress/cfgparse.sh b/regress/cfgparse.sh | > | index 7f377d8..e19b4d0 100644 | > | --- a/regress/cfgparse.sh | > | +++ b/regress/cfgparse.sh | > | @@ -3,6 +3,12 @@ | > | | > | tid="config parse" | > | | > | +# Possessing struct addrinfo is a reasonable proxy for IPv6 support. | > | +if ! config_defined HAVE_STRUCT_ADDRINFO ; then | > | > Did you mean HAVE_STRUCT_IN6_ADDR ? | | That's even betterer. Ok? | | diff --git a/regress/cfgparse.sh b/regress/cfgparse.sh | index 7f377d8..a5296a2 100644 | --- a/regress/cfgparse.sh | +++ b/regress/cfgparse.sh | @@ -3,6 +3,12 @@ | | tid="config parse" | | +# This is a reasonable proxy for IPv6 support. | +if ! config_defined HAVE_STRUCT_IN6_ADDR ; then | + echo "skipped (not supported on this platform)" | + exit 0 | +fi | + | # We need to use the keys generated for the regression test because sshd -T | # will fail if we're not running with SUDO (no permissions for real keys) or | # if we are # running tests on a system that has never had sshd installed | _______________________________________________ Seems a shame to disable the whole test. Is this too ugly? ............ --- cfgparse.sh.old 2015-06-01 22:43:48.721636775 -0700 +++ cfgparse.sh 2015-06-29 21:33:04.793724856 -0700 @@ -3,6 +3,11 @@ tid="config parse" +# This is a reasonable proxy for IPv6 support. +if ! config_defined HAVE_STRUCT_IN6_ADDR ; then + SKIP_IPV6=yes +fi + # We need to use the keys generated for the regression test because sshd -T # will fail if we're not running with SUDO (no permissions for real keys) or # if we are # running tests on a system that has never had sshd installed @@ -26,6 +31,9 @@ cat > $OBJ/sshd_config.0 <<EOD listenaddress 1.2.3.4:1234 listenaddress 1.2.3.4:5678 +EOD + +[ X${SKIP_IPV6} = Xyes ] || cat > $OBJ/sshd_config.0 <<EOD listenaddress [::1]:1234 listenaddress [::1]:5678 EOD @@ -37,6 +45,9 @@ port 1234 port 5678 listenaddress 1.2.3.4 +EOD + +[ X${SKIP_IPV6} = Xyes ] || cat > $OBJ/sshd_config.1 <<EOD listenaddress ::1 EOD ($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \ @@ -47,11 +58,14 @@ cat > $OBJ/sshd_config.1 <<EOD ${SSHD_KEYS} listenaddress 1.2.3.4 -listenaddress ::1 port 1234 port 5678 addressfamily any EOD + +[ X${SKIP_IPV6} = Xyes ] || cat > $OBJ/sshd_config.1 <<EOD +listenaddress ::1 +EOD ($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \ grep 'listenaddress ' >$OBJ/sshd_config.2 && diff $OBJ/sshd_config.0 $OBJ/sshd_config.2) || \ ............ -- Tim Rice Multitalents tim at multitalents.net
On Mon, 29 Jun 2015, Tim Rice wrote:> Seems a shame to disable the whole test. > Is this too ugly?don't mind, but there were a couple of bugs (tests reverse, > instead of >>) ok? diff --git a/regress/cfgparse.sh b/regress/cfgparse.sh index 7f377d8..fca46c1 100644 --- a/regress/cfgparse.sh +++ b/regress/cfgparse.sh @@ -3,6 +3,11 @@ tid="config parse" +# This is a reasonable proxy for IPv6 support. +if ! config_defined HAVE_STRUCT_IN6_ADDR ; then + SKIP_IPV6=yes +fi + # We need to use the keys generated for the regression test because sshd -T # will fail if we're not running with SUDO (no permissions for real keys) or # if we are # running tests on a system that has never had sshd installed @@ -26,9 +31,12 @@ verbose "listenaddress order" cat > $OBJ/sshd_config.0 <<EOD listenaddress 1.2.3.4:1234 listenaddress 1.2.3.4:5678 +EOD +[ X${SKIP_IPV6} = Xyes ] && cat >> $OBJ/sshd_config.0 <<EOD 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 @@ -37,8 +45,11 @@ addressfamily any port 1234 port 5678 listenaddress 1.2.3.4 +EOD +[ X${SKIP_IPV6} = Xyes ] && cat >> $OBJ/sshd_config.1 <<EOD listenaddress ::1 EOD + ($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \ grep 'listenaddress ' >$OBJ/sshd_config.2 && diff $OBJ/sshd_config.0 $OBJ/sshd_config.2) || \ @@ -47,11 +58,14 @@ EOD cat > $OBJ/sshd_config.1 <<EOD ${SSHD_KEYS} listenaddress 1.2.3.4 -listenaddress ::1 port 1234 port 5678 addressfamily any EOD +[ X${SKIP_IPV6} = Xyes ] && cat >> $OBJ/sshd_config.1 <<EOD +listenaddress ::1 +EOD + ($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \ grep 'listenaddress ' >$OBJ/sshd_config.2 && diff $OBJ/sshd_config.0 $OBJ/sshd_config.2) || \
On Tue, 30 Jun 2015, Damien Miller wrote:> On Mon, 29 Jun 2015, Tim Rice wrote: > > > Seems a shame to disable the whole test. > > Is this too ugly? > > don't mind, but there were a couple of bugs (tests reverse, > instead of >>)Actually the test was correct. Skip or append IPv6 bits. But "> instead of >>" was a mistake. Oops.> ok?OK leaving "||" and fixing "> instead of >>". (tested this time, although not on solaris 2.6 like the original poster)> > diff --git a/regress/cfgparse.sh b/regress/cfgparse.sh > index 7f377d8..fca46c1 100644 > --- a/regress/cfgparse.sh > +++ b/regress/cfgparse.sh > @@ -3,6 +3,11 @@ > > tid="config parse" > > +# This is a reasonable proxy for IPv6 support. > +if ! config_defined HAVE_STRUCT_IN6_ADDR ; then > + SKIP_IPV6=yes > +fi > + > # We need to use the keys generated for the regression test because sshd -T > # will fail if we're not running with SUDO (no permissions for real keys) or > # if we are # running tests on a system that has never had sshd installed > @@ -26,9 +31,12 @@ verbose "listenaddress order" > cat > $OBJ/sshd_config.0 <<EOD > listenaddress 1.2.3.4:1234 > listenaddress 1.2.3.4:5678 > +EOD > +[ X${SKIP_IPV6} = Xyes ] && cat >> $OBJ/sshd_config.0 <<EOD > 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 > @@ -37,8 +45,11 @@ addressfamily any > port 1234 > port 5678 > listenaddress 1.2.3.4 > +EOD > +[ X${SKIP_IPV6} = Xyes ] && cat >> $OBJ/sshd_config.1 <<EOD > listenaddress ::1 > EOD > + > ($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \ > grep 'listenaddress ' >$OBJ/sshd_config.2 && > diff $OBJ/sshd_config.0 $OBJ/sshd_config.2) || \ > @@ -47,11 +58,14 @@ EOD > cat > $OBJ/sshd_config.1 <<EOD > ${SSHD_KEYS} > listenaddress 1.2.3.4 > -listenaddress ::1 > port 1234 > port 5678 > addressfamily any > EOD > +[ X${SKIP_IPV6} = Xyes ] && cat >> $OBJ/sshd_config.1 <<EOD > +listenaddress ::1 > +EOD > + > ($SUDO ${SSHD} -T -f $OBJ/sshd_config.1 | \ > grep 'listenaddress ' >$OBJ/sshd_config.2 && > diff $OBJ/sshd_config.0 $OBJ/sshd_config.2) || \ > _______________________________________________-- Tim Rice Multitalents tim at multitalents.net