tests: teach various tests to cleanup /tmp when they're done.

This commit is contained in:
David Wilson 2018-10-23 15:34:18 +01:00
parent 40d2cf7e25
commit fd5066d671
3 changed files with 40 additions and 0 deletions

View File

@ -64,3 +64,20 @@
- stat.results[2].stat.checksum == "b26dd6444595e2bdb342aa0a91721b57478b5029"
- stat.results[3].stat.checksum == "d675f47e467eae19e49032a2cc39118e12a6ee72"
- file:
state: absent
path: "{{item}}"
with_items:
- /tmp/copy-tiny-file
- /tmp/copy-tiny-file.out
- /tmp/copy-no-mode
- /tmp/copy-no-mode.out
- /tmp/copy-with-mode
- /tmp/copy-with-mode.out
- /tmp/copy-large-file
- /tmp/copy-large-file.out
- /tmp/copy-tiny-inline-file.out
- /tmp/copy-large-inline-file
- /tmp/copy-large-inline-file.out
# end of cleaning out files (again)

View File

@ -102,3 +102,16 @@
- assert:
that:
- out.stat.mode == "1461"
- file:
state: absent
path: "{{item}}"
with_items:
- /tmp/weird-mode
- /tmp/weird-mode.out
- /tmp/copy-no-mode
- /tmp/copy-no-mode.out
- /tmp/copy-with-mode
- /tmp/copy-with-mode.out
# end of cleaning out files

View File

@ -32,6 +32,7 @@
- file:
path: /tmp/sync-test.out
state: absent
become: true
- synchronize:
private_key: /tmp/synchronize-action-key
@ -46,3 +47,12 @@
- assert:
that: outout == "item!"
- file:
path: "{{item}}"
state: absent
become: true
with_items:
- /tmp/synchronize-action-key
- /tmp/sync-test
- /tmp/sync-test.out