Fix fetch integration test. (#75661)

pull/75679/head
Matt Clay 3 years ago committed by GitHub
parent 12734fa21c
commit 8d84f3c593
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,12 +8,19 @@
paths: paths:
- "{{ role_path }}/vars" - "{{ role_path }}/vars"
- name: Work-around for locked users on Alpine
# see https://github.com/ansible/ansible/issues/68676
set_fact:
password: '*'
when: ansible_distribution == 'Alpine'
- name: Create test user - name: Create test user
user: user:
name: fetcher name: fetcher
create_home: yes create_home: yes
groups: "{{ _fetch_additional_groups | default(omit) }}" groups: "{{ _fetch_additional_groups | default(omit) }}"
append: "{{ True if _fetch_additional_groups else False }}" append: "{{ True if _fetch_additional_groups else False }}"
password: "{{ password | default(omit) }}"
become: yes become: yes
notify: notify:
- remove test user - remove test user

@ -11,6 +11,7 @@
# and the fact that contains the path are needed in a separate ansible-playbook run. # and the fact that contains the path are needed in a separate ansible-playbook run.
setup_remote_tmp_dir_skip_cleanup: yes setup_remote_tmp_dir_skip_cleanup: yes
setup_remote_tmp_dir_cache_path: yes setup_remote_tmp_dir_cache_path: yes
skip_cleanup: yes
# This prevents ssh access. It is fixed in some container images but not all. # This prevents ssh access. It is fixed in some container images but not all.
# https://github.com/ansible/distro-test-containers/pull/70 # https://github.com/ansible/distro-test-containers/pull/70

@ -6,6 +6,15 @@
gather_facts: no gather_facts: no
tasks: tasks:
- name: Check connectivity
command: whoami
register: whoami
- name: Verify user
assert:
that:
- whoami.stdout == 'fetcher'
- name: Try to fetch a file inside an inaccessible directory - name: Try to fetch a file inside an inaccessible directory
fetch: fetch:
src: "{{ remote_tmp_dir }}/noaccess/file1" src: "{{ remote_tmp_dir }}/noaccess/file1"

Loading…
Cancel
Save