diff --git a/tests/integration/targets/ntnx_acps/tasks/delete_acp.yml b/tests/integration/targets/ntnx_acps/tasks/delete_acp.yml index cb5c3d188..5183a9bf3 100644 --- a/tests/integration/targets/ntnx_acps/tasks/delete_acp.yml +++ b/tests/integration/targets/ntnx_acps/tasks/delete_acp.yml @@ -43,6 +43,24 @@ fail_msg: " Unable to Create ACP all specfactions " success_msg: " ACP with all specfactions created successfully " +- name: Delete acp with check mode + ntnx_acps: + state: absent + acp_uuid: "{{ result.response.metadata.uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Acp with uuid:{{ result.response.metadata.uuid }} will be deleted." + - output.acp_uuid == "{{ result.response.metadata.uuid }}" + fail_msg: "Acp Policy been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete acp ntnx_acps: diff --git a/tests/integration/targets/ntnx_address_groups/tasks/delete.yml b/tests/integration/targets/ntnx_address_groups/tasks/delete.yml index 7449a209a..123c3c4df 100644 --- a/tests/integration/targets/ntnx_address_groups/tasks/delete.yml +++ b/tests/integration/targets/ntnx_address_groups/tasks/delete.yml @@ -32,6 +32,23 @@ success_msg: "address group created susccessfully" ################################################################################################### +- name: Delete address group with check mode + ntnx_address_groups: + state: absent + address_group_uuid: "{{ test_ag.address_group_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Address group with uuid:{{ test_ag.address_group_uuid }} will be deleted." + - output.address_group_uuid == "{{ test_ag.address_group_uuid }}" + fail_msg: "Address group Policy been deleted successfully within check_mode" + success_msg: "Returned As expected" - name: delete address group ntnx_address_groups: diff --git a/tests/integration/targets/ntnx_categories/tasks/all_operations.yml b/tests/integration/targets/ntnx_categories/tasks/all_operations.yml index 655505426..a3876ae4b 100644 --- a/tests/integration/targets/ntnx_categories/tasks/all_operations.yml +++ b/tests/integration/targets/ntnx_categories/tasks/all_operations.yml @@ -131,6 +131,24 @@ fail_msg: "Fail: unable to update existing category by deleting all values " success_msg: "Passed: update existing category by deleting all values finished successfully" ################# +- name: Delete category with check mode + ntnx_categories: + state: absent + name: "{{ first_category.name }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Category with name:{{ first_category.name }} will be deleted." + - output.category_name == "{{ first_category.name }}" + fail_msg: "category been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delte the category ntnx_categories: state: "absent" diff --git a/tests/integration/targets/ntnx_foundation_image_upload/tasks/upload.yml b/tests/integration/targets/ntnx_foundation_image_upload/tasks/upload.yml index 3cc90a7f5..e7ab67761 100644 --- a/tests/integration/targets/ntnx_foundation_image_upload/tasks/upload.yml +++ b/tests/integration/targets/ntnx_foundation_image_upload/tasks/upload.yml @@ -26,6 +26,25 @@ fail_msg: " Fail : unable to upload image with nos installer_type " success_msg: "Succes: upload image with nos installer_type successfully " +- name: Delete Image with nos installer_type with check mode + ntnx_foundation_image_upload: + state: absent + filename: "integration-test-ntnx-package.tar.gz" + installer_type: nos + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Image with name:integration-test-ntnx-package.tar.gz will be deleted." + - output.image_name == "integration-test-ntnx-package.tar.gz" + fail_msg: "Image with nos installer_type been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete Image with nos installer_type ntnx_foundation_image_upload: state: absent diff --git a/tests/integration/targets/ntnx_image_placement_policy/tasks/delete.yml b/tests/integration/targets/ntnx_image_placement_policy/tasks/delete.yml index 871de54e2..1e6ff764c 100644 --- a/tests/integration/targets/ntnx_image_placement_policy/tasks/delete.yml +++ b/tests/integration/targets/ntnx_image_placement_policy/tasks/delete.yml @@ -23,6 +23,24 @@ fail_msg: "Unable to create image placement policy with minimal spec" success_msg: "Image placement policy with minimal spec created successfully" +- name: Delete image with check mode + ntnx_image_placement_policy: + state: absent + policy_uuid: "{{ result.response.metadata.uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Placement policy with uuid:{{ result.response.metadata.uuid }} will be deleted." + - output.policy_uuid == "{{ result.response.metadata.uuid }}" + fail_msg: "Image Policy been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete image placement policy created above ntnx_image_placement_policy: state: absent diff --git a/tests/integration/targets/ntnx_images/tasks/delete.yml b/tests/integration/targets/ntnx_images/tasks/delete.yml index 0f9d360be..5e3b4f86c 100644 --- a/tests/integration/targets/ntnx_images/tasks/delete.yml +++ b/tests/integration/targets/ntnx_images/tasks/delete.yml @@ -20,6 +20,25 @@ fail_msg: "Unable to create image with minimal spec for delete tests" success_msg: "Image with minimal spec created successfully" + +- name: Delete image with check mode + ntnx_images: + state: absent + image_uuid: "{{ result.response.metadata.uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Image with uuid:{{ result.response.metadata.uuid }} will be deleted." + - output.uuid == "{{ result.response.metadata.uuid }}" + fail_msg: "Image been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete image created above ntnx_images: state: absent diff --git a/tests/integration/targets/ntnx_karbon_clusters_and_info/tasks/crud.yml b/tests/integration/targets/ntnx_karbon_clusters_and_info/tasks/crud.yml index 7902da501..7ff1b83d1 100644 --- a/tests/integration/targets/ntnx_karbon_clusters_and_info/tasks/crud.yml +++ b/tests/integration/targets/ntnx_karbon_clusters_and_info/tasks/crud.yml @@ -147,6 +147,23 @@ fail_msg: " Fail: unable to create DEV cluster with Flannel network provider" success_msg: " Pass: create DEV cluster with Flannel network provider successfully " ############################# +- name: Delete Cluster with check mode + ntnx_karbon_clusters: + state: absent + name: "{{ result.response.name }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Cluster with name:{{ result.response.name }} will be deleted." + fail_msg: "Cluster been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: delete dev cluster with Flannel network provider ntnx_karbon_clusters: state: absent @@ -163,7 +180,7 @@ - result.response.status == "SUCCEEDED" fail_msg: " Fail: unable to delete dev cluster with Flannel network provider" success_msg: " Pass: delete dev cluster with Flannel network provider finished successfully" -############################# +############################ - name: create DEV cluster with Calico network provider ntnx_karbon_clusters: cluster: @@ -442,6 +459,26 @@ fail_msg: "Fail: Unable to update pool by decreasing cpu,memory_gb,num_instances and add remove labels " success_msg: "Passed: update pool by decreasing cpu,memory_gb,num_instances and add remove labels finished successfully " ################################ +- name: Delete pool with check mode + ntnx_karbon_clusters_node_pools: + state: absent + node_pool_name: "{{node1_name}}" + cluster_name: "{{karbon_name}}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Pool with name:{{ node1_name }} will be deleted." + - output.cluster_name == "{{karbon_name}}" + - output.node_pool_name == "{{node1_name}}" + fail_msg: "pool been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: delete pool ntnx_karbon_clusters_node_pools: state: absent diff --git a/tests/integration/targets/ntnx_karbon_registries/tasks/create.yml b/tests/integration/targets/ntnx_karbon_registries/tasks/create.yml index 292d7cf16..f71415b0a 100644 --- a/tests/integration/targets/ntnx_karbon_registries/tasks/create.yml +++ b/tests/integration/targets/ntnx_karbon_registries/tasks/create.yml @@ -87,6 +87,23 @@ fail_msg: "Fail: unable to create registry with username and password" success_msg: "Pass: create registry with username and password finished successfully" ############################################################### +- name: Delete registry with check mode + ntnx_karbon_registries: + state: absent + name: "{{ registry_name }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Registry with name:{{ registry_name }} will be deleted." + fail_msg: "registry been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: delete registry ntnx_karbon_registries: name: "{{registry_name}}" diff --git a/tests/integration/targets/ntnx_ndb_clusters/tasks/CRUD.yml b/tests/integration/targets/ntnx_ndb_clusters/tasks/CRUD.yml index 405e547c7..482a7306d 100644 --- a/tests/integration/targets/ntnx_ndb_clusters/tasks/CRUD.yml +++ b/tests/integration/targets/ntnx_ndb_clusters/tasks/CRUD.yml @@ -319,6 +319,23 @@ success_msg: "module errored out correctly when incorrect name is given" ################################################################ +- name: Delete Cluster with check mode + ntnx_ndb_clusters: + state: absent + uuid: "{{ todelete }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Cluster with uuid:{{ todelete }} will be deleted." + - output.cluster_uuid == "{{ todelete }}" + fail_msg: "Cluster been deleted successfully within check_mode" + success_msg: "Returned As expected" - name: delete cluster ntnx_ndb_clusters: diff --git a/tests/integration/targets/ntnx_ndb_database_clones/tasks/clones.yml b/tests/integration/targets/ntnx_ndb_database_clones/tasks/clones.yml index 899853d9e..72947d743 100644 --- a/tests/integration/targets/ntnx_ndb_database_clones/tasks/clones.yml +++ b/tests/integration/targets/ntnx_ndb_database_clones/tasks/clones.yml @@ -518,6 +518,24 @@ fail_msg: "creation of spec for unregistration failed" success_msg: "spec for unregistration created successfully" +- name: Delete clone db with check mode + ntnx_ndb_database_clones: + state: absent + uuid: "{{clone_uuid}}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Db clone with uuid:{{ clone_uuid }} will be deleted." + - output.uuid == "{{ clone_uuid }}" + fail_msg: "clone db been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: delete clone db ntnx_ndb_database_clones: state: "absent" diff --git a/tests/integration/targets/ntnx_ndb_databases_actions/tasks/all_actions.yml b/tests/integration/targets/ntnx_ndb_databases_actions/tasks/all_actions.yml index c75d79436..05b0c8038 100644 --- a/tests/integration/targets/ntnx_ndb_databases_actions/tasks/all_actions.yml +++ b/tests/integration/targets/ntnx_ndb_databases_actions/tasks/all_actions.yml @@ -644,6 +644,26 @@ success_msg: "databases added to database instance successfully" +- name: remove databases in database instance with check mode + ntnx_ndb_linked_databases: + state: absent + db_instance_uuid: "{{db_uuid}}" + database_uuid: "{{linked_databases.test1}}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Database with uuid:{{ db_uuid }} will be removed." + - output.db_uuid == "{{ db_uuid }}" + - output.db_instance_uuid == "{{ linked_databases.test1 }}" + fail_msg: " Remove databases in database instance within check_mode" + success_msg: "Returned As expected" + - name: remove databases in database instance ntnx_ndb_linked_databases: state: "absent" diff --git a/tests/integration/targets/ntnx_ndb_db_server_vms/tasks/crud.yml b/tests/integration/targets/ntnx_ndb_db_server_vms/tasks/crud.yml index 60f07a1c4..398c74ff5 100644 --- a/tests/integration/targets/ntnx_ndb_db_server_vms/tasks/crud.yml +++ b/tests/integration/targets/ntnx_ndb_db_server_vms/tasks/crud.yml @@ -939,6 +939,23 @@ db_server_uuid: "{{result.uuid}}" ################################### DB server VM Delete test ############################# +- name: Delete db server vm with check mode + ntnx_ndb_db_server_vms: + state: absent + uuid: "{{ db_server_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Db server with uuid:{{ db_server_uuid }} will be deleted." + - output.uuid == "{{ db_server_uuid }}" + fail_msg: "db server vm been deleted successfully within check_mode" + success_msg: "Returned As expected" - name: unregister db server vm diff --git a/tests/integration/targets/ntnx_ndb_maintenance_windows/tasks/crud.yml b/tests/integration/targets/ntnx_ndb_maintenance_windows/tasks/crud.yml index 15f1db254..9a036216d 100644 --- a/tests/integration/targets/ntnx_ndb_maintenance_windows/tasks/crud.yml +++ b/tests/integration/targets/ntnx_ndb_maintenance_windows/tasks/crud.yml @@ -314,6 +314,23 @@ ############################################## delete tests #################################### +- name: Delete window with check mode + ntnx_ndb_maintenance_window: + state: absent + uuid: "{{ window1_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Window with uuid:{{ window1_uuid }} will be deleted." + - output.uuid == "{{ window1_uuid }}" + fail_msg: "window been deleted successfully within check_mode" + success_msg: "Returned As expected" - name: delete window 1 ntnx_ndb_maintenance_window: diff --git a/tests/integration/targets/ntnx_ndb_profiles/tasks/compute.yml b/tests/integration/targets/ntnx_ndb_profiles/tasks/compute.yml index 0f3521d25..c70653bd3 100644 --- a/tests/integration/targets/ntnx_ndb_profiles/tasks/compute.yml +++ b/tests/integration/targets/ntnx_ndb_profiles/tasks/compute.yml @@ -147,6 +147,24 @@ fail_msg: "Fail: unable to verify unpublish flow in compute profile " success_msg: "Pass: verify unpublish flow in compute profile finished successfully" ################################################################ +- name: Delete profiles with check mode + ntnx_ndb_profiles: + state: absent + profile_uuid: "{{ todelete[0] }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Profile with uuid:{{ todelete[0] }} will be deleted." + - output.uuid == "{{ todelete[0] }}" + fail_msg: "Profile been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete all created cmpute profiles ntnx_ndb_profiles: state: absent diff --git a/tests/integration/targets/ntnx_ndb_slas/tasks/CRUD.yml b/tests/integration/targets/ntnx_ndb_slas/tasks/CRUD.yml index 9783b72a2..ff899de86 100644 --- a/tests/integration/targets/ntnx_ndb_slas/tasks/CRUD.yml +++ b/tests/integration/targets/ntnx_ndb_slas/tasks/CRUD.yml @@ -252,6 +252,25 @@ success_msg: "module errored out correctly when incorrect name is given" ######################################################################## Delete flow ################################################# + +- name: Delete Sla with check mode + ntnx_ndb_slas: + state: absent + sla_uuid: "{{ todelete[0] }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Sla with uuid:{{ todelete[0] }} will be deleted." + - output.uuid == "{{ todelete[0] }}" + fail_msg: "Sla been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: verify slas delete flow ntnx_ndb_slas: state: absent diff --git a/tests/integration/targets/ntnx_ndb_tags/tasks/crud.yml b/tests/integration/targets/ntnx_ndb_tags/tasks/crud.yml index 82f41e5c9..d34d68e15 100644 --- a/tests/integration/targets/ntnx_ndb_tags/tasks/crud.yml +++ b/tests/integration/targets/ntnx_ndb_tags/tasks/crud.yml @@ -420,6 +420,24 @@ fail_msg: "Unable to delete tag" success_msg: "tag deleted successfully" +- name: Delete Tag with check mode + ntnx_ndb_tags: + state: absent + uuid: "{{ db_server_tag_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Tag with uuid:{{ db_server_tag_uuid}} will be deleted." + - output.uuid == "{{ db_server_tag_uuid }}" + fail_msg: "Tag been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: delete the database server based tag ntnx_ndb_tags: diff --git a/tests/integration/targets/ntnx_ndb_time_machines_with_multi_clusters/tasks/data_access_management_and_snapshots.yml b/tests/integration/targets/ntnx_ndb_time_machines_with_multi_clusters/tasks/data_access_management_and_snapshots.yml index 2cce408d1..0d7873b61 100644 --- a/tests/integration/targets/ntnx_ndb_time_machines_with_multi_clusters/tasks/data_access_management_and_snapshots.yml +++ b/tests/integration/targets/ntnx_ndb_time_machines_with_multi_clusters/tasks/data_access_management_and_snapshots.yml @@ -195,6 +195,26 @@ success_msg: "snapshot replicated successfully" ####################### +- name: Delete time machine with check mode + ntnx_ndb_time_machine_clusters: + state: absent + time_machine_uuid: "{{ time_machine.uuid }}" + cluster: + uuid: "{{cluster.cluster2.uuid}}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Cluster with uuid:{{ time_machine.uuid}} will be deleted from Time Machine." + - output.time_machine_uuid == "{{ time_machine.uuid }}" + - output.cluster_uuid == "{{cluster.cluster2.uuid}}" + fail_msg: "Time machine been deleted successfully within check_mode" + success_msg: "Returned As expected" - name: delete time machine ntnx_ndb_time_machine_clusters: diff --git a/tests/integration/targets/ntnx_ndb_vlans/tasks/create_vlans.yml b/tests/integration/targets/ntnx_ndb_vlans/tasks/create_vlans.yml index 79089f56b..2b20dd37c 100644 --- a/tests/integration/targets/ntnx_ndb_vlans/tasks/create_vlans.yml +++ b/tests/integration/targets/ntnx_ndb_vlans/tasks/create_vlans.yml @@ -412,6 +412,23 @@ # success_msg: "pass: update ndb_stretched subnet_mask, gateway finished successfully" ################################################################ +- name: Delete vlan with check mode + ntnx_ndb_vlans: + state: absent + vlan_uuid: "{{ result.vlan_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Vlan with uuid:{{ result.vlan_uuid }} will be deleted." + - output.uuid == "{{ result.vlan_uuid }}" + fail_msg: "vlan has been deleted successfully within check_mode" + success_msg: "Returned As expected" - name: Delete all created vlan's ntnx_ndb_vlans: diff --git a/tests/integration/targets/ntnx_projects/tasks/delete_project.yml b/tests/integration/targets/ntnx_projects/tasks/delete_project.yml index e1fc273be..be0799084 100644 --- a/tests/integration/targets/ntnx_projects/tasks/delete_project.yml +++ b/tests/integration/targets/ntnx_projects/tasks/delete_project.yml @@ -16,6 +16,23 @@ fail_msg: "Unable to create project with minimal spec" success_msg: "Project with minimal spec created successfully" +- name: Delete project with check mode + ntnx_projects: + state: absent + project_uuid: "{{ result.project_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Project with uuid:{{ result.project_uuid }} will be deleted." + - output.uuid == "{{ result.project_uuid }}" + fail_msg: "Project has been deleted successfully within check_mode" + success_msg: "Returned As expected" - name: Delete created project ntnx_projects: state: absent diff --git a/tests/integration/targets/ntnx_protection_rules/tasks/protection_rules.yml b/tests/integration/targets/ntnx_protection_rules/tasks/protection_rules.yml index 0571559ca..477cee710 100644 --- a/tests/integration/targets/ntnx_protection_rules/tasks/protection_rules.yml +++ b/tests/integration/targets/ntnx_protection_rules/tasks/protection_rules.yml @@ -341,6 +341,23 @@ ############################################################## DELETE Protection Policy Tests ################################################################## +- name: Delete protection with check mode + ntnx_protection_rules: + state: absent + rule_uuid: "{{ result.rule_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Role with uuid:{{ result.rule_uuid}} will be deleted." + - output.rule_uuid == "{{ result.rule_uuid }}" + fail_msg: "protection policy been deleted successfully within check_mode" + success_msg: "Returned As expected" - name: Delete created protection policy ntnx_protection_rules: diff --git a/tests/integration/targets/ntnx_recovery_plans_and_jobs/tasks/crud.yml b/tests/integration/targets/ntnx_recovery_plans_and_jobs/tasks/crud.yml index baa5ec94b..61b337eba 100644 --- a/tests/integration/targets/ntnx_recovery_plans_and_jobs/tasks/crud.yml +++ b/tests/integration/targets/ntnx_recovery_plans_and_jobs/tasks/crud.yml @@ -673,6 +673,24 @@ success_msg: "Cleanup job run successfully" ############################################################### Delete Recovery Plan Test########################################################################################### +- name: Delete Recovery plan with check mode + ntnx_recovery_plans: + state: absent + plan_uuid: "{{ recovery_plan.plan_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Recovery plan with uuid:{{ recovery_plan.plan_uuid }} will be deleted." + - output.plan_uuid == "{{ recovery_plan.plan_uuid }}" + fail_msg: "Recovery plan has been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete recovery plan ntnx_recovery_plans: diff --git a/tests/integration/targets/ntnx_roles/tasks/delete.yml b/tests/integration/targets/ntnx_roles/tasks/delete.yml index 098c0fdeb..d3f23f548 100644 --- a/tests/integration/targets/ntnx_roles/tasks/delete.yml +++ b/tests/integration/targets/ntnx_roles/tasks/delete.yml @@ -31,6 +31,23 @@ success_msg: "Roles with given permissions created susccessfully" ################################################################################################### +- name: Delete rule with check mode + ntnx_roles: + state: absent + role_uuid: "{{ test_role.role_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Role with uuid:{{ test_role.role_uuid}} will be deleted." + - output.role_uuid == "{{ test_role.role_uuid }}" + fail_msg: "Role been deleted successfully within check_mode" + success_msg: "Returned As expected" - name: delete role ntnx_roles: diff --git a/tests/integration/targets/ntnx_security_rules/tasks/app_rule.yml b/tests/integration/targets/ntnx_security_rules/tasks/app_rule.yml index c7f082897..bfb48e7df 100644 --- a/tests/integration/targets/ntnx_security_rules/tasks/app_rule.yml +++ b/tests/integration/targets/ntnx_security_rules/tasks/app_rule.yml @@ -120,6 +120,24 @@ fail_msg: ' fail: unable to update app security rule with outbound list ' success_msg: 'pass :update app security rule with outbound list successfully' +- name: Delete app security rule with check mode + ntnx_security_rules: + state: absent + security_rule_uuid: "{{ result.response.metadata.uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Security rule with uuid:{{ result.response.metadata.uuid}} will be deleted." + - output.security_rule_uuid == "{{ result.response.metadata.uuid }}" + fail_msg: "app security has rule been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: delete app security rule ntnx_security_rules: state: absent diff --git a/tests/integration/targets/ntnx_service_groups/tasks/create.yml b/tests/integration/targets/ntnx_service_groups/tasks/create.yml index f5e592a3e..a2723ac10 100644 --- a/tests/integration/targets/ntnx_service_groups/tasks/create.yml +++ b/tests/integration/targets/ntnx_service_groups/tasks/create.yml @@ -159,6 +159,24 @@ - set_fact: todelete: "{{ todelete + [ result.response.uuid ] }}" ################################################################ +- name: Delete service groups with check mode + ntnx_service_groups: + state: absent + service_group_uuid: "{{ result.response.uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =='Service group with uuid:{{ result.response.uuid }} will be deleted.' + - output.service_group_uuid == '{{ result.response.uuid }}' + fail_msg: "service groups has been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete all created service groups ntnx_service_groups: state: absent diff --git a/tests/integration/targets/ntnx_user_groups/tasks/create.yml b/tests/integration/targets/ntnx_user_groups/tasks/create.yml index d512ad077..bfcb6bea8 100644 --- a/tests/integration/targets/ntnx_user_groups/tasks/create.yml +++ b/tests/integration/targets/ntnx_user_groups/tasks/create.yml @@ -128,6 +128,25 @@ # fail_msg: "Unable to list user groups using ascending name sorting" # success_msg: "user groups listed successfully using ascending name sorting" + +- name: Delete user group with check mode + ntnx_user_groups: + state: absent + user_group_uuid: "{{ user_group_to_delete }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =='User group with uuid:{{ user_group_to_delete }} will be deleted.' + - output.uuid == '{{ user_group_to_delete }}' + fail_msg: "user group has been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: delete user group ntnx_user_groups: state: absent diff --git a/tests/integration/targets/ntnx_users/tasks/create.yml b/tests/integration/targets/ntnx_users/tasks/create.yml index 843a46535..0852f2e86 100644 --- a/tests/integration/targets/ntnx_users/tasks/create.yml +++ b/tests/integration/targets/ntnx_users/tasks/create.yml @@ -48,6 +48,24 @@ - set_fact: todelete: "{{ todelete + [ result.user_uuid ] }}" ################################################# +- name: Delete user with check mode + ntnx_users: + state: absent + user_uuid: "{{ result.user_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =='User with uuid:{{ result.user_uuid }} will be deleted.' + - output.uuid == '{{ result.user_uuid }}' + fail_msg: "user has been deleted successfully within check_mode" + success_msg: "Returned As expected" +################################################# - name: Delete created users ntnx_users: state: absent diff --git a/tests/integration/targets/nutanix_floating_ips/tasks/create_floating_ips.yml b/tests/integration/targets/nutanix_floating_ips/tasks/create_floating_ips.yml index 9ae9e8aa8..2e5b297cb 100644 --- a/tests/integration/targets/nutanix_floating_ips/tasks/create_floating_ips.yml +++ b/tests/integration/targets/nutanix_floating_ips/tasks/create_floating_ips.yml @@ -40,6 +40,24 @@ - set_fact: todelete: "{{ todelete + [ result.fip_uuid ] }}" ########################################################## +- name: Delete Floating ip with check mode + ntnx_floating_ips: + state: absent + fip_uuid: "{{ result.fip_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Floating IP with uuid:{{ result.fip_uuid }} will be deleted." + - output.fip_uuid == "{{ result.fip_uuid }}" + fail_msg: "Floating IP been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete all created floating ips ntnx_floating_ips: state: absent diff --git a/tests/integration/targets/nutanix_pbrs/tasks/create_pbrs.yml b/tests/integration/targets/nutanix_pbrs/tasks/create_pbrs.yml index 8e2ffa0d9..460734286 100644 --- a/tests/integration/targets/nutanix_pbrs/tasks/create_pbrs.yml +++ b/tests/integration/targets/nutanix_pbrs/tasks/create_pbrs.yml @@ -243,6 +243,24 @@ - set_fact: todelete: "{{ todelete + [ result.pbr_uuid ] }}" ################################################################################################################## +- name: Delete Pbr with check mode + ntnx_pbrs: + state: absent + pbr_uuid: "{{ result.pbr_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Pbr with uuid:{{ result.pbr_uuid}} will be deleted." + - output.pbr_uuid == "{{ result.pbr_uuid }}" + fail_msg: "Pbr been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete all created pbrs ntnx_pbrs: state: absent diff --git a/tests/integration/targets/nutanix_subnets/tasks/delete_subnet.yml b/tests/integration/targets/nutanix_subnets/tasks/delete_subnet.yml index 3af69c07f..e1ab02d4a 100644 --- a/tests/integration/targets/nutanix_subnets/tasks/delete_subnet.yml +++ b/tests/integration/targets/nutanix_subnets/tasks/delete_subnet.yml @@ -29,7 +29,25 @@ - result.response.status.state == 'COMPLETE' fail_msg: " Unable to create Overlay Subnet with IP_pools and DHCP " success_msg: " Overlay Subnet with IP_pools and DHCP created successfully " - + +- name: Delete subnet with check mode + ntnx_subnets: + state: absent + subnet_uuid: "{{ result.subnet_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="Subnet with uuid:{{ result.subnet_uuid }} will be deleted." + - output.subnet_uuid == "{{ result.subnet_uuid }}" + fail_msg: "Subnet has been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete subnet ntnx_subnets: state: absent diff --git a/tests/integration/targets/nutanix_vms/tasks/delete.yml b/tests/integration/targets/nutanix_vms/tasks/delete.yml index 527171727..a3a5629d8 100644 --- a/tests/integration/targets/nutanix_vms/tasks/delete.yml +++ b/tests/integration/targets/nutanix_vms/tasks/delete.yml @@ -15,7 +15,25 @@ - result.response.status.state == 'COMPLETE' fail_msg: ' Unable to create VM with minimum requiremnts ' success_msg: ' VM with minimum requiremnts created successfully ' - + +- name: Delete vm with check mode + ntnx_vms: + state: absent + vm_uuid: "{{ result.response.metadata.uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =='VM with uuid:{{ result.response.metadata.uuid }} will be deleted.' + - output.vm_uuid == '{{ result.response.metadata.uuid }}' + fail_msg: "vm has been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete VM ntnx_vms: vm_uuid: '{{ result["response"]["metadata"]["uuid"] }}' diff --git a/tests/integration/targets/nutanix_vpcs/tasks/delete_vpc.yml b/tests/integration/targets/nutanix_vpcs/tasks/delete_vpc.yml index 7d0339fa6..b49e216cd 100644 --- a/tests/integration/targets/nutanix_vpcs/tasks/delete_vpc.yml +++ b/tests/integration/targets/nutanix_vpcs/tasks/delete_vpc.yml @@ -21,6 +21,24 @@ success_msg: " VPC with all specfactions created successfully " +- name: Delete vpc with check mode + ntnx_vpcs: + state: absent + vpc_uuid: "{{ result.vpc_uuid }}" + register: output + ignore_errors: true + check_mode: true + +- name: Creation Status + assert: + that: + - output.failed == false + - output.changed == false + - output.msg =="VPC with uuid:{{ result.vpc_uuid }} will be deleted." + - output.vpc_uuid == "{{ result.vpc_uuid }}" + fail_msg: "vpc has been deleted successfully within check_mode" + success_msg: "Returned As expected" + - name: Delete vpc ntnx_vpcs: state: absent