stable-2.9: Restore Tower integration tests. (#67395)

* Move tower_common tests with tower_organization.

(cherry picked from commit c92697acec)

* Test: Bump TOWER_VERSION to supported version (#67378)

* Revert "Remove Tower module tests from CI. (#67368)"

This reverts commit b041d96762.

* Test: Bump TOWER_VERSION to 3.6.2

(cherry picked from commit b9bd2c25ca)

Co-authored-by: Yanis Guenane <yguenane@gmail.com>
pull/67413/head
Matt Clay 5 years ago committed by GitHub
parent 8fc3dfca32
commit 227f498314
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -163,6 +163,9 @@ matrix:
- env: T=cs/2.7/1 - env: T=cs/2.7/1
- env: T=cs/3.6/1 - env: T=cs/3.6/1
- env: T=tower/2.7/1
- env: T=tower/3.6/1
- env: T=cloud/2.7/1 - env: T=cloud/2.7/1
- env: T=cloud/3.6/1 - env: T=cloud/3.6/1

@ -1,47 +0,0 @@
# Test behaviour common to all tower modules
- name: Check that SSL is available
tower_organization:
name: Default
register: result
- name: Check we haven't changed anything
assert:
that: result is not changed
- name: Check that SSL is available and verify_ssl is enabled (task must fail)
tower_organization:
name: Default
environment:
TOWER_CERTIFICATE: /dev/null # force check failure
ignore_errors: true
register: check_ssl_is_used
- name: Check that connection failed
assert:
that:
- check_ssl_is_used is failed
- >
'Could not establish a secure connection' in (check_ssl_is_used.module_stderr + check_ssl_is_used.module_stdout)
or 'OpenSSL.SSL.Error' in (check_ssl_is_used.module_stderr + check_ssl_is_used.module_stdout)
# 'Could not establish a secure connection': when pyOpenSSL isn't available
# 'OpenSSL.SSL.Error': with pyOpenSSL, see https://github.com/urllib3/urllib3/pull/1517
- name: Disable verify_ssl in ~/.tower_cli.cfg
copy:
dest: ~/.tower_cli.cfg
content: |
[general]
verify_ssl = False
force: false # ensure remote file doesn't exist
- block:
- name: Check that verify_ssl is disabled (task must not fail)
tower_organization:
name: Default
environment:
TOWER_CERTIFICATE: /dev/null # should not fail because verify_ssl is disabled
always:
- name: Delete ~/.tower_cli.cfg
file:
path: ~/.tower_cli.cfg
state: absent

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -11,3 +11,34 @@
- name: Make sure the default Default organization exists - name: Make sure the default Default organization exists
tower_organization: tower_organization:
name: Default name: Default
- name: Check that SSL is available
tower_organization:
name: Default
register: result
- name: Check we haven't changed anything
assert:
that: result is not changed
- name: Check that SSL is available and verify_ssl is enabled (task must fail)
tower_organization:
name: Default
environment:
TOWER_CERTIFICATE: /dev/null # force check failure
ignore_errors: true
register: check_ssl_is_used
- name: Disable verify_ssl in ~/.tower_cli.cfg
copy:
dest: ~/.tower_cli.cfg
content: |
[general]
verify_ssl = False
force: false # ensure remote file doesn't exist
- name: Check that verify_ssl is disabled (task must not fail)
tower_organization:
name: Default
environment:
TOWER_CERTIFICATE: /dev/null # should not fail because verify_ssl is disabled

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -5,6 +5,7 @@
password: "{{ tower_password }}" password: "{{ tower_password }}"
validate_certs: false validate_certs: false
return_content: true return_content: true
force_basic_auth: true
register: awx_config register: awx_config
- tower_inventory: - tower_inventory:

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -27,14 +27,6 @@
that: that:
- "result is changed" - "result is changed"
- name: Test tower_verify_ssl alias
tower_role:
user: joe
role: update
project: Demo Project
tower_verify_ssl: true
state: absent
- name: Delete a User - name: Delete a User
tower_user: tower_user:
username: joe username: joe

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -5,6 +5,7 @@
password: "{{ tower_password }}" password: "{{ tower_password }}"
user: "{{ tower_username }}" user: "{{ tower_username }}"
validate_certs: False validate_certs: False
force_basic_auth: true
register: unified_job register: unified_job
- name: Build workflow - name: Build workflow
@ -20,6 +21,7 @@
status_code: 201 status_code: 201
user: "{{ tower_username }}" user: "{{ tower_username }}"
validate_certs: False validate_certs: False
force_basic_auth: true
register: workflow register: workflow
- name: Add a node - name: Add a node
@ -42,6 +44,7 @@
status_code: 201 status_code: 201
user: "{{ tower_username }}" user: "{{ tower_username }}"
validate_certs: False validate_certs: False
force_basic_auth: true
register: node1 register: node1
- name: Add a node - name: Add a node
@ -64,6 +67,7 @@
status_code: 201 status_code: 201
user: "{{ tower_username }}" user: "{{ tower_username }}"
validate_certs: False validate_certs: False
force_basic_auth: true
register: node2 register: node2
- name: "Link nodes {{ node2.json.id }} to {{ node1.json.id }}" - name: "Link nodes {{ node2.json.id }} to {{ node1.json.id }}"
@ -76,3 +80,4 @@
status_code: 204 status_code: 204
user: "{{ tower_username }}" user: "{{ tower_username }}"
validate_certs: False validate_certs: False
force_basic_auth: true

@ -1,2 +1,2 @@
cloud/tower cloud/tower
unsupported shippable/tower/group1

@ -75,6 +75,7 @@ class TowerCloudProvider(CloudProvider):
'3.2.3': '3.3.0', '3.2.3': '3.3.0',
'3.3.5': '3.3.3', '3.3.5': '3.3.3',
'3.4.3': '3.3.3', '3.4.3': '3.3.3',
'3.6.2': '3.3.8',
} }
cli_version = tower_cli_version_map.get(self.version, fallback) cli_version = tower_cli_version_map.get(self.version, fallback)
@ -103,7 +104,7 @@ class TowerCloudProvider(CloudProvider):
display.info('Provisioning %s cloud environment.' % self.platform, verbosity=1) display.info('Provisioning %s cloud environment.' % self.platform, verbosity=1)
# temporary solution to allow version selection # temporary solution to allow version selection
self.version = os.environ.get('TOWER_VERSION', '3.2.3') self.version = os.environ.get('TOWER_VERSION', '3.6.2')
self.check_tower_version(os.environ.get('TOWER_CLI_VERSION')) self.check_tower_version(os.environ.get('TOWER_CLI_VERSION'))
aci = get_tower_aci(self.args, self.version) aci = get_tower_aci(self.args, self.version)
@ -148,6 +149,9 @@ class TowerCloudEnvironment(CloudEnvironment):
run_command(self.args, cmd) run_command(self.args, cmd)
cmd = ['tower-cli', 'config', 'verify_ssl', 'false']
run_command(self.args, cmd, capture=True)
def disable_pendo(self): def disable_pendo(self):
"""Disable Pendo tracking.""" """Disable Pendo tracking."""
display.info('Disable Pendo tracking') display.info('Disable Pendo tracking')

Loading…
Cancel
Save