diff options
Diffstat (limited to 'mysql-test/suite/plugins')
-rw-r--r-- | mysql-test/suite/plugins/r/dialog.result | 26 | ||||
-rw-r--r-- | mysql-test/suite/plugins/r/feedback_plugin_install.result | 13 | ||||
-rw-r--r-- | mysql-test/suite/plugins/r/feedback_plugin_load.result | 11 | ||||
-rw-r--r-- | mysql-test/suite/plugins/r/feedback_plugin_send.result | 15 | ||||
-rw-r--r-- | mysql-test/suite/plugins/r/fulltext_plugin.result | 5 | ||||
-rw-r--r-- | mysql-test/suite/plugins/r/pam.result | 22 | ||||
-rw-r--r-- | mysql-test/suite/plugins/suite.pm | 8 | ||||
-rw-r--r-- | mysql-test/suite/plugins/t/dialog.test | 54 | ||||
-rw-r--r-- | mysql-test/suite/plugins/t/feedback_plugin_install.opt | 1 | ||||
-rw-r--r-- | mysql-test/suite/plugins/t/feedback_plugin_install.test | 15 | ||||
-rw-r--r-- | mysql-test/suite/plugins/t/feedback_plugin_load.opt | 2 | ||||
-rw-r--r-- | mysql-test/suite/plugins/t/feedback_plugin_load.test | 10 | ||||
-rw-r--r-- | mysql-test/suite/plugins/t/feedback_plugin_send.test | 32 | ||||
-rw-r--r-- | mysql-test/suite/plugins/t/fulltext_plugin.test | 11 | ||||
-rw-r--r-- | mysql-test/suite/plugins/t/pam.test | 46 |
15 files changed, 271 insertions, 0 deletions
diff --git a/mysql-test/suite/plugins/r/dialog.result b/mysql-test/suite/plugins/r/dialog.result new file mode 100644 index 00000000000..0fcbb41ebe0 --- /dev/null +++ b/mysql-test/suite/plugins/r/dialog.result @@ -0,0 +1,26 @@ +install plugin three_attempts soname 'dialog_examples.so'; +create user test_dialog identified via three_attempts using 'SECRET'; +# +# -pSECRET is picked up, no questions asked. +# +select user(), current_user(); +user() current_user() +test_dialog@localhost test_dialog@% +# +# without -p. up to three questions are asked on the stdin. +# athentication is successful, the correct pasword is on the third line +# +Password, please: *** +Password, please: **** +Password, please: ****** +select user(), current_user(); +user() current_user() +test_dialog@localhost test_dialog@% +# +# athentication is unsuccessful, first three lines are all wrong +# +Password, please: *** +Password, please: **** +Password, please: ***** +drop user test_dialog; +uninstall plugin three_attempts; diff --git a/mysql-test/suite/plugins/r/feedback_plugin_install.result b/mysql-test/suite/plugins/r/feedback_plugin_install.result new file mode 100644 index 00000000000..b1b35072a08 --- /dev/null +++ b/mysql-test/suite/plugins/r/feedback_plugin_install.result @@ -0,0 +1,13 @@ +install plugin feedback soname 'feedback.so'; +select plugin_status from information_schema.plugins where plugin_name='feedback'; +plugin_status +ACTIVE +select * from information_schema.feedback where variable_name like 'feed%' + and variable_name not like '%_uid'; +VARIABLE_NAME VARIABLE_VALUE +FEEDBACK 1.1 +FEEDBACK_SEND_RETRY_WAIT 60 +FEEDBACK_SEND_TIMEOUT 60 +FEEDBACK_URL http://mariadb.org/feedback_plugin/post +FEEDBACK_USER_INFO mysql-test +uninstall plugin feedback; diff --git a/mysql-test/suite/plugins/r/feedback_plugin_load.result b/mysql-test/suite/plugins/r/feedback_plugin_load.result new file mode 100644 index 00000000000..d434d1282c5 --- /dev/null +++ b/mysql-test/suite/plugins/r/feedback_plugin_load.result @@ -0,0 +1,11 @@ +select plugin_status from information_schema.plugins where plugin_name='feedback'; +plugin_status +ACTIVE +select * from information_schema.feedback where variable_name like 'feed%' + and variable_name not like '%_uid'; +VARIABLE_NAME VARIABLE_VALUE +FEEDBACK 1.1 +FEEDBACK_SEND_RETRY_WAIT 60 +FEEDBACK_SEND_TIMEOUT 60 +FEEDBACK_URL http://mariadb.org/feedback_plugin/post +FEEDBACK_USER_INFO mysql-test diff --git a/mysql-test/suite/plugins/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result new file mode 100644 index 00000000000..db622cb3f97 --- /dev/null +++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result @@ -0,0 +1,15 @@ +select plugin_status from information_schema.plugins where plugin_name='feedback'; +plugin_status +ACTIVE +select * from information_schema.feedback where variable_name like 'feed%' + and variable_name not like '%_uid'; +VARIABLE_NAME VARIABLE_VALUE +FEEDBACK 1.1 +FEEDBACK_SEND_RETRY_WAIT 60 +FEEDBACK_SEND_TIMEOUT 60 +FEEDBACK_URL http://mariadb.org/feedback_plugin/post +FEEDBACK_USER_INFO mysql-test +feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent +feedback plugin: server replied 'ok' +feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent +feedback plugin: server replied 'ok' diff --git a/mysql-test/suite/plugins/r/fulltext_plugin.result b/mysql-test/suite/plugins/r/fulltext_plugin.result new file mode 100644 index 00000000000..69ebbe07e9e --- /dev/null +++ b/mysql-test/suite/plugins/r/fulltext_plugin.result @@ -0,0 +1,5 @@ +INSTALL PLUGIN simple_parser SONAME 'mypluglib.so'; +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser); +ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser; +DROP TABLE t1; +UNINSTALL PLUGIN simple_parser; diff --git a/mysql-test/suite/plugins/r/pam.result b/mysql-test/suite/plugins/r/pam.result new file mode 100644 index 00000000000..1c9036c317e --- /dev/null +++ b/mysql-test/suite/plugins/r/pam.result @@ -0,0 +1,22 @@ +install plugin pam soname 'auth_pam.so'; +create user test_pam identified via pam using 'mariadb_mtr'; +# +# athentication is successful, challenge/pin are ok +# note that current_user() differts from user() +# +Challenge input first. +Enter: not very secret challenge +Now, the magic number! +PIN: **** +select user(), current_user(), database(); +user() current_user() database() +test_pam@localhost pam_test@% test +# +# athentication is unsuccessful +# +Challenge input first. +Enter: not very secret challenge +Now, the magic number! +PIN: **** +drop user test_pam; +uninstall plugin pam; diff --git a/mysql-test/suite/plugins/suite.pm b/mysql-test/suite/plugins/suite.pm new file mode 100644 index 00000000000..f8f78086c15 --- /dev/null +++ b/mysql-test/suite/plugins/suite.pm @@ -0,0 +1,8 @@ +package My::Suite::Plugins; + +@ISA = qw(My::Suite); + +$ENV{PAM_SETUP_FOR_MTR}=1 if -e '/etc/pam.d/mariadb_mtr'; + +bless { }; + diff --git a/mysql-test/suite/plugins/t/dialog.test b/mysql-test/suite/plugins/t/dialog.test new file mode 100644 index 00000000000..0507686acf3 --- /dev/null +++ b/mysql-test/suite/plugins/t/dialog.test @@ -0,0 +1,54 @@ +# +# test for the client "dialog" plugin +# + +--source include/not_embedded.inc + +if (!$DIALOG_SO) { + skip No dialog auth plugin; +} +if (!$DIALOG_EXAMPLES_SO) { + skip No dialog auth plugin; +} + +--replace_result .dll .so +eval install plugin three_attempts soname '$DIALOG_EXAMPLES_SO'; +create user test_dialog identified via three_attempts using 'SECRET'; + +let $plugindir=`SELECT @@global.plugin_dir`; + +--write_file $MYSQLTEST_VARDIR/tmp/dialog_good.txt +foo +1234 +SECRET +select user(), current_user(); +EOF + +--write_file $MYSQLTEST_VARDIR/tmp/dialog_bad.txt +foo +1234 +wrong +SECRET +EOF + +--echo # +--echo # -pSECRET is picked up, no questions asked. +--echo # +--exec echo "select user(), current_user();"|$MYSQL_TEST -u test_dialog -pSECRET --plugin-dir=$plugindir + +--echo # +--echo # without -p. up to three questions are asked on the stdin. +--echo # athentication is successful, the correct pasword is on the third line +--echo # +--exec $MYSQL_TEST -u test_dialog --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/dialog_good.txt + +--echo # +--echo # athentication is unsuccessful, first three lines are all wrong +--echo # +--error 1 +--exec $MYSQL_TEST -u test_dialog --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/dialog_bad.txt + +--remove_file $MYSQLTEST_VARDIR/tmp/dialog_good.txt +--remove_file $MYSQLTEST_VARDIR/tmp/dialog_bad.txt +drop user test_dialog; +uninstall plugin three_attempts; diff --git a/mysql-test/suite/plugins/t/feedback_plugin_install.opt b/mysql-test/suite/plugins/t/feedback_plugin_install.opt new file mode 100644 index 00000000000..a711ae94e69 --- /dev/null +++ b/mysql-test/suite/plugins/t/feedback_plugin_install.opt @@ -0,0 +1 @@ +--loose-feedback diff --git a/mysql-test/suite/plugins/t/feedback_plugin_install.test b/mysql-test/suite/plugins/t/feedback_plugin_install.test new file mode 100644 index 00000000000..81343c436c3 --- /dev/null +++ b/mysql-test/suite/plugins/t/feedback_plugin_install.test @@ -0,0 +1,15 @@ +--source include/not_embedded.inc + +if (`select length('$FEEDBACK_SO') = 0`) { + skip No feedback plugin; +} + +--replace_regex /\.dll/.so/ +eval install plugin feedback soname '$FEEDBACK_SO'; +select plugin_status from information_schema.plugins where plugin_name='feedback'; +--replace_result https http +--sorted_result +select * from information_schema.feedback where variable_name like 'feed%' + and variable_name not like '%_uid'; +uninstall plugin feedback; + diff --git a/mysql-test/suite/plugins/t/feedback_plugin_load.opt b/mysql-test/suite/plugins/t/feedback_plugin_load.opt new file mode 100644 index 00000000000..5fbb2f83954 --- /dev/null +++ b/mysql-test/suite/plugins/t/feedback_plugin_load.opt @@ -0,0 +1,2 @@ +--loose-feedback +--plugin-load=$FEEDBACK_SO diff --git a/mysql-test/suite/plugins/t/feedback_plugin_load.test b/mysql-test/suite/plugins/t/feedback_plugin_load.test new file mode 100644 index 00000000000..5ad301667b4 --- /dev/null +++ b/mysql-test/suite/plugins/t/feedback_plugin_load.test @@ -0,0 +1,10 @@ +if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'feedback' and plugin_status='active'`) +{ + --skip Feedback plugin is not active +} + +select plugin_status from information_schema.plugins where plugin_name='feedback'; +--replace_result https http +--sorted_result +select * from information_schema.feedback where variable_name like 'feed%' + and variable_name not like '%_uid'; diff --git a/mysql-test/suite/plugins/t/feedback_plugin_send.test b/mysql-test/suite/plugins/t/feedback_plugin_send.test new file mode 100644 index 00000000000..3324ef469fe --- /dev/null +++ b/mysql-test/suite/plugins/t/feedback_plugin_send.test @@ -0,0 +1,32 @@ +source feedback_plugin_load.test; + +if (!$MTR_FEEDBACK_PLUGIN) { + skip MTR_FEEDBACK_PLUGIN is not set; +} + +# +# Yep. The plugin waits 5 minutes before sending anything, +# and there's no way to force it to send anything sooner. +# Let's wait, and hope that mtr is started with --parallel and +# is doing some work in other workers. +# +sleep 310; +source include/restart_mysqld.inc; + +replace_result https http; +perl; + $log_error= $ENV{'MYSQLTEST_VARDIR'} . '/log/mysqld.1.err'; + open(LOG, '<', $log_error) or die "open(< $log_error): $!"; + + # Get the first few rows (as there may be different number rows in the log) + $i= 0; + while ($_=<LOG>) + { + if (/feedback plugin:.*/) + { + print "$&\n"; + break if ($i++ >= 3); + } + } + close LOG; +EOF diff --git a/mysql-test/suite/plugins/t/fulltext_plugin.test b/mysql-test/suite/plugins/t/fulltext_plugin.test new file mode 100644 index 00000000000..0e2f53d5b15 --- /dev/null +++ b/mysql-test/suite/plugins/t/fulltext_plugin.test @@ -0,0 +1,11 @@ +--source include/have_simple_parser.inc + +# +# BUG#39746 - Debug flag breaks struct definition (server crash) +# +--replace_result .dll .so +eval INSTALL PLUGIN simple_parser SONAME '$MYPLUGLIB_SO'; +CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser); +ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser; +DROP TABLE t1; +UNINSTALL PLUGIN simple_parser; diff --git a/mysql-test/suite/plugins/t/pam.test b/mysql-test/suite/plugins/t/pam.test new file mode 100644 index 00000000000..3f4c563d8dc --- /dev/null +++ b/mysql-test/suite/plugins/t/pam.test @@ -0,0 +1,46 @@ + +--source include/not_embedded.inc + +if (!$AUTH_PAM_SO) { + skip No pam auth plugin; +} + +if (!$PAM_SETUP_FOR_MTR) { + skip No pam setup for mtr; +} + +--replace_result .dll .so +eval install plugin pam soname '$AUTH_PAM_SO'; +create user test_pam identified via pam using 'mariadb_mtr'; + +let $plugindir=`SELECT @@global.plugin_dir`; + +--write_file $MYSQLTEST_VARDIR/tmp/pam_good.txt +not very secret challenge +9225 +select user(), current_user(), database(); +EOF + +--write_file $MYSQLTEST_VARDIR/tmp/pam_bad.txt +not very secret challenge +9224 +select user(), current_user(), database(); +EOF + +--echo # +--echo # athentication is successful, challenge/pin are ok +--echo # note that current_user() differts from user() +--echo # +--exec $MYSQL_TEST -u test_pam --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/pam_good.txt + +--echo # +--echo # athentication is unsuccessful +--echo # +--error 1 +--exec $MYSQL_TEST -u test_pam --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/pam_bad.txt + +--remove_file $MYSQLTEST_VARDIR/tmp/pam_good.txt +--remove_file $MYSQLTEST_VARDIR/tmp/pam_bad.txt +drop user test_pam; +uninstall plugin pam; + |