diff options
author | Toshio Kuratomi <a.badger@gmail.com> | 2018-04-26 12:24:43 -0700 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2018-04-26 13:27:18 -0700 |
commit | f91d961cb4d5fc3f4362b35495cd988375ddc278 (patch) | |
tree | 60d639d232808fc579f4d0baf2a9b32571cf4872 /test/integration/targets/template | |
parent | 5dd8977cfafd6f6e0a946c92b173b79e56d8687b (diff) | |
download | ansible-f91d961cb4d5fc3f4362b35495cd988375ddc278.tar.gz |
Add tests for template with non-ascii filenames
This is a test in response to #27262 but I could not provoke the error
so it only shows that the current code is working with non-ascii
filenames in this case. It doesn't show whether there's some other bug
somewhere.
Diffstat (limited to 'test/integration/targets/template')
-rw-r--r-- | test/integration/targets/template/tasks/main.yml | 18 | ||||
-rw-r--r-- | test/integration/targets/template/templates/café.j2 | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/integration/targets/template/tasks/main.yml b/test/integration/targets/template/tasks/main.yml index ee04f0f3c2..7e34852afa 100644 --- a/test/integration/targets/template/tasks/main.yml +++ b/test/integration/targets/template/tasks/main.yml @@ -51,6 +51,24 @@ that: - "template_result.changed == true" +# Basic template with non-ascii names +- name: Check that non-ascii source and dest work + template: + src: 'café.j2' + dest: '{{ output_dir }}/café.txt' + register: template_results + +- name: Check that the resulting file exists + stat: + path: '{{ output_dir }}/café.txt' + register: stat_results + +- name: Check that template created the right file + assert: + that: + - 'template_results is changed' + - 'stat_results.stat["exists"]' + # test for import with context on jinja-2.9 See https://github.com/ansible/ansible/issues/20494 - name: fill in a template using import with context ala issue 20494 template: src=import_with_context.j2 dest={{output_dir}}/import_with_context.templated mode=0644 diff --git a/test/integration/targets/template/templates/café.j2 b/test/integration/targets/template/templates/café.j2 new file mode 100644 index 0000000000..ef7e08e741 --- /dev/null +++ b/test/integration/targets/template/templates/café.j2 @@ -0,0 +1 @@ +{{ ansible_managed }} |