Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding test case to delete user after deleting project #549

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@
ansible.builtin.set_fact:
user_group_to_delete: "{{result.response.status.project_status.resources.external_user_group_reference_list[0].uuid}}"

- name: Get user UUID to delete
ansible.builtin.set_fact:
user_to_delete: "{{ item.uuid }}"
loop: "{{ result.response.status.project_status.resources.user_reference_list }}"
when: item.name == new_user
no_log: true

- name: Update Project role mappings and subnets and quotas
ntnx_projects:
project_uuid: "{{result.project_uuid}}"
Expand Down Expand Up @@ -341,7 +348,7 @@
register: result
ignore_errors: true

- name: Check listing status
- name: Check deleting user group
ansible.builtin.assert:
that:
- result.response is defined
Expand All @@ -350,3 +357,20 @@
- result.response.status == "SUCCEEDED" or result.response.status.state == "DELETE_PENDING"
fail_msg: "Unable to delete user group "
success_msg: "user group deletd successfully"

- name: Delete user
ntnx_users:
state: absent
user_uuid: "{{user_to_delete}}"
register: result
ignore_errors: true

- name: Check deleting user
ansible.builtin.assert:
that:
- result.response is defined
- result.failed == false
- result.changed == true
- result.response.status == "SUCCEEDED" or result.response.status.state == "DELETE_PENDING"
fail_msg: "Unable to delete user "
success_msg: "user deletd successfully"
Loading