Skip to content

Commit

Permalink
Integration test fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclay committed May 1, 2021
1 parent daecb30 commit ca507ff
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions test/integration/targets/async/tasks/main.yml
Expand Up @@ -320,6 +320,7 @@

- name: run async poll callback test playbook
command: ansible-playbook {{ role_path }}/callback_test.yml
delegate_to: localhost
register: callback_output

- assert:
Expand Down
2 changes: 2 additions & 0 deletions test/integration/targets/copy/tasks/main.yml
Expand Up @@ -27,6 +27,7 @@
chdir: '{{role_path}}/files/subdir/subdir1'
warn: no
with_dict: "{{ symlinks }}"
delegate_to: localhost

- name: Create remote unprivileged remote user
user:
Expand Down Expand Up @@ -78,6 +79,7 @@
when: ansible_os_family == 'RedHat' and ansible_selinux.get('mode') == 'enforcing'

- import_tasks: no_log.yml
delegate_to: localhost

- import_tasks: check_mode.yml

Expand Down
1 change: 1 addition & 0 deletions test/integration/targets/git/tasks/archive.yml
Expand Up @@ -119,6 +119,7 @@
unarchive:
src: '{{ checkout_dir }}/test_role.{{ item }}'
dest: '{{ checkout_dir }}/{{ git_archive_prefix }}.{{ item }}'
remote_src: yes
with_items: "{{ git_archive_extensions[ansible_os_family ~ ansible_distribution_major_version | default('default') ] | default(git_archive_extensions.default) }}"

- name: ARCHIVE | Check if prefix directory exists in what's extracted
Expand Down
2 changes: 1 addition & 1 deletion test/integration/targets/setup_cron/defaults/main.yml
@@ -1 +1 @@
remote_dir: "{{ lookup('env', 'OUTPUT_DIR') }}"
remote_dir: "{{ remote_tmp_dir }}"
2 changes: 2 additions & 0 deletions test/integration/targets/setup_cron/meta/main.yml
@@ -0,0 +1,2 @@
dependencies:
- setup_remote_tmp_dir
3 changes: 3 additions & 0 deletions test/integration/targets/unarchive/tasks/test_include.yml
Expand Up @@ -15,6 +15,7 @@
unarchive:
src: "{{ remote_tmp_dir }}/test-unarchive.zip"
dest: "{{ remote_tmp_dir }}/include-zip"
remote_src: yes
include:
- FOO-UNAR.TXT

Expand All @@ -39,6 +40,7 @@
unarchive:
src: "{{ remote_tmp_dir }}/test-unarchive-multi.tar"
dest: "{{ remote_tmp_dir }}/include-tar"
remote_src: yes
include:
- foo-unarchive-777.txt

Expand All @@ -61,6 +63,7 @@
unarchive:
src: "{{ remote_tmp_dir }}/test-unarchive-multi.tar"
dest: "{{ remote_tmp_dir }}/include-tar"
remote_src: yes
include:
- foo-unarchive-777.txt
exclude:
Expand Down
15 changes: 12 additions & 3 deletions test/integration/targets/yum_repository/tasks/main.yml
Expand Up @@ -106,6 +106,11 @@
module_hotfixes: no
register: test_repo_add1

- name: Get repo file contents
slurp:
path: "{{ '/etc/yum.repos.d/' ~ yum_repository_test_repo.name ~ '2.repo' }}"
register: slurp

- name: check that options are correctly getting written to the repo file
assert:
that:
Expand All @@ -116,8 +121,7 @@
- "'keepalive = 0' in repo_file_contents"
- "'module_hotfixes = 0' in repo_file_contents"
vars:
repo_file: "{{ '/etc/yum.repos.d/' ~ yum_repository_test_repo.name ~ '2.repo' }}"
repo_file_contents: "{{ lookup('file', repo_file) }}"
repo_file_contents: "{{ slurp.content | b64decode }}"

- name: check new config doesn't change (Idempotant)
yum_repository:
Expand Down Expand Up @@ -175,6 +179,11 @@
- ddd
notify: remove listtest repo

- name: Get repo file
slurp:
path: /etc/yum.repos.d/listtest.repo
register: slurp

- name: Assert that lists were properly inserted
assert:
that:
Expand All @@ -185,6 +194,6 @@
- "'aaa bbb' in repofile"
- "'ccc ddd' in repofile"
vars:
repofile: "{{ lookup('file', '/etc/yum.repos.d/listtest.repo') }}"
repofile: "{{ slurp.content | b64decode }}"
url_hostname: "{{ yum_repository_test_repo.baseurl | urlsplit('hostname') }}"
url_hostname2: "{{ url_hostname | replace('download[0-9]?\\.', 'download2\\.', 1) }}"

0 comments on commit ca507ff

Please sign in to comment.