File tree 2 files changed +11
-21
lines changed
2 files changed +11
-21
lines changed Original file line number Diff line number Diff line change @@ -994,7 +994,6 @@ initiate_connection:
994
994
}
995
995
996
996
// processing login response
997
- success := false
998
997
for {
999
998
tokchan := make (chan tokenStruct , 5 )
1000
999
go processResponse (context .Background (), & sess , tokchan , nil )
@@ -1018,7 +1017,6 @@ initiate_connection:
1018
1017
sspi_msg = nil
1019
1018
}
1020
1019
case loginAckStruct :
1021
- success = true
1022
1020
sess .loginAck = token
1023
1021
case error :
1024
1022
return nil , fmt .Errorf ("Login error: %s" , token .Error ())
@@ -1036,9 +1034,6 @@ initiate_connection:
1036
1034
}
1037
1035
}
1038
1036
loginEnd:
1039
- if ! success {
1040
- return nil , fmt .Errorf ("Login failed" )
1041
- }
1042
1037
if sess .routedServer != "" {
1043
1038
toconn .Close ()
1044
1039
p .host = sess .routedServer
Original file line number Diff line number Diff line change @@ -415,23 +415,18 @@ func TestSecureConnection(t *testing.T) {
415
415
}
416
416
}
417
417
418
- func TestBadConnect (t * testing.T ) {
419
- checkConnStr (t )
420
- SetLogger (testLogger {t })
421
- connURL := makeConnStr (t )
422
- connURL .User = url .UserPassword ("baduser" , "badpwd" )
423
- badDSN := connURL .String ()
424
-
425
- conn , err := sql .Open ("mssql" , badDSN )
426
- if err != nil {
427
- t .Error ("Open connection failed:" , err .Error ())
428
- }
429
- defer conn .Close ()
418
+ func TestBadCredentials (t * testing.T ) {
419
+ params := testConnParams (t )
420
+ params .password = "padpwd"
421
+ params .user = "baduser"
422
+ testConnectionBad (t , params .toUrl ().String ())
423
+ }
430
424
431
- err = conn .Ping ()
432
- if err == nil {
433
- t .Error ("Ping should fail for connection: " , badDSN )
434
- }
425
+ func TestBadHost (t * testing.T ) {
426
+ params := testConnParams (t )
427
+ params .host = "badhost"
428
+ params .instance = ""
429
+ testConnectionBad (t , params .toUrl ().String ())
435
430
}
436
431
437
432
func TestSSPIAuth (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments