mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 19:51:08 -03:30
Merge pull request #13903 from john-westcott-iv/collection_intergration_tests
Enhance collection intergration tests
This commit is contained in:
@@ -46,27 +46,24 @@
|
|||||||
that:
|
that:
|
||||||
- "command is changed"
|
- "command is changed"
|
||||||
|
|
||||||
- name: Timeout waiting for the command to cancel
|
- name: Cancel the command
|
||||||
ad_hoc_command_cancel:
|
ad_hoc_command_cancel:
|
||||||
command_id: "{{ command.id }}"
|
command_id: "{{ command.id }}"
|
||||||
timeout: -1
|
|
||||||
register: results
|
register: results
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- results is failed
|
- results is changed
|
||||||
- "results['msg'] == 'Monitoring of ad hoc command aborted due to timeout'"
|
|
||||||
|
|
||||||
- block:
|
- name: "Wait for up to a minute until the job enters the can_cancel: False state"
|
||||||
- name: "Wait for up to a minute until the job enters the can_cancel: False state"
|
debug:
|
||||||
debug:
|
msg: "The job can_cancel status has transitioned into False, we can proceed with testing"
|
||||||
msg: "The job can_cancel status has transitioned into False, we can proceed with testing"
|
until: not job_status
|
||||||
until: not job_status
|
retries: 6
|
||||||
retries: 6
|
delay: 10
|
||||||
delay: 10
|
vars:
|
||||||
vars:
|
job_status: "{{ lookup('awx.awx.controller_api', 'ad_hoc_commands/'+ command.id | string +'/cancel')['can_cancel'] }}"
|
||||||
job_status: "{{ lookup('awx.awx.controller_api', 'ad_hoc_commands/'+ command.id | string +'/cancel')['can_cancel'] }}"
|
|
||||||
|
|
||||||
- name: Cancel the command with hard error if it's not running
|
- name: Cancel the command with hard error if it's not running
|
||||||
ad_hoc_command_cancel:
|
ad_hoc_command_cancel:
|
||||||
|
|||||||
@@ -108,9 +108,8 @@
|
|||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- wait_results is failed
|
- wait_results is successful
|
||||||
- 'wait_results.status == "canceled"'
|
- 'wait_results.status == "successful"'
|
||||||
- "wait_results.msg == 'The ad hoc command - {{ command.id }}, failed'"
|
|
||||||
|
|
||||||
- name: Delete the Credential
|
- name: Delete the Credential
|
||||||
credential:
|
credential:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
- name: Generate a test id
|
- name: Generate a test id
|
||||||
set_fact:
|
set_fact:
|
||||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
when: test_id is not defined
|
||||||
|
|
||||||
- name: Generate names
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
- 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
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
cred_type_name: "AWX-Collection-tests-credential_type-cred-type-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
cred_type_name: "AWX-Collection-tests-credential_type-cred-type-{{ test_id }}"
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Add Tower credential type
|
- name: Add Tower credential type
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
---
|
---
|
||||||
|
- 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
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
group_name1: "AWX-Collection-tests-group-group-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
group_name1: "AWX-Collection-tests-group-group1-{{ test_id }}"
|
||||||
group_name2: "AWX-Collection-tests-group-group-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
group_name2: "AWX-Collection-tests-group-group2-{{ test_id }}"
|
||||||
group_name3: "AWX-Collection-tests-group-group-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
group_name3: "AWX-Collection-tests-group-group3-{{ test_id }}"
|
||||||
inv_name: "AWX-Collection-tests-group-inv-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
inv_name: "AWX-Collection-tests-group-inv-{{ test_id }}"
|
||||||
host_name1: "AWX-Collection-tests-group-host-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
host_name1: "AWX-Collection-tests-group-host1-{{ test_id }}"
|
||||||
host_name2: "AWX-Collection-tests-group-host-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
host_name2: "AWX-Collection-tests-group-host2-{{ test_id }}"
|
||||||
host_name3: "AWX-Collection-tests-group-host-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
host_name3: "AWX-Collection-tests-group-host3-{{ test_id }}"
|
||||||
|
|
||||||
- name: Create an Inventory
|
- name: Create an Inventory
|
||||||
inventory:
|
inventory:
|
||||||
@@ -117,9 +122,10 @@
|
|||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
# In this case, group 2 was last a child of group1 so deleting group1 deleted group2
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "result is changed"
|
- "result is not changed"
|
||||||
|
|
||||||
- name: Delete a Group
|
- name: Delete a Group
|
||||||
group:
|
group:
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
---
|
---
|
||||||
|
- 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
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
host_name: "AWX-Collection-tests-host-host-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
host_name: "AWX-Collection-tests-host-host-{{ test_id }}"
|
||||||
inv_name: "AWX-Collection-tests-host-inv-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
inv_name: "AWX-Collection-tests-host-inv-{{ test_id }}"
|
||||||
|
|
||||||
- name: Create an Inventory
|
- name: Create an Inventory
|
||||||
inventory:
|
inventory:
|
||||||
|
|||||||
@@ -1,14 +1,25 @@
|
|||||||
---
|
---
|
||||||
|
- 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 hostnames
|
- name: Generate hostnames
|
||||||
set_fact:
|
set_fact:
|
||||||
hostname1: "AWX-Collection-tests-instance1.{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}.example.com"
|
hostname1: "AWX-Collection-tests-instance1.{{ test_id }}.example.com"
|
||||||
hostname2: "AWX-Collection-tests-instance2.{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}.example.com"
|
hostname2: "AWX-Collection-tests-instance2.{{ test_id }}.example.com"
|
||||||
hostname3: "AWX-Collection-tests-instance3.{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}.example.com"
|
hostname3: "AWX-Collection-tests-instance3.{{ test_id }}.example.com"
|
||||||
register: facts
|
register: facts
|
||||||
|
|
||||||
- name: Show hostnames
|
- name: Get the k8s setting
|
||||||
debug:
|
set_fact:
|
||||||
var: facts
|
IS_K8S: "{{ controller_settings['IS_K8S'] | default(False) }}"
|
||||||
|
vars:
|
||||||
|
controller_settings: "{{ lookup('awx.awx.controller_api', 'settings/all') }}"
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "Skipping instance test since this is instance is not running on a K8s platform"
|
||||||
|
when: not IS_K8S
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Create an instance
|
- name: Create an instance
|
||||||
@@ -57,3 +68,5 @@
|
|||||||
- "{{ hostname1 }}"
|
- "{{ hostname1 }}"
|
||||||
- "{{ hostname2 }}"
|
- "{{ hostname2 }}"
|
||||||
- "{{ hostname3 }}"
|
- "{{ hostname3 }}"
|
||||||
|
|
||||||
|
when: IS_K8S
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
- name: Generate test id
|
- name: Generate test id
|
||||||
set_fact:
|
set_fact:
|
||||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
when: test_id is not defined
|
||||||
|
|
||||||
- name: Generate names
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
- name: Generate a test ID
|
- name: Generate a test ID
|
||||||
set_fact:
|
set_fact:
|
||||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
when: test_id is not defined
|
||||||
|
|
||||||
- name: Generate names
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
---
|
---
|
||||||
|
- 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
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
openstack_cred: "AWX-Collection-tests-inventory_source-cred-openstack-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
openstack_cred: "AWX-Collection-tests-inventory_source-cred-openstack-{{ test_id }}"
|
||||||
openstack_inv: "AWX-Collection-tests-inventory_source-inv-openstack-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
openstack_inv: "AWX-Collection-tests-inventory_source-inv-openstack-{{ test_id }}"
|
||||||
openstack_inv_source: "AWX-Collection-tests-inventory_source-inv-source-openstack-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
openstack_inv_source: "AWX-Collection-tests-inventory_source-inv-source-openstack-{{ test_id }}"
|
||||||
|
|
||||||
- name: Add a credential
|
- name: Add a credential
|
||||||
credential:
|
credential:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
- name: Generate a test ID
|
- name: Generate a test ID
|
||||||
set_fact:
|
set_fact:
|
||||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
when: test_id is not defined
|
||||||
|
|
||||||
- name: Generate names
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
---
|
---
|
||||||
|
- 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
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
jt_name1: "AWX-Collection-tests-job_launch-jt1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
jt_name1: "AWX-Collection-tests-job_launch-jt1-{{ test_id }}"
|
||||||
jt_name2: "AWX-Collection-tests-job_launch-jt2-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
jt_name2: "AWX-Collection-tests-job_launch-jt2-{{ test_id }}"
|
||||||
proj_name: "AWX-Collection-tests-job_launch-project-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
proj_name: "AWX-Collection-tests-job_launch-project-{{ test_id }}"
|
||||||
|
|
||||||
- name: Launch a Job Template
|
- name: Launch a Job Template
|
||||||
job_launch:
|
job_launch:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
- name: Generate a random string for test
|
- name: Generate a random string for test
|
||||||
set_fact:
|
set_fact:
|
||||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
when: test_id is not defined
|
||||||
|
|
||||||
- name: generate random string for project
|
- name: generate random string for project
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
---
|
---
|
||||||
|
- 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 random string for template and project
|
- name: Generate random string for template and project
|
||||||
set_fact:
|
set_fact:
|
||||||
jt_name: "AWX-Collection-tests-job_wait-long_running-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
jt_name: "AWX-Collection-tests-job_wait-long_running-{{ test_id }}"
|
||||||
proj_name: "AWX-Collection-tests-job_wait-long_running-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
proj_name: "AWX-Collection-tests-job_wait-long_running-{{ test_id }}"
|
||||||
|
|
||||||
- name: Assure that the demo project exists
|
- name: Assure that the demo project exists
|
||||||
project:
|
project:
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
- 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
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
label_name: "AWX-Collection-tests-label-label-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
label_name: "AWX-Collection-tests-label-label-{{ test_id }}"
|
||||||
|
|
||||||
- name: Create a Label
|
- name: Create a Label
|
||||||
label:
|
label:
|
||||||
|
|||||||
@@ -101,6 +101,9 @@
|
|||||||
set_fact:
|
set_fact:
|
||||||
users: "{{ query(plugin_name, 'users', query_params={ 'username__endswith': test_id, 'page_size': 2 }, return_ids=True ) }}"
|
users: "{{ query(plugin_name, 'users', query_params={ 'username__endswith': test_id, 'page_size': 2 }, return_ids=True ) }}"
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "{{ users }}"
|
||||||
|
|
||||||
- name: Assert that user list has 2 ids only and that they are strings, not ints
|
- name: Assert that user list has 2 ids only and that they are strings, not ints
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
---
|
---
|
||||||
|
- 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
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
slack_not: "AWX-Collection-tests-notification_template-slack-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
slack_not: "AWX-Collection-tests-notification_template-slack-not-{{ test_id }}"
|
||||||
webhook_not: "AWX-Collection-tests-notification_template-wehbook-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
webhook_not: "AWX-Collection-tests-notification_template-wehbook-not-{{ test_id }}"
|
||||||
email_not: "AWX-Collection-tests-notification_template-email-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
email_not: "AWX-Collection-tests-notification_template-email-not-{{ test_id }}"
|
||||||
twillo_not: "AWX-Collection-tests-notification_template-twillo-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
twillo_not: "AWX-Collection-tests-notification_template-twillo-not-{{ test_id }}"
|
||||||
pd_not: "AWX-Collection-tests-notification_template-pd-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
pd_not: "AWX-Collection-tests-notification_template-pd-not-{{ test_id }}"
|
||||||
irc_not: "AWX-Collection-tests-notification_template-irc-not-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
irc_not: "AWX-Collection-tests-notification_template-irc-not-{{ test_id }}"
|
||||||
|
|
||||||
- name: Create Slack notification with custom messages
|
- name: Create Slack notification with custom messages
|
||||||
notification_template:
|
notification_template:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
- name: Generate a test ID
|
- name: Generate a test ID
|
||||||
set_fact:
|
set_fact:
|
||||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
when: test_id is not defined
|
||||||
|
|
||||||
- name: Generate an org name
|
- name: Generate an org name
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
---
|
---
|
||||||
|
- 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
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
project_name1: "AWX-Collection-tests-project-project1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
project_name1: "AWX-Collection-tests-project-project1-{{ test_id }}"
|
||||||
project_name2: "AWX-Collection-tests-project-project2-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
project_name2: "AWX-Collection-tests-project-project2-{{ test_id }}"
|
||||||
project_name3: "AWX-Collection-tests-project-project3-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
project_name3: "AWX-Collection-tests-project-project3-{{ test_id }}"
|
||||||
jt1: "AWX-Collection-tests-project-jt1-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
jt1: "AWX-Collection-tests-project-jt1-{{ test_id }}"
|
||||||
scm_cred_name: "AWX-Collection-tests-project-scm-cred-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
scm_cred_name: "AWX-Collection-tests-project-scm-cred-{{ test_id }}"
|
||||||
org_name: "AWX-Collection-tests-project-org-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
org_name: "AWX-Collection-tests-project-org-{{ test_id }}"
|
||||||
cred_name: "AWX-Collection-tests-project-cred-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
cred_name: "AWX-Collection-tests-project-cred-{{ test_id }}"
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Create an SCM Credential
|
- name: Create an SCM Credential
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Load the UI settings
|
|
||||||
set_fact:
|
|
||||||
project_base_dir: "{{ controller_settings.project_base_dir }}"
|
|
||||||
vars:
|
|
||||||
controller_settings: "{{ lookup('awx.awx.controller_api', 'config/') }}"
|
|
||||||
|
|
||||||
- inventory:
|
|
||||||
name: localhost
|
|
||||||
organization: Default
|
|
||||||
|
|
||||||
- host:
|
|
||||||
name: localhost
|
|
||||||
inventory: localhost
|
|
||||||
variables:
|
|
||||||
ansible_connection: local
|
|
||||||
|
|
||||||
- name: Create an unused SSH / Machine credential
|
|
||||||
credential:
|
|
||||||
name: dummy
|
|
||||||
credential_type: Machine
|
|
||||||
inputs:
|
|
||||||
ssh_key_data: |
|
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
|
||||||
MHcCAQEEIIUl6R1xgzR6siIUArz4XBPtGZ09aetma2eWf1v3uYymoAoGCCqGSM49
|
|
||||||
AwEHoUQDQgAENJNjgeZDAh/+BY860s0yqrLDprXJflY0GvHIr7lX3ieCtrzOMCVU
|
|
||||||
QWzw35pc5tvuP34SSi0ZE1E+7cVMDDOF3w==
|
|
||||||
-----END EC PRIVATE KEY-----
|
|
||||||
organization: Default
|
|
||||||
|
|
||||||
- block:
|
|
||||||
- name: Add a path to a setting
|
|
||||||
settings:
|
|
||||||
name: AWX_ISOLATION_SHOW_PATHS
|
|
||||||
value: "[{{ project_base_dir }}]"
|
|
||||||
|
|
||||||
- name: Create a directory for manual project
|
|
||||||
ad_hoc_command:
|
|
||||||
credential: dummy
|
|
||||||
inventory: localhost
|
|
||||||
job_type: run
|
|
||||||
module_args: "mkdir -p {{ project_base_dir }}/{{ project_dir_name }}"
|
|
||||||
module_name: command
|
|
||||||
wait: true
|
|
||||||
|
|
||||||
always:
|
|
||||||
- name: Delete path from setting
|
|
||||||
settings:
|
|
||||||
name: AWX_ISOLATION_SHOW_PATHS
|
|
||||||
value: []
|
|
||||||
|
|
||||||
- name: Delete dummy credential
|
|
||||||
credential:
|
|
||||||
name: dummy
|
|
||||||
credential_type: Machine
|
|
||||||
state: absent
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Generate random string for project
|
|
||||||
set_fact:
|
|
||||||
rand_string: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
|
||||||
|
|
||||||
- name: Generate manual project name
|
|
||||||
set_fact:
|
|
||||||
project_name: "Manual_Project_{{ rand_string }}"
|
|
||||||
|
|
||||||
- name: Generate manual project dir name
|
|
||||||
set_fact:
|
|
||||||
project_dir_name: "proj_{{ rand_string }}"
|
|
||||||
|
|
||||||
- name: Create a project directory for manual project
|
|
||||||
import_tasks: create_project_dir.yml
|
|
||||||
|
|
||||||
- name: Create a manual project
|
|
||||||
project:
|
|
||||||
name: "{{ project_name }}"
|
|
||||||
organization: Default
|
|
||||||
scm_type: manual
|
|
||||||
local_path: "{{ project_dir_name }}"
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
|
||||||
that:
|
|
||||||
- "result is changed"
|
|
||||||
|
|
||||||
- name: Delete a manual project
|
|
||||||
project:
|
|
||||||
name: "{{ project_name }}"
|
|
||||||
organization: Default
|
|
||||||
state: absent
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
|
||||||
that:
|
|
||||||
- "result is changed"
|
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
- name: Generate a test id
|
- name: Generate a test id
|
||||||
set_fact:
|
set_fact:
|
||||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
when: test_id is not defined
|
||||||
|
|
||||||
- name: Generate names
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
- name: Generate a random string for test
|
- name: Generate a random string for test
|
||||||
set_fact:
|
set_fact:
|
||||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
when: test_id is not defined
|
||||||
|
|
||||||
- name: generate random string for schedule
|
- name: generate random string for schedule
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
- 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
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
team_name: "AWX-Collection-tests-team-team-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
team_name: "AWX-Collection-tests-team-team-{{ test_id }}"
|
||||||
|
|
||||||
- name: Attempt to add a team to a non-existant Organization
|
- name: Attempt to add a team to a non-existant Organization
|
||||||
team:
|
team:
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
- 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
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
token_description: "AWX-Collection-tests-token-description-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
token_description: "AWX-Collection-tests-token-description-{{ test_id }}"
|
||||||
|
|
||||||
- name: Try to use a token as a dict which is missing the token parameter
|
- name: Try to use a token as a dict which is missing the token parameter
|
||||||
job_list:
|
job_list:
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
---
|
---
|
||||||
|
- 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
|
- name: Generate names
|
||||||
set_fact:
|
set_fact:
|
||||||
username: "AWX-Collection-tests-user-user-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
username: "AWX-Collection-tests-user-user-{{ test_id }}"
|
||||||
|
|
||||||
- name: Create a User
|
- name: Create a User
|
||||||
user:
|
user:
|
||||||
@@ -131,10 +136,6 @@
|
|||||||
'Can not verify ssl with non-https protocol' in result.exception"
|
'Can not verify ssl with non-https protocol' in result.exception"
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Generate a test ID
|
|
||||||
set_fact:
|
|
||||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
|
||||||
|
|
||||||
- name: Generate an org name
|
- name: Generate an org name
|
||||||
set_fact:
|
set_fact:
|
||||||
org_name: "AWX-Collection-tests-organization-org-{{ test_id }}"
|
org_name: "AWX-Collection-tests-organization-org-{{ test_id }}"
|
||||||
|
|||||||
@@ -2,13 +2,15 @@
|
|||||||
- name: Generate a random string for names
|
- name: Generate a random string for names
|
||||||
set_fact:
|
set_fact:
|
||||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
test_prefix: AWX-Collection-tests-workflow_approval
|
when: test_id is not defined
|
||||||
|
|
||||||
- name: Generate random names for test objects
|
- name: Generate random names for test objects
|
||||||
set_fact:
|
set_fact:
|
||||||
org_name: "{{ test_prefix }}-org-{{ test_id }}"
|
org_name: "{{ test_prefix }}-org-{{ test_id }}"
|
||||||
approval_node_name: "{{ test_prefix }}-node-{{ test_id }}"
|
approval_node_name: "{{ test_prefix }}-node-{{ test_id }}"
|
||||||
wfjt_name: "{{ test_prefix }}-wfjt-{{ test_id }}"
|
wfjt_name: "{{ test_prefix }}-wfjt-{{ test_id }}"
|
||||||
|
vars:
|
||||||
|
test_prefix: AWX-Collection-tests-workflow_approval
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Create a new organization for test isolation
|
- name: Create a new organization for test isolation
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
- name: Generate a random string for names
|
- name: Generate a random string for names
|
||||||
set_fact:
|
set_fact:
|
||||||
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
||||||
|
when: test_id is not defined
|
||||||
|
|
||||||
- name: Generate random names for test objects
|
- name: Generate random names for test objects
|
||||||
set_fact:
|
set_fact:
|
||||||
@@ -17,8 +18,8 @@
|
|||||||
webhook_wfjt_name: "AWX-Collection-tests-workflow_job_template-webhook-wfjt-{{ test_id }}"
|
webhook_wfjt_name: "AWX-Collection-tests-workflow_job_template-webhook-wfjt-{{ test_id }}"
|
||||||
email_not: "AWX-Collection-tests-job_template-email-not-{{ test_id }}"
|
email_not: "AWX-Collection-tests-job_template-email-not-{{ test_id }}"
|
||||||
webhook_notification: "AWX-Collection-tests-notification_template-wehbook-not-{{ test_id }}"
|
webhook_notification: "AWX-Collection-tests-notification_template-wehbook-not-{{ test_id }}"
|
||||||
project_inv: "AWX-Collection-tests-inventory_source-inv-project-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
project_inv: "AWX-Collection-tests-inventory_source-inv-project-{{ test_id }}"
|
||||||
project_inv_source: "AWX-Collection-tests-inventory_source-inv-source-project-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
project_inv_source: "AWX-Collection-tests-inventory_source-inv-source-project-{{ test_id }}"
|
||||||
github_webhook_credential_name: "AWX-Collection-tests-credential-webhook-{{ test_id }}_github"
|
github_webhook_credential_name: "AWX-Collection-tests-credential-webhook-{{ test_id }}_github"
|
||||||
ee1: "AWX-Collection-tests-workflow_job_template-ee1-{{ test_id }}"
|
ee1: "AWX-Collection-tests-workflow_job_template-ee1-{{ test_id }}"
|
||||||
label1: "AWX-Collection-tests-workflow_job_template-l1-{{ test_id }}"
|
label1: "AWX-Collection-tests-workflow_job_template-l1-{{ test_id }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user