Documentation
¶
Index ¶
- Constants
- func ConsulACLConfigFn(c *testutil.TestServerConfig)
- func ConsulServer(t *testing.T, cb testutil.ServerConfigCallback) *api.Config
- func SetECSConfigEnvVar(t *testing.T, val interface{})
- func TaskMetaHandler(t *testing.T, resp string) http.Handler
- func TaskMetaHandlerFn(t *testing.T, respFn func() string) http.Handler
- func TaskMetaServer(t *testing.T, handler http.Handler)
- func TempDir(t *testing.T) string
Constants ¶
const AdminToken = "123e4567-e89b-12d3-a456-426614174000"
Variables ¶
This section is empty.
Functions ¶
func ConsulACLConfigFn ¶
func ConsulACLConfigFn(c *testutil.TestServerConfig)
ConsulACLConfigFn configures a Consul test server with ACLs.
func ConsulServer ¶
ConsulServer initializes a Consul test server and returns Consul client config.
func SetECSConfigEnvVar ¶
SetECSConfigEnvVar the CONSUL_ECS_CONFIG_JSON environment variable to the JSON string of the provided value, with a test cleanup.
func TaskMetaHandler ¶
TaskMetaHandler returns an http.Handler that always responds with the given string for the 'GET /task' request of the ECS Task Metadata server.
func TaskMetaHandlerFn ¶
TaskMetaHandler wraps the respFn in an http.Handler for the ECS Task Metadata server. respFn should return a response to the 'GET /task' request.
func TaskMetaServer ¶
TaskMetaServer starts a local HTTP server to mimic the ECS Task Metadata server. This sets ECS_CONTAINER_METADATA_URI_V4 and configures a test cleanup. Because of the environment variable, this is unsafe for running tests in parallel.
Types ¶
This section is empty.