Debian Codegraph @

mysql-test/suite/connection_control/t/connection_delay_anonymous_user.test

raw
1
2 # Make sure that connection_control plugin can be loaded
3 --source ../inc/have_connection_control_plugin.inc
4
5 # Save the initial number of concurrent sessions
6 --source include/count_sessions.inc
7
8 --echo # Connection delay tests for valid user accounts
9
10 --echo
11 --echo # ----------------------------------------------------------------------
12 --echo
13
14 --echo # Setup
15 --echo # Install connection_control plugin
16 --source ../inc/install_connection_control_plugin.inc
17
18 --echo # Create anonymous user
19 CREATE USER ''@'localhost';
20
21 --echo # Save original values of connection_control variables
22 SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
23 SET @saved_max_delay = @@global.connection_control_max_connection_delay;
24
25 -- echo # Set small values for connection_control variables
26 SET @@global.connection_control_failed_connections_threshold = 3;
27 SET @global.connection_control_max_connection_delay = 1000;
28
29 # We don't need to use client side authentication plugin for this test.
30 let $USE_AUTH_PLUGIN= 0;
31
32 --echo
33 --echo # ----------------------------------------------------------------------
34 --echo
35
36 --echo # Following attempts will not experience any delay in server respose
37
38 let $USER=u1;
39 let $PASSWORD=hoho;
40 let $SUCCESS=0;
41 let $DELAY_STATS=0;
42 --source ../inc/check_connection_delay.inc
43
44 let $USER=u2;
45 let $PASSWORD=hoho;
46 let $SUCCESS=0;
47 let $DELAY_STATS=0;
48 --source ../inc/check_connection_delay.inc
49
50 let $USER=u3;
51 let $PASSWORD=hoho;
52 let $SUCCESS=0;
53 let $DELAY_STATS=0;
54 --source ../inc/check_connection_delay.inc
55
56 --echo
57 --echo # Following attempts will experience delay in server respose
58
59 let $USER=u1;
60 let $PASSWORD=hoho;
61 let $SUCCESS=0;
62 let $DELAY_STATS=1;
63 --source ../inc/check_connection_delay.inc
64
65 let $USER=u2;
66 let $PASSWORD=hoho;
67 let $SUCCESS=0;
68 let $DELAY_STATS=2;
69 --source ../inc/check_connection_delay.inc
70
71 let $USER=u3;
72 let $PASSWORD=hoho;
73 let $SUCCESS=0;
74 let $DELAY_STATS=3;
75 --source ../inc/check_connection_delay.inc
76
77 --echo
78 --echo # ----------------------------------------------------------------------
79 --echo
80
81 --echo # Cleanup
82
83 connection default;
84
85 --echo # Restore original values of conenction_control variables
86 SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
87 SET @@global.connection_control_max_connection_delay = @saved_max_delay;
88
89 --echo # Drop anonymous user
90 DROP USER ''@'localhost';
91
92 --echo # Uninstall connection_control plugin
93 --source ../inc/uninstall_connection_control_plugin.inc
94
95 # Wait till all disconnects are completed.
96 --source include/wait_until_count_sessions.inc
97
98 --echo
99 --echo # ----------------------------------------------------------------------