Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteCluster(t *testing.T, clusterName string)
- func GetInstanceIAMRole() (*iam.Role, error)
- func GetInstanceMetadata(path string) (string, error)
- func GetTaskDefinition(name string) (string, error)
- func GetTaskDefinitionWithOverrides(name string, overrides map[string]string) (string, error)
- func RequireDockerVersion(t *testing.T, selector string)
- func RoundTimeUp(realTime time.Time, duration time.Duration) time.Time
- func SearchStrInDir(dir, filePrefix, content string) error
- func VerifyMetrics(cwclient *cloudwatch.CloudWatch, params *cloudwatch.GetMetricStatisticsInput, ...) error
- type AgentOptions
- type TestAgent
- func (agent *TestAgent) Cleanup()
- func (agent *TestAgent) GetContainerNetworkMode(containerId string) ([]string, error)
- func (agent *TestAgent) RequireVersion(version string)
- func (agent *TestAgent) ResolveTaskDockerID(task *TestTask, containerName string) (string, error)
- func (agent *TestAgent) StartAgent() error
- func (agent *TestAgent) StartMultipleTasks(t *testing.T, taskDefinition string, num int) ([]*TestTask, error)
- func (agent *TestAgent) StartTask(t *testing.T, task string) (*TestTask, error)
- func (agent *TestAgent) StartTaskWithOverrides(t *testing.T, task string, overrides []*ecs.ContainerOverride) (*TestTask, error)
- func (agent *TestAgent) StartTaskWithTaskDefinitionOverrides(t *testing.T, task string, overrides map[string]string) (*TestTask, error)
- func (agent *TestAgent) StopAgent() error
- func (agent *TestAgent) WaitRunningViaIntrospection(task *TestTask) (bool, error)
- func (agent *TestAgent) WaitStoppedViaIntrospection(task *TestTask) (bool, error)
- type TestTask
- func (task *TestTask) ContainerExitcode(name string) (int, bool)
- func (task *TestTask) ExpectErrorType(containerName, errType string, timeout time.Duration) error
- func (task *TestTask) Redescribe()
- func (task *TestTask) Stop() error
- func (task *TestTask) WaitRunning(timeout time.Duration) error
- func (task *TestTask) WaitStopped(timeout time.Duration) error
- type Version
Constants ¶
const (
ExecDriverDir = "/var/lib/docker/execdriver"
)
Variables ¶
var Cluster string
var ECS *ecs.ECS
Functions ¶
func DeleteCluster ¶ added in v1.9.0
func GetInstanceIAMRole ¶ added in v1.11.1
GetInstanceIAMRole gets the iam roles attached to the instance profile
func GetInstanceMetadata ¶ added in v1.11.1
GetInstanceProfileName gets the instance profile name
func GetTaskDefinition ¶
GetTaskDefinition is a helper that provies the family:revision for the named task definition where the name matches the folder in which the task definition is present. In order to avoid re-registering a task definition when it has already been regestered in the past, this registers a task definition of the pattern 'family-md5sum' with md5sum being the input task definition json's md5. This special family name is checked for existence before a new one is registered and it is assumed that if it exists, the task definition currently represented by the file was registered as such already.
func GetTaskDefinitionWithOverrides ¶ added in v1.11.1
func RequireDockerVersion ¶ added in v1.7.0
func RoundTimeUp ¶ added in v1.9.0
RoundTimeUp rounds the time to the next second/minute/hours depending on the duration
func SearchStrInDir ¶ added in v1.11.1
SearchStrInDir searches the files in direcotry for specific content
func VerifyMetrics ¶ added in v1.9.0
func VerifyMetrics(cwclient *cloudwatch.CloudWatch, params *cloudwatch.GetMetricStatisticsInput, idleCluster bool) error
VerifyMetrics whether the response is as expected the expected value can be 0 or positive
Types ¶
type AgentOptions ¶ added in v1.5.0
type TestAgent ¶
type TestAgent struct { Image string DockerID string IntrospectionURL string Version string ContainerInstanceArn string Cluster string TestDir string Logdir string Options *AgentOptions DockerClient *docker.Client // contains filtered or unexported fields }
func RunAgent ¶
func RunAgent(t *testing.T, options *AgentOptions) *TestAgent
RunAgent launches the agent and returns an object which may be used to reference it. It will wait until the agent is correctly registered before returning. 'version' may be a docker image (e.g. amazon/amazon-ecs-agent:v1.0.0) with tag that may be used to run the agent. It defaults to 'amazon/amazon-ecs-agent:make', the version created locally by running 'make'
func (*TestAgent) GetContainerNetworkMode ¶ added in v1.12.0
GetContainerNetworkMode gets the container network mode, given container id
func (*TestAgent) RequireVersion ¶ added in v1.5.0
func (*TestAgent) ResolveTaskDockerID ¶
ResolveTaskDockerID determines the Docker ID for a container within a given task that has been run by the Agent.
func (*TestAgent) StartAgent ¶
func (*TestAgent) StartMultipleTasks ¶
func (*TestAgent) StartTaskWithOverrides ¶
func (*TestAgent) StartTaskWithTaskDefinitionOverrides ¶ added in v1.11.1
func (*TestAgent) WaitRunningViaIntrospection ¶ added in v1.8.2
type TestTask ¶
func (*TestTask) ContainerExitcode ¶
func (*TestTask) ExpectErrorType ¶
func (*TestTask) Redescribe ¶
func (task *TestTask) Redescribe()
type Version ¶ added in v1.5.0
type Version string
func (Version) Matches ¶ added in v1.5.0
Matches returns whether or not a version matches a given selector. The selector can be any of the following:
* x.y.z -- Matches a version exactly the same as the selector version * >=x.y.z -- Matches a version greater than or equal to the selector version * >x.y.z -- Matches a version greater than the selector version * <=x.y.z -- Matches a version less than or equal to the selector version * <x.y.z -- Matches a version less than the selector version * x.y.z,a.b.c -- Matches if the version matches either of the two selector versions