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 TESTNAME="test058_systemv"
0037
0038 PWD=`pwd`
0039 if [ `echo $PWD | grep $TESTNAME ` ]; then
0040
0041 echo > /dev/null
0042 else
0043
0044 pushd .
0045 echo "Doing cd"
0046 cd $TESTNAME
0047 fi;
0048
0049 . ../testenv.sh
0050
0051 export TESTDIR="$NDRX_APPHOME/atmitest/$TESTNAME"
0052 export PATH=$PATH:$TESTDIR
0053 export NDRX_SILENT=Y
0054 export NDRX_TOUT=20
0055
0056
0057
0058
0059 set_dom1() {
0060 echo "Setting domain 1"
0061 . ../dom1.sh
0062 export NDRX_CONFIG=$TESTDIR/ndrxconfig-dom1.xml
0063 export NDRX_DMNLOG=$TESTDIR/ndrxd-dom1.log
0064 export NDRX_LOG=$TESTDIR/ndrx-dom1.log
0065 export NDRX_DEBUG_CONF=$TESTDIR/debug-dom1.conf
0066 }
0067
0068
0069
0070
0071 function go_out {
0072 echo "Test exiting with: $1"
0073
0074 set_dom1;
0075 xadmin stop -y
0076 xadmin down -y
0077
0078
0079
0080
0081 xadmin killall atmiclt58
0082
0083 popd 2>/dev/null
0084 exit $1
0085 }
0086
0087 rm *dom*.log
0088
0089 xadmin killall tpbridge
0090
0091 set_dom1;
0092 xadmin down -y
0093 xadmin start -y || go_out 1
0094
0095 RET=0
0096
0097 xadmin psc
0098 xadmin ppm
0099 xadmin psvc -r
0100
0101
0102
0103 RES=`xadmin psvc -r | egrep '^[^0-9]+0[^0-9]+[0-9]+[^0-9]+2$'`
0104 if [ "X$RES" == "X" ]; then
0105 echo "Invalid service count (0.2)!"
0106 go_out -10
0107 fi
0108
0109 RES=`xadmin psvc -r | egrep '^[^0-9]+1[^0-9]+[0-9]+[^0-9]+2$'`
0110 if [ "X$RES" == "X" ]; then
0111 echo "Invalid service count (1.2)!"
0112 go_out -10
0113 fi
0114
0115
0116 RES=`xadmin psvc -r | egrep '^[^0-9]+[0-9]+[^0-9]+[0-9]+[^0-9]+[0-9]+$' | wc | awk '{print $1}'`
0117 if [ "X$RES" != "X2" ]; then
0118 echo "Invalid identifier count, expected 2 got $RES!"
0119 go_out -10
0120 fi
0121
0122
0123
0124
0125 echo "Stop one"
0126 xadmin stop -i 10
0127 xadmin psvc -r
0128 RES=`xadmin psvc -r | egrep '^[^0-9]+0[^0-9]+[0-9]+[^0-9]+1$'`
0129
0130 if [ "X$RES" == "X" ]; then
0131 echo "Invalid service count (0.1)!"
0132 go_out -11
0133 fi
0134
0135 RES=`xadmin psvc -r | egrep '^[^0-9]+1[^0-9]+[0-9]+[^0-9]+2$'`
0136
0137 if [ "X$RES" == "X" ]; then
0138 echo "Invalid service count (1.2)!"
0139 go_out -11
0140 fi
0141
0142
0143 RES=`xadmin psvc -r | egrep '^[^0-9]+[0-9]+[^0-9]+[0-9]+[^0-9]+[0-9]+$' | wc | awk '{print $1}'`
0144 if [ "X$RES" != "X2" ]; then
0145 echo "Invalid identifier count, expected 2 got $RES!"
0146 go_out -11
0147 fi
0148
0149
0150
0151
0152
0153
0154 echo "Stop another"
0155
0156 xadmin stop -i 11
0157 xadmin psvc -r
0158
0159 RES=`xadmin psvc -r | egrep '^[^0-9]+0[^0-9]+[0-9]+[^0-9]+2$'`
0160
0161 if [ "X$RES" == "X" ]; then
0162 echo "Invalid service count (0.2)!"
0163 go_out -12
0164 fi
0165
0166
0167 RES=`xadmin psvc -r | egrep '^[^0-9]+[0-9]+[^0-9]+[0-9]+[^0-9]+[0-9]+$' | wc | awk '{print $1}'`
0168 if [ "X$RES" != "X1" ]; then
0169 echo "Invalid identifier count, expected 1 got $RES!"
0170 go_out -12
0171 fi
0172
0173
0174
0175
0176
0177 xadmin start -y
0178 xadmin psvc -r
0179
0180
0181 RES=`xadmin psvc -r | egrep '^[^0-9]+0[^0-9]+[0-9]+[^0-9]+2$'`
0182 if [ "X$RES" == "X" ]; then
0183 echo "Invalid service count (0.2)!"
0184 go_out -13
0185 fi
0186
0187 RES=`xadmin psvc -r | egrep '^[^0-9]+1[^0-9]+[0-9]+[^0-9]+2$'`
0188 if [ "X$RES" == "X" ]; then
0189 echo "Invalid service count (1.2)!"
0190 go_out -13
0191 fi
0192
0193
0194 RES=`xadmin psvc -r | egrep '^[^0-9]+[0-9]+[^0-9]+[0-9]+[^0-9]+[0-9]+$' | wc | awk '{print $1}'`
0195 if [ "X$RES" != "X2" ]; then
0196 echo "Invalid identifier count, expected 2 got $RES!"
0197 go_out -13
0198 fi
0199
0200 echo "Running off client"
0201
0202 set_dom1;
0203
0204
0205
0206 (./atmiclt58 GpriQQMLVdaBg 2>&1) > ./atmiclt-dom1.log
0207
0208
0209 RET=$?
0210
0211 if [[ "X$RET" != "X0" ]]; then
0212 go_out $RET
0213 fi
0214
0215 if [ "X`grep TESTERROR *.log`" != "X" ]; then
0216 echo "Test error detected!"
0217 RET=-2
0218 fi
0219
0220
0221
0222
0223
0224 echo "Waiting for servers to finish..."
0225 sleep 6
0226
0227 xadmin psc
0228
0229 RES=`xadmin psc | egrep "atmi\.sv58[ \\t\\r\\n\\v\\f]+10[ \\t\\r\\n\\v\\f]+1[ \\t\\r\\n\\v\\f]+0"`
0230
0231 if [ "X$RES" == "X" ]; then
0232 echo "Processed entries missing (5)!"
0233 go_out -14
0234 fi
0235
0236 RES=`xadmin psc | egrep "atmi\.sv58[ \\t\\r\\n\\v\\f]+11[ \\t\\r\\n\\v\\f]+1[ \\t\\r\\n\\v\\f]+0"`
0237
0238 if [ "X$RES" == "X" ]; then
0239 echo "Processed entries missing (6)!"
0240 go_out -14
0241 fi
0242
0243 RES=`xadmin psc | egrep "atmi\.sv58[ \\t\\r\\n\\v\\f]+100[ \\t\\r\\n\\v\\f]+1[ \\t\\r\\n\\v\\f]+0"`
0244
0245 if [ "X$RES" == "X" ]; then
0246 echo "Processed entries missing (7)!"
0247 go_out -15
0248 fi
0249
0250 RES=`xadmin psc | egrep "atmi\.sv58[ \\t\\r\\n\\v\\f]+101[ \\t\\r\\n\\v\\f]+1[ \\t\\r\\n\\v\\f]+0"`
0251
0252 if [ "X$RES" == "X" ]; then
0253 echo "Processed entries missing (8)!"
0254 go_out -15
0255 fi
0256
0257 go_out $RET
0258
0259