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
0037
0038
0039 function go_out {
0040 echo "Test exiting with: $1"
0041
0042 xadmin stop -y
0043 xadmin down -y
0044
0045 popd 2>/dev/null
0046 exit $1
0047 }
0048
0049
0050
0051
0052 function go_out_silent {
0053 echo "Test exiting with: $1"
0054
0055 popd 2>/dev/null
0056 exit $1
0057 }
0058
0059
0060 echo ">>> Testing ubb_config1 -> E/X convert"
0061
0062
0063
0064
0065
0066
0067 (xadmin ps -r "-k [a-zA-Z0-9]{8,8} -i" -p | xargs kill -9) 2>/dev/null
0068 (xadmin ps -r "-k [a-zA-Z0-9]{8,8} -i" -p | xargs kill -9) 2>/dev/null
0069 (xadmin ps -r "-k [a-zA-Z0-9]{8,8} -i" -p | xargs kill -9) 2>/dev/null
0070
0071 export NDRX_SILENT=Y
0072 rm -rf ./runtime tmp1 tmp2 2>/dev/null
0073 ubb2ex -P ./runtime ubb_logs
0074
0075 RET=$?
0076
0077 if [ "X$RET" != "X0" ]; then
0078 go_out_silent $RET
0079 fi
0080
0081
0082
0083
0084 pushd .
0085
0086 cd runtime/appdir/app/conf
0087 . setsite1
0088
0089 popd
0090
0091
0092 xadmin down -y
0093 xadmin start -y
0094
0095 RET=$?
0096 if [ "X$RET" != "X0" ]; then
0097 go_out $RET
0098 fi
0099
0100 xadmin psc
0101
0102 xadmin stop -y
0103
0104
0105 echo ">>> Check file existence..."
0106
0107
0108 if [ ! -f runtime/logs/log/a1.log ]; then
0109 echo "Missing runtime/logs/log/a1.log"
0110 go_out -1
0111 fi
0112
0113 if [ ! -f runtime/logs/log/sub/a2.log ]; then
0114 echo "Missing runtime/logs/log/sub/a2.log"
0115 go_out -1
0116 fi
0117
0118 if [ ! -f runtime/appdir/app/log/third.log ]; then
0119 echo "Missing runtime/appdir/app/log/third.log"
0120 go_out -1
0121 fi
0122
0123 if [ ! -f runtime/appdir/app/dir/third2.log ]; then
0124 echo "Missing runtime/appdir/app/dir/third2.log"
0125 go_out -1
0126 fi
0127
0128 if [ ! -f runtime/other/app/dir/forth.log ]; then
0129 echo "Missing runtime/other/app/dir/forth.log"
0130 go_out -1
0131 fi
0132
0133
0134 echo ">>> Compare outputs of the XML"
0135
0136
0137
0138 cat $TESTDIR/ubb_logs.xml | \
0139 grep -v forth.log > tmp1
0140
0141 cat $TESTDIR/runtime/appdir/app/conf/ndrxconfig.site1.xml | \
0142 grep -v forth.log > tmp2
0143
0144 OUT=`diff tmp1 tmp2`
0145
0146 RET=$?
0147
0148 if [ "X$RET" != "X0" ]; then
0149 go_out $RET
0150 fi
0151
0152 echo $OUT
0153
0154 if [ "X$OUT" != "X" ]; then
0155 echo "$TESTDIR/ubb_logs.xml!=$TESTDIR/runtime/appdir/app/conf/ndrxconfig.site1.xml"
0156 go_out -1
0157 fi
0158
0159 go_out $RET
0160
0161
0162