*** empty log message ***
[csql.git] / test / cache / Bidirectional / test005.ksh
blobdd0e674e46e3e56e707dd582cd7982ad4d78e1a6
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 #cp $CSQL_CONFIG_FILE /tmp/csql.conf
17 #echo DSN=$DSN >>$CSQL_CONFIG_FILE
18 isql $DSN < $REL_PATH/mysqlcreatelogtable.sql >/dev/null 2>&1 &
19 echo table csql_log_int is created with records in target db
21 isql $DSN < $REL_PATH/create.sql >/dev/null 2>&1
22 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
23 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
24 isql $DSN < $REL_PATH/trigger.sql >/dev/null
25 isql $DSN < $REL_PATH/trigger1.sql >/dev/null
28 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
29 echo DSN=$DSN >>$CSQL_CONFIG_FILE
30 for (( a=1; a<3; a++ ))
32 echo "1:t$a NULL NULL NULL"
33 done >> /tmp/csql/csqltable.conf
35 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
36 pid=$!
37 sleep 5
38 echo "server 1 started"
40 echo "cache node 2"
41 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
42 if [ $? -ne 0 ]
43 then
44 echo "unable to locate cache 1"
45 # cp /tmp/csql.conf $CSQL_CONFIG_FILE
46 exit 3
48 mkdir /tmp/csql1 >/dev/null 2>&1
49 rm -f /tmp/csql1/csqltable.conf /tmp/csql1/csql.db
50 touch /tmp/csql1/csqltable.conf /tmp/csql1/csql.db
52 export CSQL_CONFIG_FILE=$REL_PATH/conf/csql.conf
53 echo DSN=$DSN >>$CSQL_CONFIG_FILE
55 for (( a=1; a<3; a++ ))
57 echo "1:t$a NULL NULL NULL"
58 done >> /tmp/csql1/csqltable.conf
60 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
61 pid1=$!
62 sleep 5
63 echo "server 2 started"
65 echo "cache node 1"
66 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
67 if [ $? -ne 0 ]
68 then
69 echo "unable to locate cache 1"
70 # cp /tmp/csql.conf $CSQL_CONFIG_FILE
71 exit 4
74 isql $DSN < ${REL_PATH}/insert.sql >/dev/null 2>&1
75 sleep 15
76 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
78 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
79 echo DSN=$DSN >>$CSQL_CONFIG_FILE
80 echo "cache node 2"
81 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
83 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1
84 isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1
85 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
86 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
87 rm -f /tmp/csql1/csqltable.conf /tmp/csql1/csql.db
88 touch /tmp/csql1/csqltable.conf /tmp/csql1/csql.db
90 kill -2 $pid
91 ipcrm -M 4000 -M 4500
92 kill -2 $pid1
93 ipcrm -M 5000 -M 5500
94 # cp /tmp/csql.conf $CSQL_CONFIG_FILE
95 exit 0;