summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/ansible-galaxy-collection-scm
diff options
context:
space:
mode:
authorSloane Hertel <shertel@redhat.com>2020-07-30 19:55:29 +0200
committerGitHub <noreply@github.com>2020-07-30 19:55:29 +0200
commit54e2ae79e72cd651c233bbbefc23ae53444980e7 (patch)
treeb3f81632933064e949e419488c1d0398f46fb042 /test/integration/targets/ansible-galaxy-collection-scm
parentlinux facts - return proper broadcast address (#64528) (diff)
downloadansible-54e2ae79e72cd651c233bbbefc23ae53444980e7.tar.xz
ansible-54e2ae79e72cd651c233bbbefc23ae53444980e7.zip
fix downloading collections in git repos and tar.gz artifacts (#70524)
* Fix downloading tar files * Fix downloading SCM collections * changelog
Diffstat (limited to 'test/integration/targets/ansible-galaxy-collection-scm')
-rw-r--r--test/integration/targets/ansible-galaxy-collection-scm/tasks/download.yml36
-rw-r--r--test/integration/targets/ansible-galaxy-collection-scm/tasks/main.yml1
2 files changed, 37 insertions, 0 deletions
diff --git a/test/integration/targets/ansible-galaxy-collection-scm/tasks/download.yml b/test/integration/targets/ansible-galaxy-collection-scm/tasks/download.yml
new file mode 100644
index 0000000000..fd1da68b62
--- /dev/null
+++ b/test/integration/targets/ansible-galaxy-collection-scm/tasks/download.yml
@@ -0,0 +1,36 @@
+- name: create test download dir
+ file:
+ path: '{{ galaxy_dir }}/download'
+ state: directory
+
+- name: download a git repository
+ command: 'ansible-galaxy collection download git+https://github.com/ansible-collections/amazon.aws.git,37875c5b4ba5bf3cc43e07edf29f3432fd76def5'
+ args:
+ chdir: '{{ galaxy_dir }}/download'
+ register: download_collection
+
+- name: check that the file was downloaded
+ stat:
+ path: '{{ galaxy_dir }}/download/collections/amazon-aws-1.0.0.tar.gz'
+ register: download_collection_actual
+
+- assert:
+ that:
+ - '"Downloading collection ''amazon.aws'' to" in download_collection.stdout'
+ - download_collection_actual.stat.exists
+
+- name: test the downloaded repository can be installed
+ command: 'ansible-galaxy collection install -r requirements.yml'
+ args:
+ chdir: '{{ galaxy_dir }}/download/collections/'
+
+- name: list installed collections
+ command: 'ansible-galaxy collection list'
+ register: installed_collections
+
+- assert:
+ that:
+ - "'amazon.aws' in installed_collections.stdout"
+
+- include_tasks: ./empty_installed_collections.yml
+ when: cleanup
diff --git a/test/integration/targets/ansible-galaxy-collection-scm/tasks/main.yml b/test/integration/targets/ansible-galaxy-collection-scm/tasks/main.yml
index 500defb878..7db7e1d6e6 100644
--- a/test/integration/targets/ansible-galaxy-collection-scm/tasks/main.yml
+++ b/test/integration/targets/ansible-galaxy-collection-scm/tasks/main.yml
@@ -22,6 +22,7 @@
- include_tasks: ./multi_collection_repo_individual.yml
- include_tasks: ./setup_recursive_scm_dependency.yml
- include_tasks: ./scm_dependency_deduplication.yml
+ - include_tasks: ./download.yml
always: