removing csqltable.conf file before starting the tests
[csql.git] / test / cache / Bidirectional / test005.ksh
blob6ea89c7b34c0a77a80e89eb17724d5637e12f866
1 #!/bin/sh
2 # Test Case
4 #Bi-directional mutiple cache node test
5 #Two Cache Node and t1 and t2 table to be cached
6 # insert operation in target database
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/mysqlcreatelogtable.sql >/dev/null 2>&1 &
17 echo table csql_log_int is created with records 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
26 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
28 for (( a=1; a<3; a++ ))
30 echo "1:t$a NULL"
31 done >> /tmp/csql/csqltable.conf
33 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
34 pid=$!
35 sleep 5
36 echo "server 1 started"
38 echo "cache node 2"
39 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
40 if [ $? -ne 0 ]
41 then
42 echo "unable to locate cache 1"
43 exit 3
45 mkdir /tmp/csql1 >/dev/null 2>&1
46 rm -f /tmp/csql1/csqltable.conf /tmp/csql1/csql.db
47 touch /tmp/csql1/csqltable.conf /tmp/csql1/csql.db
49 export CSQL_CONFIG_FILE=$REL_PATH/conf/csql.conf
51 for (( a=1; a<3; a++ ))
53 echo "1:t$a NULL"
54 done >> /tmp/csql1/csqltable.conf
56 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
57 pid1=$!
58 sleep 5
59 echo "server 2 started"
61 echo "cache node 1"
62 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
63 if [ $? -ne 0 ]
64 then
65 echo "unable to locate cache 1"
66 exit 4
69 isql myodbc3 < ${REL_PATH}/insert.sql >/dev/null 2>&1
70 sleep 15
71 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
73 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
74 echo "cache node 2"
75 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
77 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1
78 isql myodbc3 < ${REL_PATH}/drop.sql >/dev/null 2>&1
79 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
80 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
81 rm -f /tmp/csql1/csqltable.conf /tmp/csql1/csql.db
82 touch /tmp/csql1/csqltable.conf /tmp/csql1/csql.db
84 kill -2 $pid
85 ipcrm -M 4000 -M 4500
86 kill -2 $pid1
87 ipcrm -M 5000 -M 5500
88 exit 0;