0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 export TESTNO="039"
0037 export TESTNAME_SHORT="tpbroadcast"
0038 export TESTNAME="test${TESTNO}_${TESTNAME_SHORT}"
0039
0040 PWD=`pwd`
0041 if [ `echo $PWD | grep $TESTNAME ` ]; then
0042
0043 echo > /dev/null
0044 else
0045
0046 pushd .
0047 echo "Doing cd"
0048 cd $TESTNAME
0049 fi;
0050
0051 . ../testenv.sh
0052
0053 export TESTDIR="$NDRX_APPHOME/atmitest/$TESTNAME"
0054 export PATH=$PATH:$TESTDIR
0055
0056 export NDRX_TOUT=9999
0057
0058
0059
0060
0061 function set_dom1 {
0062 echo "Setting domain 1"
0063 . ../dom1.sh
0064 export NDRX_CONFIG=$TESTDIR/ndrxconfig-dom1.xml
0065 export NDRX_DMNLOG=$TESTDIR/ndrxd-dom1.log
0066 export NDRX_LOG=$TESTDIR/ndrx-dom1.log
0067 export NDRX_DEBUG_CONF=$TESTDIR/debug-dom1.conf
0068 }
0069
0070
0071
0072
0073 function set_dom2 {
0074 echo "Setting domain 2"
0075 . ../dom2.sh
0076 export NDRX_CONFIG=$TESTDIR/ndrxconfig-dom2.xml
0077 export NDRX_DMNLOG=$TESTDIR/ndrxd-dom2.log
0078 export NDRX_LOG=$TESTDIR/ndrx-dom2.log
0079 export NDRX_DEBUG_CONF=$TESTDIR/debug-dom2.conf
0080 }
0081
0082
0083
0084
0085 function go_out {
0086 echo "Test exiting with: $1"
0087 xadmin killall atmiclt
0088
0089 set_dom1;
0090 xadmin stop -y
0091 xadmin down -y
0092
0093 set_dom2;
0094 xadmin stop -y
0095 xadmin down -y
0096
0097
0098 xadmin killall atmiclt39
0099
0100 popd 2>/dev/null
0101 exit $1
0102 }
0103
0104
0105
0106
0107 function chk_lines {
0108 log_file=$1
0109 code=$2
0110 must_be=$3
0111 chk_num=$4
0112
0113 CNT=`grep $code $log_file | grep T_STRING_FLD | wc | awk '{print $1}'`
0114 echo "$code count in $log_file: $CNT"
0115
0116 if [[ $CNT -ne $must_be ]]; then
0117 echo "Actual $code $CNT != $must_be!"
0118 go_out $chk_num
0119 fi
0120
0121 }
0122
0123 rm *dom*.log
0124
0125 xadmin killall tpbridge
0126
0127 set_dom1;
0128 xadmin down -y
0129 xadmin start -y || go_out 1
0130
0131 set_dom2;
0132 xadmin down -y
0133 xadmin start -y || go_out 2
0134
0135
0136 sleep 60
0137 RET=0
0138 MAX_CALLS=1000
0139
0140 echo "Running off client"
0141
0142
0143
0144
0145 set_dom1;
0146
0147
0148
0149
0150
0151 ./atmicltA39 retnum > ./atmicltA39-retnum-dom1.log 2>&1
0152 RET=$?
0153
0154 if [[ "X$RET" != "X0" ]]; then
0155 go_out $RET
0156 fi
0157
0158
0159
0160
0161 (./atmicltA39 listen 2>&1 ) > ./atmicltA39-listen-dom1.log &
0162 (./atmicltA39 mutted 2>&1 ) > ./atmicltA39-mutted-dom1.log &
0163
0164 (./atmicltB39 listen 2>&1 ) > ./atmicltB39-listen-dom1.log &
0165 (./atmicltB39 mutted 2>&1 ) > ./atmicltB39-mutted-dom1.log &
0166
0167 (./atmicltC39 listen 2>&1 ) > ./atmicltC39-listen-dom1.log &
0168 (./atmicltC39 mutted 2>&1 ) > ./atmicltC39-mutted-dom1.log &
0169
0170
0171
0172
0173 set_dom2;
0174 (./atmicltA39 listen 2>&1 ) > ./atmicltA39-listen-dom2.log &
0175 (./atmicltA39 mutted 2>&1 ) > ./atmicltA39-mutted-dom2.log &
0176
0177 (./atmicltB39 listen 2>&1 ) > ./atmicltB39-listen-dom2.log &
0178 (./atmicltB39 mutted 2>&1 ) > ./atmicltB39-mutted-dom2.log &
0179
0180 (./atmicltC39 listen 2>&1 ) > ./atmicltC39-listen-dom2.log &
0181 (./atmicltC39 mutted 2>&1 ) > ./atmicltC39-mutted-dom2.log &
0182
0183
0184
0185 sleep 5
0186
0187
0188
0189 set_dom1;
0190
0191 (./atmicltA39 broadcast 2>&1) > ./atmicltA39-broadcast-dom1.log
0192 RET=$?
0193
0194 if [[ "X$RET" != "X0" ]]; then
0195 go_out $RET
0196 fi
0197
0198
0199 echo "Waiting for completion..."
0200 sleep 180
0201
0202
0203
0204
0205
0206 chk_lines "atmicltA39-broadcast-dom1.log" "AA01" "$MAX_CALLS" "1"
0207
0208 chk_lines "atmicltA39-listen-dom1.log" "AA01" "$MAX_CALLS" "2"
0209 chk_lines "atmicltA39-mutted-dom1.log" "AA01" "0" "3"
0210
0211 chk_lines "atmicltB39-listen-dom1.log" "AA01" "$MAX_CALLS" "4"
0212 chk_lines "atmicltB39-mutted-dom1.log" "AA01" "0" "5"
0213
0214 chk_lines "atmicltC39-listen-dom1.log" "AA01" "$MAX_CALLS" "6"
0215 chk_lines "atmicltC39-mutted-dom1.log" "AA01" "0" "7"
0216
0217 chk_lines "atmicltA39-listen-dom2.log" "AA01" "$MAX_CALLS" "8"
0218 chk_lines "atmicltA39-mutted-dom2.log" "AA01" "0" "9"
0219
0220 chk_lines "atmicltB39-listen-dom2.log" "AA01" "$MAX_CALLS" "10"
0221 chk_lines "atmicltB39-mutted-dom2.log" "AA01" "0" "11"
0222
0223 chk_lines "atmicltC39-listen-dom2.log" "AA01" "$MAX_CALLS" "12"
0224 chk_lines "atmicltC39-mutted-dom2.log" "AA01" "0" "13"
0225
0226
0227
0228
0229
0230
0231 chk_lines "atmicltA39-broadcast-dom1.log" "BB01" "0" "14"
0232
0233 chk_lines "atmicltA39-listen-dom1.log" "BB01" "0" "15"
0234 chk_lines "atmicltA39-mutted-dom1.log" "BB01" "0" "16"
0235
0236 chk_lines "atmicltB39-listen-dom1.log" "BB01" "$MAX_CALLS" "17"
0237 chk_lines "atmicltB39-mutted-dom1.log" "BB01" "0" "18"
0238
0239 chk_lines "atmicltC39-listen-dom1.log" "BB01" "0" "19"
0240 chk_lines "atmicltC39-mutted-dom1.log" "BB01" "0" "20"
0241
0242 chk_lines "atmicltA39-listen-dom2.log" "BB01" "0" "21"
0243 chk_lines "atmicltA39-mutted-dom2.log" "BB01" "0" "22"
0244
0245 chk_lines "atmicltB39-listen-dom2.log" "BB01" "$MAX_CALLS" "23"
0246 chk_lines "atmicltB39-mutted-dom2.log" "BB01" "0" "24"
0247
0248 chk_lines "atmicltC39-listen-dom2.log" "BB01" "0" "25"
0249 chk_lines "atmicltC39-mutted-dom2.log" "BB01" "0" "26"
0250
0251
0252
0253
0254 chk_lines "atmicltA39-broadcast-dom1.log" "CC01" "0" "27"
0255
0256 chk_lines "atmicltA39-listen-dom1.log" "CC01" "0" "28"
0257 chk_lines "atmicltA39-mutted-dom1.log" "CC01" "0" "29"
0258
0259 chk_lines "atmicltB39-listen-dom1.log" "CC01" "0" "30"
0260 chk_lines "atmicltB39-mutted-dom1.log" "CC01" "0" "31"
0261
0262 chk_lines "atmicltC39-listen-dom1.log" "CC01" "0" "32"
0263 chk_lines "atmicltC39-mutted-dom1.log" "CC01" "0" "33"
0264
0265 chk_lines "atmicltA39-listen-dom2.log" "CC01" "$MAX_CALLS" "34"
0266 chk_lines "atmicltA39-mutted-dom2.log" "CC01" "0" "35"
0267
0268 chk_lines "atmicltB39-listen-dom2.log" "CC01" "$MAX_CALLS" "36"
0269 chk_lines "atmicltB39-mutted-dom2.log" "CC01" "0" "37"
0270
0271 chk_lines "atmicltC39-listen-dom2.log" "CC01" "$MAX_CALLS" "38"
0272 chk_lines "atmicltC39-mutted-dom2.log" "CC01" "0" "39"
0273
0274
0275
0276
0277
0278 chk_lines "atmicltA39-broadcast-dom1.log" "DD01" "0" "40"
0279
0280 chk_lines "atmicltA39-listen-dom1.log" "DD01" "0" "41"
0281 chk_lines "atmicltA39-mutted-dom1.log" "DD01" "0" "42"
0282
0283 chk_lines "atmicltB39-listen-dom1.log" "DD01" "0" "43"
0284 chk_lines "atmicltB39-mutted-dom1.log" "DD01" "0" "44"
0285
0286 chk_lines "atmicltC39-listen-dom1.log" "DD01" "$MAX_CALLS" "45"
0287 chk_lines "atmicltC39-mutted-dom1.log" "DD01" "0" "46"
0288
0289 chk_lines "atmicltA39-listen-dom2.log" "DD01" "0" "47"
0290 chk_lines "atmicltA39-mutted-dom2.log" "DD01" "0" "48"
0291
0292 chk_lines "atmicltB39-listen-dom2.log" "DD01" "0" "49"
0293 chk_lines "atmicltB39-mutted-dom2.log" "DD01" "0" "50"
0294
0295 chk_lines "atmicltC39-listen-dom2.log" "DD01" "$MAX_CALLS" "51"
0296 chk_lines "atmicltC39-mutted-dom2.log" "DD01" "0" "52"
0297
0298
0299 if [ "X`grep TESTERROR *.log`" != "X" ]; then
0300 echo "Test error detected!"
0301 RET=-2
0302 fi
0303
0304
0305 go_out $RET
0306
0307
0308
0309