Debian Codegraph @

test/integration/targets/file/tasks/selinux_tests.yml

raw
1 # Test code for the file module - selinux subtasks.
2 # (c) 2014, Richard Isaacson <[email protected]>
3
4 # This file is part of Ansible
5 #
6 # Ansible is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # Ansible is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
18
19 - name: Initialize the test output dir
20 import_tasks: initialize.yml
21
22 - name: touch a file for testing
23 file: path={{remote_tmp_dir_test}}/foo-se.txt state=touch
24 register: file_se_result
25
26 - name: verify that the file was marked as changed
27 assert:
28 that:
29 - "file_se_result.changed == true"
30 - "file_se_result.secontext == 'unconfined_u:object_r:admin_home_t:s0'"
31
32 - name: remove the file used for testing
33 file: path={{remote_tmp_dir_test}}/foo-se.txt state=absent