mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Revert the WithContext changes to vault tests (#14947)
This commit is contained in:
committed by
GitHub
parent
48b43e9213
commit
e7b5b2a48d
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user