Changeset: bbf2c351143a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bbf2c351143a
Modified Files:
        sql/test/Users/Tests/grantMonetdbToRegularUser.Bug-3771.SQL.py
        sql/test/Users/Tests/grantMonetdbToSchemaOwner.Bug-3771.SQL.py
Branch: mtest
Log Message:

Some corrections in the converted tests and remove old python code in the 
comments


diffs (124 lines):

diff --git a/sql/test/Users/Tests/grantMonetdbToRegularUser.Bug-3771.SQL.py 
b/sql/test/Users/Tests/grantMonetdbToRegularUser.Bug-3771.SQL.py
--- a/sql/test/Users/Tests/grantMonetdbToRegularUser.Bug-3771.SQL.py
+++ b/sql/test/Users/Tests/grantMonetdbToRegularUser.Bug-3771.SQL.py
@@ -1,6 +1,6 @@
 ###
-# Let a user inherit the rights of monetdb.
-# Check that by assuming the monetdb role the user has complete privileges 
(e.g. select, create, drop).
+# Let a user who is not the owner of schema inherit the rights of monetdb.
+# Check that by assuming the sysadmin role the user has complete privileges 
(e.g. select, create, drop).
 ###
 
 from MonetDBtesting.sqltest import SQLTestCase
@@ -25,43 +25,3 @@ with SQLTestCase() as tc:
             DELETE FROM testTable WHERE v1 = 2;
         """).assertSucceeded()
 
-# import os, sys
-# try:
-#     from MonetDBtesting import process
-# except ImportError:
-#     import process
-
-# def sql_test_client(user, passwd, input):
-#     with process.client(lang="sql", user=user, passwd=passwd, 
communicate=True,
-#                         stdin=process.PIPE, stdout=process.PIPE, 
stderr=process.PIPE,
-#                         input=input, port=int(os.getenv("MAPIPORT"))) as c:
-#         c.communicate()
-
-# sql_test_client('monetdb', 'monetdb', input="""\
-# CREATE USER user_with_many_rights with password 'ThisIsAS3m1S3cur3P4ssw0rd' 
name 'user gets monetdb rights' schema sys;
-
-# CREATE SCHEMA a_brand_new_schema_with_a_longer_name_than_usual;
-
-# CREATE table a_brand_new_schema_with_a_longer_name_than_usual.testTable(v1 
int, v2 int);
-
-# -- Grant delete rights.
-# GRANT sysadmin to user_with_many_rights;
-
-# """)
-
-# sql_test_client('user_with_many_rights', 'ThisIsAS3m1S3cur3P4ssw0rd', 
input="""\
-# -- Check delete.
-# set schema a_brand_new_schema_with_a_longer_name_than_usual;
-# set role sysadmin;
-
-# DROP TABLE testTable;
-# CREATE TABLE testTable(v1 INT);
-# ALTER TABLE testTable ADD COLUMN v2 INT;
-
-
-# SELECT * FROM testTable;
-# INSERT INTO testTable VALUES (3, 3);
-# UPDATE testTable SET v1 = 2 WHERE v2 = 7;
-# DELETE FROM testTable WHERE v1 = 2;
-# """)
-
diff --git a/sql/test/Users/Tests/grantMonetdbToSchemaOwner.Bug-3771.SQL.py 
b/sql/test/Users/Tests/grantMonetdbToSchemaOwner.Bug-3771.SQL.py
--- a/sql/test/Users/Tests/grantMonetdbToSchemaOwner.Bug-3771.SQL.py
+++ b/sql/test/Users/Tests/grantMonetdbToSchemaOwner.Bug-3771.SQL.py
@@ -1,6 +1,6 @@
 ###
 # Let a schema owner inherit the rights of monetdb.
-# Check that by assuming the monetdb role the user has complete privileges 
(e.g. select, create, drop).
+# Check that by assuming the sysadmin role the user has complete privileges 
(e.g. select, create, drop).
 ###
 
 from MonetDBtesting.sqltest import SQLTestCase
@@ -9,10 +9,12 @@ with SQLTestCase() as tc:
     tc.execute("CREATE USER owner with password 'ThisIsAS3m1S3cur3P4ssw0rd' 
name 'user gets monetdb rights' schema sys;").assertSucceeded()
     tc.execute("CREATE SCHEMA schemaForOwner AUTHORIZATION 
owner;").assertSucceeded()
     tc.execute("CREATE table schemaForOwner.testTable(v1 int, v2 
int);").assertSucceeded()
+    tc.execute("GRANT sysadmin to owner;").assertSucceeded()
 
     tc.connect(username="owner", password="ThisIsAS3m1S3cur3P4ssw0rd")
     tc.execute("""
         set schema schemaForOwner;
+        set role sysadmin;
         DROP TABLE testTable;
         CREATE TABLE testTable(v1 INT);
         ALTER TABLE testTable ADD COLUMN v2 INT;
@@ -22,43 +24,3 @@ with SQLTestCase() as tc:
         DELETE FROM testTable WHERE v1 = 2;
     """).assertSucceeded()
 
-# import os, sys
-# try:
-#     from MonetDBtesting import process
-# except ImportError:
-#     import process
-
-# def sql_test_client(user, passwd, input):
-#     with process.client(lang="sql", user=user, passwd=passwd, 
communicate=True,
-#                         stdin=process.PIPE, stdout=process.PIPE, 
stderr=process.PIPE,
-#                         input=input, port=int(os.getenv("MAPIPORT"))) as c:
-#         c.communicate()
-
-# sql_test_client('monetdb', 'monetdb', input="""\
-# CREATE USER owner with password 'ThisIsAS3m1S3cur3P4ssw0rd' name 'user gets 
monetdb rights' schema sys;
-
-# CREATE SCHEMA schemaForOwner AUTHORIZATION owner;
-
-# CREATE table schemaForOwner.testTable(v1 int, v2 int);
-
-# -- Grant delete rights.
-# GRANT sysadmin to owner;
-
-# """)
-
-# sql_test_client('owner', 'ThisIsAS3m1S3cur3P4ssw0rd', input="""\
-# -- Check delete.
-# set schema schemaForOwner;
-# set role monetdb;
-
-# DROP TABLE testTable;
-# CREATE TABLE testTable(v1 INT);
-# ALTER TABLE testTable ADD COLUMN v2 INT;
-
-
-# SELECT * FROM testTable;
-# INSERT INTO testTable VALUES (3, 3);
-# UPDATE testTable SET v1 = 2 WHERE v2 = 7;
-# DELETE FROM testTable WHERE v1 = 2;
-# """)
-
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to