mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(ec2): apply cidr-block filter in DescribeSubnets (#1864)
* fix(ec2): apply cidr-block filter in DescribeSubnets DescribeSubnets ignored Name=cidr-block and returned all subnets in the VPC. Match AWS aliases cidr-block, cidrBlock, and cidr. Fixes #1643 * test(ec2): set describeSubnetsByCidrBlockFilter Order to 23
This commit is contained in:
1 parent
aa4eee6e0c
commit
8f3597c205
2 files changed
+52
No files matched your search
@@ -683,6 +683,57 @@ class Ec2IntegrationTest {
|
||||
.body("DescribeSubnetsResponse.subnetSet.item.subnetId", equalTo(subnetId));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(23)
|
||||
void describeSubnetsByCidrBlockFilter() {
|
||||
String isolatedVpcId = given()
|
||||
.formParam("Action", "CreateVpc")
|
||||
.formParam("CidrBlock", "10.10.0.0/16")
|
||||
.header("Authorization", AUTH_HEADER)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.extract().path("CreateVpcResponse.vpc.vpcId");
|
||||
|
||||
String firstSubnetId = given()
|
||||
.formParam("Action", "CreateSubnet")
|
||||
.formParam("VpcId", isolatedVpcId)
|
||||
.formParam("CidrBlock", "10.10.1.0/24")
|
||||
.formParam("AvailabilityZone", "us-east-1a")
|
||||
.header("Authorization", AUTH_HEADER)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.extract().path("CreateSubnetResponse.subnet.subnetId");
|
||||
|
||||
given()
|
||||
.formParam("Action", "CreateSubnet")
|
||||
.formParam("VpcId", isolatedVpcId)
|
||||
.formParam("CidrBlock", "10.10.2.0/24")
|
||||
.formParam("AvailabilityZone", "us-east-1b")
|
||||
.header("Authorization", AUTH_HEADER)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200);
|
||||
|
||||
given()
|
||||
.formParam("Action", "DescribeSubnets")
|
||||
.formParam("Filter.1.Name", "vpc-id")
|
||||
.formParam("Filter.1.Value.1", isolatedVpcId)
|
||||
.formParam("Filter.2.Name", "cidr-block")
|
||||
.formParam("Filter.2.Value.1", "10.10.1.0/24")
|
||||
.header("Authorization", AUTH_HEADER)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("DescribeSubnetsResponse.subnetSet.item.subnetId", equalTo(firstSubnetId))
|
||||
.body("DescribeSubnetsResponse.subnetSet.item.cidrBlock", equalTo("10.10.1.0/24"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(21)
|
||||
void createSubnetHasAssignIpv6AddressOnCreation() {
|
||||
|
||||
Reference in new issue
Block a user