mirror of https://github.com/ansible/ansible.git
Fix incorrect assumptions in integration tests. (#58365)
* Fix nested template test. There were two issues with the previous implementation: 1. The LOGNAME environment variable may not be set. 2. The comparison assumed that testhost is localhost. * Fix variable display for cartesian lookup test. * Fix vars list test. The test assumed that the ansible_user variable is always set, which is not guaranteed when using connections other than local. * Fix supervisorctl integration test. Use ansible_user_id instead of ansible_user since ansible_user is not guaranteed to be available when the connection is not local. * Fix file integration test. Use ansible_user_id instead of ansible_user since ansible_user is not guaranteed to be available when the connection is not local. * Fix expect integration test. Do not assume module_utils is available for utility scripts. * Fix python_requirements_info integration test. Check for pip instead of ansible, since ansible is not guaranteed to be installed when using a connection other than local. * Fix ansible-runner integration test. Use implicit localhost to run the test since it requires access to the ansible installation currently being tested. * Fix tower_common integration test. Accept errors on stdout or stderr. * Fix tower_user integration test. Recognize errors on stdout or stderr.pull/58368/head
parent
c604e347b2
commit
013b0039ba
@ -0,0 +1 @@
|
||||
# no hosts required, test only requires implicit localhost
|
||||
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
|
||||
ANSIBLE_ROLES_PATH=../ ansible-playbook test.yml -e '@../../integration_config.yml' -i inventory "$@"
|
||||
@ -0,0 +1,3 @@
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- ansible-runner
|
||||
@ -1,10 +1,12 @@
|
||||
import sys
|
||||
|
||||
from ansible.module_utils.six.moves import input
|
||||
|
||||
try:
|
||||
input_function = raw_input
|
||||
except NameError:
|
||||
input_function = input
|
||||
|
||||
prompts = sys.argv[1:] or ['foo']
|
||||
|
||||
for prompt in prompts:
|
||||
user_input = input(prompt)
|
||||
user_input = input_function(prompt)
|
||||
print(user_input)
|
||||
|
||||
Loading…
Reference in New Issue