~ubuntu-branches/debian/experimental/ion/experimental

« back to all changes in this revision

Viewing changes to tests/cgr-test/dotest

  • Committer: Package Import Robot
  • Author(s): Leo Iannacone
  • Date: 2012-02-01 09:46:31 UTC
  • Revision ID: package-import@ubuntu.com-20120201094631-qpfwehc1b7ftkjgx
Tags: upstream-2.5.3~dfsg1
ImportĀ upstreamĀ versionĀ 2.5.3~dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
# Scott Burleigh
 
4
# April 12, 2010
 
5
 
 
6
# documentation boilerplate
 
7
CONFIGFILES=" \
 
8
./amroc.ltprc \
 
9
./amroc.bprc \
 
10
./amroc.ionconfig \
 
11
./global.ionrc \
 
12
./amroc.ionrc \
 
13
./amroc.ionsecrc \
 
14
./amroc.ipnrc \
 
15
./amroc.cfdprc \
 
16
"
 
17
echo "########################################"
 
18
echo
 
19
pwd | sed "s/\/.*\///" | xargs echo "NAME: "
 
20
echo
 
21
echo "PURPOSE: To test out Contact Graph Routing behavior in a very large
 
22
        contact graph.  Only one node is actually run, though there are several
 
23
        nodes defined in the graph."
 
24
echo
 
25
echo "CONFIG: Large contact graph, with only one configured node:"
 
26
echo
 
27
for N in $CONFIGFILES
 
28
do
 
29
        echo "$N:"
 
30
        cat $N
 
31
        echo "# EOF"
 
32
        echo
 
33
done
 
34
echo "OUTPUT: Searching for bundle forwarding messages in ion.log to ensure 
 
35
        that the CGR engine is capable of making decisions."
 
36
echo
 
37
echo "########################################"
 
38
 
 
39
echo "Cleaning up old ION..."
 
40
rm -f ion.log
 
41
killm
 
42
sleep 1
 
43
 
 
44
echo "Starting ION..."
 
45
export ION_NODE_LIST_DIR=$PWD
 
46
rm -f ./ion_nodes
 
47
 
 
48
# Start node 9, loading large contact plan.
 
49
./ionstart
 
50
 
 
51
sleep 5
 
52
 
 
53
echo "Send a bundle from ipn:9.1 destined for (noexistent) node ipn:1.1..."
 
54
bptrace ipn:9.1 ipn:1.1 ipn:9.0 200000 1.1 "Hi"
 
55
 
 
56
# Route should be computed quickly.
 
57
echo "The 'b' ("forwarded") watch character should appear almost immediately."
 
58
sleep 1
 
59
echo "The 'b' ("forwarded") watch character should have appeared by now."
 
60
 
 
61
# Wait for all sessions to terminate.
 
62
echo "Waiting for initial contact to terminate..."
 
63
sleep 120
 
64
echo "Contact has terminated.  Verifying results..."
 
65
 
 
66
# Verify bundle was forwarded.
 
67
RETVAL=0
 
68
 
 
69
echo "Searching ion.log for a single 'fwd' message '(1) 1 3'..."
 
70
COUNT=`grep fwd ion.log | grep "(1) 1 3" | wc -l`
 
71
if [ $COUNT -eq 1 ]
 
72
then
 
73
        echo "OK: Route was computed."
 
74
else
 
75
        echo "ERROR: Route was not computed."
 
76
        RETVAL=1
 
77
fi
 
78
 
 
79
# Shut down ION processes.
 
80
echo "Stopping ION..."
 
81
./ionstop
 
82
killm
 
83
echo "CGR test completed."
 
84
exit $RETVAL