Many tests had duplicate code to create the base level domain objects in a boundary environment. This commit refactors that code to use functions for these commonly used operations.
* Randomize order of worker output. This uses the standard
rand.Shuffle() call; cribbed from
https://pkg.go.dev/math/rand#example-Shuffle
* Have some error/eventing in the worker status path use the base
context instead of the status-call-specific context to allow eventing
after a timeout event
The sessions.bats tests were seeing some flaky behavior when listing sessions but not getting the expected amount back. This is due to the connect_nc command that is currently used, which will immediately set the session to be "canceled" once it returns. This can cause subsequent operations to get unexpected results (sometimes, listing sessions would return an empty list if the created sessions go to a "terminated" state).
This variable defines the IP address of a target used in tests. We should pass in the address itself instead of a list of addresses that will get converted to a single address eventually anyways.
This adds a github actions workflow to run the new e2e test suite
Co-authored-by: Michael Anthony <manthony@hashicorp.com>
Co-authored-by: Josh Brand <jbrand@hashicorp.com>
Trigger a downstream merge. This requires that the DOWNSTREAM_SLUG
environment variable is set in CircleCI. This will trigger downstream
merges for main and all release branches.
feat(config): Support multiple files
This updates the three subcommands that take a `-config` flag to
to support multiple config files via a repeated `-config` flag.
It updates the following subcommands:
- `server`
- `database init`
- `database migrate`
Note that the multiple file support only works if all config files are
HCL, not JSON. Also note that the config files are concatenated
together. There is no attempt to merge config files, so having the same
stanza in multiple files can yield unexpected results, with only one of
the stanzas being used.
When used with these limitations understood, this provides a way to take
different actions for different kinds of dynamic configuration changes.
An example would be when using consul-template to render the
configuration files for boundary. With the multi file support
consul-template can render one config file for the controller stanza,
and provide boundary with a dynamic database credential via vault. Then
when the credential is rotated, consul-template can send boundary a
SIGHUP to switch to the new credential without a restart. A separate
template could be used to render a config for a stanza that does not
support SIGHUP, such as the events stanza that gets its values via
consul's KV. If these values change, consul-template can restart
boundary so the new configuration is used.
Co-authored-by: Timothy Messier <tim.messier@gmail.com>
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>