Fix the dependency issue (#231)
This commit is contained in:
2428
vendor/github.com/aws/aws-sdk-go/service/ec2/api.go
generated
vendored
2428
vendor/github.com/aws/aws-sdk-go/service/ec2/api.go
generated
vendored
File diff suppressed because it is too large
Load Diff
48
vendor/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go
generated
vendored
48
vendor/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go
generated
vendored
@@ -1,48 +0,0 @@
|
||||
package ec2_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/awstesting/unit"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
)
|
||||
|
||||
func TestCopySnapshotPresignedURL(t *testing.T) {
|
||||
svc := ec2.New(unit.Session, &aws.Config{Region: aws.String("us-west-2")})
|
||||
|
||||
func() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
t.Fatalf("expect CopySnapshotRequest with nill")
|
||||
}
|
||||
}()
|
||||
// Doesn't panic on nil input
|
||||
req, _ := svc.CopySnapshotRequest(nil)
|
||||
req.Sign()
|
||||
}()
|
||||
|
||||
req, _ := svc.CopySnapshotRequest(&ec2.CopySnapshotInput{
|
||||
SourceRegion: aws.String("us-west-1"),
|
||||
SourceSnapshotId: aws.String("snap-id"),
|
||||
})
|
||||
req.Sign()
|
||||
|
||||
b, _ := ioutil.ReadAll(req.HTTPRequest.Body)
|
||||
q, _ := url.ParseQuery(string(b))
|
||||
u, _ := url.QueryUnescape(q.Get("PresignedUrl"))
|
||||
if e, a := "us-west-2", q.Get("DestinationRegion"); e != a {
|
||||
t.Errorf("expect %v, got %v", e, a)
|
||||
}
|
||||
if e, a := "us-west-1", q.Get("SourceRegion"); e != a {
|
||||
t.Errorf("expect %v, got %v", e, a)
|
||||
}
|
||||
|
||||
r := regexp.MustCompile(`^https://ec2\.us-west-1\.amazonaws\.com/.+&DestinationRegion=us-west-2`)
|
||||
if !r.MatchString(u) {
|
||||
t.Errorf("expect %v to match, got %v", r.String(), u)
|
||||
}
|
||||
}
|
||||
1262
vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go
generated
vendored
1262
vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go
generated
vendored
File diff suppressed because it is too large
Load Diff
4213
vendor/github.com/aws/aws-sdk-go/service/ec2/examples_test.go
generated
vendored
4213
vendor/github.com/aws/aws-sdk-go/service/ec2/examples_test.go
generated
vendored
File diff suppressed because it is too large
Load Diff
37
vendor/github.com/aws/aws-sdk-go/service/ec2/retryer_test.go
generated
vendored
37
vendor/github.com/aws/aws-sdk-go/service/ec2/retryer_test.go
generated
vendored
@@ -1,37 +0,0 @@
|
||||
package ec2
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/awstesting/unit"
|
||||
)
|
||||
|
||||
func TestCustomRetryer(t *testing.T) {
|
||||
svc := New(unit.Session, &aws.Config{Region: aws.String("us-west-2")})
|
||||
if _, ok := svc.Client.Retryer.(retryer); !ok {
|
||||
t.Error("expected custom retryer, but received otherwise")
|
||||
}
|
||||
|
||||
req, _ := svc.ModifyNetworkInterfaceAttributeRequest(&ModifyNetworkInterfaceAttributeInput{
|
||||
NetworkInterfaceId: aws.String("foo"),
|
||||
})
|
||||
|
||||
duration := svc.Client.Retryer.RetryRules(req)
|
||||
if duration < time.Second*1 || duration > time.Second*2 {
|
||||
t.Errorf("expected duration to be between 1 and 2, but received %v", duration)
|
||||
}
|
||||
|
||||
req.RetryCount = 15
|
||||
duration = svc.Client.Retryer.RetryRules(req)
|
||||
if duration < time.Second*5 || duration > time.Second*10 {
|
||||
t.Errorf("expected duration to be between 1 and 2, but received %v", duration)
|
||||
}
|
||||
|
||||
svc = New(unit.Session, &aws.Config{Region: aws.String("us-west-2"), Retryer: client.DefaultRetryer{}})
|
||||
if _, ok := svc.Client.Retryer.(client.DefaultRetryer); !ok {
|
||||
t.Error("expected default retryer, but received otherwise")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user