Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stanhu committed Sep 11, 2024
1 parent 86e27a0 commit 8913527
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
4 changes: 4 additions & 0 deletions aws/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ func TestV2ConfigFromURLParams(t *testing.T) {
HostnameImmutable: true,
},
},
{
name: "FIPS and dual stack",
query: url.Values{"fips": {"true"}, "dualstack": {"true"}},
},
// Can't test "profile", since AWS validates that the profile exists.
}

Expand Down
24 changes: 16 additions & 8 deletions blob/s3blob/s3blob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,18 +476,26 @@ func TestOpenBucketFromURL(t *testing.T) {
{"s3://mybucket?awssdk=v2", false},
// OK, use KMS Server Side Encryption
{"s3://mybucket?ssetype=aws:kms&kmskeyid=arn:aws:us-east-1:12345:key/1-a-2-b", false},
// OK, use S3 Transfer acceleration
{"s3://mybucket?accelerate=true", false},
// OK, use dual stack endpoints
{"s3://mybucket?dualstack=true", false},
// OK, use S3 Transfer acceleration and dual stack endpoints
{"s3://mybucket?accelerate=true&dualstack=true", false},
// OK, use FIPS endpoints
{"s3://mybucket?fips=true", false},
// OK, use S3 Transfer acceleration (v1)
{"s3://mybucket?awssdk=v1&accelerate=true", false},
// OK, use dual stack endpoints (v1)
{"s3://mybucket?awssdk=v1&dualstack=true", false},
// OK, use S3 Transfer accleration and dual stack endpoints (v1)
{"s3://mybucket?awssdk=v1&accelerate=true&dualstack=true", false},
// OK, use FIPS endpoints (v1)
{"s3://mybucket?awssdk=v1&fips=true", false},
// Invalid accelerate (v1)
{"s3://mybucket?awssdk=v1&accelerate=bogus", true},
// Invalid accelerate (v2)
{"s3://mybucket?accelerate=bogus", true},
// Invalid FIPS (v1)
{"s3://mybucket?awssdk=v1&fips=bogus", true},
// Invalid FIPS (v2)
{"s3://mybucket?fips=bogus", true},
// Invalid dualstack (v1)
{"s3://mybucket?awssdk=v1&dualstack=bad", true},
// Invalid dualstack (v2)
{"s3://mybucket?dualstack=bad", true},
// Invalid ssetype
{"s3://mybucket?ssetype=aws:notkmsoraes&kmskeyid=arn:aws:us-east-1:12345:key/1-a-2-b", true},
// Invalid parameter together with a valid one.
Expand Down

0 comments on commit 8913527

Please sign in to comment.