Пример #1
0
func (s *S) SetUpSuite(c *check.C) {
	var err error

	s.testServer, err = ec2test.NewServer()
	if err != nil {
		panic(err)
	}

	s.instance_ids = s.testServer.NewInstances(1, "t1.micro", "ami-00000", ec2test.Running, nil)

	s.testPath = c.MkDir()

	AWSRegion = "test"
	Region = aws.USEast
	Region.EC2Endpoint = s.testServer.URL()
	Config = &config.Config{
		TopicArn:      "arn:test",
		AutoSubscribe: false,
		Upstreams: []config.Upstream{
			config.Upstream{
				AutoScalingGroupARN: "arn:asg-test",
				ContainerFolder:     path.Join(s.testPath, "testupstreamcontainer"),
				File:                path.Join(s.testPath, "testupstreamfile"),
				Name:                "test",
			},
		},
	}
}
Пример #2
0
func (s *LocalServer) SetUp(c *C) {
	srv, err := ec2test.NewServer()
	c.Assert(err, IsNil)
	c.Assert(srv, NotNil)

	// Add default attributes.
	srv.SetInitialAttributes(map[string][]string{
		"supported-platforms": {"VPC", "EC2"},
		"default-vpc":         {"vpc-xxxxxxx"},
	})

	s.srv = srv
	s.region = aws.Region{EC2Endpoint: srv.URL(), Sign: aws.SignV2}
}