summaryrefslogtreecommitdiff
path: root/test/integration/targets/ansible-galaxy-collection/tasks/build.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/ansible-galaxy-collection/tasks/build.yml')
-rw-r--r--test/integration/targets/ansible-galaxy-collection/tasks/build.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/integration/targets/ansible-galaxy-collection/tasks/build.yml b/test/integration/targets/ansible-galaxy-collection/tasks/build.yml
index 8140d468..83e9acc9 100644
--- a/test/integration/targets/ansible-galaxy-collection/tasks/build.yml
+++ b/test/integration/targets/ansible-galaxy-collection/tasks/build.yml
@@ -1,4 +1,29 @@
---
+- name: create a dangling symbolic link inside collection directory
+ ansible.builtin.file:
+ src: '/non-existent-path/README.md'
+ dest: '{{ galaxy_dir }}/scratch/ansible_test/my_collection/docs/README.md'
+ state: link
+ force: yes
+
+- name: build basic collection based on current directory with dangling symlink
+ command: ansible-galaxy collection build {{ galaxy_verbosity }}
+ args:
+ chdir: '{{ galaxy_dir }}/scratch/ansible_test/my_collection'
+ register: fail_symlink_build
+ ignore_errors: yes
+
+- name: assert that build fails due to dangling symlink
+ assert:
+ that:
+ - fail_symlink_build.failed
+ - '"Failed to find the target path" in fail_symlink_build.stderr'
+
+- name: remove dangling symbolic link
+ ansible.builtin.file:
+ path: '{{ galaxy_dir }}/scratch/ansible_test/my_collection/docs/README.md'
+ state: absent
+
- name: build basic collection based on current directory
command: ansible-galaxy collection build {{ galaxy_verbosity }}
args: