mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
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:
7
test/integration/unicode-test-script
Executable file
7
test/integration/unicode-test-script
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Non-ascii arguments:"
|
||||
echo $@
|
||||
|
||||
echo "Non-ascii Env var:"
|
||||
echo $option
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user