builtin/credential/approle: fix dropped test errors (#11990)
This commit is contained in:
parent
8201b42651
commit
159272db7f
|
@ -209,6 +209,9 @@ func TestAppRole_LocalSecretIDImmutability(t *testing.T) {
|
|||
Storage: storage,
|
||||
Data: roleData,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if resp == nil || !resp.IsError() {
|
||||
t.Fatalf("expected an error since local_secret_ids can't be overwritten")
|
||||
}
|
||||
|
|
|
@ -44,21 +44,26 @@ func TestAppRole_TidyDanglingAccessors_Normal(t *testing.T) {
|
|||
SecretIDHMAC: "samplesecretidhmac",
|
||||
},
|
||||
)
|
||||
err = storage.Put(context.Background(), entry1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := storage.Put(context.Background(), entry1); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
entry2, err := logical.StorageEntryJSON(
|
||||
"accessor/invalid2",
|
||||
&secretIDAccessorStorageEntry{
|
||||
SecretIDHMAC: "samplesecretidhmac2",
|
||||
},
|
||||
)
|
||||
err = storage.Put(context.Background(), entry2)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := storage.Put(context.Background(), entry2); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
accessorHashes, err = storage.List(context.Background(), "accessor/")
|
||||
if err != nil {
|
||||
|
@ -138,11 +143,14 @@ func TestAppRole_TidyDanglingAccessors_RaceTest(t *testing.T) {
|
|||
SecretIDHMAC: "samplesecretidhmac",
|
||||
},
|
||||
)
|
||||
err = storage.Put(context.Background(), entry)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := storage.Put(context.Background(), entry); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
count++
|
||||
time.Sleep(100 * time.Microsecond)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue