mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-20 22:21:09 +02:00
Short-circuit TestBackend_PluginMainEnv on plain test run (#5393)
This commit is contained in:
parent
14ce354353
commit
1aad6e0800
@ -647,16 +647,17 @@ func TestBackend_PluginMainCredentials(t *testing.T) {
|
|||||||
|
|
||||||
// TestBackend_PluginMainEnv is a mock plugin that simply checks for the existence of FOO env var.
|
// TestBackend_PluginMainEnv is a mock plugin that simply checks for the existence of FOO env var.
|
||||||
func TestBackend_PluginMainEnv(t *testing.T) {
|
func TestBackend_PluginMainEnv(t *testing.T) {
|
||||||
actual := os.Getenv(expectedEnvKey)
|
|
||||||
if actual != expectedEnvValue {
|
|
||||||
t.Fatalf("expected: %q, got: %q", expectedEnvValue, actual)
|
|
||||||
}
|
|
||||||
|
|
||||||
args := []string{}
|
args := []string{}
|
||||||
if os.Getenv(pluginutil.PluginUnwrapTokenEnv) == "" && os.Getenv(pluginutil.PluginMetadataModeEnv) != "true" {
|
if os.Getenv(pluginutil.PluginUnwrapTokenEnv) == "" && os.Getenv(pluginutil.PluginMetadataModeEnv) != "true" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check on actual vs expected env var
|
||||||
|
actual := os.Getenv(expectedEnvKey)
|
||||||
|
if actual != expectedEnvValue {
|
||||||
|
t.Fatalf("expected: %q, got: %q", expectedEnvValue, actual)
|
||||||
|
}
|
||||||
|
|
||||||
caPEM := os.Getenv(pluginutil.PluginCACertPEMEnv)
|
caPEM := os.Getenv(pluginutil.PluginCACertPEMEnv)
|
||||||
if caPEM == "" {
|
if caPEM == "" {
|
||||||
t.Fatal("CA cert not passed in")
|
t.Fatal("CA cert not passed in")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user