source: trunk/athena/bin/hostinfo/regress.sh @ 25957

Revision 25957, 756 bytes checked in by vasilvv, 11 years ago (diff)
Fix the regression test script
  • Property svn:executable set to *
Line 
1#!/bin/sh
2
3SRCDIR=${SRCDIR:-.}
4
5check () {
6    if [ "$2" != "$3" ]; then
7        echo Regression test failed checking $1:
8        echo Expected $2, got $3
9        exit 1
10    fi;
11}
12
13gather () {
14    $1 | sort | tr '\012' ' ' | sed -e 's/ $//'
15}
16
17check "bitsy's host address" 18.72.0.3 "`$SRCDIR/hostinfo -a bitsy 2>&1`"
18check "18.71.0.151's name" STRAWB.MIT.EDU. "`$SRCDIR/hostinfo -h 18.71.0.151 2>&1`"
19check "ls's hostinfo" "\"DEC/VAXSTATION-3100\"/\"UNIX\"" "`$SRCDIR/hostinfo -i ls 2>&1`"
20check "alum's MX record" alum.mit.edu. "`$SRCDIR/hostinfo -m alum.mit.edu 2>&1`"
21
22athmx=`gather "$SRCDIR/hostinfo -m athena"`
23outmx=`gather "$SRCDIR/hostinfo -m outgoing"`
24check "athena's MX records match outgoing's MX records" "$athmx" "$outmx"
25
26echo "Regression tests passed."
27exit 0
Note: See TracBrowser for help on using the repository browser.