mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #10857 from jeffb-stell/devel
Add test for https://github.com/ansible/ansible/issues/9851
This commit is contained in:
commit
aefca24616
2 changed files with 22 additions and 0 deletions
3
test/integration/roles/test_filters/files/9851.txt
Normal file
3
test/integration/roles/test_filters/files/9851.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[{
|
||||||
|
"k": "Quotes \"'\n"
|
||||||
|
}]
|
|
@ -25,6 +25,25 @@
|
||||||
- name: Verify that we workaround a py26 json bug
|
- name: Verify that we workaround a py26 json bug
|
||||||
template: src=py26json.j2 dest={{output_dir}}/py26json.templated mode=0644
|
template: src=py26json.j2 dest={{output_dir}}/py26json.templated mode=0644
|
||||||
|
|
||||||
|
- name: 9851 - Verify that we don't trigger https://github.com/ansible/ansible/issues/9851
|
||||||
|
copy:
|
||||||
|
content: " [{{item|to_nice_json}}]"
|
||||||
|
dest: "{{output_dir}}/9851.out"
|
||||||
|
with_items:
|
||||||
|
- {"k": "Quotes \"'\n"}
|
||||||
|
|
||||||
|
- name: 9851 - copy known good output into place
|
||||||
|
copy: src=9851.txt dest={{output_dir}}/9851.txt
|
||||||
|
|
||||||
|
- name: 9851 - Compare generated json to known good
|
||||||
|
shell: diff {{output_dir}}/9851.out {{output_dir}}/9851.txt
|
||||||
|
register: 9851_diff_result
|
||||||
|
|
||||||
|
- name: 9851 - verify generated file matches known good
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- '9851_diff_result.stdout == ""'
|
||||||
|
|
||||||
- name: fill in a basic template
|
- name: fill in a basic template
|
||||||
template: src=foo.j2 dest={{output_dir}}/foo.templated mode=0644
|
template: src=foo.j2 dest={{output_dir}}/foo.templated mode=0644
|
||||||
register: template_result
|
register: template_result
|
||||||
|
|
Loading…
Reference in a new issue