zuul-jobs/test-playbooks/stage-output.yaml
Clark Boylan 1f78388328 Improve stage-output functional test
This adds extra . separators to the file we check is renamed. This came
up as a real world issue with devstack when testing the follow on update
to stage-output. We put this in a separate change to ensure the old and
new behavior is consistent.

Change-Id: I3b7504cfd90a4e7523ce88c50e90b2e9004e05ee
2022-09-06 16:16:12 -07:00

38 lines
1.1 KiB
YAML

- hosts: all
tasks:
- name: Write a test file
copy:
content: "Test file"
dest: "/tmp/test-output.txt"
- name: Write a second test file
copy:
content: "Second test file"
dest: "/tmp/test-output.something.log"
- name: Test stage-output with explicit files
include_role:
name: stage-output
vars:
zuul_copy_output:
/tmp/test-output.txt: logs
/tmp/test-output.something.log: logs
extensions_to_txt:
log: true
txt: false
- name: Check the file was renamed
stat:
path: /home/zuul/logs/test-output.something_log.txt
register: renamed_file_stat
- name: Fail if file was not renamed
fail:
msg: "Renamed test-output log file does not exist."
when: not renamed_file_stat.stat.exists
- name: Test stage-output with no input
include_role:
name: stage-output
- name: Remove sudo
include_role:
name: revoke-sudo
- name: Test stage-output without sudo
include_role:
name: stage-output