1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
|
#
# Testing mysql_config_editor utility.
#
################################################
# Tests for mysql_config_editor's insert command
################################################
#
# Default login path (client)
# done..
# 'test-login-path1'
# done..
# 'test-login-path2'
# done..
# 'test-login-path3'
# done..
################################################
# Tests for mysql_config_editor's print command
################################################
#
# Default path
[client]
user = test_user1
host = localhost
#
# test-login-path1
[test-login-path1]
user = test_user2
host = 127.0.0.1
#
# test-login-path2
[test-login-path2]
user = test_user3
host = www.mysql.com
#
# all the paths
[client]
user = test_user1
host = localhost
[test-login-path1]
user = test_user2
host = 127.0.0.1
[test-login-path2]
user = test_user3
host = www.mysql.com
[test-login-path3]
user = test_user4
host = 127.0.0.1
socket = /tmp/configtest.sock
port = 15000
#
# Overwrite existing paths, test-login-path2 & default
#
# all the paths again
[test-login-path1]
user = test_user2
host = 127.0.0.1
[test-login-path3]
user = test_user4
host = 127.0.0.1
socket = /tmp/configtest.sock
port = 15000
[test-login-path2]
user = test_user4
[client]
user = test_user5
################################################
# Tests for mysql_config_editor's remove command
################################################
#
# Default path
# done..
# test-login-path1
# done..
# test-login-path3
# done..
########################
# Printing the leftovers
########################
#
# using all
[test-login-path3]
user = test_user4
host = 127.0.0.1
[test-login-path2]
user = test_user4
###############################################
# Tests for mysql_config_editor's reset command
###############################################
# done..
# Print-all to check if everything got deleted.
##############################################
# Tests for mysql_config_editor's help command
##############################################
Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
MySQL Configuration Utility.
-?, --help Display this help and exit.
-v, --verbose Write more information.
-V, --version Output version information and exit.
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- ----------------------------------------
verbose FALSE
Where command can be any one of the following :
set [command options] Sets user name/password/host name/socket/port
for a given login path (section).
remove [command options] Remove a login path from the login file.
print [command options] Print all the options for a specified
login path.
reset [command options] Deletes the contents of the login file.
help Display this usage/help information.
# done..
######################
# Testing client tools
######################
#
# Inserting login paths default & test-login-path1
File exists.
File has the required permission.
Opening the file.
Reading the login key.
Login key read successfully.
Executing set command.
Successfully decrypted the login file.
Key successfully written to the file.
Successfully written encrypted data to the login file.
File exists.
File has the required permission.
Opening the file.
Reading the login key.
Login key read successfully.
Executing set command.
Successfully decrypted the login file.
Key successfully written to the file.
Successfully written encrypted data to the login file.
File exists.
File has the required permission.
Opening the file.
Reading the login key.
Login key read successfully.
Executing set command.
Successfully decrypted the login file.
Key successfully written to the file.
Successfully written encrypted data to the login file.
# done..
# Connecting using 'test_user1'
#
ERROR 1045 (28000): Access denied for user 'test_user1'@'localhost' (using password: NO)
# Connecting using 'test_user2'
#
ERROR 1045 (28000): Access denied for user 'test_user2'@'localhost' (using password: NO)
# Creating user 'test_user1'
CREATE USER test_user1;
# Creating user 'test_user2'
CREATE USER test_user2;
FLUSH PRIVILEGES;
#
# Now trying to connect again..
# Connecting using 'test_user1'
#
mysqld is alive
mysqld is alive
# Connecting using 'test_user2'
#
mysqld is alive
mysqld is alive
#
# Inserting a login path to test group suffix (client_suffix1)
# Printing all the paths..
[client]
user = test_user1
host = localhost
[test-login-path1]
user = test_user2
host = 127.0.0.1
[test-login-path2]
user = test_user3
host = 127.0.0.1
socket = /tmp/configtest.sock
port = 15000
[client_suffix1]
user = test_user3
# Now trying to connect using 'test_user3'
# Note : In this case options from login
# paths 'client' (default) and
# client_suffix1 will be read..
ERROR 1045 (28000): Access denied for user 'test_user3'@'localhost' (using password: NO)
## Running my_print_defaults ##
#
# (a) With --no-defaults option..
# It should print the options under the default
# login path 'client'.
--user=test_user1
--host=localhost
# (b) With --no-defaults & --login-path
--user=test_user1
--host=localhost
--user=test_user2
--host=127.0.0.1
--user=test_user1
--host=localhost
--user=test_user3
--host=127.0.0.1
--socket=/tmp/configtest.sock
--port=15000
# (c) With --no-defaults & --defaults-group-suffix
--user=test_user1
--host=localhost
--user=test_user3
# (d) With --no-defaults, --login-path & --defaults-group-suffix
--user=test_user1
--host=localhost
--user=test_user2
--host=127.0.0.1
# Dropping users 'test_user1' & 'test_user2'
DROP USER test_user1, test_user2;
###############################
# Resetting the test login file
###############################
# done..
####################################
# Testing with an invalid login file
####################################
# mysql_config_editor.test
This is non-standard test login file.
# The 'invalid' login file should not cause
# any problem.
#
mysqld is alive
###############################
# Dropping the test login file
###############################
#################################
# Testing with login file removed
#################################
# Even if login file does not exist, the
# tools should be able to continue
# normally.
mysqld is alive
#### End of test ####
|