-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests for setup plugin errors #3253
Conversation
vault/logical_system_integ_test.go
Outdated
@@ -220,6 +273,28 @@ func testSystemBackendMock(t *testing.T, numMounts int, backendType logical.Back | |||
return cluster | |||
} | |||
|
|||
func ensureCoresSealed(t *testing.T, c *vault.TestCluster) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we maybe not have this function copied around somewhere yet again?
Let's start migrating such utility functions to a helper/testutil or so package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to testing.go since its a TestCluster
operation
directoryPath := filepath.Dir(fullPath) | ||
|
||
// Set core's plugin directory and plugin catalog directory | ||
c.pluginDirectory = directoryPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have both of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setupPluginCatalog()
uses c.pluginDirectory
. If there is a unseal process during the test, the plugin loads from an empty directory and plugin mount fails:
"core: failed to create mount entry: path=mock-0/ error=no plugin found with name: mock-plugin"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that one comment, looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, curious why travis isn't running on this PR though. Would be nice to make sure the changes to the cluster setup didn't break other tests.
@briankassouf I think it's because this is not a merge to master. Travis should run when I open the PR on |
@calvn Ah, didn't notice that 👍 |
@jefferai I also changed |
I'd bump it back up. Other testing code (especially on ent side) can take quite a bit longer to finish up tasks before sealing. |
Bumped, merging if no objections. |
Also refactored
NewTestCluster
to be able to create a cluster with an arbitrary number of cores.