MCPcopy
hub / github.com/go-sql-driver/mysql / TestAuthFastCleartextPasswordNotAllowed

Function TestAuthFastCleartextPasswordNotAllowed

auth_test.go:329–343  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

327}
328
329func TestAuthFastCleartextPasswordNotAllowed(t *testing.T) {
330 _, mc := newRWMockConn(1)
331 mc.cfg.User = "root"
332 mc.cfg.Passwd = "secret"
333
334 authData := []byte{70, 114, 92, 94, 1, 38, 11, 116, 63, 114, 23, 101, 126,
335 103, 26, 95, 81, 17, 24, 21}
336 plugin := "mysql_clear_password"
337
338 // Send Client Authentication Packet
339 _, err := mc.auth(authData, plugin)
340 if err != ErrCleartextPassword {
341 t.Errorf("expected ErrCleartextPassword, got %v", err)
342 }
343}
344
345func TestAuthFastCleartextPassword(t *testing.T) {
346 conn, mc := newRWMockConn(1)

Callers

nothing calls this directly

Calls 2

newRWMockConnFunction · 0.85
authMethod · 0.80

Tested by

no test coverage detected