separating database engine and cache tests
[csql.git] / test / cache / Bidirectional / test002.ksh
blob9fe88c92a95a906cdf0093d8355fdf965e64c9a5
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,Create log table in target database
7 #Donot run trigger
8 input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql
10 REL_PATH=.
11 if [ -s "$input" ]
12 then
13 REL_PATH=${PWD}/cache/Bidirectional
16 isql $DSN < $REL_PATH/mysqlcreatelogtable.sql >/dev/null 2>&1 &
17 echo Log table created in target DB
19 isql $DSN < $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 $DSN <$REL_PATH/droptrigger.sql >/dev/null
24 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
26 for (( a=1; a<3; a++ ))
28 echo "1:t$a NULL"
29 done >> /tmp/csql/csqltable.conf
31 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
32 pid=$!
33 sleep 5
34 echo "server started"
35 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
36 if [ $? -ne 0 ]
37 then
38 echo "unable to locate cache 1"
39 exit 1
42 isql $DSN < ${REL_PATH}/insert.sql >/dev/null 2>&1
43 sleep 15
44 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
46 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1
47 isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1
48 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
49 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
51 kill -2 $pid
52 ipcrm -M 4000 -M 4500
53 exit 0;