From 8a51678ba6710badbfeb6f635133b44babd4dc95 Mon Sep 17 00:00:00 2001 From: Mandar Kulkarni Date: Wed, 26 Apr 2023 22:22:43 -0700 Subject: [PATCH] fix integration tests --- .../rds_cluster_restore/tasks/main.yaml | 8 ++-- .../rds_instance_modify/tasks/main.yml | 48 +++++++------------ 2 files changed, 22 insertions(+), 34 deletions(-) diff --git a/tests/integration/targets/rds_cluster_restore/tasks/main.yaml b/tests/integration/targets/rds_cluster_restore/tasks/main.yaml index 8af3035210b..b1934f3223b 100644 --- a/tests/integration/targets/rds_cluster_restore/tasks/main.yaml +++ b/tests/integration/targets/rds_cluster_restore/tasks/main.yaml @@ -47,7 +47,7 @@ - "'engine' in _result_create_source_db_cluster" - _result_create_source_db_cluster.engine == "{{ engine }}" - "'engine_mode' in _result_create_source_db_cluster" - - _result_create_source_db_cluster.engine_mode == "provisioned" + - _result_create_source_db_cluster.engine_mode == "serverless" - "'engine_version' in _result_create_source_db_cluster" - "'master_username' in _result_create_source_db_cluster" - _result_create_source_db_cluster.master_username == "{{ username }}" @@ -55,7 +55,7 @@ - _result_create_source_db_cluster.port == {{ port }} - "'status' in _result_create_source_db_cluster" - _result_create_source_db_cluster.status == 'available' - - _result_create_source_db_cluster.storage_encrypted == false + - _result_create_source_db_cluster.storage_encrypted == true - "'tags' in _result_create_source_db_cluster" - "'vpc_security_groups' in _result_create_source_db_cluster" @@ -89,7 +89,7 @@ - "'engine' in _result_restored_db_cluster" - _result_restored_db_cluster.engine == "{{ engine }}" - "'engine_mode' in _result_restored_db_cluster" - - _result_restored_db_cluster.engine_mode == "provisioned" + - _result_restored_db_cluster.engine_mode == "serverless" - "'engine_version' in _result_restored_db_cluster" - "'master_username' in _result_restored_db_cluster" - _result_restored_db_cluster.master_username == "{{ username }}" @@ -158,7 +158,7 @@ - "'engine' in _result_restored_db_cluster" - _result_restored_db_cluster.engine == "{{ engine }}" - "'engine_mode' in _result_restored_db_cluster" - - _result_restored_db_cluster.engine_mode == "provisioned" + - _result_restored_db_cluster.engine_mode == "serverless" - "'engine_version' in _result_restored_db_cluster" - "'master_username' in _result_restored_db_cluster" - _result_restored_db_cluster.master_username == "{{ username }}" diff --git a/tests/integration/targets/rds_instance_modify/tasks/main.yml b/tests/integration/targets/rds_instance_modify/tasks/main.yml index 62110e44ff5..7edc5e9048f 100644 --- a/tests/integration/targets/rds_instance_modify/tasks/main.yml +++ b/tests/integration/targets/rds_instance_modify/tasks/main.yml @@ -198,15 +198,22 @@ - name: Modify the CA certificate identifier to rds-ca-ecc384-g1 - check_mode rds_instance: - id: '{{ instance_id }}' state: present + db_instance_identifier: '{{ modified_instance_id }}' + allow_major_version_upgrade: true ca_certificate_identifier: rds-ca-ecc384-g1 + apply_immediately: true + tags: + Name: '{{ modified_instance_id }}' + Created_by: Ansible rds_instance tests register: result check_mode: true + vars: + ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}" - name: Get curent CA certificate identifier rds_instance_info: - db_instance_identifier: '{{ instance_id }}' + db_instance_identifier: '{{ modified_instance_id }}' register: db_info - name: Assert that CA certificate identifier has been modified - check_mode assert: @@ -217,17 +224,23 @@ - name: Modify the CA certificate identifier to rds-ca-ecc384-g1 rds_instance: - id: '{{ instance_id }}' state: present + db_instance_identifier: '{{ modified_instance_id }}' + allow_major_version_upgrade: true ca_certificate_identifier: rds-ca-ecc384-g1 apply_immediately: true + tags: + Name: '{{ modified_instance_id }}' + Created_by: Ansible rds_instance tests register: result + vars: + ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}" - name: Get curent CA certificate identifier rds_instance_info: - db_instance_identifier: '{{ instance_id }}' + db_instance_identifier: '{{ modified_instance_id }}' register: db_info - retries: 10 + retries: 20 delay: 10 until: db_info.instances[0].ca_certificate_identifier == "rds-ca-ecc384-g1" - name: Assert that CA certificate identifier has been modified @@ -237,31 +250,6 @@ - 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: