99 "github.com/pingcap/errors"
1010
1111 "github.com/go-mysql-org/go-mysql/mysql"
12+ "github.com/go-mysql-org/go-mysql/test_util"
1213 "github.com/go-mysql-org/go-mysql/test_util/test_keys"
1314)
1415
@@ -19,7 +20,7 @@ type clientTestSuite struct {
1920
2021func (s * clientTestSuite ) SetUpSuite (c * C ) {
2122 var err error
22- addr := fmt .Sprintf ("%s:%s" , * testHost , s .port )
23+ addr := fmt .Sprintf ("%s:%s" , * test_util . MysqlHost , s .port )
2324 s .c , err = Connect (addr , * testUser , * testPassword , "" )
2425 if err != nil {
2526 c .Fatal (err )
@@ -117,7 +118,7 @@ func (s *clientTestSuite) TestConn_SetCapability(c *C) {
117118func (s * clientTestSuite ) TestConn_TLS_Verify (c * C ) {
118119 // Verify that the provided tls.Config is used when attempting to connect to mysql.
119120 // An empty tls.Config will result in a connection error.
120- addr := fmt .Sprintf ("%s:%s" , * testHost , s .port )
121+ addr := fmt .Sprintf ("%s:%s" , * test_util . MysqlHost , s .port )
121122 _ , err := Connect (addr , * testUser , * testPassword , * testDB , func (c * Conn ) {
122123 c .UseSSL (false )
123124 })
@@ -133,7 +134,7 @@ func (s *clientTestSuite) TestConn_TLS_Verify(c *C) {
133134
134135func (s * clientTestSuite ) TestConn_TLS_Skip_Verify (c * C ) {
135136 // An empty tls.Config will result in a connection error but we can configure to skip it.
136- addr := fmt .Sprintf ("%s:%s" , * testHost , s .port )
137+ addr := fmt .Sprintf ("%s:%s" , * test_util . MysqlHost , s .port )
137138 _ , err := Connect (addr , * testUser , * testPassword , * testDB , func (c * Conn ) {
138139 c .UseSSL (true )
139140 })
@@ -145,7 +146,7 @@ func (s *clientTestSuite) TestConn_TLS_Certificate(c *C) {
145146 // And if server uses auto-generated certificates, it will be an error like:
146147 // "x509: certificate is valid for MySQL_Server_8.0.12_Auto_Generated_Server_Certificate, not not-a-valid-name"
147148 tlsConfig := NewClientTLSConfig (test_keys .CaPem , test_keys .CertPem , test_keys .KeyPem , false , "not-a-valid-name" )
148- addr := fmt .Sprintf ("%s:%s" , * testHost , s .port )
149+ addr := fmt .Sprintf ("%s:%s" , * test_util . MysqlHost , s .port )
149150 _ , err := Connect (addr , * testUser , * testPassword , * testDB , func (c * Conn ) {
150151 c .SetTLSConfig (tlsConfig )
151152 })
0 commit comments