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:
Lars Lehtonen 2017-07-04 10:58:28 -07:00 committed by Jeff Mitchell
parent 753b68fa1b
commit d0a3f07b07
3 changed files with 13 additions and 0 deletions

View File

@ -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")

View File

@ -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

View File

@ -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)
}