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="test087_tmsrv"
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
0050
0051
0052 source ./funcs.sh
0053
0054
0055
0056
0057 export NDRX_XA_FLAGS="RECON:*:3:100"
0058
0059
0060
0061
0062 buildprograms "";
0063
0064 echo ""
0065 echo "************************************************************************"
0066 echo "Start RECON"
0067 echo "************************************************************************"
0068
0069 cat << EOF > lib1.rets
0070 xa_open_entry:0:1:0
0071 xa_close_entry:0:1:0
0072 xa_start_entry:-7:2:0
0073 xa_end_entry:-7:2:0
0074 xa_rollback_entry:-7:2:8
0075 xa_prepare_entry:-7:2:-7
0076 xa_commit_entry:0:1:0
0077 xa_recover_entry:0:1:0
0078 xa_forget_entry:-7:2:0
0079 xa_complete_entry:0:1:0
0080 xa_open_entry:0:1:0
0081 xa_close_entry:0:1:0
0082 xa_start_entry:0:1:0
0083 EOF
0084
0085 cat << EOF > lib2.rets
0086 xa_open_entry:0:1:0
0087 xa_close_entry:0:1:0
0088 xa_start_entry:0:1:0
0089 xa_end_entry:0:1:0
0090 xa_rollback_entry:0:1:0
0091 xa_prepare_entry:0:1:0
0092 xa_commit_entry:0:1:0
0093 xa_recover_entry:0:1:0
0094 xa_forget_entry:0:1:0
0095 xa_complete_entry:0:1:0
0096 xa_open_entry:0:1:0
0097 xa_close_entry:0:1:0
0098 xa_start_entry:0:1:0
0099 EOF
0100
0101
0102 xadmin start -y || go_out 1
0103
0104 ERR=`NDRX_CCTAG="RM1" ./atmiclt87 2>&1`
0105 RET=$?
0106
0107 echo "[$ERR]"
0108
0109 if [ "X$RET" == "X0" ]; then
0110 echo "atmiclt87 must fail"
0111 go_out 1
0112 fi
0113
0114 if [[ $ERR != *"TPEABORT"* ]]; then
0115 echo "Expected TPEABORT"
0116 go_out 1
0117 fi
0118
0119
0120
0121
0122
0123 xadmin stop -y
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136 verify_ulog "RM1" "xa_open" "21";
0137 verify_ulog "RM1" "xa_close" "21";
0138
0139
0140
0141
0142 verify_ulog "RM1" "xa_start" "7";
0143
0144
0145
0146
0147 verify_ulog "RM1" "xa_end" "7";
0148 verify_ulog "RM1" "xa_prepare" "4";
0149
0150
0151
0152
0153
0154 verify_ulog "RM1" "xa_rollback" "3";
0155 verify_ulog "RM1" "xa_forget" "3";
0156 verify_ulog "RM1" "xa_commit" "0";
0157 verify_logfiles "log1" "0";
0158
0159
0160
0161
0162
0163
0164
0165 verify_ulog "RM2" "xa_open" "4";
0166 verify_ulog "RM2" "xa_close" "4";
0167 verify_ulog "RM2" "xa_prepare" "0";
0168 verify_ulog "RM2" "xa_commit" "0";
0169 verify_ulog "RM2" "xa_rollback" "1";
0170 verify_ulog "RM2" "xa_forget" "0";
0171 verify_logfiles "log2" "0";
0172
0173
0174 echo ""
0175 echo "************************************************************************"
0176 echo "COMMIT Retry"
0177 echo "************************************************************************"
0178
0179 cat << EOF > lib1.rets
0180 xa_open_entry:0:1:0
0181 xa_close_entry:0:1:0
0182 xa_start_entry:0:1:0
0183 xa_end_entry:0:1:0
0184 xa_rollback_entry:0:1:0
0185 xa_prepare_entry:0:1:0
0186 xa_commit_entry:-7:2:0
0187 xa_recover_entry:0:1:0
0188 xa_forget_entry:0:1:0
0189 xa_complete_entry:0:1:0
0190 xa_open_entry:0:1:0
0191 xa_close_entry:0:1:0
0192 xa_start_entry:0:1:0
0193 EOF
0194
0195 cat << EOF > lib2.rets
0196 xa_open_entry:0:1:0
0197 xa_close_entry:0:1:0
0198 xa_start_entry:0:1:0
0199 xa_end_entry:0:1:0
0200 xa_rollback_entry:0:1:0
0201 xa_prepare_entry:0:1:0
0202 xa_commit_entry:0:1:0
0203 xa_recover_entry:0:1:0
0204 xa_forget_entry:0:1:0
0205 xa_complete_entry:0:1:0
0206 xa_open_entry:0:1:0
0207 xa_close_entry:0:1:0
0208 xa_start_entry:0:1:0
0209 EOF
0210
0211 clean_ulog;
0212 xadmin start -y || go_out 1
0213
0214 NDRX_CCTAG="RM1" ./atmiclt87
0215 RET=$?
0216
0217 if [ "X$RET" != "X0" ]; then
0218 echo "Build atmiclt87 failed"
0219 go_out 1
0220 fi
0221
0222
0223
0224
0225 xadmin stop -y
0226
0227
0228
0229
0230
0231
0232
0233 verify_ulog "RM1" "xa_open" "7";
0234 verify_ulog "RM1" "xa_close" "7";
0235 verify_ulog "RM1" "xa_prepare" "1";
0236 verify_ulog "RM1" "xa_commit" "3";
0237 verify_ulog "RM1" "xa_rollback" "0";
0238 verify_ulog "RM1" "xa_forget" "0";
0239 verify_logfiles "log1" "0"
0240
0241 verify_ulog "RM1" "xa_end" "3";
0242
0243 verify_ulog "RM2" "xa_prepare" "1";
0244 verify_ulog "RM2" "xa_commit" "1";
0245 verify_ulog "RM2" "xa_rollback" "0";
0246 verify_ulog "RM2" "xa_forget" "0";
0247 verify_logfiles "log2" "0"
0248
0249 echo ""
0250 echo "************************************************************************"
0251 echo "RECOVER Retry"
0252 echo "************************************************************************"
0253
0254 cat << EOF > lib1.rets
0255 xa_open_entry:0:1:0
0256 xa_close_entry:0:1:0
0257 xa_start_entry:0:1:0
0258 xa_end_entry:0:1:0
0259 xa_rollback_entry:0:1:0
0260 xa_prepare_entry:0:1:0
0261 xa_commit_entry:0:1:0
0262 xa_recover_entry:-7:2:0
0263 xa_forget_entry:0:1:0
0264 xa_complete_entry:0:1:0
0265 xa_open_entry:0:1:0
0266 xa_close_entry:0:1:0
0267 xa_start_entry:0:1:0
0268 EOF
0269
0270 cat << EOF > lib2.rets
0271 xa_open_entry:0:1:0
0272 xa_close_entry:0:1:0
0273 xa_start_entry:0:1:0
0274 xa_end_entry:0:1:0
0275 xa_rollback_entry:0:1:0
0276 xa_prepare_entry:0:1:0
0277 xa_commit_entry:0:1:0
0278 xa_recover_entry:-7:2:0
0279 xa_forget_entry:0:1:0
0280 xa_complete_entry:0:1:0
0281 xa_open_entry:0:1:0
0282 xa_close_entry:0:1:0
0283 xa_start_entry:0:1:0
0284 EOF
0285
0286 clean_ulog;
0287 xadmin start -y || go_out 1
0288
0289 NDRX_CCTAG="RM1" tmrecovercl
0290 RET=$?
0291
0292 if [ "X$RET" != "X0" ]; then
0293 echo "Build atmiclt87 failed"
0294 go_out 1
0295 fi
0296
0297
0298
0299
0300 xadmin stop -y
0301
0302
0303
0304
0305
0306
0307 verify_ulog "RM1" "xa_open" "6";
0308 verify_ulog "RM1" "xa_close" "6";
0309 verify_ulog "RM1" "xa_prepare" "0";
0310 verify_ulog "RM1" "xa_commit" "0";
0311 verify_ulog "RM1" "xa_rollback" "0";
0312 verify_ulog "RM1" "xa_forget" "0";
0313
0314
0315
0316
0317 verify_ulog "RM1" "xa_recover" "3";
0318 verify_logfiles "log1" "0"
0319 verify_ulog "RM1" "xa_end" "0";
0320
0321 verify_ulog "RM2" "xa_open" "6";
0322 verify_ulog "RM2" "xa_close" "6";
0323 verify_ulog "RM2" "xa_prepare" "0";
0324 verify_ulog "RM2" "xa_commit" "0";
0325 verify_ulog "RM2" "xa_rollback" "0";
0326 verify_ulog "RM2" "xa_forget" "0";
0327 verify_ulog "RM2" "xa_recover" "3";
0328 verify_logfiles "log2" "0"
0329
0330 echo ""
0331 echo "************************************************************************"
0332 echo "OPEN/CLOSE Retry (system does not start...)"
0333 echo "************************************************************************"
0334
0335 cat << EOF > lib1.rets
0336 xa_open_entry:-5:2:0
0337 xa_close_entry:-7:2:0
0338 xa_start_entry:0:1:0
0339 xa_end_entry:0:1:0
0340 xa_rollback_entry:0:1:0
0341 xa_prepare_entry:0:1:0
0342 xa_commit_entry:0:1:0
0343 xa_recover_entry:0:1:0
0344 xa_forget_entry:0:1:0
0345 xa_complete_entry:0:1:0
0346 xa_open_entry:0:1:0
0347 xa_close_entry:0:1:0
0348 xa_start_entry:0:1:0
0349 EOF
0350
0351 cat << EOF > lib2.rets
0352 xa_open_entry:-5:1:0
0353 xa_close_entry:-7:1:0
0354 xa_start_entry:0:1:0
0355 xa_end_entry:0:1:0
0356 xa_rollback_entry:0:1:0
0357 xa_prepare_entry:0:1:0
0358 xa_commit_entry:0:1:0
0359 xa_recover_entry:0:1:0
0360 xa_forget_entry:0:1:0
0361 xa_complete_entry:0:1:0
0362 xa_open_entry:0:1:0
0363 xa_close_entry:0:1:0
0364 xa_start_entry:0:1:0
0365 EOF
0366
0367 clean_ulog;
0368 xadmin start -y || go_out 1
0369
0370 ERR=`NDRX_CCTAG="RM1" ./atmiclt87 2>&1`
0371 RET=$?
0372
0373 echo "[$ERR]"
0374
0375 if [ "X$RET" == "X0" ]; then
0376 echo "atmiclt87 must fail"
0377 go_out 1
0378 fi
0379
0380 if [[ $ERR != *"TPERMERR"* ]]; then
0381 echo "Expected TPERMERR"
0382 go_out 1
0383 fi
0384
0385 xadmin stop -y
0386
0387 echo ""
0388 echo "************************************************************************"
0389 echo "Prepare Retry, other err -> TPEABORT"
0390 echo "************************************************************************"
0391
0392 cat << EOF > lib1.rets
0393 xa_open_entry:0:1:0
0394 xa_close_entry:0:1:0
0395 xa_start_entry:0:1:0
0396 xa_end_entry:0:1:0
0397 xa_rollback_entry:0:1:0
0398 xa_prepare_entry:-3:1:0
0399 xa_commit_entry:0:2:0
0400 xa_recover_entry:0:1:0
0401 xa_forget_entry:0:1:0
0402 xa_complete_entry:0:1:0
0403 xa_open_entry:0:1:0
0404 xa_close_entry:0:1:0
0405 xa_start_entry:0:1:0
0406 EOF
0407
0408 cat << EOF > lib2.rets
0409 xa_open_entry:0:1:0
0410 xa_close_entry:0:1:0
0411 xa_start_entry:0:1:0
0412 xa_end_entry:0:1:0
0413 xa_rollback_entry:0:1:0
0414 xa_prepare_entry:0:1:0
0415 xa_commit_entry:0:1:0
0416 xa_recover_entry:0:1:0
0417 xa_forget_entry:0:1:0
0418 xa_complete_entry:0:1:0
0419 xa_open_entry:0:1:0
0420 xa_close_entry:0:1:0
0421 xa_start_entry:0:1:0
0422 EOF
0423
0424 clean_ulog;
0425 xadmin start -y || go_out 1
0426
0427 ERR=`NDRX_CCTAG="RM1" ./atmiclt87 2>&1`
0428 RET=$?
0429
0430 echo "[$ERR]"
0431
0432 if [ "X$RET" == "X0" ]; then
0433 echo "atmiclt87 must fail"
0434 go_out 1
0435 fi
0436
0437 if [[ $ERR != *"TPEABORT"* ]]; then
0438 echo "Expected TPEABORT"
0439 go_out 1
0440 fi
0441
0442
0443
0444
0445 xadmin stop -y
0446
0447 echo ""
0448 echo "************************************************************************"
0449 echo "Prepare Retry, other err configred recon"
0450 echo "************************************************************************"
0451
0452 cat << EOF > lib1.rets
0453 xa_open_entry:0:1:0
0454 xa_close_entry:0:1:0
0455 xa_start_entry:0:1:0
0456 xa_end_entry:0:1:0
0457 xa_rollback_entry:0:1:0
0458 xa_prepare_entry:-3:1:0
0459 xa_commit_entry:0:1:0
0460 xa_recover_entry:0:1:0
0461 xa_forget_entry:0:1:0
0462 xa_complete_entry:0:1:0
0463 xa_open_entry:0:1:0
0464 xa_close_entry:0:1:0
0465 xa_start_entry:0:1:0
0466 EOF
0467
0468 cat << EOF > lib2.rets
0469 xa_open_entry:0:1:0
0470 xa_close_entry:0:1:0
0471 xa_start_entry:0:1:0
0472 xa_end_entry:0:1:0
0473 xa_rollback_entry:0:1:0
0474 xa_prepare_entry:0:1:0
0475 xa_commit_entry:0:1:0
0476 xa_recover_entry:0:1:0
0477 xa_forget_entry:0:1:0
0478 xa_complete_entry:0:1:0
0479 xa_open_entry:0:1:0
0480 xa_close_entry:0:1:0
0481 xa_start_entry:0:1:0
0482 EOF
0483
0484 export NDRX_XA_FLAGS="RECON:*:3:100:-3,-7"
0485 clean_ulog;
0486 xadmin start -y || go_out 1
0487
0488 NDRX_CCTAG="RM1" ./atmiclt87
0489 RET=$?
0490
0491 if [ "X$RET" != "X0" ]; then
0492 echo "Build atmiclt87 failed"
0493 go_out 1
0494 fi
0495
0496
0497 go_out 0
0498
0499