Skip to content

Commit

Permalink
test: added tests with org_name
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemental authored and rrey committed Nov 8, 2023
1 parent 1651324 commit 709397e
Showing 1 changed file with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
state: present
register: org

- name: Add user to the organization
- name: Add user to the new organization by org_id
community.grafana.grafana_organization_user:
url: "{{ grafana_url }}"
url_username: "{{ grafana_username }}"
Expand All @@ -108,3 +108,48 @@
- "result.changed == true"
- "result.user.orgId == org.org.id"
- "result.user.role == 'Admin'"

- name: Remove user from new organization by org_id
community.grafana.grafana_organization_user:
url: "{{ grafana_url }}"
url_username: "{{ grafana_username }}"
url_password: "{{ grafana_password }}"
org_id: "{{ org.org.id }}"
login: orgtest
state: absent
register: result
- assert:
that:
- "result.failed == false"
- "result.changed == true"

- name: Add user to the new organization by org_name
community.grafana.grafana_organization_user:
url: "{{ grafana_url }}"
url_username: "{{ grafana_username }}"
url_password: "{{ grafana_password }}"
org_name: "{{ org.org.name }}"
login: orgtest
role: admin
state: present
register: result
- assert:
that:
- "result.failed == false"
- "result.changed == true"
- "result.user.orgId == org.org.id"
- "result.user.role == 'Admin'"

- name: Remove user from new organization by org_name
community.grafana.grafana_organization_user:
url: "{{ grafana_url }}"
url_username: "{{ grafana_username }}"
url_password: "{{ grafana_password }}"
org_name: "{{ org.org.name }}"
login: orgtest
state: absent
register: result
- assert:
that:
- "result.failed == false"
- "result.changed == true"

0 comments on commit 709397e

Please sign in to comment.