adding test scripts
[csql.git] / test / cache / CacheVerify / test007.ksh
blobb3c32a9eba055f0f968e88cfc1b03a1486e86077
1 #!/bin/ksh
2 # Test Case
3 # 7. For the above scenario,
4 # delete 3 tuples from csql and
5 # delete 2 tuples from mysql.
6 # Run $ cacheverify -t t1.
7 # The output should display number of records as 7 and 8 for csql and
8 # mysql respectively.
9 # Run $ cacheverify -t t1 -p.
10 # The output should display the primary key field values for missing
11 # records in either of the databases in ascending order.
12 # Run $ cacheverify -t t1 -f.
13 # The output should display the records are consistent for the same
14 # primary key.
16 #Run this test only under csql/test or on this directory.
17 #Otherwise, it may fail
19 input=${PWD}/cache/CacheVerify/csqldelete.sql
20 REL_PATH=.
21 if [ -s "$input" ]
22 then
23 REL_PATH=${PWD}/cache/CacheVerify
26 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/csqldelete.sql >/dev/null 2>&1
27 if [ $? -ne 0 ]
28 then
29 exit 1;
32 cp $CSQL_CONFIG_FILE /tmp/csql.conf
33 export CSQL_CONFIG_FILE=/tmp/csql.conf
34 echo DSN=$DSN >>$CSQL_CONFIG_FILE
35 DS="$DSN $DBUSER $PASSWORD"
36 rm -f /tmp/csql/csqlds.conf
37 touch /tmp/csql/csqlds.conf
38 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
39 if [ $? -ne 0 ]
40 then
41 exit 1;
44 isql $DS < ${REL_PATH}/mysqldelete.sql >/dev/null 2>&1
45 if [ $? -ne 0 ]
46 then
47 exit 2;
50 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1
51 if [ $? -ne 0 ]
52 then
53 exit 3;
56 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p
57 if [ $? -ne 0 ]
58 then
59 exit 4;
62 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f
63 if [ $? -ne 0 ]
64 then
65 exit 5;
68 exit 0;