Fix problems with non-ascii values passed as part of the command to connection plugins

@drybjed discovered this with non-ascii environment variables and
command line arguments to script and raw module.
This commit is contained in:
Toshio Kuratomi
2016-01-04 19:23:12 -08:00
parent 8d57ffd16b
commit c0a8cd950b
10 changed files with 97 additions and 13 deletions

View File

@@ -0,0 +1,7 @@
#!/bin/sh
echo "Non-ascii arguments:"
echo $@
echo "Non-ascii Env var:"
echo $option

View File

@@ -49,6 +49,51 @@
that:
- "'¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö ×' in output.stdout_lines"
- name: Run raw with non-ascii options
raw: "/bin/echo Zażółć gęślą jaźń"
register: results
- name: Check that raw output the right thing
assert:
that:
- "'Zażółć gęślą jaźń' in results.stdout_lines"
- name: Run a script with non-ascii options and environment
script: unicode-test-script --option "Zażółć gęślą jaźń"
environment:
option: Zażółć
register: results
- name: Check that script output includes the nonascii arguments and environment values
assert:
that:
- "'--option Zażółć gęślą jaźń' in results.stdout_lines"
- "'Zażółć' in results.stdout_lines"
- name: Ping with non-ascii environment variable and option
ping:
data: "Zażółć gęślą jaźń"
environment:
option: Zażółć
register: results
- name: Check that ping with non-ascii data was correct
assert:
that:
- "'Zażółć gęślą jaźń' == results.ping"
- name: Command that echos a non-ascii env var
command: "echo $option"
environment:
option: Zażółć
register: results
- name: Check that a non-ascii env var was passed to the command module
assert:
that:
- "'Zażółć' in results.stdout_lines"
- name: 'A play for hosts in group: ĪīĬĭ'
hosts: 'ĪīĬĭ'
gather_facts: true