Fixing failed test
[csql.git] / test / cache / Recovery / test002.ksh
blob0bfc44ccbf2402baa288544efe0ee130472c6cc6
1 #!/bin/sh
2 #This test requires kernel.shmmax to be 1GB, otherwise it may fail
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 cp $CSQL_CONFIG_FILE /tmp
14 echo DSN=$DSN >> $CSQL_CONFIG_FILE
15 isql $DSN < $REL_PATH/create.sql > /dev/null 2>&1
17 if [ $? -ne 0 ]
18 then
19 mv /tmp/csql.conf $CSQL_CONFIG_FILE
20 exit 1;
22 # edit /tmp/csql/csqltable.conf
23 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
24 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
25 for (( a=1; a<101; a++ ))
27 echo "1:t$a NULL NULL NULL"
28 done >> /tmp/csql/csqltable.conf
30 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
31 pid=$!
32 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
37 if [ $? -ne 0 ]
38 then
39 mv /tmp/csql.conf $CSQL_CONFIG_FILE
40 exit 5;
43 kill $pid > /dev/null 2>&1
44 ipcrm -M 1199
45 ipcrm -M 2277
46 isql $DSN < $REL_PATH/dropall.sql > /dev/null 2>&1
47 mv /tmp/csql.conf $CSQL_CONFIG_FILE
48 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
49 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
50 exit 0;