summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorPrasad Katti <prasadmkatti@gmail.com>2019-10-22 11:46:40 -0700
committeransibot <ansibot@users.noreply.github.com>2019-10-22 14:46:40 -0400
commit56f52a0169d112b0ccbf9cc41737cdbbaefd0a40 (patch)
treea9bdfc3126720c968ed58dc101d68c29bfa9657f /test/integration
parent7afba9420a5fe100b1cae273725df2a33133682c (diff)
downloadansible-56f52a0169d112b0ccbf9cc41737cdbbaefd0a40.tar.gz
ec2_vpc_route_table_info integration tests (#63413)
* ec2_vpc_route_table_info integration tests Make sure ec2_vpc_route_table_info return value has the right attributes. * ec2_vpc_route_table_info integration tests for tags
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/targets/ec2_vpc_route_table/aliases1
-rw-r--r--test/integration/targets/ec2_vpc_route_table/tasks/main.yml36
2 files changed, 34 insertions, 3 deletions
diff --git a/test/integration/targets/ec2_vpc_route_table/aliases b/test/integration/targets/ec2_vpc_route_table/aliases
index 5e7a8d3877..e4da78b0eb 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 2764dfc3ac..8dee7c154a 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 }}"