removing csqltable.conf file before starting the tests
[csql.git] / test / cache / Bidirectional / test001.ksh
blobe8532ae4c19efb00341c493debb33b93782b19b7
1 #!/bin/sh
2 # Test Case
4 # Bi-directional cache test
5 # Cache t1 and t2 table
6 # Set bidirectional flag in csql.conf to true,delete log table from target db if exist
8 input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql
10 REL_PATH=.
11 if [ -s "$input" ]
12 then
13 REL_PATH=${PWD}/cache/Bidirectional
16 isql myodbc3 < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 &
17 echo No log table in target DB
19 isql myodbc3 < $REL_PATH/create.sql >/dev/null 2>&1
20 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
21 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
22 isql myodbc3 <$REL_PATH/trigger.sql >/dev/null
23 isql myodbc3 <$REL_PATH/trigger1.sql >/dev/null
25 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
27 for (( a=1; a<3; a++ ))
29 echo "1:t$a NULL"
30 done >> /tmp/csql/csqltable.conf
32 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
33 pid=$!
34 sleep 5
35 echo "server started"
36 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
37 if [ $? -ne 0 ]
38 then
39 echo "unable to locate cache 1"
40 exit 1
43 isql myodbc3 < ${REL_PATH}/insert.sql >/dev/null 2>&1
44 sleep 15
45 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
47 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1
48 isql myodbc3 < ${REL_PATH}/drop.sql >/dev/null 2>&1
49 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
50 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
52 kill -2 $pid
53 ipcrm -M 4000 -M 4500
54 exit 0;