1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
#!/bin/bash
#
# Scott Burleigh
# April 21, 2010
# documentation boilerplate
CONFIGFILES=" \
./amroc.ltprc \
./amroc.bprc \
./global.ionrc \
./amroc.ionrc \
./amroc.ionsecrc \
./amroc.ipnrc
"
echo "########################################"
echo
pwd | sed "s/\/.*\///" | xargs echo "NAME: "
echo
echo "PURPOSE: Verify that non-zero loopback one-way light time is supported."
echo
echo "CONFIG: A contact graph with 100-second loopback one-way light time:"
echo
for N in $CONFIGFILES
do
echo "$N:"
cat $N
echo "# EOF"
echo
done
echo "OUTPUT: Searching for bundle reforwarding messages in ion.log to ensure
that non-zero loopback one-way light time is correctly handled."
echo
echo "########################################"
echo "Cleaning up old ION..."
./cleanup
sleep 1
echo "Starting ION..."
export ION_NODE_LIST_DIR=$PWD
# Start node 9, with 20-second loopback range.
./ionstart
# Send a loopback bundle with lifetime = 300.
echo "Sending 10-byte bundle with 5-minute lifetime from ipn:9.1 to ipn:9.2."
bptrace ipn:9.1 ipn:9.2 ipn:9.0 300 0.1 "Hello Bob"
sleep 1
echo "Watch characters should be 'abcdefg'."
sleep 1
# Send a non-loopback bundle with lifetime = 300.
echo "Sending 3-byte bundle with 5-minute lifetime from ipn:9.1 to ipn:5.2."
bptrace ipn:9.1 ipn:5.2 ipn:9.0 300 0.1 "Hi"
sleep 1
echo "Watch characters should be 'abcdefg'."
sleep 1
echo "Both should be forwarded to node 5: the loopback owlt is so long that CGR decides it will be faster to transmit to node 5 and then back again."
sleep 1
# Wait for all sessions to terminate.
echo "Both bundles should be reforwarded on block transmission failure due to excessive ack timeouts (watch character '#'), because even the loopback bundle was sent to nonexistent node 5 due to the length of the loopback RTT."
echo "Waiting for contact to terminate..."
sleep 70
echo "Contact has terminated. Verifying results..."
# Verify bundle was forwarded.
RETVAL=0
echo "Checking ion.log for 'src' message '(+) 2 13'..."
COUNT=`grep src ion.log | grep "(+) 2 13" | wc -l`
if [ $COUNT -gt 0 ]
then
echo "OK: All bundles sourced."
else
echo "ERROR: Bundles not sourced."
RETVAL=1
fi
echo "Checking ion.log for 'fwd' message '(+) 4 26'..."
COUNT=`grep fwd ion.log | grep "(+) 4 26" | wc -l`
if [ $COUNT -gt 0 ]
then
echo "OK: All bundles forwarded."
else
echo "ERROR: Bundles not forwarded."
RETVAL=1
fi
echo "Checking ion.log for 'rfw' message '(+) 2 13'..."
COUNT=`grep rfw ion.log | grep "(+) 2 13" | wc -l`
if [ $COUNT -gt 0 ]
then
echo "OK: Both bundles reforwarded."
else
echo "ERROR: Bundles not reforwarded."
RETVAL=1
fi
# Shut down ION processes.
echo "Stopping ION..."
./ionstop
echo "Non-zero loopback range test completed."
exit $RETVAL
|