diff --git a/test/integration/targets/ec2_vpc_route_table/aliases b/test/integration/targets/ec2_vpc_route_table/aliases index 5e7a8d3877c..e4da78b0eb3 100644 --- a/test/integration/targets/ec2_vpc_route_table/aliases +++ b/test/integration/targets/ec2_vpc_route_table/aliases @@ -1,3 +1,4 @@ cloud/aws shippable/aws/group2 unstable +ec2_vpc_route_table_info diff --git a/test/integration/targets/ec2_vpc_route_table/tasks/main.yml b/test/integration/targets/ec2_vpc_route_table/tasks/main.yml index 2764dfc3aca..8dee7c154a2 100644 --- a/test/integration/targets/ec2_vpc_route_table/tasks/main.yml +++ b/test/integration/targets/ec2_vpc_route_table/tasks/main.yml @@ -456,7 +456,7 @@ <<: *aws_connection_info register: update_tags - - name: assert purge tags worked + - name: assert update tags worked assert: that: - update_tags.changed @@ -578,11 +578,41 @@ <<: *aws_connection_info register: nat_gateway - - name: show route table facts + - name: show route table info, get table using route-table-id ec2_vpc_route_table_info: filters: route-table-id: "{{ create_private_table.route_table.id }}" <<: *aws_connection_info + register: route_table_info + + - name: assert route_table_info has correct attributes + assert: + that: + - '"route_tables" in route_table_info' + - 'route_table_info.route_tables | length == 1' + - '"id" in route_table_info.route_tables[0]' + - '"routes" in route_table_info.route_tables[0]' + - '"associations" in route_table_info.route_tables[0]' + - '"tags" in route_table_info.route_tables[0]' + - '"vpc_id" in route_table_info.route_tables[0]' + - 'route_table_info.route_tables[0].id == create_private_table.route_table.id' + + - name: show route table info, get table using tags + ec2_vpc_route_table_info: + filters: + "tag:Public": "false" + "tag:Name": "Private route table" + vpc-id: "{{ vpc.vpc.id }}" + <<: *aws_connection_info + register: route_table_info + + - name: assert route_table_info has correct tags + assert: + that: + - 'route_table_info.route_tables | length == 1' + - '"tags" in route_table_info.route_tables[0]' + - '"Public" in route_table_info.route_tables[0].tags and route_table_info.route_tables[0].tags["Public"] == "false"' + - '"Name" in route_table_info.route_tables[0].tags and route_table_info.route_tables[0].tags["Name"] == "Private route table"' - name: create NAT GW ec2_vpc_nat_gateway: @@ -592,7 +622,7 @@ <<: *aws_connection_info register: nat_gateway - - name: show route table facts + - name: show route table info ec2_vpc_route_table_info: filters: route-table-id: "{{ create_private_table.route_table.id }}"