1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

A few updates to the ec2_elb_lb integration test

This commit is contained in:
James Cammarata 2014-04-25 14:38:55 -05:00
parent 2ef65ae813
commit f2db460203
2 changed files with 36 additions and 49 deletions

View file

@ -7,7 +7,7 @@
#- { role: test_ec2_vol, tags: test_ec2_vol }
#- { role: test_ec2_tag, tags: test_ec2_tag }
#- { role: test_ec2_facts, tags: test_ec2_facts }
#- { role: test_ec2_elb_lb, tags: test_ec2_elb_lb }
- { role: test_ec2_elb_lb, tags: test_ec2_elb_lb }
#- { role: test_ec2_eip, tags: test_ec2_eip }
#- { role: test_ec2_elb, tags: test_ec2_elb }
#- { role: test_ec2_ami, tags: test_ec2_ami }

View file

@ -41,11 +41,9 @@
- protocol: http
load_balancer_port: 80
instance_port: 80
- protocol: https
load_balancer_port: 443
instance_protocol: http
instance_port: 80
ssl_certificate_id: "{{ elb_lb_cert }}"
- protocol: http
load_balancer_port: 8080
instance_port: 8080
health_check:
ping_protocol: http
ping_port: 80
@ -68,15 +66,9 @@
- 'info.elb.health_check.target == "HTTP:80/index.html"'
- 'info.elb.health_check.timeout == 5'
- 'info.elb.health_check.unhealthy_threshold == 2'
- 'info.elb.listeners[0][0] == 80'
- 'info.elb.listeners[0][1] == 80'
- 'info.elb.listeners[0][2] == "HTTP"'
- 'info.elb.listeners[0][3] == "HTTP"'
- 'info.elb.listeners[1][0] == 443'
- 'info.elb.listeners[1][1] == 80'
- 'info.elb.listeners[1][2] == "HTTPS"'
- 'info.elb.listeners[1][3] == "HTTP"'
- 'info.elb.listeners[1][4] == "{{ elb_lb_cert }}"'
- '[80, 80, "HTTP", "HTTP"] in info.elb.listeners'
- '[8080, 8080, "HTTP", "HTTP"] in info.elb.listeners'
# ============================================================
# check ports, would be cool, but we are at the mercy of AWS
@ -113,11 +105,6 @@
- protocol: http
load_balancer_port: 80
instance_port: 80
- protocol: https
load_balancer_port: 443
instance_protocol: http
instance_port: 80
ssl_certificate_id: "{{ elb_lb_cert }}"
purge_zones: yes
health_check:
ping_protocol: http
@ -157,11 +144,6 @@
- protocol: http
load_balancer_port: 80
instance_port: 80
- protocol: https
load_balancer_port: 443
instance_protocol: http
instance_port: 80
ssl_certificate_id: "{{ elb_lb_cert }}"
purge_zones: yes
register: info
@ -170,9 +152,9 @@
- '"failed" not in info'
- 'info.changed'
- 'info.elb.status == "ok"'
- 'info.elb.zones[0] == "us-east-1b"'
- 'info.elb.zones[1] == "us-east-1c"'
- 'info.elb.zones[2] == "us-east-1d"'
- '"us-east-1b" in info.elb.zones'
- '"us-east-1c" in info.elb.zones'
- '"us-east-1d" in info.elb.zones'
# ============================================================
@ -202,9 +184,8 @@
- '"failed" not in info'
- 'info.elb.status == "ok"'
- 'info.changed'
- 'info.elb.listeners[0][0] == 80'
- 'info.elb.listeners[0][1] == 81'
- 'len(info.elb.listeners) == 1'
- '[80, 81, "HTTP", "HTTP"] in info.elb.listeners'
- 'info.elb.listeners|length == 1'
@ -225,14 +206,9 @@
- us-east-1d
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 81
- protocol: https
load_balancer_port: 443
instance_protocol: http
instance_port: 80
ssl_certificate_id: "{{ elb_lb_cert }}"
purge_listeners: yes
load_balancer_port: 8081
instance_port: 8081
purge_listeners: no
register: info
- assert:
@ -240,16 +216,9 @@
- '"failed" not in info'
- 'info.elb.status == "ok"'
- 'info.changed'
- 'info.elb.listeners[0][0] == 80'
- 'info.elb.listeners[0][1] == 80'
- 'info.elb.listeners[0][2] == "HTTP"'
- 'info.elb.listeners[0][3] == "HTTP"'
- 'info.elb.listeners[1][0] == 443'
- 'info.elb.listeners[1][1] == 80'
- 'info.elb.listeners[1][2] == "HTTPS"'
- 'info.elb.listeners[1][3] == "HTTP"'
- 'info.elb.listeners[1][4] == "{{ elb_lb_cert }}"'
- 'len(info.elb.listeners) == 2'
- '[80, 81, "HTTP", "HTTP"] in info.elb.listeners'
- '[8081, 8081, "HTTP", "HTTP"] in info.elb.listeners'
- 'info.elb.listeners|length == 2'
# ============================================================
@ -419,3 +388,21 @@
that:
- 'result.failed'
- '"No handler was ready to authenticate. 1 handlers were checked." in result.msg'
# ============================================================
- name: remove the test load balancer completely
ec2_elb_lb:
name: "{{ tag_prefix }}"
region: "{{ ec2_region }}"
state: absent
ec2_access_key: "{{ ec2_access_key }}"
ec2_secret_key: "{{ ec2_secret_key }}"
register: result
- name: assert the load balancer was removed
assert:
that:
- 'result.changed'
- 'result.elb.name == "{{tag_prefix}}"'
- 'result.elb.status == "deleted"'