Debian Codegraph @

mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test

raw
1
2 #
3 # Tests for the performance_schema host_cache.
4 #
5 # Test authorization with auth plugins.
6 # error reporting in:
7 # - column COUNT_AUTH_PLUGIN_ERRORS
8 # - column COUNT_PROXY_USER_ERRORS
9 # - column COUNT_PROXY_USER_ACL_ERRORS
10
11 --source include/have_debug.inc
12 --source include/have_ipv6.inc
13 --source include/have_plugin_auth.inc
14
15 # Enforce a clean state
16 --source ../include/wait_for_pfs_thread_count.inc
17 --source ../include/hostcache_set_state.inc
18
19 CREATE USER 'plug'@'santa.claus.ipv6.example.com'
20 IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
21 CREATE USER 'plug_dest'@'santa.claus.ipv6.example.com'
22 IDENTIFIED BY 'plug_test_passwd';
23 GRANT SELECT ON test.* TO 'plug_dest'@'santa.claus.ipv6.example.com';
24
25 connect (con1,"::1",root,,test,$MASTER_MYPORT,);
26 select "Con1 is alive";
27 select current_user();
28 disconnect con1;
29
30 --connection default
31 set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
32 uninstall plugin test_plugin_server;
33
34 --disable_query_log
35 --error ER_PLUGIN_IS_NOT_LOADED
36 connect (con2,"::1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
37 --enable_query_log
38
39 --connection default
40 --source ../include/hostcache_dump.inc
41
42 --disable_query_log
43 --error ER_PLUGIN_IS_NOT_LOADED
44 connect (con3,"::1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
45 --enable_query_log
46
47 --connection default
48 --source ../include/hostcache_dump.inc
49
50 --replace_result $PLUGIN_AUTH PLUGIN_AUTH
51 eval install plugin test_plugin_server soname '$PLUGIN_AUTH';
52
53 --disable_query_log
54 --error ER_ACCESS_DENIED_ERROR
55 connect (con2,"::1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
56 --enable_query_log
57
58 --connection default
59 --source ../include/hostcache_dump.inc
60
61 --disable_query_log
62 --error ER_ACCESS_DENIED_ERROR
63 connect (con3,"::1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
64 --enable_query_log
65
66 --connection default
67 --source ../include/hostcache_dump.inc
68
69 GRANT PROXY ON 'plug_dest'@'santa.claus.ipv6.example.com'
70 TO 'plug'@'santa.claus.ipv6.example.com';
71
72 connect (con4,"::1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin);
73 select "Con4 is alive";
74 select user();
75 select current_user();
76 disconnect con4;
77
78 --connection default
79 --source ../include/hostcache_dump.inc
80
81 REVOKE ALL PRIVILEGES ON *.* FROM 'plug_dest'@'santa.claus.ipv6.example.com';
82 REVOKE PROXY ON 'plug_dest'@'santa.claus.ipv6.example.com'
83 FROM 'plug'@'santa.claus.ipv6.example.com';
84 DROP USER 'plug'@'santa.claus.ipv6.example.com';
85 DROP USER 'plug_dest'@'santa.claus.ipv6.example.com';
86
87 set global debug= default;
88