Debian Codegraph @

mysql-test/suite/x/t/connection_auth_mechanism_memory1.test

raw
1 ## Test cases for authorization plugins
2
3 --source include/xplugin_preamble.inc
4 --source include/xplugin_create_user.inc
5
6 #
7 ## Setup
8 #
9
10 --write_file $MYSQL_TMP_DIR/try_login_using_memory.xpl
11 -->import connection_auth_mechanism_memory_helpers.macro
12
13 callmacro Try_to_login_all_xusers_using_memory %RESULT%;
14 EOF
15
16 --write_file $MYSQL_TMP_DIR/login_using_plain.xpl
17 -->import connection_auth_mechanism_memory_helpers.macro
18
19 callmacro Login_all_xusers_using_plain_to_fill_the_cache;
20 EOF
21
22 --let $MYSQLXTEST=$MYSQLXTEST -ux_root --ssl-cipher='ECDHE-RSA-AES128-GCM-SHA256'
23 --let $memory_login_fail= --file=$MYSQL_TMP_DIR/try_login_using_memory.xpl -v%RESULT%=Login_failed
24 --let $plain_login_ok= --file=$MYSQL_TMP_DIR/login_using_plain.xpl
25
26
27 # Create and configure xuser_* accounts that use native, sha256 and
28 # cache_sha2 authentication plugins.
29
30 --source ../include/create_mysql_accounts_for_xplugin_tests.inc
31
32 GRANT ALL ON *.* TO xuser_native@localhost;
33 GRANT ALL ON *.* TO xuser_sha256@localhost;
34 GRANT ALL ON *.* TO xuser_cache2@localhost;
35
36
37 #
38 ## Test starts here
39 #
40
41 --echo
42 --echo #######################################################################
43 --echo ## 1. Memory mechanism fails
44 --echo ##
45 --echo ## when:
46 --echo ## * The cache is empty
47 --echo ## * The the mysqlx_cache_cleaner plugin is not installed
48 --echo ## then the cache is not filled with data.
49 --echo ##
50 --echo ## Requirements: F1
51 --echo #
52
53 --echo #######################################################################
54 --echo # Cache is empty, the sha256_memory request must fail
55 exec $MYSQLXTEST $memory_login_fail 2>&1;
56
57 --echo
58 --echo #######################################################################
59 --echo # Plain auth work as expected, anyway it doesnt fill the cache
60 exec $MYSQLXTEST $plain_login_ok 2>&1;
61
62 --echo
63 --echo #######################################################################
64 --echo # Recheck that the cache is empty after plain auth, the sha256_memory request must fail:
65 exec $MYSQLXTEST $memory_login_fail 2>&1;
66
67 #
68 # Postamble
69 #
70 --source ../include/xplugin_cleanup.inc
71
72 --source ../include/remove_mysql_accounts_for_xplugin_tests.inc
73