mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Add symlinks sanity test. (#46467)
* Add symlinks sanity test. * Replace legacy test symlinks with actual content. * Remove dir symlink from template_jinja2_latest. * Update import test to use generated library dir. * Fix copy test symlink setup.
This commit is contained in:
@@ -1 +0,0 @@
|
||||
/tmp/ansible-test-abs-link
|
||||
@@ -1 +0,0 @@
|
||||
/tmp/ansible-test-abs-link-dir
|
||||
@@ -1 +0,0 @@
|
||||
invalid
|
||||
@@ -1 +0,0 @@
|
||||
../invalid
|
||||
@@ -1 +0,0 @@
|
||||
/tmp/ansible-test-link-dir/out_of_tree_circle
|
||||
@@ -1 +0,0 @@
|
||||
../subdir2/subdir3
|
||||
@@ -9,15 +9,25 @@
|
||||
local_temp_dir: '{{ tempfile_result.stdout }}'
|
||||
# output_dir is hardcoded in test/runner/lib/executor.py and created there
|
||||
remote_dir: '{{ output_dir }}'
|
||||
symlinks:
|
||||
ansible-test-abs-link: /tmp/ansible-test-abs-link
|
||||
ansible-test-abs-link-dir: /tmp/ansible-test-abs-link-dir
|
||||
circles: ../
|
||||
invalid: invalid
|
||||
invalid2: ../invalid
|
||||
out_of_tree_circle: /tmp/ansible-test-link-dir/out_of_tree_circle
|
||||
subdir3: ../subdir2/subdir3
|
||||
|
||||
- file: path={{local_temp_dir}} state=directory
|
||||
name: ensure temp dir exists
|
||||
|
||||
# file cannot do this properly, use command instead
|
||||
- name: Create circular symbolic link
|
||||
command: ln -s ../ circles
|
||||
- name: Create symbolic link
|
||||
command: "ln -s '{{ item.value }}' '{{ item.key }}'"
|
||||
args:
|
||||
chdir: '{{role_path}}/files/subdir/subdir1'
|
||||
warn: no
|
||||
with_dict: "{{ symlinks }}"
|
||||
|
||||
- name: Create remote unprivileged remote user
|
||||
user:
|
||||
@@ -55,11 +65,12 @@
|
||||
state: absent
|
||||
connection: local
|
||||
|
||||
- name: Remove circular symbolic link
|
||||
- name: Remove symbolic link
|
||||
file:
|
||||
path: '{{ role_path }}/files/subdir/subdir1/circles'
|
||||
path: '{{ role_path }}/files/subdir/subdir1/{{ item.key }}'
|
||||
state: absent
|
||||
connection: local
|
||||
with_dict: "{{ symlinks }}"
|
||||
|
||||
- name: Remote unprivileged remote user
|
||||
user:
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../template
|
||||
@@ -18,4 +18,7 @@ source "${MYTMPDIR}/jinja2/bin/activate"
|
||||
|
||||
pip install -U jinja2
|
||||
|
||||
ANSIBLE_ROLES_PATH="$(dirname "$(pwd)")"
|
||||
export ANSIBLE_ROLES_PATH
|
||||
|
||||
ansible-playbook -i ../../inventory main.yml -e @../../integration_config.yml -v "$@"
|
||||
|
||||
Reference in New Issue
Block a user