9
9
"github.com/pingcap/errors"
10
10
11
11
"github.com/go-mysql-org/go-mysql/mysql"
12
+ "github.com/go-mysql-org/go-mysql/test_util"
12
13
"github.com/go-mysql-org/go-mysql/test_util/test_keys"
13
14
)
14
15
@@ -19,7 +20,7 @@ type clientTestSuite struct {
19
20
20
21
func (s * clientTestSuite ) SetUpSuite (c * C ) {
21
22
var err error
22
- addr := fmt .Sprintf ("%s:%s" , * testHost , s .port )
23
+ addr := fmt .Sprintf ("%s:%s" , * test_util . MysqlHost , s .port )
23
24
s .c , err = Connect (addr , * testUser , * testPassword , "" )
24
25
if err != nil {
25
26
c .Fatal (err )
@@ -117,7 +118,7 @@ func (s *clientTestSuite) TestConn_SetCapability(c *C) {
117
118
func (s * clientTestSuite ) TestConn_TLS_Verify (c * C ) {
118
119
// Verify that the provided tls.Config is used when attempting to connect to mysql.
119
120
// 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 )
121
122
_ , err := Connect (addr , * testUser , * testPassword , * testDB , func (c * Conn ) {
122
123
c .UseSSL (false )
123
124
})
@@ -133,7 +134,7 @@ func (s *clientTestSuite) TestConn_TLS_Verify(c *C) {
133
134
134
135
func (s * clientTestSuite ) TestConn_TLS_Skip_Verify (c * C ) {
135
136
// 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 )
137
138
_ , err := Connect (addr , * testUser , * testPassword , * testDB , func (c * Conn ) {
138
139
c .UseSSL (true )
139
140
})
@@ -145,7 +146,7 @@ func (s *clientTestSuite) TestConn_TLS_Certificate(c *C) {
145
146
// And if server uses auto-generated certificates, it will be an error like:
146
147
// "x509: certificate is valid for MySQL_Server_8.0.12_Auto_Generated_Server_Certificate, not not-a-valid-name"
147
148
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 )
149
150
_ , err := Connect (addr , * testUser , * testPassword , * testDB , func (c * Conn ) {
150
151
c .SetTLSConfig (tlsConfig )
151
152
})
0 commit comments