Changeset: febda30627eb for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=febda30627eb Added Files: sql/test/Users/Tests/privs.sql.src sql/test/Users/Tests/privs.stable.err sql/test/Users/Tests/privs.stable.out sql/test/Users/Tests/test_privs_p1.SQL.py sql/test/Users/Tests/test_privs_p1.stable.err sql/test/Users/Tests/test_privs_p1.stable.out sql/test/Users/Tests/test_privs_p2.SQL.py sql/test/Users/Tests/test_privs_p2.stable.err sql/test/Users/Tests/test_privs_p2.stable.out sql/test/Users/privs.sql sql/test/Users/test_privs.sql Modified Files: sql/test/Users/Tests/All Branch: Feb2013 Log Message:
add test(s) for bug 3229 diffs (truncated from 333 to 300 lines): diff --git a/sql/test/Users/Tests/All b/sql/test/Users/Tests/All --- a/sql/test/Users/Tests/All +++ b/sql/test/Users/Tests/All @@ -3,3 +3,6 @@ role1 role2 table unknown_user +privs +test_privs_p1 +test_privs_p2 diff --git a/sql/test/Users/Tests/privs.sql.src b/sql/test/Users/Tests/privs.sql.src new file mode 100644 --- /dev/null +++ b/sql/test/Users/Tests/privs.sql.src @@ -0,0 +1,1 @@ +$RELSRCDIR/../privs.sql diff --git a/sql/test/Users/Tests/privs.stable.err b/sql/test/Users/Tests/privs.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/Users/Tests/privs.stable.err @@ -0,0 +1,35 @@ +stderr of test 'privs` in directory 'sql/test/Users` itself: + + +# 13:33:49 > +# 13:33:49 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=36407" "--set" "mapi_usock=/var/tmp/mtest-14454/.s.monetdb.36407" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_Users" "--set" "mal_listing=0" +# 13:33:49 > + +# builtin opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/var/monetdb5/dbfarm/demo +# builtin opt gdk_debug = 0 +# builtin opt gdk_vmtrim = yes +# builtin opt monet_prompt = > +# builtin opt monet_daemon = no +# builtin opt mapi_port = 50000 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 36407 +# cmdline opt mapi_usock = /var/tmp/mtest-14454/.s.monetdb.36407 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_Users +# cmdline opt mal_listing = 0 + +# 13:33:49 > +# 13:33:49 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-14454" "--port=36407" +# 13:33:49 > + + +# 13:33:49 > +# 13:33:49 > "Done." +# 13:33:49 > + diff --git a/sql/test/Users/Tests/privs.stable.out b/sql/test/Users/Tests/privs.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/Users/Tests/privs.stable.out @@ -0,0 +1,38 @@ +stdout of test 'privs` in directory 'sql/test/Users` itself: + + +# 13:33:49 > +# 13:33:49 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=36407" "--set" "mapi_usock=/var/tmp/mtest-14454/.s.monetdb.36407" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_Users" "--set" "mal_listing=0" +# 13:33:49 > + +# MonetDB 5 server v11.15.0 +# This is an unreleased version +# Serving database 'mTests_sql_test_Users', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 3.778 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2013 MonetDB B.V., all rights reserved +# Visit http://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://niels.nesco.mine.nu:36407/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-14454/.s.monetdb.36407 +# MonetDB/GIS module loaded +# MonetDB/JAQL module loaded +# MonetDB/SQL module loaded + +Ready. + +# 13:33:49 > +# 13:33:49 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-14454" "--port=36407" +# 13:33:49 > + +#set schema "my_schema"; +#CREATE table test (i int, b bigint); +#GRANT SELECT on table test to my_user; +#GRANT INSERT on table test to my_user; +#GRANT UPDATE on table test to my_user; +#GRANT DELETE on table test to my_user; + +# 13:33:49 > +# 13:33:49 > "Done." +# 13:33:49 > + diff --git a/sql/test/Users/Tests/test_privs_p1.SQL.py b/sql/test/Users/Tests/test_privs_p1.SQL.py new file mode 100644 --- /dev/null +++ b/sql/test/Users/Tests/test_privs_p1.SQL.py @@ -0,0 +1,12 @@ +import os, sys +try: + from MonetDBtesting import process +except ImportError: + import process + +clt = process.client('sql', user = 'my_user', passwd = 'p1', + stdin = open(os.path.join(os.getenv('RELSRCDIR'), os.pardir, 'test_privs.sql')), + stdout = process.PIPE, stderr = process.PIPE) +out, err = clt.communicate() +sys.stdout.write(out) +sys.stderr.write(err) diff --git a/sql/test/Users/Tests/test_privs_p1.stable.err b/sql/test/Users/Tests/test_privs_p1.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/Users/Tests/test_privs_p1.stable.err @@ -0,0 +1,35 @@ +stderr of test 'test_privs_p1` in directory 'sql/test/Users` itself: + + +# 13:35:20 > +# 13:35:20 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=35552" "--set" "mapi_usock=/var/tmp/mtest-14654/.s.monetdb.35552" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_Users" "--set" "mal_listing=0" +# 13:35:20 > + +# builtin opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/var/monetdb5/dbfarm/demo +# builtin opt gdk_debug = 0 +# builtin opt gdk_vmtrim = yes +# builtin opt monet_prompt = > +# builtin opt monet_daemon = no +# builtin opt mapi_port = 50000 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 35552 +# cmdline opt mapi_usock = /var/tmp/mtest-14654/.s.monetdb.35552 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_Users +# cmdline opt mal_listing = 0 + +# 13:35:20 > +# 13:35:20 > "/usr/bin/python2" "test_privs_p1.SQL.py" "test_privs_p1" +# 13:35:20 > + + +# 13:35:21 > +# 13:35:21 > "Done." +# 13:35:21 > + diff --git a/sql/test/Users/Tests/test_privs_p1.stable.out b/sql/test/Users/Tests/test_privs_p1.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/Users/Tests/test_privs_p1.stable.out @@ -0,0 +1,43 @@ +stdout of test 'test_privs_p1` in directory 'sql/test/Users` itself: + + +# 13:35:20 > +# 13:35:20 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=35552" "--set" "mapi_usock=/var/tmp/mtest-14654/.s.monetdb.35552" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_Users" "--set" "mal_listing=0" +# 13:35:20 > + +# MonetDB 5 server v11.15.0 +# This is an unreleased version +# Serving database 'mTests_sql_test_Users', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 3.778 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2013 MonetDB B.V., all rights reserved +# Visit http://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://niels.nesco.mine.nu:35552/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-14654/.s.monetdb.35552 +# MonetDB/GIS module loaded +# MonetDB/JAQL module loaded +# MonetDB/SQL module loaded + +Ready. + +# 13:35:20 > +# 13:35:20 > "/usr/bin/python2" "test_privs_p1.SQL.py" "test_privs_p1" +# 13:35:20 > + +#select * from test; +% my_schema.test, my_schema.test # table_name +% i, b # name +% int, bigint # type +% 1, 1 # length +#insert into test values(1,1); +[ 1 ] +#update test set b = 2; +[ 1 ] +#delete from test; +[ 1 ] + +# 13:35:21 > +# 13:35:21 > "Done." +# 13:35:21 > + diff --git a/sql/test/Users/Tests/test_privs_p2.SQL.py b/sql/test/Users/Tests/test_privs_p2.SQL.py new file mode 100644 --- /dev/null +++ b/sql/test/Users/Tests/test_privs_p2.SQL.py @@ -0,0 +1,12 @@ +import os, sys +try: + from MonetDBtesting import process +except ImportError: + import process + +clt = process.client('sql', user = 'my_user2', passwd = 'p2', + stdin = open(os.path.join(os.getenv('RELSRCDIR'), os.pardir, 'test_privs.sql')), + stdout = process.PIPE, stderr = process.PIPE) +out, err = clt.communicate() +sys.stdout.write(out) +sys.stderr.write(err) diff --git a/sql/test/Users/Tests/test_privs_p2.stable.err b/sql/test/Users/Tests/test_privs_p2.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/Users/Tests/test_privs_p2.stable.err @@ -0,0 +1,47 @@ +stderr of test 'test_privs_p2` in directory 'sql/test/Users` itself: + + +# 13:35:21 > +# 13:35:21 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=35552" "--set" "mapi_usock=/var/tmp/mtest-14654/.s.monetdb.35552" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_Users" "--set" "mal_listing=0" +# 13:35:21 > + +# builtin opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/var/monetdb5/dbfarm/demo +# builtin opt gdk_debug = 0 +# builtin opt gdk_vmtrim = yes +# builtin opt monet_prompt = > +# builtin opt monet_daemon = no +# builtin opt mapi_port = 50000 +# builtin opt mapi_open = false +# builtin opt mapi_autosense = false +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_open = true +# cmdline opt mapi_port = 35552 +# cmdline opt mapi_usock = /var/tmp/mtest-14654/.s.monetdb.35552 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_Users +# cmdline opt mal_listing = 0 + +# 13:35:21 > +# 13:35:21 > "/usr/bin/python2" "test_privs_p2.SQL.py" "test_privs_p2" +# 13:35:21 > + +MAPI = (my_user2) /var/tmp/mtest-14654/.s.monetdb.35552 +QUERY = select * from test; +ERROR = !SELECT: access denied for my_user2 to table 'my_schema.test' +MAPI = (my_user2) /var/tmp/mtest-14654/.s.monetdb.35552 +QUERY = insert into test values(1,1); +ERROR = !INSERT INTO: insufficient privileges for user 'my_user2' to insert into table 'test' +MAPI = (my_user2) /var/tmp/mtest-14654/.s.monetdb.35552 +QUERY = update test set b = 2; +ERROR = !UPDATE: insufficient privileges for user 'my_user2' to update table 'test' on column 'b' +MAPI = (my_user2) /var/tmp/mtest-14654/.s.monetdb.35552 +QUERY = delete from test; +ERROR = !DELETE FROM: insufficient privileges for user 'my_user2' to delete from table 'test' + +# 13:35:21 > +# 13:35:21 > "Done." +# 13:35:21 > + diff --git a/sql/test/Users/Tests/test_privs_p2.stable.out b/sql/test/Users/Tests/test_privs_p2.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/Users/Tests/test_privs_p2.stable.out @@ -0,0 +1,32 @@ +stdout of test 'test_privs_p2` in directory 'sql/test/Users` itself: + + +# 13:35:21 > +# 13:35:21 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=35552" "--set" "mapi_usock=/var/tmp/mtest-14654/.s.monetdb.35552" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_Users" "--set" "mal_listing=0" +# 13:35:21 > + +# MonetDB 5 server v11.15.0 +# This is an unreleased version +# Serving database 'mTests_sql_test_Users', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 3.778 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2013 MonetDB B.V., all rights reserved +# Visit http://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://niels.nesco.mine.nu:35552/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-14654/.s.monetdb.35552 +# MonetDB/GIS module loaded +# MonetDB/JAQL module loaded +# MonetDB/SQL module loaded + +Ready. _______________________________________________ checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
