Debian Codegraph @

mysql-test/suite/connection_control/t/connection_delay_invalid_users.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
9 --echo # Connection delay tests for valid user accounts
10
11 --echo
12 --echo # ----------------------------------------------------------------------
13 --echo
14
15 --echo # Setup
16 --echo # Install connection_control plugin
17 --source ../inc/install_connection_control_plugin.inc
18
19 --echo # Save original values of connection_control variables
20 SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
21 SET @saved_max_delay = @@global.connection_control_max_connection_delay;
22
23 -- echo # Set small values for connection_control variables
24 SET @@global.connection_control_failed_connections_threshold = 3;
25 SET @@global.connection_control_max_connection_delay = 1000;
26
27 # We don't need to use client side authentication plugin for this test.
28 let $USE_AUTH_PLUGIN= 0;
29
30 --echo
31 --echo # ----------------------------------------------------------------------
32 --echo
33
34 --echo # Following attempts will not experience any delay in server respose
35
36 let $USER=u1;
37 let $PASSWORD=hoho;
38 let $SUCCESS=0;
39 let $DELAY_STATS=0;
40 --source ../inc/check_connection_delay.inc
41
42 let $USER=u2;
43 let $PASSWORD=hoho;
44 let $SUCCESS=0;
45 let $DELAY_STATS=0;
46 --source ../inc/check_connection_delay.inc
47
48 let $USER=u3;
49 let $PASSWORD=hoho;
50 let $SUCCESS=0;
51 let $DELAY_STATS=0;
52 --source ../inc/check_connection_delay.inc
53
54 let $USER=u1;
55 let $PASSWORD=hoho;
56 let $SUCCESS=0;
57 let $DELAY_STATS=0;
58 --source ../inc/check_connection_delay.inc
59
60 let $USER=u2;
61 let $PASSWORD=hoho;
62 let $SUCCESS=0;
63 let $DELAY_STATS=0;
64 --source ../inc/check_connection_delay.inc
65
66 let $USER=u3;
67 let $PASSWORD=hoho;
68 let $SUCCESS=0;
69 let $DELAY_STATS=0;
70 --source ../inc/check_connection_delay.inc
71
72 let $USER=u1;
73 let $PASSWORD=hoho;
74 let $SUCCESS=0;
75 let $DELAY_STATS=0;
76 --source ../inc/check_connection_delay.inc
77
78 let $USER=u2;
79 let $PASSWORD=hoho;
80 let $SUCCESS=0;
81 let $DELAY_STATS=0;
82 --source ../inc/check_connection_delay.inc
83
84 let $USER=u3;
85 let $PASSWORD=hoho;
86 let $SUCCESS=0;
87 let $DELAY_STATS=0;
88 --source ../inc/check_connection_delay.inc
89
90 --echo
91 --echo # Following attempts will experience delay in server respose
92
93 let $USER=u1;
94 let $PASSWORD=hoho;
95 let $SUCCESS=0;
96 let $DELAY_STATS=1;
97 --source ../inc/check_connection_delay.inc
98
99 let $USER=u2;
100 let $PASSWORD=hoho;
101 let $SUCCESS=0;
102 let $DELAY_STATS=2;
103 --source ../inc/check_connection_delay.inc
104
105 let $USER=u3;
106 let $PASSWORD=hoho;
107 let $SUCCESS=0;
108 let $DELAY_STATS=3;
109 --source ../inc/check_connection_delay.inc
110
111 --sorted_result
112 SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
113
114 let $USER=u3;
115 let $PASSWORD=abcd;
116 let $SUCCESS=0;
117 let $DELAY_STATS=4;
118 --source ../inc/check_connection_delay.inc
119
120 let $USER=u2;
121 let $PASSWORD=abcd;
122 let $SUCCESS=0;
123 let $DELAY_STATS=5;
124 --source ../inc/check_connection_delay.inc
125
126 let $USER=u1;
127 let $PASSWORD=abcd;
128 let $SUCCESS=0;
129 let $DELAY_STATS=6;
130 --source ../inc/check_connection_delay.inc
131
132 --sorted_result
133 SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
134
135 --echo
136 --echo # ----------------------------------------------------------------------
137 --echo
138
139 --echo # Cleanup
140
141 connection default;
142
143 --echo # Restore original values of conenction_control variables
144 SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
145 SET @@global.connection_control_max_connection_delay = @saved_max_delay;
146
147
148 --echo # Uninstall connection_control plugin
149 --source ../inc/uninstall_connection_control_plugin.inc
150
151 # Wait till all disconnects are completed.
152 --source include/wait_until_count_sessions.inc
153
154 --echo
155 --echo # ----------------------------------------------------------------------