diff options
author | softwarefactory-project-zuul[bot] <33884098+softwarefactory-project-zuul[bot]@users.noreply.github.com> | 2021-05-04 17:55:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-04 17:55:51 +0200 |
commit | da9a0750008e54487296825719acd910a8a5dc5e (patch) | |
tree | 8c7c37f45df3925be52d3cefb3fbb3e2c7b06c76 /awx_collection/tests | |
parent | Merge pull request #10094 from jladdjr/awx_8853_add_notification_error_to_nt_... (diff) | |
parent | add search label by org (diff) | |
download | awx-da9a0750008e54487296825719acd910a8a5dc5e.tar.xz awx-da9a0750008e54487296825719acd910a8a5dc5e.zip |
Merge pull request #10047 from sean-m-sullivan/org_label
add org search to labels
SUMMARY
After having an issue with labels I saw that orgs were referenced, Remembering #7567 implemented the code to do the search for orgs so you can search for labels within an org, Tests include creating the same named label in two orgs, and the search not erroring out that it found two labels of that name.
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
awx_collection
AWX VERSION
19.0.0
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Reviewed-by: Rebeccah Hunter <rhunter@redhat.com>
Diffstat (limited to 'awx_collection/tests')
-rw-r--r-- | awx_collection/tests/integration/targets/tower_job_template/tasks/main.yml | 22 | ||||
-rw-r--r-- | awx_collection/tests/integration/targets/tower_workflow_job_template/tasks/main.yml | 23 |
2 files changed, 41 insertions, 4 deletions
diff --git a/awx_collection/tests/integration/targets/tower_job_template/tasks/main.yml b/awx_collection/tests/integration/targets/tower_job_template/tasks/main.yml index 3b56bc9094..6ad195732b 100644 --- a/awx_collection/tests/integration/targets/tower_job_template/tasks/main.yml +++ b/awx_collection/tests/integration/targets/tower_job_template/tasks/main.yml @@ -5,6 +5,7 @@ - name: generate random string for project set_fact: + org_name: "AWX-Collection-tests-tower_organization-org-{{ test_id }}" cred1: "AWX-Collection-tests-tower_job_template-cred1-{{ test_id }}" cred2: "AWX-Collection-tests-tower_job_template-cred2-{{ test_id }}" cred3: "AWX-Collection-tests-tower_job_template-cred3-{{ test_id }}" @@ -16,6 +17,13 @@ webhook_not: "AWX-Collection-tests-tower_notification_template-wehbook-not-{{ test_id }}" group_name1: "AWX-Collection-tests-tower_instance_group-group1-{{ test_id }}" +- name: "Create a new organization" + tower_organization: + name: "{{ org_name }}" + galaxy_credentials: + - Ansible Galaxy + register: result + - name: Create a Demo Project tower_project: name: "{{ proj1 }}" @@ -44,10 +52,13 @@ organization: Default kind: ssh -- name: Create Label +- name: Create Labels tower_label: name: "{{ lab1 }}" - organization: Default + organization: "{{ item }}" + loop: + - Default + - "{{ org_name }}" - name: Create an Instance Group tower_instance_group: @@ -202,6 +213,7 @@ - name: Create Job Template 2 tower_job_template: name: "{{ jt2 }}" + organization: Default project: "{{ proj1 }}" inventory: Demo Inventory playbook: hello_world.yml @@ -409,3 +421,9 @@ name: "{{ webhook_not }}" organization: Default state: absent + +- name: "Remove the organization" + tower_organization: + name: "{{ org_name }}" + state: absent + register: result diff --git a/awx_collection/tests/integration/targets/tower_workflow_job_template/tasks/main.yml b/awx_collection/tests/integration/targets/tower_workflow_job_template/tasks/main.yml index cb8be5a06b..8741f0cb1b 100644 --- a/awx_collection/tests/integration/targets/tower_workflow_job_template/tasks/main.yml +++ b/awx_collection/tests/integration/targets/tower_workflow_job_template/tasks/main.yml @@ -5,6 +5,7 @@ - name: Generate random names for test objects set_fact: + org_name: "AWX-Collection-tests-tower_organization-org-{{ test_id }}" scm_cred_name: "AWX-Collection-tests-tower_workflow_job_template-scm-cred-{{ test_id }}" demo_project_name: "AWX-Collection-tests-tower_workflow_job_template-proj-{{ test_id }}" jt1_name: "AWX-Collection-tests-tower_workflow_job_template-jt1-{{ test_id }}" @@ -17,6 +18,13 @@ project_inv: "AWX-Collection-tests-tower_inventory_source-inv-project-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" project_inv_source: "AWX-Collection-tests-tower_inventory_source-inv-source-project-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" +- name: "Create a new organization" + tower_organization: + name: "{{ org_name }}" + galaxy_credentials: + - Ansible Galaxy + register: result + - name: Create an SCM Credential tower_credential: name: "{{ scm_cred_name }}" @@ -55,10 +63,13 @@ state: present register: result -- name: Create Label +- name: Create Labels tower_label: name: "{{ lab1 }}" - organization: Default + organization: "{{ item }}" + loop: + - Default + - "{{ org_name }}" - name: Create a Demo Project tower_project: @@ -126,6 +137,7 @@ - name: Add a Survey to second Job Template tower_job_template: name: "{{ jt2_name }}" + organization: Default project: "{{ demo_project_name }}" inventory: Demo Inventory playbook: hello_world.yml @@ -142,6 +154,7 @@ - name: Create a workflow job template tower_workflow_job_template: name: "{{ wfjt_name }}" + organization: Default inventory: Demo Inventory extra_vars: {'foo': 'bar', 'another-foo': {'barz': 'bar2'}} labels: @@ -652,3 +665,9 @@ name: "{{ webhook_not }}" organization: Default state: absent + +- name: "Remove the organization" + tower_organization: + name: "{{ org_name }}" + state: absent + register: result |