db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1221456 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthProcs.java
Date Tue, 20 Dec 2011 19:35:45 GMT
Author: rhillegas
Date: Tue Dec 20 19:35:44 2011
New Revision: 1221456

URL: http://svn.apache.org/viewvc?rev=1221456&view=rev
Log:
DERBY-866: Add regression tests for GRANT/REVOKE on new procedures supporting NATIVE authentication.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthProcs.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthProcs.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthProcs.java?rev=1221456&r1=1221455&r2=1221456&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthProcs.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NativeAuthProcs.java
Tue Dec 20 19:35:44 2011
@@ -188,6 +188,7 @@ public class NativeAuthProcs extends Gen
         createUserTests( dboConnection, janetConnection );
         resetPasswordTests( dboConnection, janetConnection );
         modifyPasswordTests( dboConnection, janetConnection );
+        if ( authorizationIsOn() ) { grantRevokeTests( dboConnection, janetConnection );
}
     }
     private boolean dboExists( Connection conn )
         throws Exception
@@ -421,4 +422,31 @@ public class NativeAuthProcs extends Gen
         return newerLastModified;
     }
     
+    //
+    // Grant/Revoke
+    //
+    private void    grantRevokeTests
+        ( Connection dboConnection, Connection janetConnection )
+        throws Exception
+    {
+        goodStatement( dboConnection, "grant execute on procedure syscs_util.syscs_create_user
to JANET" );
+        goodStatement( dboConnection, "grant execute on procedure syscs_util.syscs_reset_password
to JANET" );
+        goodStatement( dboConnection, "grant execute on procedure syscs_util.syscs_drop_user
to JANET" );
+
+        goodStatement( janetConnection, "call syscs_util.syscs_create_user( 'JOE', 'joepassword'
)" );
+        goodStatement( janetConnection, "call syscs_util.syscs_reset_password( 'JOE', 'joepassword_rev3'
)" );
+        goodStatement( janetConnection, "call syscs_util.syscs_drop_user( 'JOE' )" );
+
+        goodStatement( dboConnection, "revoke execute on procedure syscs_util.syscs_create_user
from JANET restrict" );
+        goodStatement( dboConnection, "revoke execute on procedure syscs_util.syscs_reset_password
from JANET restrict" );
+        goodStatement( dboConnection, "revoke execute on procedure syscs_util.syscs_drop_user
from JANET restrict" );
+        
+        expectExecutionError
+            ( janetConnection, NO_EXECUTE_PERMISSION, "call syscs_util.syscs_create_user(
'JOE', 'joepassword' )" );
+        expectExecutionError
+            ( janetConnection, NO_EXECUTE_PERMISSION, "call syscs_util.syscs_reset_password(
'JOE', 'joepassword_rev3' )" );
+        expectExecutionError
+            ( janetConnection, NO_EXECUTE_PERMISSION, "call syscs_util.syscs_drop_user( 'JOE'
)" );
+    }
+    
 }



Mime
View raw message