[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] Re: [PATCH] Inetd and test scripts
From: |
Mats Erik Andersson |
Subject: |
Re: [bug-inetutils] Re: [PATCH] Inetd and test scripts |
Date: |
Tue, 2 Nov 2010 23:24:51 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
tisdag den 2 november 2010 klockan 23:09 skrev Ludovic Courtès detta:
> Hello,
>
> Mats Erik Andersson <address@hidden> writes:
>
> > --- a/ChangeLog
> > +++ b/ChangeLog
> > @@ -1,3 +1,11 @@
> > +2010-10-31 Mats Erik Andersson <address@hidden>
> > +
> > + Improve the three test scripts.
> > +
> > + * tests/tftp.sh: Make it robust and portable to GNU/Linux and BSD.
> > + * tests/ping-localhost.sh: Test `ping' and `ping6'. Configurable
> > targets.
> > + * tests/traceroute-localhost.sh: Test UDP and ICMP. Configurable target.
>
> [...]
>
> > index 6b2dc80..f14f758 100755
> > --- a/tests/tftp.sh
> > +++ b/tests/tftp.sh
> > @@ -22,13 +22,15 @@
> > TFTP="${TFTP:-../src/tftp$EXEEXT}"
> > TFTPD="${TFTPD:-$PWD/../src/tftpd$EXEEXT}"
> > INETD="${INETD:-../src/inetd$EXEEXT}"
> > -IFCONFIG="${IFCONFIG:-../ifconfig/ifconfig$EXEEXT}"
> > +IFCONFIG="${IFCONFIG:-../ifconfig/ifconfig$EXEEXT --format=unix}"
> >
> > -PORT=7777
> > +AF=${AF:-inet}
> > +PROTO=${PROTO:-udp}
> > +PORT=${PORT:-7777}
>
> Not sure these were absolutely necessary...
Only convenience for manual extension of test. I found it most useful.
>
> [...]
>
> > +# Check that the port is still available
> > +netstat -na | grep -q "^$PROTO .*$PORT "
> > +if test $? -eq 0; then
> > + echo "Desired port $PORT/$PROTO is already in use."
> > + exit 1
> > +fi
>
> This breaks because ???netstat??? may not be in $PATH; in particular, it
> breaks the Hydra builder: <http://hydra.nixos.org/build/727555>.
True. Will be changed.
>
> Furthermore, I think it???s useless: if ???inetd??? fails to listen on $PORT,
> the remainder of the script will notice it anyway.
Not at all. How do you then tell which part was failing: Inetd or Tftpd.
This is what robustness is all about. Predictable results, not ad hoc
failures.
>
> Can you please fix it?
>
> [...]
>
> > +# Wait somewhat for the service to settle
> > +sleep 1
>
> Pointless.
On the contrary, GNU/Linux was so quick to proceed that the test failed.
Again, robustness and predictable behaviour.
> > +# Did `inetd' really succeed in establishing a listener?
> > +netstat -na | grep "^$PROTO .*$PORT "
> > +if test $? -ne 0; then
> > + # No it did not
> > + ps "$inetd_pid" >/dev/null 2>&1 && kill "$inetd_pid"
> > + echo "Failed in starting correct Inetd instance." >&2
> > + exit 1
> > +fi
>
> Same as above.
Same as above!!!!! This test is absolutely necessary. Otherwise
I could not have detected that Inetd failed to start in OpenBSD.
>
> Thanks,
> Ludo???.
>
Regards,
Mats
Re: [bug-inetutils] Re: [PATCH] Inetd and test scripts, Alfred M. Szmidt, 2010/11/02