Skip to content

Commit 5979836

Browse files
committed
Fix auth tests for Tarantool >= 2.11.0
1 parent e5ab9f7 commit 5979836

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

auth_test.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,29 @@ func TestAuth(t *testing.T) {
2525
User: "user_not_found",
2626
Password: "qwerty",
2727
})
28+
ver, _ := tntBoxVersion(box)
29+
2830
if assert.Error(err) && assert.Nil(conn) {
29-
assert.Contains(err.Error(), "is not found")
31+
if ver >= version2_11_0 {
32+
assert.Exactly(err.Error(), "User not found or supplied credentials are invalid")
33+
} else {
34+
assert.Contains(err.Error(), "is not found")
35+
}
3036
}
3137

3238
// bad password
3339
conn, err = box.Connect(&Options{
3440
User: "tester",
3541
Password: "qwerty",
3642
})
43+
ver, _ = tntBoxVersion(box)
44+
3745
if assert.Error(err) && assert.Nil(conn) {
38-
assert.Contains(err.Error(), "Incorrect password supplied for user")
46+
if ver >= version2_11_0 {
47+
assert.Exactly(err.Error(), "User not found or supplied credentials are invalid")
48+
} else {
49+
assert.Contains(err.Error(), "Incorrect password supplied for user")
50+
}
3951
}
4052

4153
// ok user password

const.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const (
136136
ErrDropUser = uint(0x2c) // Failed to drop user '%s': %s
137137
ErrNoSuchUser = uint(0x2d) // User '%s' is not found
138138
ErrUserExists = uint(0x2e) // User '%s' already exists
139-
ErrPasswordMismatch = uint(0x2f) // Incorrect password supplied for user '%s'
139+
ErrCredsMismatch = uint(0x2f) // User not found or supplied credentials are invalid
140140
ErrUnknownRequestType = uint(0x30) // Unknown request type %u
141141
ErrUnknownSchemaObject = uint(0x31) // Unknown object type '%s'
142142
ErrCreateFunction = uint(0x32) // Failed to create function '%s': %s

0 commit comments

Comments
 (0)