PageRenderTime 17ms CodeModel.GetById 10ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/test/integration/roles/test_file/tasks/selinux_tests.yml

https://github.com/ajanthanm/ansible
YAML | 30 lines | 10 code | 4 blank | 16 comment | 0 complexity | ea00353d1670e6787be592837d66ec60 MD5 | raw file
 1# Test code for the file module - selinux subtasks.
 2# (c) 2014, Richard Isaacson <richard.c.isaacson@gmail.com>
 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: touch a file for testing
20  file: path={{output_dir}}/foo-se.txt state=touch
21  register: file_se_result
22
23- name: verify that the file was marked as changed
24  assert:
25    that:
26      - "file_se_result.changed == true"
27      - "file_se_result.secontext == 'unconfined_u:object_r:admin_home_t:s0'"
28
29- name: remove the file used for testing
30  file: path={{output_dir}}/foo-se.txt state=absent