Skip to content

Commit

Permalink
backport of commit f4f1762 (hashicorp#19317)
Browse files Browse the repository at this point in the history
Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
  • Loading branch information
1 parent d21564e commit 62eeda8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vault/external_tests/plugin/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ func testPlugin_continueOnError(t *testing.T, btype logical.BackendType, mismatc

// Get the registered plugin
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()
resp, err := core.HandleRequest(namespace.RootContext(testCtx), req)
if err != nil || resp == nil || (resp != nil && resp.IsError()) {
Expand Down
3 changes: 3 additions & 0 deletions vault/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ func TestAddTestPlugin(t testing.T, c *Core, name string, pluginType consts.Plug
if err != nil {
t.Fatal(err)
}
// Ensure that the file is closed and written. This seems to be
// necessary on Linux systems.
out.Close()

dirPath = tempDir
}
Expand Down

0 comments on commit 62eeda8

Please sign in to comment.