adding DSN to csql.conf based on the cache test mode
[csql.git] / test / cache / CacheVerify / test006.ksh
blob99341dbc437bf659b186ed5c1f79b3c0fab49159
1 #!/bin/sh
2 # Test Case
3 # 6. Create table t1 in mysql with primary key. Insert 10 rows.
4 # Cache the table in csql.
5 # Run $ cacheverify -t t1
6 # The output should display the number of records present in csql
7 # and mysql separately.
8 # Run $ cacheverify -t t1 -p
9 # The output should display no missing records in either database.
10 # Run $ cacheverify -t t1 -f
11 # The output should display no missing records and should display
12 # the data is consistent in both databases.
15 #Run this test only under csql/test or on this directory.
16 #Otherwise, it may fail
18 input=${PWD}/cache/CacheVerify/mysqlinput.sql
19 REL_PATH=.
20 if [ -s "$input" ]
21 then
22 REL_PATH=${PWD}/cache/CacheVerify
25 cp $CSQL_CONFIG_FILE /tmp/csql.conf
26 echo DSN=$DSN >>$CSQL_CONFIG_FILE
27 isql $DSN < ${REL_PATH}/mysqlinput.sql >/dev/null 2>&1
28 if [ $? -ne 0 ]
29 then
30 cp /tmp/csql.conf $CSQL_CONFIG_FILE
31 exit 1;
34 rm -f /tmp/csql/csqltable.conf
35 touch /tmp/csql/csqltable.conf
38 $CSQL_INSTALL_ROOT/bin/cachetable -t t1
39 if [ $? -ne 0 ]
40 then
41 cp /tmp/csql.conf $CSQL_CONFIG_FILE
42 exit 2;
45 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1
46 if [ $? -ne 0 ]
47 then
48 cp /tmp/csql.conf $CSQL_CONFIG_FILE
49 exit 3;
52 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p
53 if [ $? -ne 0 ]
54 then
55 cp /tmp/csql.conf $CSQL_CONFIG_FILE
56 exit 4;
59 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f
60 if [ $? -ne 0 ]
61 then
62 cp /tmp/csql.conf $CSQL_CONFIG_FILE
63 exit 5;
66 cp /tmp/csql.conf $CSQL_CONFIG_FILE
67 exit 0;