mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
test: Fix bug in TestAddTestPlugin test helper (#19313)
* fix external plugin test failing locally * Ensure file is closed and written in TestAddTestPlugin
This commit is contained in:
committed by
GitHub
parent
20b347e3cd
commit
f4f1762991
@@ -423,6 +423,8 @@ func testPlugin_continueOnError(t *testing.T, btype logical.BackendType, mismatc
|
|||||||
|
|
||||||
// Get the registered plugin
|
// Get the registered plugin
|
||||||
req := logical.TestRequest(t, logical.ReadOperation, fmt.Sprintf("sys/plugins/catalog/%s/mock-plugin", pluginType))
|
req := logical.TestRequest(t, logical.ReadOperation, fmt.Sprintf("sys/plugins/catalog/%s/mock-plugin", pluginType))
|
||||||
|
// We are using the mock backend from vault/sdk/plugin/mock/backend.go which sets the plugin version.
|
||||||
|
req.Data["version"] = "v0.0.0+mock"
|
||||||
req.ClientToken = core.Client.Token()
|
req.ClientToken = core.Client.Token()
|
||||||
resp, err := core.HandleRequest(namespace.RootContext(testCtx), req)
|
resp, err := core.HandleRequest(namespace.RootContext(testCtx), req)
|
||||||
if err != nil || resp == nil || (resp != nil && resp.IsError()) {
|
if err != nil || resp == nil || (resp != nil && resp.IsError()) {
|
||||||
|
|||||||
@@ -539,6 +539,9 @@ func TestAddTestPlugin(t testing.T, c *Core, name string, pluginType consts.Plug
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
// Ensure that the file is closed and written. This seems to be
|
||||||
|
// necessary on Linux systems.
|
||||||
|
out.Close()
|
||||||
|
|
||||||
dirPath = tempDir
|
dirPath = tempDir
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user