summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/copy/tasks/acls.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/copy/tasks/acls.yml')
-rw-r--r--test/integration/targets/copy/tasks/acls.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/integration/targets/copy/tasks/acls.yml b/test/integration/targets/copy/tasks/acls.yml
new file mode 100644
index 0000000..d7d099e
--- /dev/null
+++ b/test/integration/targets/copy/tasks/acls.yml
@@ -0,0 +1,38 @@
+- block:
+ - name: Install the acl package on Ubuntu
+ apt:
+ name: acl
+ when: ansible_distribution in ('Ubuntu')
+
+ - block:
+ - name: Testing ACLs
+ copy:
+ content: "TEST"
+ mode: 0644
+ dest: "~/test.txt"
+
+ - shell: getfacl ~/test.txt
+ register: acls
+
+ become: yes
+ become_user: "{{ remote_unprivileged_user }}"
+
+ - name: Check that there are no ACLs leftovers
+ assert:
+ that:
+ - "'user:{{ remote_unprivileged_user }}:r-x\t#effective:r--' not in acls.stdout_lines"
+
+ - name: Check that permissions match with what was set in the mode param
+ assert:
+ that:
+ - "'user::rw-' in acls.stdout_lines"
+ - "'group::r--' in acls.stdout_lines"
+ - "'other::r--' in acls.stdout_lines"
+
+ always:
+ - name: Clean up
+ file:
+ path: "~/test.txt"
+ state: absent
+ become: yes
+ become_user: "{{ remote_unprivileged_user }}"