diff options
author | rwagnergit <rjwagner.commerce@gmail.com> | 2020-04-22 18:56:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-22 18:56:35 +0200 |
commit | 977b58740b7dbb328355c7c6970e1a6684101d13 (patch) | |
tree | ce38034a4cab7b3eef4b58dea301e108088c76e3 /test/integration | |
parent | Cap cryptography version for macOS openssl test (#69083) (diff) | |
download | ansible-977b58740b7dbb328355c7c6970e1a6684101d13.tar.xz ansible-977b58740b7dbb328355c7c6970e1a6684101d13.zip |
update ActionBase._low_level_execute_command to honor executable (#68315)
* update ActionBase._low_level_execute_command to honor executable
* adding changelog fragment
* renaming changelog fragment to .yml
* noop change to bump shippable
* adding raw_executable integration test
* copying aliases from raw
* removing blank lines
* skipping aix and freebsd
* noop to bump shippable
* moving tests to raw/
* removing become_method: sudo ; it doesn't work on AIX
* removing trailing blank line
* forcing become_method: su to try to get AIX to work
Co-authored-by: Rob Wagner <rob.wagner@sas.com>
Diffstat (limited to 'test/integration')
-rwxr-xr-x | test/integration/targets/raw/runme.sh | 6 | ||||
-rw-r--r-- | test/integration/targets/raw/runme.yml | 4 | ||||
-rw-r--r-- | test/integration/targets/raw/tasks/main.yml | 24 |
3 files changed, 34 insertions, 0 deletions
diff --git a/test/integration/targets/raw/runme.sh b/test/integration/targets/raw/runme.sh new file mode 100755 index 0000000000..079554277b --- /dev/null +++ b/test/integration/targets/raw/runme.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -ux +export ANSIBLE_BECOME_ALLOW_SAME_USER=1 +export ANSIBLE_ROLES_PATH=../ +ansible-playbook -i ../../inventory runme.yml -e "output_dir=${OUTPUT_DIR}" -v "$@" diff --git a/test/integration/targets/raw/runme.yml b/test/integration/targets/raw/runme.yml new file mode 100644 index 0000000000..ea865bcafb --- /dev/null +++ b/test/integration/targets/raw/runme.yml @@ -0,0 +1,4 @@ +- hosts: testhost + gather_facts: no + roles: + - { role: raw } diff --git a/test/integration/targets/raw/tasks/main.yml b/test/integration/targets/raw/tasks/main.yml index 715e4eb802..7f99eadf27 100644 --- a/test/integration/targets/raw/tasks/main.yml +++ b/test/integration/targets/raw/tasks/main.yml @@ -81,3 +81,27 @@ - 'raw_result2.stdout_lines is defined' - 'raw_result2.rc == 0' - 'raw_result2.stdout_lines == ["foobar"]' +# the following five tests added to test https://github.com/ansible/ansible/pull/68315 +- name: get the path to sh + shell: which sh + register: sh_path +- name: use sh + raw: echo $0 + args: + executable: "{{ sh_path.stdout }}" + become: true + become_method: su + register: sh_output +- name: assert sh + assert: + that: "(sh_output.stdout | trim) == sh_path.stdout" +- name: use bash + raw: echo $0 + args: + executable: "{{ bash_path.stdout }}" + become: true + become_method: su + register: bash_output +- name: assert bash + assert: + that: "(bash_output.stdout | trim) == bash_path.stdout" |