1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

1. add --plugin-dir and --default-auth to mysqltest.

2. dialog plugin now always returns mysql->password if non-empty and the first question is of password type
3. split get_tty_password into get_tty_password_buff and strdup.
4. dialog plugin now uses get_tty_password by default
5. dialog.test
6. moved small tests of individual plugins into a dedicated suite
This commit is contained in:
Sergei Golubchik
2011-12-02 16:26:43 +01:00
parent 791286ee1c
commit d5fd757a42
29 changed files with 203 additions and 94 deletions

View File

@ -0,0 +1,51 @@
#
# test for the client "dialog" plugin
#
--source include/not_embedded.inc
if (!$DIALOG_SO) {
skip No dialog auth plugin;
}
--replace_result .dll .so
eval install plugin three_attempts soname '$DIALOG_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;

View File

@ -0,0 +1 @@
--loose-feedback

View File

@ -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;

View File

@ -0,0 +1,2 @@
--loose-feedback
--plugin-load=$FEEDBACK_SO

View File

@ -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';

View File

@ -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

View File

@ -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;