mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
Place error check before the response check in expiration test
This commit is contained in:
parent
3345322132
commit
d5b73fa0f5
1 changed files with 5 additions and 4 deletions
|
|
@ -160,7 +160,7 @@ func TestExpiration_RegisterAuth_NoLease(t *testing.T) {
|
|||
// Should not be able to renew, no expiration
|
||||
resp, err := exp.RenewToken(&logical.Request{}, "auth/github/login", root.ID, 0)
|
||||
if err != nil && (err != logical.ErrInvalidRequest || (resp != nil && resp.IsError() && resp.Error().Error() != "lease not found or lease is not renewable")) {
|
||||
t.Fatalf("err: %v", err)
|
||||
t.Fatalf("bad: err:%v resp:%#v", err, resp)
|
||||
}
|
||||
if resp == nil {
|
||||
t.Fatal("expected a response")
|
||||
|
|
@ -459,12 +459,13 @@ func TestExpiration_RenewToken_NotRenewable(t *testing.T) {
|
|||
|
||||
// Attempt to renew the token
|
||||
resp, err := exp.RenewToken(&logical.Request{}, "auth/github/login", root.ID, 0)
|
||||
if err != nil && (err != logical.ErrInvalidRequest || (resp != nil && resp.IsError() && resp.Error().Error() != "lease not found or lease is not renewable")) {
|
||||
t.Fatalf("bad: err:%v resp:%#v", err, resp)
|
||||
}
|
||||
if resp == nil {
|
||||
t.Fatal("expected a response")
|
||||
}
|
||||
if err != logical.ErrInvalidRequest || resp.Error().Error() != "lease is not renewable" {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestExpiration_Renew(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue