mirror of
https://github.com/ansible/awx.git
synced 2026-02-14 01:34:45 -03:30
* Fix collection task breaking collection ci checks * Patch ansible.module_utils.basic._ANSIBLE_PROFILE directly * Conditionalize other santity assertions * Remove added blank lines and identifier from Fail if absent and no identifier set
49 lines
1023 B
YAML
49 lines
1023 B
YAML
---
|
|
- name: Generate a test ID
|
|
set_fact:
|
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
|
when: test_id is not defined
|
|
|
|
- name: Generate names
|
|
set_fact:
|
|
label_name: "AWX-Collection-tests-label-label-{{ test_id }}"
|
|
|
|
- name: Create a Label
|
|
label:
|
|
name: "{{ label_name }}"
|
|
organization: Default
|
|
state: present
|
|
register: results
|
|
|
|
- assert:
|
|
that:
|
|
- "results is changed"
|
|
|
|
- name: Create a Label with exists
|
|
label:
|
|
name: "{{ label_name }}"
|
|
organization: Default
|
|
state: exists
|
|
register: results
|
|
|
|
- assert:
|
|
that:
|
|
- "results is not changed"
|
|
|
|
- name: Check module fails with correct msg
|
|
label:
|
|
name: "Test Label"
|
|
organization: "Non_existing_org"
|
|
state: present
|
|
register: result
|
|
ignore_errors: yes
|
|
|
|
- assert:
|
|
that:
|
|
- "result is failed"
|
|
- "result is not changed"
|
|
- "'Non_existing_org' in result.msg"
|
|
- "result.total_results == 0"
|
|
|
|
# You can't delete a label directly so no cleanup is necessary
|