Stop Vault Package Tests From Swallowing Errors (#2960)
* Fix ignored error in TestAESGCMBarrier_MoveIntegrityV1(). * Fix ignored error in TestAESGCMBarrier_MoveIntegrityV2(). * Fix ignored err in TestExpiration_Tidy(). * Fix ignored error in TestSystemBackend_policyCRUD().
This commit is contained in:
parent
753b68fa1b
commit
d0a3f07b07
|
@ -275,6 +275,9 @@ func TestAESGCMBarrier_MoveIntegrityV1(t *testing.T) {
|
|||
pe, _ := inm.Get("test")
|
||||
pe.Key = "moved"
|
||||
err = inm.Put(pe)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
|
||||
// Read from the barrier
|
||||
_, err = b.Get("moved")
|
||||
|
@ -314,6 +317,9 @@ func TestAESGCMBarrier_MoveIntegrityV2(t *testing.T) {
|
|||
pe, _ := inm.Get("test")
|
||||
pe.Key = "moved"
|
||||
err = inm.Put(pe)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
|
||||
// Read from the barrier
|
||||
_, err = b.Get("moved")
|
||||
|
|
|
@ -214,6 +214,9 @@ func TestExpiration_Tidy(t *testing.T) {
|
|||
}
|
||||
|
||||
root, err := exp.tokenStore.rootToken()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
le.ClientToken = root.ID
|
||||
|
||||
// Attach a valid token with the leases
|
||||
|
|
|
@ -1232,6 +1232,10 @@ func TestSystemBackend_policyCRUD(t *testing.T) {
|
|||
// Read, and make sure that case has been normalized
|
||||
req = logical.TestRequest(t, logical.ReadOperation, "policy/Foo")
|
||||
resp, err = b.HandleRequest(req)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
|
||||
if resp != nil {
|
||||
t.Fatalf("err: expected nil response, got %#v", *resp)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue