Debian Codegraph @

mysql-test/suite/plugins/t/dialog.test

raw
1 #
2 # test for the client "dialog" plugin
3 #
4
5 --source include/not_embedded.inc
6
7 if (!$DIALOG_SO) {
8 skip No dialog auth plugin;
9 }
10 if (!$DIALOG_EXAMPLES_SO) {
11 skip No dialog auth plugin;
12 }
13
14 --replace_result .dll .so
15 eval install plugin three_attempts soname '$DIALOG_EXAMPLES_SO';
16 create user test_dialog identified via three_attempts using 'SECRET';
17 GRANT SELECT ON test.* TO test_dialog;
18
19 --write_file $MYSQLTEST_VARDIR/tmp/dialog_good.txt
20 foo
21 1234
22 SECRET
23 select user(), current_user();
24 EOF
25
26 --write_file $MYSQLTEST_VARDIR/tmp/dialog_bad.txt
27 foo
28 1234
29 wrong
30 SECRET
31 EOF
32
33 --echo #
34 --echo # -pSECRET is picked up, no questions asked.
35 --echo #
36 --exec echo "select user(), current_user();"|$MYSQL_TEST -u test_dialog -pSECRET
37
38 --echo #
39 --echo # without -p. up to three questions are asked on the stdin.
40 --echo # athentication is successful, the correct pasword is on the third line
41 --echo #
42 --exec $MYSQL_TEST -u test_dialog < $MYSQLTEST_VARDIR/tmp/dialog_good.txt
43
44 --echo #
45 --echo # athentication is unsuccessful, first three lines are all wrong
46 --echo #
47 --error 1
48 --exec $MYSQL_TEST -u test_dialog < $MYSQLTEST_VARDIR/tmp/dialog_bad.txt
49
50 --remove_file $MYSQLTEST_VARDIR/tmp/dialog_good.txt
51 --remove_file $MYSQLTEST_VARDIR/tmp/dialog_bad.txt
52 drop user test_dialog;
53 uninstall plugin three_attempts;