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 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
|
#!/bin/bash
#
# Scott Burleigh
# April 21, 2010
# documentation boilerplate
CONFIGFILES=" \
./amroc.ltprc \
./amroc.bprc \
./amroc.ionconfig \
./global.ionrc \
./amroc.ionrc \
./amroc.ionsecrc \
./amroc.ipnrc \
"
echo "########################################"
echo
pwd | sed "s/\/.*\///" | xargs echo "NAME: "
echo
echo "PURPOSE: Test out behavior using asymmetrically configured ranges in the
contact graph. Bundle forwarding, reforwarding, and expiration are
expected."
echo
echo "CONFIG: A contact graph with asymmetric delay between nodes.
Only one node is actually configured and run in this network:"
echo
for N in $CONFIGFILES
do
echo "$N:"
cat $N
echo "# EOF"
echo
done
echo "OUTPUT: Searching for bundle forwarding messages in ion.log to ensure
that the CGR engine can make correct decisions with asymmetric ranges.
The terminal should also contain a variety of 'watch' characters for
further debugging."
echo
echo "########################################"
echo "Cleaning up old ION..."
rm -f ion.log
killm
sleep 1
echo "Starting ION..."
export ION_NODE_LIST_DIR=$PWD
rm -f ./ion_nodes
# Start node 9, with asymmetric range to node 5.
./ionstart
echo "Sending bundle with 10-second lifetime from ipn:9.1 to ipn:6.1."
# Send a bundle destined for (nonexistent) node 6 with lifetime = 10.
echo "Should be abandoned as unroutable prior to expiration."
bptrace ipn:9.1 ipn:6.1 ipn:9.0 10 0.1 "Hi"
sleep 1
echo "Watch characters should be 'a~'."
echo "Sending bundle with 25-second lifetime from ipn:9.1 to ipn:6.1."
# Send a bundle destined for (nonexistent) node 6 with lifetime = 25.
echo "Should be forwarded and transmitted but expire prior to end of session."
bptrace ipn:9.1 ipn:6.1 ipn:9.0 25 0.1 "Hi"
sleep 1
echo "Watch characters should be 'abwcdefg'."
echo "Sending bundle with 120-second lifetime from ipn:9.1 to ipn:6.1."
# Send a bundle destined for (nonexistent) node 6 with lifetime = 120.
echo "Should be forwarded and transmitted, but session will end before ack."
echo "Should be retransmitted and later reforwarded."
bptrace ipn:9.1 ipn:6.1 ipn:9.0 120 0.1 "Hi"
# Wait for all sessions to terminate.
echo "Waiting for contact to terminate..."
sleep 60
echo "Contact has terminated. Verifying results..."
# Verify bundle was forwarded.
RETVAL=0
echo "Checking ion.log for 'src' message '(+) 3 9'..."
COUNT=`grep src ion.log | grep "(+) 3 9" | 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 '(+) 2 6'..."
COUNT=`grep fwd ion.log | grep "(+) 2 6" | wc -l`
if [ $COUNT -gt 0 ]
then
echo "OK: Two bundles forwarded."
else
echo "ERROR: Bundles not forwarded."
RETVAL=1
fi
echo "Checking ion.log for 'exp' message '(+) 1 3'..."
COUNT=`grep exp ion.log | grep "(+) 1 3" | wc -l`
if [ $COUNT -gt 0 ]
then
echo "OK: One bundle expired."
else
echo "ERROR: Bundle not expired."
RETVAL=1
fi
echo "Checking ion.log for 'rfw' message '(+) 1 3'..."
COUNT=`grep rfw ion.log | grep "(+) 1 3" | wc -l`
if [ $COUNT -gt 0 ]
then
echo "OK: One bundle reforwarded."
else
echo "ERROR: Bundle not reforwarded."
RETVAL=1
fi
# Shut down ION processes.
echo "Stopping ION..."
ionstop
killm
echo "Asymmetric range test completed."
exit $RETVAL
|