[28446] in Source-Commits

home help back first fref pref prev next nref lref last post

Re: scripts commit: Switch to qemu from vmware; enhance tests

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Thu Sep 25 17:53:10 2014

From: Jonathan D Reed <jdreed@mit.edu>
To: Benjamin J Kaduk <kaduk@mit.edu>
CC: "source-commits@MIT.EDU" <source-commits@mit.edu>
Date: Thu, 25 Sep 2014 21:52:59 +0000
Message-ID: <65C356C0-14CE-46AF-8C93-FFE3C8B6A787@mit.edu>
In-Reply-To: <alpine.GSO.1.10.1409251628170.21571@multics.mit.edu>
Content-Language: en-US
Content-Type: text/plain; charset="Windows-1252"
Content-ID: <1161AECD5888EE43A749F3C913DC6E13@exchange.mit.edu>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit


On Sep 25, 2014, at 4:53 PM, Benjamin Kaduk <kaduk@MIT.EDU> wrote:

>> 
>> +	echo "QEMU PID file ($QPIDFILE) missing or unreadable" >&2
> 
> Your parentheses are unbalanced here.

Per zephyr, this is moot.

>> +    if ! echo quit | nc localhost 4444; then
>> +       echo "Couldn't send quit command to monitor! Trying to kill.." >&2
>> +       kill "$PID" || :
> 
> Probably wise to use kill -- "$PID", in case there is some garbage in the
> file.

Noted, I’ll fix that.

>> +[ -n "$SUITE" ] || die "SUITE unspecified"
>> +[ -f "$ISOLINUXBIN" ] || die "$ISOLINUXBIN missing"
> 
> It may be better to not have the dollar sign there?

Where?  In the error message?  

> 
>> +echo -n "Looking up $HOSTNAME ... "
>> +# This will always return true because of tail(1)
> 
> (Until some bozo decides to set -o pipefail somewhere earlier.  Which
> seems unlikely.)

“Don’t do that”, but I’ll update the comment.

> 
>> +IP=$(dig +short $HOSTNAME | tail -1)
>> +if echo "$IP" | grep -q '[^0-9\.]'; then
>> +    echo "bad IP ($IP)."
>> +    exit 1
>> +else
>> +    echo "$IP"
> 
> Maybe "IP $IP”?

Sure.

> 
>> +echo "Install started at $(date)"
>> +echo -n "Waiting up to 30s for machine networking to come up..."
>> +err=1
>> +for i in $(seq 30); do
>> +    if ping -c 1 -w 2 "$IP" > /dev/null 2>&1; then
>> +	err=0
>> +	echo "ok"
>> +	break
>> +    fi
>> +    echo -n "."
>> +    sleep 1
>> +done
>> +[ $err -eq 1 ] && die "Machine did not respond to ping within 30s"
> 
> I think this ends up printing "Machine did not[...]" on the same line as
> all the '.'s, not that it really matters.

I consider that a feature, since my default pager has line wrapping :-)

-Jon



home help back first fref pref prev next nref lref last post