diff --git a/builtin/logical/ssh/path_config_ca_test.go b/builtin/logical/ssh/path_config_ca_test.go index 1230b491d901..f77852c1cb7d 100644 --- a/builtin/logical/ssh/path_config_ca_test.go +++ b/builtin/logical/ssh/path_config_ca_test.go @@ -117,8 +117,11 @@ func TestSSH_ConfigCAUpdateDelete(t *testing.T) { // Fail to overwrite it resp, err = b.HandleRequest(context.Background(), caReq) - if err == nil { - t.Fatalf("expected an error") + if err != nil { + t.Fatal(err) + } + if !resp.IsError() { + t.Fatalf("expected an error, got %#v", *resp) } caReq.Operation = logical.DeleteOperation @@ -142,8 +145,11 @@ func TestSSH_ConfigCAUpdateDelete(t *testing.T) { // Fail to overwrite it resp, err = b.HandleRequest(context.Background(), caReq) - if err == nil { - t.Fatalf("expected an error") + if err != nil { + t.Fatal(err) + } + if !resp.IsError() { + t.Fatalf("expected an error, got %#v", *resp) } caReq.Operation = logical.DeleteOperation