Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
LBGarber committed Jun 9, 2022
1 parent 7b95ec0 commit e7c6aa8
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions tests/integration/targets/nodebalancer_basic/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,65 @@
- create_empty_nodebalancer.changed
- create_empty_nodebalancer.configs|length == 0

- name: Add NodeBalancer config
linode.cloud.nodebalancer:
api_token: '{{ api_token }}'
label: '{{ create_empty_nodebalancer.node_balancer.label }}'
region: us-east
client_conn_throttle: 6
state: present
configs:
- port: 80
protocol: http
algorithm: roundrobin
register: create_config

- assert:
that:
- create_config.configs|length == 1
- create_config.configs[0].port == 80

- name: Update NodeBalancer config
linode.cloud.nodebalancer:
api_token: '{{ api_token }}'
label: '{{ create_empty_nodebalancer.node_balancer.label }}'
region: us-east
client_conn_throttle: 6
state: present
configs:
- port: 80
protocol: http
algorithm: roundrobin
check_timeout: 1
register: update_config

- assert:
that:
- update_config.configs|length == 1
- update_config.configs[0].check_timeout == 1

- update_config.changed

- name: Recreate NodeBalancer config
linode.cloud.nodebalancer:
api_token: '{{ api_token }}'
label: '{{ create_empty_nodebalancer.node_balancer.label }}'
region: us-east
client_conn_throttle: 6
state: present
configs:
- port: 80
protocol: http
algorithm: roundrobin
check_timeout: 1
recreate: true
register: recreate_config

- assert:
that:
- recreate_config.changed
- update_config.configs|length == 1

always:
- ignore_errors: yes
block:
Expand Down

0 comments on commit e7c6aa8

Please sign in to comment.