summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-12-02 16:26:43 +0100
committerSergei Golubchik <sergii@pisem.net>2011-12-02 16:26:43 +0100
commitd5fd757a4279f4fa8f032c6dd63d1d121d8e1fea (patch)
treead5b63e8b1d154ab7b1753f9e156e7741b01899d /mysql-test
parent791286ee1c3c705cb8853e242cdf718a7b5ce5b7 (diff)
downloadmariadb-git-d5fd757a4279f4fa8f032c6dd63d1d121d8e1fea.tar.gz
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
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/Makefile.am2
-rwxr-xr-xmysql-test/mysql-test-run.pl2
-rw-r--r--mysql-test/suite/plugins/r/dialog.result26
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_install.result (renamed from mysql-test/r/feedback_plugin_install.result)0
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_load.result (renamed from mysql-test/r/feedback_plugin_load.result)0
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_send.result (renamed from mysql-test/r/feedback_plugin_send.result)0
-rw-r--r--mysql-test/suite/plugins/r/fulltext_plugin.result (renamed from mysql-test/r/fulltext_plugin.result)0
-rw-r--r--mysql-test/suite/plugins/t/dialog.test51
-rw-r--r--mysql-test/suite/plugins/t/feedback_plugin_install.opt (renamed from mysql-test/t/feedback_plugin_install.opt)0
-rw-r--r--mysql-test/suite/plugins/t/feedback_plugin_install.test (renamed from mysql-test/t/feedback_plugin_install.test)0
-rw-r--r--mysql-test/suite/plugins/t/feedback_plugin_load.opt (renamed from mysql-test/t/feedback_plugin_load.opt)0
-rw-r--r--mysql-test/suite/plugins/t/feedback_plugin_load.test (renamed from mysql-test/t/feedback_plugin_load.test)0
-rw-r--r--mysql-test/suite/plugins/t/feedback_plugin_send.test (renamed from mysql-test/t/feedback_plugin_send.test)2
-rw-r--r--mysql-test/suite/plugins/t/fulltext_plugin.test (renamed from mysql-test/t/fulltext_plugin.test)0
14 files changed, 80 insertions, 3 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index ddf8d0457f3..b73771391c2 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -110,7 +110,7 @@ TEST_DIRS = t r include std_data std_data/parts collections \
suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \
suite/innodb_plugin suite/innodb_plugin/t suite/innodb_plugin/r \
suite/innodb_plugin/include \
- suite/percona suite/handler \
+ suite/percona suite/handler suite/plugins suite/plugins/t suite/plugins/r \
suite/engines suite/engines/funcs suite/engines/iuds suite/engines/rr_trx \
suite/engines/funcs/r suite/engines/funcs/t suite/engines/iuds/r \
suite/engines/iuds/t suite/engines/rr_trx/include suite/engines/rr_trx/r \
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index bc3518ed2bc..dc03a6bf5b5 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -160,7 +160,7 @@ my $path_config_file; # The generated config file, var/my.cnf
# executables will be used by the test suite.
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
-my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,handler,parts,innodb,innodb_plugin,percona,ndb,vcol,oqgraph,sphinx";
+my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,handler,parts,innodb,innodb_plugin,percona,ndb,vcol,oqgraph,sphinx,plugins";
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
diff --git a/mysql-test/suite/plugins/r/dialog.result b/mysql-test/suite/plugins/r/dialog.result
new file mode 100644
index 00000000000..da3117fd491
--- /dev/null
+++ b/mysql-test/suite/plugins/r/dialog.result
@@ -0,0 +1,26 @@
+install plugin three_attempts soname 'dialog.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/r/feedback_plugin_install.result b/mysql-test/suite/plugins/r/feedback_plugin_install.result
index b1b35072a08..b1b35072a08 100644
--- a/mysql-test/r/feedback_plugin_install.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_install.result
diff --git a/mysql-test/r/feedback_plugin_load.result b/mysql-test/suite/plugins/r/feedback_plugin_load.result
index d434d1282c5..d434d1282c5 100644
--- a/mysql-test/r/feedback_plugin_load.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_load.result
diff --git a/mysql-test/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result
index db622cb3f97..db622cb3f97 100644
--- a/mysql-test/r/feedback_plugin_send.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result
diff --git a/mysql-test/r/fulltext_plugin.result b/mysql-test/suite/plugins/r/fulltext_plugin.result
index 69ebbe07e9e..69ebbe07e9e 100644
--- a/mysql-test/r/fulltext_plugin.result
+++ b/mysql-test/suite/plugins/r/fulltext_plugin.result
diff --git a/mysql-test/suite/plugins/t/dialog.test b/mysql-test/suite/plugins/t/dialog.test
new file mode 100644
index 00000000000..47452643609
--- /dev/null
+++ b/mysql-test/suite/plugins/t/dialog.test
@@ -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;
diff --git a/mysql-test/t/feedback_plugin_install.opt b/mysql-test/suite/plugins/t/feedback_plugin_install.opt
index a711ae94e69..a711ae94e69 100644
--- a/mysql-test/t/feedback_plugin_install.opt
+++ b/mysql-test/suite/plugins/t/feedback_plugin_install.opt
diff --git a/mysql-test/t/feedback_plugin_install.test b/mysql-test/suite/plugins/t/feedback_plugin_install.test
index 81343c436c3..81343c436c3 100644
--- a/mysql-test/t/feedback_plugin_install.test
+++ b/mysql-test/suite/plugins/t/feedback_plugin_install.test
diff --git a/mysql-test/t/feedback_plugin_load.opt b/mysql-test/suite/plugins/t/feedback_plugin_load.opt
index 5fbb2f83954..5fbb2f83954 100644
--- a/mysql-test/t/feedback_plugin_load.opt
+++ b/mysql-test/suite/plugins/t/feedback_plugin_load.opt
diff --git a/mysql-test/t/feedback_plugin_load.test b/mysql-test/suite/plugins/t/feedback_plugin_load.test
index 5ad301667b4..5ad301667b4 100644
--- a/mysql-test/t/feedback_plugin_load.test
+++ b/mysql-test/suite/plugins/t/feedback_plugin_load.test
diff --git a/mysql-test/t/feedback_plugin_send.test b/mysql-test/suite/plugins/t/feedback_plugin_send.test
index d882539cfea..3324ef469fe 100644
--- a/mysql-test/t/feedback_plugin_send.test
+++ b/mysql-test/suite/plugins/t/feedback_plugin_send.test
@@ -1,4 +1,4 @@
-source t/feedback_plugin_load.test;
+source feedback_plugin_load.test;
if (!$MTR_FEEDBACK_PLUGIN) {
skip MTR_FEEDBACK_PLUGIN is not set;
diff --git a/mysql-test/t/fulltext_plugin.test b/mysql-test/suite/plugins/t/fulltext_plugin.test
index 0e2f53d5b15..0e2f53d5b15 100644
--- a/mysql-test/t/fulltext_plugin.test
+++ b/mysql-test/suite/plugins/t/fulltext_plugin.test