Back to home page

Enduro/X

 
 

    


0001 #!/bin/bash
0002 ##
0003 ##
0004 ## @file run.sh
0005 ##
0006 ## -----------------------------------------------------------------------------
0007 ## Enduro/X Middleware Platform for Distributed Transaction Processing
0008 ## Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
0009 ## Copyright (C) 2017-2023, Mavimax, Ltd. All Rights Reserved.
0010 ## This software is released under one of the following licenses:
0011 ## AGPL (with Java and Go exceptions) or Mavimax's license for commercial use.
0012 ## See LICENSE file for full text.
0013 ## -----------------------------------------------------------------------------
0014 ## AGPL license:
0015 ##
0016 ## This program is free software; you can redistribute it and/or modify it under
0017 ## the terms of the GNU Affero General Public License, version 3 as published
0018 ## by the Free Software Foundation;
0019 ##
0020 ## This program is distributed in the hope that it will be useful, but WITHOUT ANY
0021 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0022 ## PARTICULAR PURPOSE. See the GNU Affero General Public License, version 3
0023 ## for more details.
0024 ##
0025 ## You should have received a copy of the GNU Affero General Public License along 
0026 ## with this program; if not, write to the Free Software Foundation, Inc.,
0027 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0028 ##
0029 ## -----------------------------------------------------------------------------
0030 ## A commercial use license is available from Mavimax, Ltd
0031 ## contact@mavimax.com
0032 ## -----------------------------------------------------------------------------
0033 ##
0034 export TESTNO="021"
0035 export TESTNAME_SHORT="xafull"
0036 export TESTNAME="test${TESTNO}_${TESTNAME_SHORT}"
0037 export NDRX_TESTMODE=1
0038 
0039 PWD=`pwd`
0040 if [ `echo $PWD | grep $TESTNAME ` ]; then
0041     # Do nothing 
0042     echo > /dev/null
0043 else
0044     # started from parent folder
0045     pushd .
0046     echo "Doing cd"
0047     cd $TESTNAME
0048 fi;
0049 
0050 
0051 SUFFIX="so"
0052 
0053 if [ "$(uname)" == "Darwin" ]; then
0054     SUFFIX="dylib"
0055 fi
0056 
0057 SYSTEM=`uname`
0058 echo "SYSTEM: "$SYSTEM""
0059 
0060 export TESTPING_DOM1="";
0061 export TESTPING_DOM2="";
0062 ################################################################################
0063 # Bug 160, xa_start fails due to closed connection, recon
0064 ################################################################################
0065 
0066 # Seems TLS is not working for aix within the loaded driver
0067 if [ "X$SYSTEM" != "XAIX" ]; then
0068 
0069 echo ">>> Doing static registration tests... (Bug #160 - start fails at random...)"
0070 echo ">>> #160: Firstly does retry, test case must succeed as flags set"
0071 export NDRX_XA_DRIVERLIB_FILENAME=libxadrv_s-startfail.$SUFFIX
0072 
0073 #
0074 # Recon on every xa_start error, 3xretries, sleep 10ms between retries.
0075 #
0076 export NDRX_XA_FLAGS="RECON:*:2:10"
0077 export TEST160_FLAG=""
0078 
0079 ./run-dom.sh || exit $?
0080 
0081 fi
0082 
0083 ################################################################################
0084 # Bug 160, xa_start fails due to closed connection, recon, but only 2x times
0085 # the test case engine needs 3x times...
0086 ################################################################################
0087 
0088 # Seems TLS is not working for aix...
0089 if [ "X$SYSTEM" != "XAIX" ]; then
0090 
0091 echo ">>> Doing static registration tests... (Bug #160 - start fails at random...)"
0092 echo ">>> #160: Secondly does retry, only 2x times, no success"
0093 export NDRX_XA_DRIVERLIB_FILENAME=libxadrv_s-startfail.$SUFFIX
0094 
0095 #
0096 # Recon on every xa_start error, 3xretries, sleep 10ms between retries.
0097 #
0098 export NDRX_XA_FLAGS="RECON:*:1:10"
0099 export TEST160_FLAG="fail"
0100 
0101 ./run-dom.sh || exit $?
0102 
0103 fi
0104 
0105 
0106 ################################################################################
0107 # Bug 160, xa_start fails due to closed connection, no recon
0108 ################################################################################
0109 
0110 # Seems TLS is not working for aix...
0111 if [ "X$SYSTEM" != "XAIX" ]; then
0112 
0113 echo ">>> Doing static registration tests... (Bug #160 - start fails at random...)"
0114 echo ">>> #160: Third test -  no retries, test case must fail"
0115 export NDRX_XA_DRIVERLIB_FILENAME=libxadrv_s-startfail.$SUFFIX
0116 export TEST160_FLAG="fail"
0117 unset NDRX_XA_FLAGS
0118 
0119 ./run-dom.sh || exit $?
0120 
0121 fi
0122 
0123 
0124 ################################################################################
0125 # Test case 105, prepare fails
0126 ################################################################################
0127 
0128 echo "Doing static registration tests... (Bug #105 - prepare ok, but proc abort)"
0129 export NDRX_XA_DRIVERLIB_FILENAME=libxadrv_s-105.$SUFFIX
0130 ./run-dom.sh || exit $?
0131 
0132 echo "Doing static registration tests... (Bug #123 - try fail commit \
0133         manual complete (by xadmin))"
0134 export NDRX_XA_DRIVERLIB_FILENAME=libxadrv_s-tryfail.$SUFFIX
0135 ./run-dom.sh || exit $?
0136 
0137 echo "Doing static registration tests... (Bug #123 - try fail, but recovers after awhile)"
0138 export NDRX_XA_DRIVERLIB_FILENAME=libxadrv_s-tryok.$SUFFIX
0139 ./run-dom.sh || exit $?
0140 
0141 echo "Doing static registration tests... (Bug #105 - prepare ok, but proc abort)"
0142 export NDRX_XA_DRIVERLIB_FILENAME=libxadrv_s-105.$SUFFIX
0143 ./run-dom.sh || exit $?
0144 
0145 ################################################################################
0146 # Normal tests
0147 ################################################################################
0148 
0149 export NDRX_XA_FLAGS=RECON:*:2:100
0150 # tests with xa_recover type pings
0151 export TESTPING_DOM1="-P1 -R";
0152 
0153 # tests with xa_start type pings
0154 export TESTPING_DOM2="-P1";
0155 
0156 echo "Doing static registration tests..."
0157 export NDRX_XA_DRIVERLIB_FILENAME=libxadrv_s.$SUFFIX
0158 ./run-dom.sh || exit $?
0159 
0160 echo "Doing dynamic registration tests..."
0161 export NDRX_XA_DRIVERLIB_FILENAME=libxadrv_d.$SUFFIX
0162 ./run-dom.sh || exit $?
0163 
0164 # vim: set ts=4 sw=4 et smartindent: