test integration changes
[csql.git] / test / tools / UserStmt / test005.ksh
blob7e4ddf522b0ce61fdbe74eb23e96c4c619e4d0d6
1 #!/bin/ksh
2 #Test Case : Creation of user with same name twice should be failed
3 # Connect to root user as:
4 # # csql -u root -p manager
5 # create a user say nihar as:
6 # CSQL> create user nihar password 'nihar123';
7 # create another user with same name nihar
8 # CSQL> create user nihar password 'nihar123';
9 # It should be failed, saying user name in this name already exist.
11 QUITFILE=${PWD}/tools/UserStmt/csql.conf
12 REL_PATH=.
13 if [ -s "$QUITFILE" ]
14 then
15 REL_PATH=`pwd`/tools/UserStmt
18 exitStatus()
20 rm -f ${REL_PATH}/usr.sql
21 echo "Test $1"
22 exit $2;
25 echo "echo create user nihar password 'nihar123';" >${REL_PATH}/usr.sql
26 echo "create user nihar password 'nihar123';" >>${REL_PATH}/usr.sql
27 echo "echo create user nihar password 'nihar321';" >>${REL_PATH}/usr.sql
28 echo "create user nihar password 'nihar321';" >>${REL_PATH}/usr.sql
29 echo "echo drop user nihar;" >>${REL_PATH}/usr.sql
30 echo "drop user nihar;" >>${REL_PATH}/usr.sql
31 echo "quit;" >>${REL_PATH}/usr.sql
33 echo "Connecting User root"
34 if [ "$VALGRIND" = "true" ]
35 then
36 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/usr.sql
37 else
38 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/usr.sql
39 if [ $? -ne 0 ]
40 then
41 exitStatus Failed 1;
45 exitStatus Passed 0;