Skip to content

Commit

Permalink
backport of commit c0014c9 (#24211)
Browse files Browse the repository at this point in the history
Co-authored-by: Victor Rodriguez <[email protected]>
  • Loading branch information
1 parent 8753d08 commit 9055b7e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion vault/rekey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ func TestCore_Rekey_Update(t *testing.T) {
}

func testCore_Rekey_Update_Common(t *testing.T, c *Core, keys [][]byte, root string, recovery bool) {
testCore_Rekey_Update_Common_Error(t, c, keys, root, recovery, false)
}

func testCore_Rekey_Update_Common_Error(t *testing.T, c *Core, keys [][]byte, root string, recovery bool, wantRekeyUpdateError bool) {
var err error
// Start a rekey
var expType string
Expand Down Expand Up @@ -184,12 +188,19 @@ func testCore_Rekey_Update_Common(t *testing.T, c *Core, keys [][]byte, root str
for _, key := range keys {
result, err = c.RekeyUpdate(context.Background(), key, rkconf.Nonce, recovery)
if err != nil {
t.Fatalf("err: %v", err)
if !wantRekeyUpdateError {
t.Fatalf("err: %v", err)
} else {
return
}
}
if result != nil {
break
}
}
if wantRekeyUpdateError {
t.Fatal("expected and error during RekeyUpdate")
}
if result == nil {
t.Fatal("nil result after update")
}
Expand Down

0 comments on commit 9055b7e

Please sign in to comment.