adding test scripts
[csql.git] / test / cache / Recovery / test001.ksh
blob42a79da573682dd15cb8af44d25465f01747f744
1 #!/bin/ksh
3 #Run this test only under csql/test or on this directory.
4 #Otherwise, it may fail
6 # mysql is not connecting becos odbc.ini does not have anything.
7 # try to cache the table created in target db
8 # it should fail
10 CSQL_CONF=${PWD}/cache/Recovery/csql.conf
11 REL_PATH=.
12 if [ -s "$CSQL_CONF" ]
13 then
14 REL_PATH=${PWD}/cache/Recovery
17 rm -f /tmp/csql.conf
18 cp $REL_PATH/csql.conf /tmp
19 export CSQL_CONFIG_FILE=/tmp/csql.conf
21 echo DSN=$DSN >>$CSQL_CONFIG_FILE
22 DS="$DSN $DBUSER $PASSWORD"
23 echo $DS
24 rm -f /tmp/csql/csqlds.conf
25 touch /tmp/csql/csqlds.conf
26 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
27 if [ $? -ne 0 ]
28 then
29 exit 1;
33 isql $DS < $REL_PATH/drop.sql > /dev/null 2>&1
34 isql $DS < $REL_PATH/createt1.sql > /dev/null 2>&1
35 if [ $? -ne 0 ]
36 then
37 exit 2;
40 rm -f /tmp/csql/csqltable.conf
41 touch /tmp/csql/csqltable.conf
43 echo "1 t1 NULL NULL NULL $DSN" > /tmp/csql/csqltable.conf
46 mv ~/.odbc.ini /tmp
47 touch ~/.odbc.ini
49 rm -f /tmp/csql/csqlds.conf
50 touch /tmp/csql/csqlds.conf
51 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1
52 if [ $? -ne 0 ]
53 then
54 mv /tmp/.odbc.ini ~
55 rm -f /tmp/csql/csqlds.conf
56 touch /tmp/csql/csqlds.conf
57 isql $DS < $REL_PATH/drop.sql > /dev/null 2>&1
58 exit 0;
60 mv /tmp/.odbc.ini ~
61 rm -f /tmp/csql/csqlds.conf
62 touch /tmp/csql/csqlds.conf
63 isql $DS < $REL_PATH/drop.sql > /dev/null 2>&1
64 exit 3;