3 # 2. Create table t1 with primary key in mysql. Cache the table in csql.
4 # Check for user authentication:
5 # $ cachetable [-U username] [-P password] -t t1
7 # a. correct username correct password - should pass
8 # b. correct username wrong password - should return error
9 # c. wrong username correct password - should return error
10 # d. wrong username wrong password - should return error
12 #Run this test only under csql/test or on this directory.
13 #Otherwise, it may fail
15 input
=${PWD}/cache
/CacheTable
/inputtest4.sql
19 REL_PATH
=${PWD}/cache
/CacheTable
21 cp $CSQL_CONFIG_FILE /tmp
/csql.conf
22 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
24 isql
$DSN < ${REL_PATH}/inputtest4.sql
>/dev
/null
2>&1
27 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
31 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
32 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
34 # check with correct username and correct password
35 $CSQL_INSTALL_ROOT/bin
/cachetable
-U root
-P manager
-t t1
>/dev
/null
2>&1
38 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
42 # correct username and wrong password
43 $CSQL_INSTALL_ROOT/bin
/cachetable
-U root
-P MANAGER
-t t1
> /dev
/null
2>&1
46 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
50 # wrong username and correct password
51 $CSQL_INSTALL_ROOT/bin
/cachetable
-U ROOT
-P manager
-t t1
> /dev
/null
2>&1
54 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
58 #wrong username and wrong password
59 $CSQL_INSTALL_ROOT/bin
/cachetable
-U ROOT
-P MANAGER
-t t1
> /dev
/null
2>&1
62 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
66 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
67 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
69 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/drop.sql
> /dev
/null
2>&1
70 isql
$DSN < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
71 #rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
72 #touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
74 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE