MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cloud-sql-proxy / TestMySQLMCPUnix

Function TestMySQLMCPUnix

tests/mysql_test.go:122–146  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

120}
121
122func TestMySQLMCPUnix(t *testing.T) {
123 if testing.Short() {
124 t.Skip("skipping MySQL integration tests")
125 }
126 requireMySQLVars(t)
127 tmpDir, cleanup := createTempDir(t)
128 defer cleanup()
129
130 cfg := mysql.Config{
131 User: *mysqlUser,
132 Passwd: *mysqlMCPPass,
133 DBName: *mysqlDB,
134 AllowNativePasswords: true,
135 // re-use utility function to determine the Unix address in a
136 // Windows-friendly way.
137 Addr: proxy.UnixAddress(tmpDir, *mysqlMCPConnName),
138 Net: "unix",
139 }
140 // Prepare the initial arguments
141 args := []string{"--unix-socket", tmpDir, *mysqlMCPConnName}
142 // Add the IP type flag using the helper
143 args = AddIPTypeFlag(args)
144 // Run the test
145 proxyConnTest(t, args, "mysql", cfg.FormatDSN())
146}
147
148func TestMySQLImpersonation(t *testing.T) {
149 if testing.Short() {

Callers

nothing calls this directly

Calls 5

UnixAddressFunction · 0.92
requireMySQLVarsFunction · 0.85
AddIPTypeFlagFunction · 0.85
proxyConnTestFunction · 0.85
createTempDirFunction · 0.70

Tested by

no test coverage detected