Test against galaxy_ng (#70303)

* Test against galaxy_ng

* Switch container image

* Remove redundant |default

* Re-enable

* Update image

* Update wording

* Don't use pulp as the container name
This commit is contained in:
Matt Martz 2020-07-01 15:20:03 -05:00 committed by GitHub
parent 5d3d097de3
commit ce570691e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 266 additions and 248 deletions

View file

@ -1,4 +1,3 @@
shippable/galaxy/group1
shippable/galaxy/smoketest
cloud/galaxy
disabled

View file

@ -5,7 +5,7 @@
state: directory
- name: download collection with multiple dependencies
command: ansible-galaxy collection download parent_dep.parent_collection -s {{ fallaxy_galaxy_server }} {{ galaxy_verbosity }}
command: ansible-galaxy collection download parent_dep.parent_collection -s pulp_v2 {{ galaxy_verbosity }}
register: download_collection
args:
chdir: '{{ galaxy_dir }}/download'
@ -69,7 +69,7 @@
dest: '{{ galaxy_dir }}/download/download.yml'
- name: download collection with req to custom dir
command: ansible-galaxy collection download -r '{{ galaxy_dir }}/download/download.yml' -s {{ fallaxy_ah_server }} -p '{{ galaxy_dir }}/download/collections-custom' {{ galaxy_verbosity }}
command: ansible-galaxy collection download -r '{{ galaxy_dir }}/download/download.yml' -s galaxy_ng -p '{{ galaxy_dir }}/download/collections-custom' {{ galaxy_verbosity }}
register: download_req_custom_path
- name: get result of download collection with req to custom dir

View file

@ -0,0 +1,30 @@
- name: Create galaxy_ng namespaces
uri:
url: '{{ pulp_api }}/api/galaxy/v3/_ui/namespaces/'
method: POST
body_format: json
body:
name: '{{ namespace }}'
groups:
- system:partner-engineers
status_code:
- 201
user: '{{ pulp_user }}'
password: '{{ pulp_password }}'
force_basic_auth: true
loop: '{{ collection_list|map(attribute="namespace")|unique + publish_namespaces }}'
loop_control:
loop_var: namespace
- name: Get galaxy_ng token
uri:
url: '{{ pulp_api }}/api/galaxy/v3/auth/token/'
method: POST
body_format: json
body: {}
status_code:
- 200
user: '{{ pulp_user }}'
password: '{{ pulp_password }}'
force_basic_auth: true
register: galaxy_ng_token

View file

@ -5,7 +5,7 @@
state: directory
- name: install simple collection with implicit path - {{ test_name }}
command: ansible-galaxy collection install namespace1.name1 -s '{{ test_server }}' {{ galaxy_verbosity }}
command: ansible-galaxy collection install namespace1.name1 -s '{{ test_name }}' {{ galaxy_verbosity }}
environment:
ANSIBLE_COLLECTIONS_PATH: '{{ galaxy_dir }}/ansible_collections'
register: install_normal
@ -32,7 +32,7 @@
- (install_normal_manifest.content | b64decode | from_json).collection_info.version == '1.0.9'
- name: install existing without --force - {{ test_name }}
command: ansible-galaxy collection install namespace1.name1 -s '{{ test_server }}' {{ galaxy_verbosity }}
command: ansible-galaxy collection install namespace1.name1 -s '{{ test_name }}' {{ galaxy_verbosity }}
environment:
ANSIBLE_COLLECTIONS_PATH: '{{ galaxy_dir }}/ansible_collections'
register: install_existing_no_force
@ -43,7 +43,7 @@
- '"Skipping ''namespace1.name1'' as it is already installed" in install_existing_no_force.stdout'
- name: install existing with --force - {{ test_name }}
command: ansible-galaxy collection install namespace1.name1 -s '{{ test_server }}' --force {{ galaxy_verbosity }}
command: ansible-galaxy collection install namespace1.name1 -s '{{ test_name }}' --force {{ galaxy_verbosity }}
environment:
ANSIBLE_COLLECTIONS_PATH: '{{ galaxy_dir }}/ansible_collections'
register: install_existing_force
@ -59,7 +59,7 @@
state: absent
- name: install pre-release as explicit version to custom dir - {{ test_name }}
command: ansible-galaxy collection install 'namespace1.name1:1.1.0-beta.1' -s '{{ test_server }}' -p '{{ galaxy_dir }}/ansible_collections' {{ galaxy_verbosity }}
command: ansible-galaxy collection install 'namespace1.name1:1.1.0-beta.1' -s '{{ test_name }}' -p '{{ galaxy_dir }}/ansible_collections' {{ galaxy_verbosity }}
register: install_prerelease
- name: get result of install pre-release as explicit version to custom dir - {{ test_name }}
@ -79,7 +79,7 @@
state: absent
- name: install pre-release version with --pre to custom dir - {{ test_name }}
command: ansible-galaxy collection install --pre 'namespace1.name1' -s '{{ test_server }}' -p '{{ galaxy_dir }}/ansible_collections' {{ galaxy_verbosity }}
command: ansible-galaxy collection install --pre 'namespace1.name1' -s '{{ test_name }}' -p '{{ galaxy_dir }}/ansible_collections' {{ galaxy_verbosity }}
register: install_prerelease
- name: get result of install pre-release version with --pre to custom dir - {{ test_name }}
@ -127,13 +127,16 @@
- (install_multiple_with_dep_actual.results[3].content | b64decode | from_json).collection_info.version == '1.2.2'
- name: expect failure with dep resolution failure
command: ansible-galaxy collection install fail_namespace.fail_collection -s {{ test_server }} {{ galaxy_verbosity }}
command: ansible-galaxy collection install fail_namespace.fail_collection -s {{ test_name }} {{ galaxy_verbosity }}
register: fail_dep_mismatch
failed_when: '"Cannot meet dependency requirement ''fail_dep2.name:<0.0.5'' for collection fail_namespace.fail_collection" not in fail_dep_mismatch.stderr'
- name: Find artifact url
- name: Find artifact url for namespace3.name
uri:
url: '{{ test_server }}{{ vX }}collections/namespace3/name/versions/1.0.0/'
user: '{{ pulp_user }}'
password: '{{ pulp_password }}'
force_basic_auth: true
register: artifact_url_response
- name: download a collection for an offline install - {{ test_name }}
@ -178,9 +181,12 @@
that:
- not fail_bad_tar_actual.stat.exists
- name: Find artifact url
- name: Find artifact url for namespace4.name
uri:
url: '{{ test_server }}{{ vX }}collections/namespace4/name/versions/1.0.0/'
user: '{{ pulp_user }}'
password: '{{ pulp_password }}'
force_basic_auth: true
register: artifact_url_response
- name: install a collection from a URI - {{ test_name }}
@ -207,6 +213,8 @@
environment:
ANSIBLE_GALAXY_SERVER_LIST: undefined
- when: not requires_auth
block:
- name: install a collection with an empty server list - {{ test_name }}
command: ansible-galaxy collection install namespace5.name -s '{{ test_server }}' {{ galaxy_verbosity }}
register: install_empty_server_list
@ -237,7 +245,7 @@
# Need to run with -vvv to validate the roles will be skipped msg
- name: install collections only with requirements-with-role.yml - {{ test_name }}
command: ansible-galaxy collection install -r '{{ galaxy_dir }}/ansible_collections/requirements-with-role.yml' -s '{{ test_server }}' -vvv
command: ansible-galaxy collection install -r '{{ galaxy_dir }}/ansible_collections/requirements-with-role.yml' -s '{{ test_name }}' -vvv
register: install_req_collection
environment:
ANSIBLE_COLLECTIONS_PATH: '{{ galaxy_dir }}/ansible_collections'
@ -270,7 +278,7 @@
dest: '{{ galaxy_dir }}/ansible_collections/requirements.yaml'
- name: install collections with ansible-galaxy install - {{ test_name }}
command: ansible-galaxy install -r '{{ galaxy_dir }}/ansible_collections/requirements.yaml' -s '{{ test_server }}'
command: ansible-galaxy install -r '{{ galaxy_dir }}/ansible_collections/requirements.yaml' -s '{{ test_name }}'
register: install_req
environment:
ANSIBLE_COLLECTIONS_PATH: '{{ galaxy_dir }}/ansible_collections'
@ -299,7 +307,7 @@
state: absent
- name: install collection with symlink - {{ test_name }}
command: ansible-galaxy collection install symlink.symlink -s '{{ test_server }}' {{ galaxy_verbosity }}
command: ansible-galaxy collection install symlink.symlink -s '{{ test_name }}' {{ galaxy_verbosity }}
environment:
ANSIBLE_COLLECTIONS_PATHS: '{{ galaxy_dir }}/ansible_collections'
register: install_symlink

View file

@ -14,14 +14,17 @@
- name: run ansible-galaxy collection build tests
import_tasks: build.yml
- name: configure pulp
include_tasks: pulp.yml
- name: configure galaxy_ng
include_tasks: galaxy_ng.yml
- name: create test ansible.cfg that contains the Galaxy server list
template:
src: ansible.cfg.j2
dest: '{{ galaxy_dir }}/ansible.cfg'
- name: configure pulp
include_tasks: pulp.yml
- name: run ansible-galaxy collection publish tests for {{ test_name }}
include_tasks: publish.yml
args:
@ -32,23 +35,28 @@
test_name: '{{ item.name }}'
test_server: '{{ item.server }}'
is_pulp: '{{ item.pulp|default(false) }}'
with_items:
- name: galaxy
server: '{{ fallaxy_galaxy_server }}'
- name: automation_hub
server: '{{ fallaxy_ah_server }}'
vX: '{{ "v3/" if item.v3|default(false) else "v2/" }}'
loop:
- name: pulp_v2
server: '{{ pulp_v2_server }}'
pulp: true
- name: pulp_v3
server: '{{ pulp_v3_server }}'
pulp: true
v3: true
- name: galaxy_ng
server: '{{ galaxy_ng_server }}'
pulp: true
v3: true
# We use a module for this so we can speed up the test time.
- name: setup test collections for install and download test
loop:
- '{{ fallaxy_galaxy_server }}'
- pulp_v2
# For pulp interactions, we only upload to galaxy_ng which shares
# the same repo and distribution with pulp_ansible
# However, we use galaxy_ng only, since collections are unique across
# pulp repositories, and galaxy_ng maintains a 2nd list of published collections
- galaxy_ng
environment:
ANSIBLE_CONFIG: '{{ galaxy_dir }}/ansible.cfg'
async: 300
@ -56,114 +64,7 @@
register: setup_collections
setup_collections:
server: '{{ item }}'
token: '{{ omit if item == "pulp_v2" else fallaxy_token }}'
collections:
# Scenario to test out pre-release being ignored unless explicitly set and version pagination.
- namespace: namespace1
name: name1
version: 0.0.1
- namespace: namespace1
name: name1
version: 0.0.2
- namespace: namespace1
name: name1
version: 0.0.3
- namespace: namespace1
name: name1
version: 0.0.4
- namespace: namespace1
name: name1
version: 0.0.5
- namespace: namespace1
name: name1
version: 0.0.6
- namespace: namespace1
name: name1
version: 0.0.7
- namespace: namespace1
name: name1
version: 0.0.8
- namespace: namespace1
name: name1
version: 0.0.9
- namespace: namespace1
name: name1
version: 0.0.10
- namespace: namespace1
name: name1
version: 0.1.0
- namespace: namespace1
name: name1
version: 1.0.0
- namespace: namespace1
name: name1
version: 1.0.9
- namespace: namespace1
name: name1
version: 1.1.0-beta.1
# Pad out number of namespaces for pagination testing
- namespace: namespace2
name: name
- namespace: namespace3
name: name
- namespace: namespace4
name: name
- namespace: namespace5
name: name
- namespace: namespace6
name: name
- namespace: namespace7
name: name
- namespace: namespace8
name: name
- namespace: namespace9
name: name
# Complex dependency resolution
- namespace: parent_dep
name: parent_collection
dependencies:
child_dep.child_collection: '>=0.5.0,<1.0.0'
- namespace: child_dep
name: child_collection
version: 0.4.0
- namespace: child_dep
name: child_collection
version: 0.5.0
- namespace: child_dep
name: child_collection
version: 0.9.9
dependencies:
child_dep.child_dep2: '!=1.2.3'
- namespace: child_dep
name: child_collection
- namespace: child_dep
name: child_dep2
version: 1.2.2
- namespace: child_dep
name: child_dep2
version: 1.2.3
# Dep resolution failure
- namespace: fail_namespace
name: fail_collection
version: 2.1.2
dependencies:
fail_dep.name: '0.0.5'
fail_dep2.name: '<0.0.5'
- namespace: fail_dep
name: name
version: '0.0.5'
dependencies:
fail_dep2.name: '>0.0.5'
- namespace: fail_dep2
name: name
# Symlink tests
- namespace: symlink
name: symlink
use_symlink: yes
collections: '{{ collection_list }}'
- name: Wait for setup_collections
async_status:
@ -187,12 +88,16 @@
test_name: '{{ item.name }}'
test_server: '{{ item.server }}'
vX: '{{ "v3/" if item.v3|default(false) else "v2/" }}'
with_items:
- name: galaxy
server: '{{ fallaxy_galaxy_server }}'
- name: automation_hub
server: '{{ fallaxy_ah_server }}'
requires_auth: '{{ item.requires_auth|default(false) }}'
args:
apply:
environment:
ANSIBLE_CONFIG: '{{ galaxy_dir }}/ansible.cfg'
loop:
- name: galaxy_ng
server: '{{ galaxy_ng_server }}'
v3: true
requires_auth: true
- name: pulp_v2
server: '{{ pulp_v2_server }}'
- name: pulp_v3

View file

@ -16,7 +16,7 @@
when: not is_pulp
- name: publish collection - {{ test_name }}
command: ansible-galaxy collection publish ansible_test-my_collection-1.0.0.tar.gz -s {{ test_server }} --token {{ fallaxy_token }} {{ galaxy_verbosity }}
command: ansible-galaxy collection publish ansible_test-my_collection-1.0.0.tar.gz -s {{ test_name }} {{ galaxy_verbosity }}
args:
chdir: '{{ galaxy_dir }}'
register: fallaxy_publish_collection
@ -34,8 +34,11 @@
- name: get result of publish collection - {{ test_name }}
uri:
url: '{{ test_server }}v2/collections/ansible_test/my_collection/versions/1.0.0/'
url: '{{ test_server }}{{ vX }}collections/ansible_test/my_collection/versions/1.0.0/'
return_content: yes
user: '{{ pulp_user }}'
password: '{{ pulp_password }}'
force_basic_auth: true
register: publish_collection_actual
- name: assert publish collection - {{ test_name }}
@ -47,7 +50,7 @@
- publish_collection_actual.json.version == '1.0.0'
- name: fail to publish existing collection version - {{ test_name }}
command: ansible-galaxy collection publish ansible_test-my_collection-1.0.0.tar.gz -s {{ test_server }} --token {{ fallaxy_token }} {{ galaxy_verbosity }}
command: ansible-galaxy collection publish ansible_test-my_collection-1.0.0.tar.gz -s {{ test_name }} {{ galaxy_verbosity }}
args:
chdir: '{{ galaxy_dir }}'
register: fail_publish_existing

View file

@ -109,39 +109,46 @@
delay: 1
retries: 25
- name: create pulp repo
- name: create pulp repos
uri:
url: '{{ pulp_api }}/pulp/api/v3/repositories/ansible/ansible/'
method: POST
body_format: json
body:
name: ansible_ci
name: '{{ repo_name }}'
status_code:
- 201
user: '{{ pulp_user }}'
password: '{{ pulp_password }}'
force_basic_auth: true
register: pulp_repo
loop:
- automation-hub
loop_control:
loop_var: repo_name
- name: create pulp distribution
- name: create pulp distributions
uri:
url: '{{ pulp_api }}/pulp/api/v3/distributions/ansible/ansible/'
method: POST
body_format: json
body:
name: ansible_ci
base_path: ansible_ci
repository: '{{ pulp_api }}{{ pulp_repo.json.pulp_href }}'
name: '{{ repo.repo_name }}'
base_path: '{{ repo.repo_name }}'
repository: '{{ pulp_api }}{{ repo.json.pulp_href }}'
status_code:
- 202
user: '{{ pulp_user }}'
password: '{{ pulp_password }}'
force_basic_auth: true
register: pulp_distribution_task
loop: '{{ pulp_repo.results }}'
loop_control:
loop_var: repo
- name: wait for distribution creation
uri:
url: '{{ pulp_api }}{{ pulp_distribution_task.json.task }}'
url: '{{ pulp_api }}{{ task.json.task }}'
method: GET
status_code:
- 200
@ -152,3 +159,7 @@
delay: 1
retries: 25
register: pulp_distribution
loop: '{{ pulp_distribution_task.results }}'
loop_control:
loop_var: task
label: '{{ task.json.task }}'

View file

@ -1,13 +1,5 @@
[galaxy]
server_list=galaxy,automation_hub,pulp_v2,pulp_v3
[galaxy_server.galaxy]
url={{ fallaxy_galaxy_server }}
token={{ fallaxy_token }}
[galaxy_server.automation_hub]
url={{ fallaxy_ah_server }}
token={{ fallaxy_token }}
server_list=pulp_v2,pulp_v3,galaxy_ng
[galaxy_server.pulp_v2]
url={{ pulp_v2_server }}
@ -19,3 +11,7 @@ url={{ pulp_v3_server }}
v3=true
username={{ pulp_user }}
password={{ pulp_password }}
[galaxy_server.galaxy_ng]
url={{ galaxy_ng_server }}
token={{ galaxy_ng_token.json.token }}

View file

@ -1 +1,112 @@
galaxy_verbosity: "{{ '' if not ansible_verbosity else '-' ~ ('v' * ansible_verbosity) }}"
publish_namespaces:
- ansible_test
collection_list:
# Scenario to test out pre-release being ignored unless explicitly set and version pagination.
- namespace: namespace1
name: name1
version: 0.0.1
- namespace: namespace1
name: name1
version: 0.0.2
- namespace: namespace1
name: name1
version: 0.0.3
- namespace: namespace1
name: name1
version: 0.0.4
- namespace: namespace1
name: name1
version: 0.0.5
- namespace: namespace1
name: name1
version: 0.0.6
- namespace: namespace1
name: name1
version: 0.0.7
- namespace: namespace1
name: name1
version: 0.0.8
- namespace: namespace1
name: name1
version: 0.0.9
- namespace: namespace1
name: name1
version: 0.0.10
- namespace: namespace1
name: name1
version: 0.1.0
- namespace: namespace1
name: name1
version: 1.0.0
- namespace: namespace1
name: name1
version: 1.0.9
- namespace: namespace1
name: name1
version: 1.1.0-beta.1
# Pad out number of namespaces for pagination testing
- namespace: namespace2
name: name
- namespace: namespace3
name: name
- namespace: namespace4
name: name
- namespace: namespace5
name: name
- namespace: namespace6
name: name
- namespace: namespace7
name: name
- namespace: namespace8
name: name
- namespace: namespace9
name: name
# Complex dependency resolution
- namespace: parent_dep
name: parent_collection
dependencies:
child_dep.child_collection: '>=0.5.0,<1.0.0'
- namespace: child_dep
name: child_collection
version: 0.4.0
- namespace: child_dep
name: child_collection
version: 0.5.0
- namespace: child_dep
name: child_collection
version: 0.9.9
dependencies:
child_dep.child_dep2: '!=1.2.3'
- namespace: child_dep
name: child_collection
- namespace: child_dep
name: child_dep2
version: 1.2.2
- namespace: child_dep
name: child_dep2
version: 1.2.3
# Dep resolution failure
- namespace: fail_namespace
name: fail_collection
version: 2.1.2
dependencies:
fail_dep.name: '0.0.5'
fail_dep2.name: '<0.0.5'
- namespace: fail_dep
name: name
version: '0.0.5'
dependencies:
fail_dep2.name: '>0.0.5'
- namespace: fail_dep2
name: name
# Symlink tests
- namespace: symlink
name: symlink
use_symlink: yes

View file

@ -28,11 +28,19 @@ from ..docker_util import (
)
# We add BasicAuthentication, to make the tasks that deal with
# direct API access easier to deal with across galaxy_ng and pulp
SETTINGS = b'''
CONTENT_ORIGIN='pulp:80'
ANSIBLE_API_HOSTNAME='http://pulp:80'
ANSIBLE_CONTENT_HOSTNAME='http://pulp:80/pulp/content'
CONTENT_ORIGIN = 'http://ansible-ci-pulp:80'
ANSIBLE_API_HOSTNAME = 'http://ansible-ci-pulp:80'
ANSIBLE_CONTENT_HOSTNAME = 'http://ansible-ci-pulp:80/pulp/content'
TOKEN_AUTH_DISABLED = True
GALAXY_REQUIRE_CONTENT_APPROVAL = False
GALAXY_AUTHENTICATION_CLASSES = [
"rest_framework.authentication.SessionAuthentication",
"rest_framework.authentication.TokenAuthentication",
"rest_framework.authentication.BasicAuthentication",
]
'''
SET_ADMIN_PASSWORD = b'''#!/usr/bin/execlineb -S0
@ -42,7 +50,8 @@ foreground {
export DJANGO_SETTINGS_MODULE pulpcore.app.settings
export PULP_CONTENT_ORIGIN localhost
s6-setuidgid postgres
/usr/local/bin/django-admin reset-admin-password --password password
if { /usr/local/bin/django-admin reset-admin-password --password password }
if { /usr/local/bin/pulpcore-manager create-group system:partner-engineers --users admin }
}
'''
@ -50,9 +59,8 @@ foreground {
class GalaxyProvider(CloudProvider):
"""Galaxy plugin.
Sets up fallaxy and pulp (ansible-galaxy) servers for tests.
Sets up pulp (ansible-galaxy) servers for tests.
The fallaxy source itself resides at: https://github.com/ansible/fallaxy-test-container
The pulp source itself resides at: https://github.com/pulp/pulp-oci-images
"""
@ -62,13 +70,9 @@ class GalaxyProvider(CloudProvider):
"""
super(GalaxyProvider, self).__init__(args)
self.fallaxy = os.environ.get(
'ANSIBLE_FALLAXY_CONTAINER',
'quay.io/ansible/fallaxy-test-container:2.0.1'
)
self.pulp = os.environ.get(
'ANSIBLE_PULP_CONTAINER',
'docker.io/pulp/pulp-fedora31@sha256:71054f92fc9c986ba823d86b68631bafc84ae61b7832ce0be1f8e74423e56f64'
'docker.io/pulp/pulp-galaxy-ng@sha256:69b4c4cba4908539b56c5592f40d282f938dd1bdf4de5a81e0a8d04ac3e6e326'
)
self.containers = []
@ -102,55 +106,13 @@ class GalaxyProvider(CloudProvider):
if container_id:
display.info('Running in docker container: %s' % container_id, verbosity=1)
f_results = docker_inspect(self.args, 'fallaxy-stub')
p_results = docker_inspect(self.args, 'pulp')
if f_results and not f_results[0].get('State', {}).get('Running'):
docker_rm(self.args, 'fallaxy-stub')
f_results = []
p_results = docker_inspect(self.args, 'ansible-ci-pulp')
if p_results and not p_results[0].get('State', {}).get('Running'):
docker_rm(self.args, 'pulp')
docker_rm(self.args, 'ansible-ci-pulp')
p_results = []
display.info('%s fallaxy-stub docker container.'
% ('Using the existing' if f_results else 'Starting a new'),
verbosity=1)
fallaxy_port = 8080
fallaxy_token = str(uuid.uuid4()).replace('-', '')
if not f_results:
if self.args.docker or container_id:
publish_ports = []
else:
# publish the simulator ports when not running inside docker
publish_ports = [
'-p', ':'.join((str(fallaxy_port),) * 2),
]
docker_pull(self.args, self.fallaxy)
docker_run(
self.args,
self.fallaxy,
['-d', '--name', 'fallaxy-stub', '-e', 'FALLAXY_TOKEN=%s' % fallaxy_token] + publish_ports,
)
self.containers.append('fallaxy-stub')
if self.args.docker:
fallaxy_host = 'fallaxy-stub'
elif container_id:
fallaxy_host = self._get_simulator_address('fallaxy-stub')
display.info('Found Galaxy simulator container address: %s' % fallaxy_host, verbosity=1)
else:
fallaxy_host = 'localhost'
self._set_cloud_config('FALLAXY_HOST', fallaxy_host)
self._set_cloud_config('FALLAXY_PORT', str(fallaxy_port))
self._set_cloud_config('FALLAXY_TOKEN', fallaxy_token)
display.info('%s pulp docker container.'
display.info('%s ansible-ci-pulp docker container.'
% ('Using the existing' if p_results else 'Starting a new'),
verbosity=1)
@ -162,7 +124,7 @@ class GalaxyProvider(CloudProvider):
else:
# publish the simulator ports when not running inside docker
publish_ports = [
'-p', ':'.join((str(fallaxy_port),) * 2),
'-p', ':'.join((str(pulp_port),) * 2),
]
docker_pull(self.args, self.pulp)
@ -171,7 +133,7 @@ class GalaxyProvider(CloudProvider):
stdout, _dummy = docker_run(
self.args,
self.pulp,
['--name', 'pulp'] + publish_ports,
['--name', 'ansible-ci-pulp'] + publish_ports,
create_only=True
)
@ -194,14 +156,14 @@ class GalaxyProvider(CloudProvider):
os.unlink(admin_pass.name)
# Start the container
docker_start(self.args, 'pulp', [])
docker_start(self.args, 'ansible-ci-pulp', [])
self.containers.append('pulp')
self.containers.append('ansible-ci-pulp')
if self.args.docker:
pulp_host = 'pulp'
pulp_host = 'ansible-ci-pulp'
elif container_id:
pulp_host = self._get_simulator_address('pulp')
pulp_host = self._get_simulator_address('ansible-ci-pulp')
display.info('Found Galaxy simulator container address: %s' % pulp_host, verbosity=1)
else:
pulp_host = 'localhost'
@ -216,7 +178,7 @@ class GalaxyProvider(CloudProvider):
:rtype: list[str]
"""
return ['--link', 'fallaxy-stub', '--link', 'pulp'] # if self.managed else []
return ['--link', 'ansible-ci-pulp'] # if self.managed else []
def cleanup(self):
"""Clean up the resource and temporary configs files after tests."""
@ -240,9 +202,6 @@ class GalaxyEnvironment(CloudEnvironment):
"""
:rtype: CloudEnvironmentConfig
"""
fallaxy_token = self._get_cloud_config('FALLAXY_TOKEN')
fallaxy_host = self._get_cloud_config('FALLAXY_HOST')
fallaxy_port = self._get_cloud_config('FALLAXY_PORT')
pulp_user = self._get_cloud_config('PULP_USER')
pulp_password = self._get_cloud_config('PULP_PASSWORD')
pulp_host = self._get_cloud_config('PULP_HOST')
@ -250,22 +209,18 @@ class GalaxyEnvironment(CloudEnvironment):
return CloudEnvironmentConfig(
ansible_vars=dict(
fallaxy_token=fallaxy_token,
fallaxy_galaxy_server='http://%s:%s/api/' % (fallaxy_host, fallaxy_port),
fallaxy_ah_server='http://%s:%s/api/automation-hub/' % (fallaxy_host, fallaxy_port),
pulp_user=pulp_user,
pulp_password=pulp_password,
pulp_v2_server='http://%s:%s/pulp_ansible/galaxy/ansible_ci/api/' % (pulp_host, pulp_port),
pulp_v3_server='http://%s:%s/pulp_ansible/galaxy/ansible_ci/api/' % (pulp_host, pulp_port),
pulp_v2_server='http://%s:%s/pulp_ansible/galaxy/automation-hub/api/' % (pulp_host, pulp_port),
pulp_v3_server='http://%s:%s/pulp_ansible/galaxy/automation-hub/api/' % (pulp_host, pulp_port),
pulp_api='http://%s:%s' % (pulp_host, pulp_port),
galaxy_ng_server='http://%s:%s/api/galaxy/' % (pulp_host, pulp_port),
),
env_vars=dict(
FALLAXY_TOKEN=fallaxy_token,
FALLAXY_GALAXY_SERVER='http://%s:%s/api/' % (fallaxy_host, fallaxy_port),
FALLAXY_AH_SERVER='http://%s:%s/api/automation-hub/' % (fallaxy_host, fallaxy_port),
PULP_USER=pulp_user,
PULP_PASSWORD=pulp_password,
PULP_V2_SERVER='http://%s:%s/pulp_ansible/galaxy/ansible_ci/api/' % (pulp_host, pulp_port),
PULP_V3_SERVER='http://%s:%s/pulp_ansible/galaxy/ansible_ci/api/' % (pulp_host, pulp_port),
PULP_V2_SERVER='http://%s:%s/pulp_ansible/galaxy/automation-hub/api/' % (pulp_host, pulp_port),
PULP_V3_SERVER='http://%s:%s/pulp_ansible/galaxy/automation-hub/api/' % (pulp_host, pulp_port),
GALAXY_NG_SERVER='http://%s:%s/api/galaxy/' % (pulp_host, pulp_port),
),
)