improve testing of proxy delete by saving up a number of relayIDs and

sending with multiple -d flags to rq.
This commit is contained in:
Eric House 2011-08-16 19:44:37 -07:00
parent dc273c7162
commit c2c673e932

View file

@ -225,11 +225,17 @@ close_device() {
unset ROOMS[$ID]
}
OBITS=""
kill_from_log() {
LOG=$1
RELAYID=$(./scripts/relayID.sh --long $LOG)
if [ -n "$RELAYID" ]; then
../relay/rq -a $HOST -d $RELAYID 2>/dev/null || true
OBITS="$OBITS -d $RELAYID"
if [ 0 -eq $(($RANDOM%2)) ]; then
../relay/rq -a $HOST $OBITS 2>/dev/null || true
OBITS=""
fi
return 0 # success
fi
echo "unable to send kill command for $LOG"
@ -281,10 +287,15 @@ check_game() {
close_device $ID $DONEDIR "game over"
done
date
# XWRELAY_ERROR_DELETED may be old
elif grep -q 'relay_error_curses(XWRELAY_ERROR_DELETED)' $LOG; then
echo "deleting $LOG $(connName $LOG) b/c another resigned"
kill_from_log $LOG || true
close_device $KEY $DEADDIR "other resigned"
elif grep -q 'relay_error_curses(XWRELAY_ERROR_DEADGAME)' $LOG; then
echo "deleting $LOG $(connName $LOG) b/c another resigned"
kill_from_log $LOG || true
close_device $KEY $DEADDIR "other resigned"
else
maybe_resign $KEY
fi
@ -334,6 +345,8 @@ run_cmds() {
fi
done
[ -n "$OBITS" ] && ../relay/rq -a $HOST $OBITS 2>/dev/null || true
# kill any remaining games
if [ $COUNT -gt 0 ]; then
mkdir -p ${LOGDIR}/not_done