Skip to content

Commit

Permalink
Change assertions to work with newer Ansible releases
Browse files Browse the repository at this point in the history
  • Loading branch information
href committed Jan 24, 2024
1 parent d614803 commit 7fb54e9
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 123 deletions.
34 changes: 17 additions & 17 deletions tests/integration/targets/load_balancer/tasks/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
that:
- load_balancer is changed
- load_balancer.status == 'running'
- load_balancer.name == '{{ cloudscale_resource_prefix }}-test'
- load_balancer.flavor.slug == '{{ cloudscale_test_flavor_lb }}'
- load_balancer.vip_addresses[0].subnet.uuid == '{{ snet.uuid }}'
- load_balancer.zone.slug == '{{ cloudscale_test_zone }}'
- load_balancer.name == cloudscale_resource_prefix + "-test"
- load_balancer.flavor.slug == cloudscale_test_flavor_lb
- load_balancer.vip_addresses[0].subnet.uuid == snet.uuid
- load_balancer.zone.slug == cloudscale_test_zone
- load_balancer.tags.project == 'ansible-test'
- load_balancer.tags.stage == 'production'
- load_balancer.tags.sla == '24-7'
Expand All @@ -61,10 +61,10 @@
that:
- load_balancer is not changed
- load_balancer.status == 'running'
- load_balancer.name == '{{ cloudscale_resource_prefix }}-test'
- load_balancer.flavor.slug == '{{ cloudscale_test_flavor_lb }}'
- load_balancer.vip_addresses[0].subnet.uuid == '{{ snet.uuid }}'
- load_balancer.zone.slug == '{{ cloudscale_test_zone }}'
- load_balancer.name == cloudscale_resource_prefix + "-test"
- load_balancer.flavor.slug == cloudscale_test_flavor_lb
- load_balancer.vip_addresses[0].subnet.uuid == snet.uuid
- load_balancer.zone.slug == cloudscale_test_zone
- load_balancer.tags.project == 'ansible-test'
- load_balancer.tags.stage == 'production'
- load_balancer.tags.sla == '24-7'
Expand All @@ -79,9 +79,9 @@
that:
- load_balancer_default_flavor is changed
- load_balancer_default_flavor.status == 'running'
- load_balancer_default_flavor.name == '{{ cloudscale_resource_prefix }}-test2'
- load_balancer_default_flavor.flavor.slug == '{{ cloudscale_test_flavor_lb }}'
- load_balancer_default_flavor.zone.slug == '{{ cloudscale_test_zone }}'
- load_balancer_default_flavor.name == cloudscale_resource_prefix + "-test2"
- load_balancer_default_flavor.flavor.slug == cloudscale_test_flavor_lb
- load_balancer_default_flavor.zone.slug == cloudscale_test_zone

# Get LB facts
- name: Test get facts of a load balancer by name
Expand All @@ -92,7 +92,7 @@
assert:
that:
- load_balancer is not changed
- load_balancer.name == '{{ cloudscale_resource_prefix }}-test'
- load_balancer.name == cloudscale_resource_prefix + "-test"

# Update running LB
- name: Test update name and tags of a running load balancer in check mode
Expand All @@ -110,7 +110,7 @@
that:
- load_balancer is changed
- load_balancer.status == 'running'
- load_balancer.name == '{{ cloudscale_resource_prefix }}-test'
- load_balancer.name == cloudscale_resource_prefix + "-test"

- name: Test update name and tags of a running load balancer
cloudscale_ch.cloud.load_balancer:
Expand All @@ -126,8 +126,8 @@
that:
- load_balancer is changed
- load_balancer.status == 'running'
- load_balancer.name == '{{ cloudscale_resource_prefix }}-test-renamed'
- load_balancer.flavor.slug == '{{ cloudscale_test_flavor_lb }}'
- load_balancer.name == cloudscale_resource_prefix + "-test-renamed"
- load_balancer.flavor.slug == cloudscale_test_flavor_lb
- load_balancer.tags.project == 'ansible-test'
- load_balancer.tags.stage == 'staging'
- load_balancer.tags.sla == '8-5'
Expand All @@ -146,8 +146,8 @@
that:
- load_balancer is not changed
- load_balancer.status == 'running'
- load_balancer.name == '{{ cloudscale_resource_prefix }}-test-renamed'
- load_balancer.flavor.slug == '{{ cloudscale_test_flavor_lb }}'
- load_balancer.name == cloudscale_resource_prefix + "-test-renamed"
- load_balancer.flavor.slug == cloudscale_test_flavor_lb
- load_balancer.tags.project == 'ansible-test'
- load_balancer.tags.stage == 'staging'
- load_balancer.tags.sla == '8-5'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
that:
- load_balancer_health_monitor is changed
- load_balancer_health_monitor.state == 'present'
- load_balancer_health_monitor.pool.uuid == '{{ load_balancer_pool_ping.uuid }}'
- load_balancer_health_monitor.pool.uuid == load_balancer_pool_ping.uuid
- load_balancer_health_monitor.type == 'ping'
- load_balancer_health_monitor.tags.project == 'ansible-test'
- load_balancer_health_monitor.tags.stage == 'production'
Expand All @@ -50,7 +50,7 @@
that:
- load_balancer_health_monitor is not changed
- load_balancer_health_monitor.state == 'present'
- load_balancer_health_monitor.pool.uuid == '{{ load_balancer_pool_ping.uuid }}'
- load_balancer_health_monitor.pool.uuid == load_balancer_pool_ping.uuid
- load_balancer_health_monitor.type == 'ping'
- load_balancer_health_monitor.tags.project == 'ansible-test'
- load_balancer_health_monitor.tags.stage == 'production'
Expand Down Expand Up @@ -110,11 +110,11 @@
that:
- load_balancer_health_monitor is changed
- load_balancer_health_monitor.state == 'present'
- load_balancer_health_monitor.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_health_monitor.delay_s == {{ cloudscale_test_delay_lb_monitor }}
- load_balancer_health_monitor.timeout_s == {{ cloudscale_test_timeout_lb_monitor }}
- load_balancer_health_monitor.up_threshold == {{ cloudscale_test_up_threshold_lb_monitor }}
- load_balancer_health_monitor.down_threshold == {{ cloudscale_test_down_threshold_lb_monitor }}
- load_balancer_health_monitor.pool.uuid == load_balancer_pool.uuid
- load_balancer_health_monitor.delay_s == cloudscale_test_delay_lb_monitor
- load_balancer_health_monitor.timeout_s == cloudscale_test_timeout_lb_monitor
- load_balancer_health_monitor.up_threshold == cloudscale_test_up_threshold_lb_monitor
- load_balancer_health_monitor.down_threshold == cloudscale_test_down_threshold_lb_monitor
- load_balancer_health_monitor.type == 'http'
- '"200" in load_balancer_health_monitor.http.expected_codes'
- '"202" in load_balancer_health_monitor.http.expected_codes'
Expand Down Expand Up @@ -152,11 +152,11 @@
that:
- load_balancer_health_monitor is not changed
- load_balancer_health_monitor.state == 'present'
- load_balancer_health_monitor.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_health_monitor.delay_s == {{ cloudscale_test_delay_lb_monitor }}
- load_balancer_health_monitor.timeout_s == {{ cloudscale_test_timeout_lb_monitor }}
- load_balancer_health_monitor.up_threshold == {{ cloudscale_test_up_threshold_lb_monitor }}
- load_balancer_health_monitor.down_threshold == {{ cloudscale_test_down_threshold_lb_monitor }}
- load_balancer_health_monitor.pool.uuid == load_balancer_pool.uuid
- load_balancer_health_monitor.delay_s == cloudscale_test_delay_lb_monitor
- load_balancer_health_monitor.timeout_s == cloudscale_test_timeout_lb_monitor
- load_balancer_health_monitor.up_threshold == cloudscale_test_up_threshold_lb_monitor
- load_balancer_health_monitor.down_threshold == cloudscale_test_down_threshold_lb_monitor
- load_balancer_health_monitor.type == 'http'
- '"200" in load_balancer_health_monitor.http.expected_codes'
- '"202" in load_balancer_health_monitor.http.expected_codes'
Expand Down Expand Up @@ -196,11 +196,11 @@
that:
- load_balancer_health_monitor is changed
- load_balancer_health_monitor.state == 'present'
- load_balancer_health_monitor.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_health_monitor.delay_s == {{ cloudscale_test_delay_lb_monitor }}
- load_balancer_health_monitor.timeout_s == {{ cloudscale_test_timeout_lb_monitor }}
- load_balancer_health_monitor.up_threshold == {{ cloudscale_test_up_threshold_lb_monitor }}
- load_balancer_health_monitor.down_threshold == {{ cloudscale_test_down_threshold_lb_monitor }}
- load_balancer_health_monitor.pool.uuid == load_balancer_pool.uuid
- load_balancer_health_monitor.delay_s == cloudscale_test_delay_lb_monitor
- load_balancer_health_monitor.timeout_s == cloudscale_test_timeout_lb_monitor
- load_balancer_health_monitor.up_threshold == cloudscale_test_up_threshold_lb_monitor
- load_balancer_health_monitor.down_threshold == cloudscale_test_down_threshold_lb_monitor

- name: Test update timeouts for a load balancer health monitor
cloudscale_ch.cloud.load_balancer_health_monitor:
Expand All @@ -219,7 +219,7 @@
that:
- load_balancer_health_monitor is changed
- load_balancer_health_monitor.state == 'present'
- load_balancer_health_monitor.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_health_monitor.pool.uuid == load_balancer_pool.uuid
- load_balancer_health_monitor.delay_s == 2
- load_balancer_health_monitor.timeout_s == 1
- load_balancer_health_monitor.up_threshold == 2
Expand Down Expand Up @@ -252,7 +252,7 @@
that:
- load_balancer_health_monitor is not changed
- load_balancer_health_monitor.state == 'present'
- load_balancer_health_monitor.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_health_monitor.pool.uuid == load_balancer_pool.uuid
- load_balancer_health_monitor.delay_s == 2
- load_balancer_health_monitor.timeout_s == 1
- load_balancer_health_monitor.up_threshold == 2
Expand Down Expand Up @@ -289,7 +289,7 @@
that:
- load_balancer_health_monitor is changed
- load_balancer_health_monitor.state == 'present'
- load_balancer_health_monitor.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_health_monitor.pool.uuid == load_balancer_pool.uuid
- load_balancer_health_monitor.http.method == 'GET'

- name: Test update HTTP method of a load balancer health monitor
Expand Down Expand Up @@ -318,7 +318,7 @@
that:
- load_balancer_health_monitor is changed
- load_balancer_health_monitor.state == 'present'
- load_balancer_health_monitor.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_health_monitor.pool.uuid == load_balancer_pool.uuid
- load_balancer_health_monitor.delay_s == 2
- load_balancer_health_monitor.timeout_s == 1
- load_balancer_health_monitor.up_threshold == 2
Expand Down Expand Up @@ -360,7 +360,7 @@
that:
- load_balancer_health_monitor is not changed
- load_balancer_health_monitor.state == 'present'
- load_balancer_health_monitor.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_health_monitor.pool.uuid == load_balancer_pool.uuid
- load_balancer_health_monitor.delay_s == 2
- load_balancer_health_monitor.timeout_s == 1
- load_balancer_health_monitor.up_threshold == 2
Expand All @@ -387,7 +387,7 @@
assert:
that:
- load_balancer_health_monitor is changed
- load_balancer_health_monitor.uuid == '{{ load_balancer_health_monitor.uuid }}'
- load_balancer_health_monitor.uuid == load_balancer_health_monitor.uuid

- name: Test load balancer health monitor deletion by UUID
cloudscale_ch.cloud.load_balancer_health_monitor:
Expand Down
80 changes: 40 additions & 40 deletions tests/integration/targets/load_balancer_listener/tasks/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
assert:
that:
- load_balancer_listener is changed
- load_balancer_listener.name == '{{ cloudscale_resource_prefix }}-test'
- load_balancer_listener.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_listener.protocol == '{{ cloudscale_test_listener_protocol }}'
- load_balancer_listener.protocol_port == {{ cloudscale_test_protocol_port }}
- "'{{ cloudscale_test_allowed_cidr_v4 }}' in load_balancer_listener.allowed_cidrs"
- "'{{ cloudscale_test_allowed_cidr_v6 }}' in load_balancer_listener.allowed_cidrs"
- load_balancer_listener.timeout_client_data_ms == {{ cloudscale_test_timeout_client_data_ms }}
- load_balancer_listener.timeout_member_connect_ms == {{ cloudscale_test_timeout_member_connect_ms }}
- load_balancer_listener.timeout_member_data_ms == {{ cloudscale_test_timeout_member_data_ms }}
- load_balancer_listener.name == cloudscale_resource_prefix + "-test"
- load_balancer_listener.pool.uuid == load_balancer_pool.uuid
- load_balancer_listener.protocol == cloudscale_test_listener_protocol
- load_balancer_listener.protocol_port == cloudscale_test_protocol_port
- cloudscale_test_allowed_cidr_v4 in load_balancer_listener.allowed_cidrs
- cloudscale_test_allowed_cidr_v6 in load_balancer_listener.allowed_cidrs
- load_balancer_listener.timeout_client_data_ms == cloudscale_test_timeout_client_data_ms
- load_balancer_listener.timeout_member_connect_ms == cloudscale_test_timeout_member_connect_ms
- load_balancer_listener.timeout_member_data_ms == cloudscale_test_timeout_member_data_ms
- load_balancer_listener.tags.project == 'ansible-test'
- load_balancer_listener.tags.stage == 'production'
- load_balancer_listener.tags.sla == '24-7'
Expand All @@ -79,15 +79,15 @@
assert:
that:
- load_balancer_listener is not changed
- load_balancer_listener.name == '{{ cloudscale_resource_prefix }}-test'
- load_balancer_listener.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_listener.protocol == '{{ cloudscale_test_listener_protocol }}'
- load_balancer_listener.protocol_port == {{ cloudscale_test_protocol_port }}
- "'{{ cloudscale_test_allowed_cidr_v4 }}' in load_balancer_listener.allowed_cidrs"
- "'{{ cloudscale_test_allowed_cidr_v6 }}' in load_balancer_listener.allowed_cidrs"
- load_balancer_listener.timeout_client_data_ms == {{ cloudscale_test_timeout_client_data_ms }}
- load_balancer_listener.timeout_member_connect_ms == {{ cloudscale_test_timeout_member_connect_ms }}
- load_balancer_listener.timeout_member_data_ms == {{ cloudscale_test_timeout_member_data_ms }}
- load_balancer_listener.name == cloudscale_resource_prefix + "-test"
- load_balancer_listener.pool.uuid == load_balancer_pool.uuid
- load_balancer_listener.protocol == cloudscale_test_listener_protocol
- load_balancer_listener.protocol_port == cloudscale_test_protocol_port
- cloudscale_test_allowed_cidr_v4 in load_balancer_listener.allowed_cidrs
- cloudscale_test_allowed_cidr_v6 in load_balancer_listener.allowed_cidrs
- load_balancer_listener.timeout_client_data_ms == cloudscale_test_timeout_client_data_ms
- load_balancer_listener.timeout_member_connect_ms == cloudscale_test_timeout_member_connect_ms
- load_balancer_listener.timeout_member_data_ms == cloudscale_test_timeout_member_data_ms
- load_balancer_listener.tags.project == 'ansible-test'
- load_balancer_listener.tags.stage == 'production'
- load_balancer_listener.tags.sla == '24-7'
Expand Down Expand Up @@ -127,15 +127,15 @@
assert:
that:
- load_balancer_listener is changed
- load_balancer_listener.name == '{{ cloudscale_resource_prefix }}-test'
- load_balancer_listener.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_listener.protocol == '{{ cloudscale_test_listener_protocol }}'
- load_balancer_listener.protocol_port == {{ cloudscale_test_protocol_port }}
- "'{{ cloudscale_test_allowed_cidr_v4 }}' in load_balancer_listener.allowed_cidrs"
- "'{{ cloudscale_test_allowed_cidr_v6 }}' in load_balancer_listener.allowed_cidrs"
- load_balancer_listener.timeout_client_data_ms == {{ cloudscale_test_timeout_client_data_ms }}
- load_balancer_listener.timeout_member_connect_ms == {{ cloudscale_test_timeout_member_connect_ms }}
- load_balancer_listener.timeout_member_data_ms == {{ cloudscale_test_timeout_member_data_ms }}
- load_balancer_listener.name == cloudscale_resource_prefix + "-test"
- load_balancer_listener.pool.uuid == load_balancer_pool.uuid
- load_balancer_listener.protocol == cloudscale_test_listener_protocol
- load_balancer_listener.protocol_port == cloudscale_test_protocol_port
- cloudscale_test_allowed_cidr_v4 in load_balancer_listener.allowed_cidrs
- cloudscale_test_allowed_cidr_v6 in load_balancer_listener.allowed_cidrs
- load_balancer_listener.timeout_client_data_ms == cloudscale_test_timeout_client_data_ms
- load_balancer_listener.timeout_member_connect_ms == cloudscale_test_timeout_member_connect_ms
- load_balancer_listener.timeout_member_data_ms == cloudscale_test_timeout_member_data_ms
- load_balancer_listener.tags.project == 'ansible-test'
- load_balancer_listener.tags.stage == 'production'
- load_balancer_listener.tags.sla == '24-7'
Expand All @@ -162,13 +162,13 @@
assert:
that:
- load_balancer_listener is changed
- load_balancer_listener.name == '{{ cloudscale_resource_prefix }}-test-renamed'
- load_balancer_listener.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_listener.protocol == '{{ cloudscale_test_listener_protocol }}'
- load_balancer_listener.protocol_port == {{ cloudscale_test_protocol_port }}
- "'{{ cloudscale_test_allowed_cidr_v4 }}' not in load_balancer_listener.allowed_cidrs"
- load_balancer_listener.name == cloudscale_resource_prefix + "-test-renamed"
- load_balancer_listener.pool.uuid == load_balancer_pool.uuid
- load_balancer_listener.protocol == cloudscale_test_listener_protocol
- load_balancer_listener.protocol_port == cloudscale_test_protocol_port
- cloudscale_test_allowed_cidr_v4 not in load_balancer_listener.allowed_cidrs
- "'192.168.1.0/24' in load_balancer_listener.allowed_cidrs"
- "'{{ cloudscale_test_allowed_cidr_v6 }}' in load_balancer_listener.allowed_cidrs"
- cloudscale_test_allowed_cidr_v6 in load_balancer_listener.allowed_cidrs
- load_balancer_listener.timeout_client_data_ms == 40001
- load_balancer_listener.timeout_member_connect_ms == 4001
- load_balancer_listener.timeout_member_data_ms == 40001
Expand Down Expand Up @@ -198,13 +198,13 @@
assert:
that:
- load_balancer_listener is not changed
- load_balancer_listener.name == '{{ cloudscale_resource_prefix }}-test-renamed'
- load_balancer_listener.pool.uuid == '{{ load_balancer_pool.uuid }}'
- load_balancer_listener.protocol == '{{ cloudscale_test_listener_protocol }}'
- load_balancer_listener.protocol_port == {{ cloudscale_test_protocol_port }}
- "'{{ cloudscale_test_allowed_cidr_v4 }}' not in load_balancer_listener.allowed_cidrs"
- load_balancer_listener.name == cloudscale_resource_prefix + "-test-renamed"
- load_balancer_listener.pool.uuid == load_balancer_pool.uuid
- load_balancer_listener.protocol == cloudscale_test_listener_protocol
- load_balancer_listener.protocol_port == cloudscale_test_protocol_port
- cloudscale_test_allowed_cidr_v4 not in load_balancer_listener.allowed_cidrs
- "'192.168.1.0/24' in load_balancer_listener.allowed_cidrs"
- "'{{ cloudscale_test_allowed_cidr_v6 }}' in load_balancer_listener.allowed_cidrs"
- cloudscale_test_allowed_cidr_v6 in load_balancer_listener.allowed_cidrs
- load_balancer_listener.timeout_client_data_ms == 40001
- load_balancer_listener.timeout_member_connect_ms == 4001
- load_balancer_listener.timeout_member_data_ms == 40001
Expand All @@ -223,7 +223,7 @@
assert:
that:
- load_balancer_listener is changed
- load_balancer_listener.name == '{{ cloudscale_resource_prefix }}-test-renamed'
- load_balancer_listener.name == cloudscale_resource_prefix + "-test-renamed"

- name: Test load balancer listener deletion by name
cloudscale_ch.cloud.load_balancer_listener:
Expand Down
Loading

0 comments on commit 7fb54e9

Please sign in to comment.