Skip to content

Commit

Permalink
Add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mandar242 committed Apr 26, 2023
1 parent 923f398 commit 137a265
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions tests/integration/targets/rds_instance_modify/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,75 @@
- result.changed
- result.db_instance_identifier == "{{ modified_instance_id }}"


# Test modifying CA certificate identifier -------------------------------------------

- name: Modify the CA certificate identifier to rds-ca-ecc384-g1 - check_mode
rds_instance:
id: '{{ instance_id }}'
state: present
ca_certificate_identifier: rds-ca-ecc384-g1
register: result
check_mode: true

- name: Get curent CA certificate identifier
rds_instance_info:
db_instance_identifier: '{{ instance_id }}'
register: db_info
- name: Assert that CA certificate identifier has been modified - check_mode
assert:
that:
- result is changed
- result is not failed
- db_info.instances[0].ca_certificate_identifier != "rds-ca-ecc384-g1"

- name: Modify the CA certificate identifier to rds-ca-ecc384-g1
rds_instance:
id: '{{ instance_id }}'
state: present
ca_certificate_identifier: rds-ca-ecc384-g1
apply_immediately: true
register: result

- name: Get curent CA certificate identifier
rds_instance_info:
db_instance_identifier: '{{ instance_id }}'
register: db_info
retries: 10
delay: 10
until: db_info.instances[0].ca_certificate_identifier == "rds-ca-ecc384-g1"
- name: Assert that CA certificate identifier has been modified
assert:
that:
- result is changed
- result is not failed
- db_info.instances[0].ca_certificate_identifier == "rds-ca-ecc384-g1"

- name: Modify the CA certificate identifier to rds-ca-ecc384-g1 - Idempotent - check_mode
rds_instance:
id: '{{ instance_id }}'
state: present
ca_certificate_identifier: rds-ca-ecc384-g1
register: result
check_mode: true
- name: Assert that CA certificate identifier is not modified
assert:
that:
- result is not changed
- result is not failed

- name: Modify the CA certificate identifier to rds-ca-ecc384-g1 - Idempotent
rds_instance:
id: '{{ instance_id }}'
state: present
ca_certificate_identifier: rds-ca-ecc384-g1
register: result
- name: Assert that CA certificate identifier is not modified
assert:
that:
- result is not changed
- result is not failed

always:
- name: Delete the instance
rds_instance:
Expand Down

0 comments on commit 137a265

Please sign in to comment.