adding DSN to csql.conf based on the cache test mode
[csql.git] / test / cache / Recovery / test002.ksh
blob4cd666883c51923def7292a85d16547f13ad71bc
1 #!/bin/sh
3 #Run this test only under csql/test or on this directory.
4 #Otherwise, it may fail
5 CSQL_CONF=${PWD}/cache/Recovery/csql.conf
6 input=${PWD}/cache/Recovery/create.sql
7 REL_PATH=.
8 if [ -s "$input" -a -s "$CSQL_CONF" ]
9 then
10 REL_PATH=${PWD}/cache/Recovery
12 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
13 echo DSN=$DSN >> $CSQL_CONFIG_FILE
14 isql $DSN < $REL_PATH/create.sql > /dev/null 2>&1
16 if [ $? -ne 0 ]
17 then
18 exit 1;
21 # edit /tmp/csql/csqltable.conf
22 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
23 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
24 for (( a=1; a<101; a++ ))
26 echo "1:t$a NULL NULL NULL"
27 done >> /tmp/csql/csqltable.conf
29 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
30 pid=$!
31 sleep 60
33 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
34 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
36 $CSQL_INSTALL_ROOT/bin/csqldump
38 if [ $? -ne 0 ]
39 then
40 exit 5;
43 kill $pid > /dev/null 2>&1
45 isql $DSN < $REL_PATH/dropall.sql > /dev/null 2>&1
47 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
48 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
49 exit 0;