*** empty log message ***
[csql.git] / test / tools / csql / testnw001.ksh
blobbd89bc3b2e105e7889f2fabe8eb465746e26f83c
1 #!/bin/ksh
2 # Test Case
3 # check no option, ?
4 # check whether authentication is working
6 QUITFILE=${PWD}/tools/csql/quit.sql
7 REL_PATH=.
8 if [ -s "$QUITFILE" ]
9 then
10 REL_PATH=`pwd`/tools/csql
12 echo "Case 1: With no option:"
13 $CSQL_INSTALL_ROOT/bin/csql < ${REL_PATH}/quit.sql
14 if [ $? -ne 0 ]
15 then
16 exit 1;
18 echo "Case 2: With ? option:"
19 $CSQL_INSTALL_ROOT/bin/csql -?
20 if [ $? -ne 0 ]
21 then
22 exit 2;
25 echo "Case 3: With wrong username and wrong password :"
26 $CSQL_INSTALL_ROOT/bin/csql -o 4 -u wronguser -p password < ${REL_PATH}/quit.sql >/dev/null 2>&1
27 if [ $? -eq 0 ]
28 then
29 echo passed
30 exit 3;
32 echo failed
34 echo "Case 4: With wrong username :"
35 $CSQL_INSTALL_ROOT/bin/csql -o 4 -u wronguser -p manager < ${REL_PATH}/quit.sql >/dev/null 2>&1
36 if [ $? -eq 0 ]
37 then
38 echo Passed
39 exit 4;
41 echo Failed
43 echo "Case 5: With wrong password :"
44 $CSQL_INSTALL_ROOT/bin/csql -o 4 -u root -p password < ${REL_PATH}/quit.sql >/dev/null 2>&1
45 if [ $? -eq 0 ]
46 then
47 echo passed
48 exit 5;
50 echo failed
52 echo "Case 6: With correct user name and password :"
53 $CSQL_INSTALL_ROOT/bin/csql -o 4 -u root -p manager < ${REL_PATH}/quit.sql
54 if [ $? -ne 0 ]
55 then
56 echo failed
57 exit 6;
59 echo passed
60 exit 0;