Skip to content

Commit

Permalink
Enable all the binary tests inside of the role.
Browse files Browse the repository at this point in the history
They're not being run by default so make sure they're ready to show
errors when we turn them on for v2
  • Loading branch information
abadger committed Dec 10, 2014
1 parent 37d1b3f commit 65be0ee
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions test/integration/roles/test_binary/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
path: "{{ output_dir }}/b64_latin1"
register: b64_latin1

# Tests themselves
- name: copy with utf-8 content in a playbook
copy:
content: "{{ simple_accents }}\n"
Expand All @@ -43,7 +44,6 @@
- assert:
that:
- 'results.stat.checksum == from_playbook.stat.checksum'
ignore_errors: True

- name: copy with utf8 in a base64 encoded string
copy:
Expand All @@ -58,22 +58,20 @@
- assert:
that:
- 'results.stat.checksum == b64_utf8.stat.checksum'
ignore_errors: True

#- name: copy with latin1 in a base64 encoded string
# copy:
# content: "{{ latin1_simple_accents|b64decode }}\n"
# dest: "{{ output_dir }}/b64_latin1.txt"
#
#- name: Check that what was written matches
# stat:
# path: "{{ output_dir }}/b64_latin1.txt"
# register: results
#
#- assert:
# that:
# - 'results.stat.checksum == b64_latin1.stat.checksum'
# ignore_errors: True

- name: copy with latin1 in a base64 encoded string
copy:
content: "{{ latin1_simple_accents|b64decode }}\n"
dest: "{{ output_dir }}/b64_latin1.txt"

- name: Check that what was written matches
stat:
path: "{{ output_dir }}/b64_latin1.txt"
register: results

- assert:
that:
- 'results.stat.checksum == b64_latin1.stat.checksum'

- name: Template with a unicode string from the playbook
template:
Expand Down Expand Up @@ -103,21 +101,21 @@
that:
- 'results.stat.checksum == b64_utf8.stat.checksum'

#- name: Template with latin1 in a base64 encoded string
# template:
# src: "b64_latin1_template.j2"
# dest: "{{ output_dir }}/b64_latin1_template.txt"
#
#- name: Check that what was written matches
# stat:
# path: "{{ output_dir }}/b64_latin1_template.txt"
# register: results
#
#- assert:
# that:
# - 'results.stat.checksum == b64_latin1.stat.checksum'
- name: Template with latin1 in a base64 encoded string
template:
src: "b64_latin1_template.j2"
dest: "{{ output_dir }}/b64_latin1_template.txt"

- name: Check that what was written matches
stat:
path: "{{ output_dir }}/b64_latin1_template.txt"
register: results

- assert:
that:
- 'results.stat.checksum == b64_latin1.stat.checksum'

# These might give garbled output but none of them should traceback
- debug: var=simple_accents
- debug: msg={{ utf8_simple_accents|b64decode}}
#- debug: msg={{ latin1_simple_accents|b64decode}}
- debug: msg={{ latin1_simple_accents|b64decode}}

0 comments on commit 65be0ee

Please sign in to comment.