fix fixup_perms2() test

pull/715/head
Steven Robertson 4 years ago
parent 22bc5448b1
commit 355e2ffba2

@ -1,18 +1,12 @@
# Verify action plugins still set file modes correctly even though
# fixup_perms2() avoids setting execute bit despite being asked to.
# As of Ansible 2.10.0, default perms vary based on OS. On debian systems it's 0644 and on centos it's 0664 based on test output
# regardless, we're testing that no execute bit is set here so either check is ok
- name: integration/action/fixup_perms2__copy.yml
hosts: test-targets
any_errors_fatal: true
tasks:
- name: Get default remote file mode
shell: python -c 'import os; print("%04o" % (int("0644", 8) & ~os.umask(0)))'
register: py_umask
- name: Set default file mode
set_fact:
mode: "{{py_umask.stdout}}"
#
# copy module (no mode).
#
@ -26,7 +20,7 @@
register: out
- assert:
that:
- out.stat.mode == mode
- out.stat.mode in ("0644", "0666")
#
# copy module (explicit mode).
@ -68,7 +62,7 @@
register: out
- assert:
that:
- out.stat.mode == mode
- out.stat.mode in ("0644", "0666")
#
# copy module (existing disk files, preserve mode).

Loading…
Cancel
Save