From 42d61191c4816977b39a7f2527b9281209df641e Mon Sep 17 00:00:00 2001 From: Tomasz Kleczek Date: Tue, 24 Sep 2019 11:20:35 +0200 Subject: [PATCH] storage: conformance tests improvements --- storage/conformance/conformance.go | 8 +++++--- storage/conformance/transactions.go | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/storage/conformance/conformance.go b/storage/conformance/conformance.go index a1399807..0be3661c 100644 --- a/storage/conformance/conformance.go +++ b/storage/conformance/conformance.go @@ -161,6 +161,8 @@ func testAuthRequestCRUD(t *testing.T, s storage.Storage) { t.Fatalf("failed to delete auth request: %v", err) } + _, err = s.GetAuthRequest(a1.ID) + mustBeErrNotFound(t, "auth request", err) } func testAuthCodeCRUD(t *testing.T, s storage.Storage) { @@ -214,7 +216,7 @@ func testAuthCodeCRUD(t *testing.T, s storage.Storage) { got, err := s.GetAuthCode(a1.ID) if err != nil { - t.Fatalf("failed to get auth req: %v", err) + t.Fatalf("failed to get auth code: %v", err) } if a1.Expiry.Unix() != got.Expiry.Unix() { t.Errorf("auth code expiry did not match want=%s vs got=%s", a1.Expiry, got.Expiry) @@ -812,7 +814,7 @@ func testGC(t *testing.T, s storage.Storage) { } } if _, err := s.GetAuthRequest(a.ID); err != nil { - t.Errorf("expected to be able to get auth code after GC: %v", err) + t.Errorf("expected to be able to get auth request after GC: %v", err) } } @@ -823,7 +825,7 @@ func testGC(t *testing.T, s storage.Storage) { } if _, err := s.GetAuthRequest(a.ID); err == nil { - t.Errorf("expected auth code to be GC'd") + t.Errorf("expected auth request to be GC'd") } else if err != storage.ErrNotFound { t.Errorf("expected storage.ErrNotFound, got %v", err) } diff --git a/storage/conformance/transactions.go b/storage/conformance/transactions.go index dc1be1b6..2fc6755b 100644 --- a/storage/conformance/transactions.go +++ b/storage/conformance/transactions.go @@ -135,8 +135,8 @@ func testKeysConcurrentUpdate(t *testing.T, s storage.Storage) { for i := 0; i < 2; i++ { n := time.Now().UTC().Round(time.Second) keys1 := storage.Keys{ - SigningKey: jsonWebKeys[0].Private, - SigningKeyPub: jsonWebKeys[0].Public, + SigningKey: jsonWebKeys[i].Private, + SigningKeyPub: jsonWebKeys[i].Public, NextRotation: n, }