Debian Codegraph @

mysql-test/suite/connection_control/r/connection_delay_valid_users.result

raw
1 # Connection delay tests for valid user accounts
2
3 # ----------------------------------------------------------------------
4
5 # Setup
6 # Install connection_control plugin
7 INSTALL PLUGIN connection_control SONAME 'CONNECTION_CONTROL_LIB';
8 INSTALL PLUGIN connection_control_failed_login_attempts SONAME 'CONNECTION_CONTROL_LIB';
9 # Create user accounts for testing
10 CREATE USER u1 IDENTIFIED BY 'abcd';
11 CREATE USER u2 IDENTIFIED BY 'abcd';
12 CREATE USER u3 IDENTIFIED BY 'abcd';
13 # Save original values of connection_control variables
14 SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
15 SET @saved_max_delay = @@global.connection_control_max_connection_delay;
16 SET @saved_min_delay= @@global.connection_control_min_connection_delay;
17 # Set small values for connection_control variables
18 SET @@global.connection_control_failed_connections_threshold = 3;
19 SET @@global.connection_control_max_connection_delay = 4000;
20 SET @@global.connection_control_min_connection_delay = 2000;
21
22 # ----------------------------------------------------------------------
23
24 # Make enough failed attempts to trigger delays
25 connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
26 connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
27 connect(localhost,u2,efgh,test,MASTER_PORT,MASTER_SOCKET);
28 connect(localhost,u3,,test,MASTER_PORT,MASTER_SOCKET);
29 connect(localhost,u2,haha,test,MASTER_PORT,MASTER_SOCKET);
30 connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
31 connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
32 connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
33 connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
34
35 # Following attempts will experience delay in server respose
36 # Connection attempt should fail.
37 Connection_control_delay_generated should be 1
38 Variable_name Value
39 Connection_control_delay_generated 1
40 @server_response_time >= 2
41 1
42 # Connection attempt should fail.
43 Connection_control_delay_generated should be 2
44 Variable_name Value
45 Connection_control_delay_generated 2
46 @server_response_time >= 2
47 1
48 # Connection attempt should fail.
49 Connection_control_delay_generated should be 3
50 Variable_name Value
51 Connection_control_delay_generated 3
52 @server_response_time >= 2
53 1
54 # Connection attempt should succeed.
55 Connection_control_delay_generated should be 4
56 Variable_name Value
57 Connection_control_delay_generated 4
58 @server_response_time >= 2
59 1
60 # Connection attempt should succeed.
61 Connection_control_delay_generated should be 5
62 Variable_name Value
63 Connection_control_delay_generated 5
64 @server_response_time >= 2
65 1
66 # Connection attempt should succeed.
67 Connection_control_delay_generated should be 6
68 Variable_name Value
69 Connection_control_delay_generated 6
70 @server_response_time >= 2
71 1
72
73 # Following attempts will not experience any delay in server respose
74 # Connection attempt should fail.
75 Connection_control_delay_generated should be 6
76 Variable_name Value
77 Connection_control_delay_generated 6
78 # Connection attempt should fail.
79 Connection_control_delay_generated should be 6
80 Variable_name Value
81 Connection_control_delay_generated 6
82 # Connection attempt should fail.
83 Connection_control_delay_generated should be 6
84 Variable_name Value
85 Connection_control_delay_generated 6
86 # Connection attempt should succeed.
87 Connection_control_delay_generated should be 6
88 Variable_name Value
89 Connection_control_delay_generated 6
90 # Connection attempt should succeed.
91 Connection_control_delay_generated should be 6
92 Variable_name Value
93 Connection_control_delay_generated 6
94 # Connection attempt should succeed.
95 Connection_control_delay_generated should be 6
96 Variable_name Value
97 Connection_control_delay_generated 6
98
99 # ----------------------------------------------------------------------
100
101 # Cleanup
102 # Restore original values of conenction_control variables
103 SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
104 SET @@global.connection_control_max_connection_delay = @saved_max_delay;
105 SET @@global.connection_control_min_connection_delay = @saved_min_delay;
106 # Remove user accounts created for the test
107 DROP USER u1;
108 DROP USER u2;
109 DROP USER u3;
110 # Uninstall connection_control plugin
111 UNINSTALL PLUGIN connection_control;
112 UNINSTALL PLUGIN connection_control_failed_login_attempts;
113
114 # ----------------------------------------------------------------------