Revert the WithContext changes to vault tests (#14947)

This commit is contained in:
Anton Averchenkov
2022-04-07 15:12:58 -04:00
committed by GitHub
parent 48b43e9213
commit e7b5b2a48d
104 changed files with 1093 additions and 1167 deletions

View File

@@ -2,7 +2,6 @@ package http
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
@@ -62,7 +61,7 @@ func TestHTTP_Fallback_Bad_Address(t *testing.T) {
}
client.SetToken(cluster.RootToken)
secret, err := client.Auth().Token().LookupSelfWithContext(context.Background())
secret, err := client.Auth().Token().LookupSelf()
if err != nil {
t.Fatal(err)
}
@@ -110,7 +109,7 @@ func TestHTTP_Fallback_Disabled(t *testing.T) {
}
client.SetToken(cluster.RootToken)
secret, err := client.Auth().Token().LookupSelfWithContext(context.Background())
secret, err := client.Auth().Token().LookupSelf()
if err != nil {
t.Fatal(err)
}
@@ -530,7 +529,7 @@ func TestHTTP_Forwarding_ClientTLS(t *testing.T) {
t.Fatal(err)
}
secret, err := client.Logical().WriteWithContext(context.Background(), "auth/cert/login", nil)
secret, err := client.Logical().Write("auth/cert/login", nil)
if err != nil {
t.Fatal(err)
}
@@ -547,7 +546,7 @@ func TestHTTP_Forwarding_ClientTLS(t *testing.T) {
t.Fatalf("bad client token: %#v", *secret.Auth)
}
client.SetToken(secret.Auth.ClientToken)
secret, err = client.Auth().Token().LookupSelfWithContext(context.Background())
secret, err = client.Auth().Token().LookupSelf()
if err != nil {
t.Fatal(err)
}
@@ -595,7 +594,7 @@ func TestHTTP_Forwarding_LocalOnly(t *testing.T) {
vault.TestWaitActive(t, cores[0].Core)
testLocalOnly := func(client *api.Client) {
_, err := client.Logical().ReadWithContext(context.Background(), "sys/config/state/sanitized")
_, err := client.Logical().Read("sys/config/state/sanitized")
if err == nil {
t.Fatal("expected error")
}