Skip to content

Commit

Permalink
fixing jinja2 templating issues in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ykim-akamai committed Jan 3, 2024
1 parent e98b960 commit b5966b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions tests/integration/targets/ip_share/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@
register: ip_unshared

- name: Assert shared IPs configured.
assert:
set_fact:
ip_shared_address: "{{ instance_create.instance.ipv4[0] }}"

- assert:
that:
- ip_shared.ips[0] == '{{ instance_create.instance.ipv4[0]}}'
- ip_shared.ips[0] == ip_shared_address
- ip_already_shared.changed == false
- ip_unshared.ips == []

Expand Down
7 changes: 5 additions & 2 deletions tests/integration/targets/nodebalancer_node/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@
state: present
register: nb_node

- set_fact:
inst_ipv4_address: "{{ inst.instance.ipv4[1] }}:80"

- assert:
that:
- nb_node.changed
- nb_node.node.label == 'cool'
- nb_node.node.address == '{{ inst.instance.ipv4[1] }}:80'
- nb_node.node.address == inst_ipv4_address
- nb_node.node.mode == 'accept'
- nb_node.node.weight == 10

Expand All @@ -66,7 +69,7 @@
that:
- nb_node_update.changed
- nb_node_update.node.label == 'cool'
- nb_node_update.node.address == '{{ inst.instance.ipv4[1] }}:80'
- nb_node_update.node.address == inst_ipv4_address
- nb_node_update.node.mode == 'reject'
- nb_node_update.node.weight == 15

Expand Down

0 comments on commit b5966b6

Please sign in to comment.