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

Function TestAuthFastNativePasswordNotAllowed

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

Source from the content-addressed store, hash-verified

429}
430
431func TestAuthFastNativePasswordNotAllowed(t *testing.T) {
432 _, mc := newRWMockConn(1)
433 mc.cfg.User = "root"
434 mc.cfg.Passwd = "secret"
435 mc.cfg.AllowNativePasswords = false
436
437 authData := []byte{70, 114, 92, 94, 1, 38, 11, 116, 63, 114, 23, 101, 126,
438 103, 26, 95, 81, 17, 24, 21}
439 plugin := "mysql_native_password"
440
441 // Send Client Authentication Packet
442 _, err := mc.auth(authData, plugin)
443 if err != ErrNativePassword {
444 t.Errorf("expected ErrNativePassword, got %v", err)
445 }
446}
447
448func TestAuthFastNativePassword(t *testing.T) {
449 conn, mc := newRWMockConn(1)

Callers

nothing calls this directly

Calls 2

newRWMockConnFunction · 0.85
authMethod · 0.80

Tested by

no test coverage detected