diff options
author | Matt Clay <mclay@redhat.com> | 2021-09-08 22:11:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-08 22:11:40 -0700 |
commit | 8d84f3c5936ef24198b819842a6359775d74d340 (patch) | |
tree | 58f09d431cd8b8a056ed4b4eeae87e083a895e4e /test | |
parent | 12734fa21c08a0ce8c84e533abdc560db2eb1955 (diff) | |
download | ansible-8d84f3c5936ef24198b819842a6359775d74d340.tar.gz |
Fix fetch integration test. (#75661)
Diffstat (limited to 'test')
3 files changed, 17 insertions, 0 deletions
diff --git a/test/integration/targets/fetch/roles/fetch_tests/tasks/setup.yml b/test/integration/targets/fetch/roles/fetch_tests/tasks/setup.yml index e38086d378..89b94c4622 100644 --- a/test/integration/targets/fetch/roles/fetch_tests/tasks/setup.yml +++ b/test/integration/targets/fetch/roles/fetch_tests/tasks/setup.yml @@ -8,12 +8,19 @@ paths: - "{{ 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 user: name: fetcher create_home: yes groups: "{{ _fetch_additional_groups | default(omit) }}" append: "{{ True if _fetch_additional_groups else False }}" + password: "{{ password | default(omit) }}" become: yes notify: - remove test user diff --git a/test/integration/targets/fetch/setup_unreadable_test.yml b/test/integration/targets/fetch/setup_unreadable_test.yml index 4c08969c85..f4cc8c1e6e 100644 --- a/test/integration/targets/fetch/setup_unreadable_test.yml +++ b/test/integration/targets/fetch/setup_unreadable_test.yml @@ -11,6 +11,7 @@ # 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_cache_path: yes + skip_cleanup: yes # This prevents ssh access. It is fixed in some container images but not all. # https://github.com/ansible/distro-test-containers/pull/70 diff --git a/test/integration/targets/fetch/test_unreadable_with_stat.yml b/test/integration/targets/fetch/test_unreadable_with_stat.yml index e00026bc6f..c8a0145ce9 100644 --- a/test/integration/targets/fetch/test_unreadable_with_stat.yml +++ b/test/integration/targets/fetch/test_unreadable_with_stat.yml @@ -6,6 +6,15 @@ gather_facts: no 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 fetch: src: "{{ remote_tmp_dir }}/noaccess/file1" |