forked from ansible/test-playbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_proot.yml
69 lines (62 loc) · 2.03 KB
/
test_proot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
# Launch a job and assert that it cannot:
# - see /var/lib/awx/projects (except for self)
# - see /var/lib/awx/job_status
# - see /tmp/ (except for self)
# - see /etc/awx/settings.py
# - see /var/log/
- hosts: all
gather_facts: true
vars:
tower_conf_dir: /etc/tower
tower_tmp_dirs:
- /tmp
- /var/tmp
sys_log_dir: /var/log
tower_projects_dir: /var/lib/awx/projects
tower_job_status_dir: /var/lib/awx/job_status
tasks:
- name: 'Wait 30 seconds before proceeding...'
pause: seconds=30
- command: find {{tower_tmp_dirs|join(' ')}} -mindepth 1 -maxdepth 1 -type d -regex '.*ansible_tower.*\|.*awx_proot.*'
register: result
- debug: var=result
- name: assert that only one ansible_tower_XXXXX tempfile is visible
assert:
that:
- 'result.rc == 0'
- 'result.stdout_lines|length <= 1'
- command: find {{tower_projects_dir}}/ -mindepth 1 -maxdepth 1 -type d
register: result
- debug: var=result
- name: assert that only one tower project directory is visible
assert:
that:
- 'result.rc == 0'
- 'result.stdout_lines|length == 1'
- command: find {{tower_job_status_dir}} -mindepth 1 -maxdepth 1 -type f
register: result
- debug: var=result
- name: assert that no job_status files are visible
assert:
that:
- 'result.rc == 0'
- 'result.stdout_lines|length == 0'
- command: find {{tower_conf_dir}} -mindepth 1 -maxdepth 1 -type f
ignore_errors: true
register: result
- debug: var=result
- name: assert that no tower conf files are visible
assert:
that:
- 'result.rc == 0'
- 'result.stdout_lines|length == 0'
- command: find {{sys_log_dir}} -mindepth 1 -maxdepth 1 -type f
ignore_errors: true
register: result
- debug: var=result
- name: assert that no tower log files are visible
assert:
that:
- 'result.rc == 0'
# - 'result.stdout_lines|length == 0'