"examples": start adding structure to regression tests.

pull/193/head
David Wilson 6 years ago
parent 95ca29262a
commit 047458a8b3

@ -185,6 +185,9 @@ class ScriptPlanner(BinaryPlanner):
detection and rewrite.
"""
def _rewrite_interpreter(self, interpreter, task_vars, templar):
if interpreter is None:
return None
key = u'ansible_%s_interpreter' % os.path.basename(interpreter).strip()
try:
return templar.template(task_vars[key].strip())

@ -1,2 +1,2 @@
modules/binary_producing_junk
modules/binary_producing_json
modules/custom_binary_producing_junk
modules/custom_binary_producing_json

@ -1,4 +1,4 @@
all: \
modules/binary_producing_junk \
modules/binary_producing_json
modules/custom_binary_producing_junk \
modules/custom_binary_producing_json

@ -1,11 +1,7 @@
---
# Verify the behaviour of _low_level_execute_command().
- hosts: all
gather_facts: false
tasks:
# "echo -en" to test we actually hit bash shell too.
- name: Run raw module without sudo
raw: 'echo -en $((1 + 1))'

@ -1,7 +1,8 @@
[defaults]
inventory = hosts
gathering = explicit
strategy_plugins = ../../ansible_mitogen/plugins/strategy
strategy = mitogen_linear
#strategy = mitogen_linear
library = modules
retry_files_enabled = False
forks = 50

@ -1,9 +1,5 @@
---
- hosts: all
gather_facts: false
tasks:
- name: simulate long running op (3 sec), wait for up to 5 sec, poll every 1 sec
command: /bin/sleep 2
async: 4

@ -1,8 +1,5 @@
---
# Reproduction for issue #109.
- hosts: all
roles:
- issue_109
gather_facts: no

@ -1,7 +1,4 @@
---
- hosts: all
gather_facts: false
tasks:
- name: Get auth token

@ -1,5 +1,3 @@
---
# issue #118 repro: chmod +x not happening during script upload
#
- name: saytrue

@ -1,4 +1,3 @@
- hosts: all
tasks:
- script: scripts/print_env.sh

@ -1,13 +1,9 @@
---
# Hopeful reproduction for issue #131.
# Run lots of steps (rather than just one) so WorkerProcess and suchlike
# machinery is constantly recreated.
- hosts: all
gather_facts: no
tasks:
- shell: "true"
- shell: "true"
- shell: "true"
@ -58,4 +54,3 @@
- shell: "true"
- shell: "true"
- shell: "true"

@ -1,11 +1,7 @@
---
# Reproduction for issue #140.
- hosts: all
gather_facts: no
tasks:
- name: Create file tree
connection: local
shell: >
@ -26,4 +22,3 @@
with_filetree:
- filetree
when: item.state == 'file'

@ -1,8 +1,5 @@
- hosts: all
tasks:
- name: Make virtualenv
pip:
virtualenv: /tmp/issue_151_virtualenv

@ -1,4 +1,3 @@
# issue #152 (b): local connections were not receiving
# ansible_python_interpreter treatment, breaking virtualenvs.
@ -9,7 +8,5 @@
# - Run ansible-playbook ... with the virtualenv activated. Observe success.
- hosts: all
gather_facts: false
tasks:
- local_action: cloudformation_facts

@ -1,6 +1,4 @@
- hosts: all
gather_facts: no
become: true
vars:
repo_baseurl: "http://myurl.com"
@ -11,7 +9,6 @@
- repo: demo-repo2
description: Misc packages
url: "{{repo_baseurl}}/repo2"
tasks:
- name: Create multiple yum repos
yum_repository:

@ -1,9 +1,5 @@
---
- hosts: all
gather_facts: false
tasks:
- name: add nginx ppa
become: yes
apt_repository: repo='ppa:nginx/stable' update_cache=yes

@ -1,11 +1,7 @@
- hosts: all
gather_facts: false
tasks:
- name: copy repo configs
copy: src=/etc/{{ item }} dest=/tmp/{{item}} mode=0644
with_items:
- passwd
- hosts

@ -1,5 +0,0 @@
#!/bin/bash
exec >/tmp/derp
echo "$1"
cat "$1"

@ -4,13 +4,13 @@
INPUT=$1
[ ! -r "$INPUT" ] && {
echo "Usage: $0 <input.json>" >&2
echo "Usage: $0 <input_file>" >&2
exit 1
}
echo "{"
echo " \"changed\": false,"
echo " \"msg\": \"Here is my input\","
echo " \"filname\": \"$INPUT\","
echo " \"filename\": \"$INPUT\","
echo " \"input\": [\"$(cat $INPUT | tr \" \' )\"]"
echo "}"

@ -1,6 +0,0 @@
---
- hosts: all
gather_facts: false
tasks:
- bin_bash_module:

@ -0,0 +1,27 @@
# This must be run with FOO=2 set in the environment.
#
# Test sudo_flags respects -E.
#
- hosts: all
tasks:
- name: "without -E"
become: true
shell: "echo $FOO"
register: out
- assert:
that: "out.stdout == ''"
- hosts: all
become_flags: -E
tasks:
- name: "with -E"
become: true
shell: "set"
register: out2
- debug: msg={{out2}}
- assert:
that: "out2.stdout == '2'"

@ -1,9 +1,5 @@
---
- hosts: all
gather_facts: false
tasks:
#
# delegate_to, no sudo
#

@ -1,10 +1,7 @@
---
# Ensure environment: is preserved during call.
- hosts: all
gather_facts: false
tasks:
- shell: echo $SOME_ENV
environment:
SOME_ENV: 123
@ -14,4 +11,3 @@
- assert:
that: "result.stdout == '123'"

@ -0,0 +1,9 @@
- import_playbook: runner__builtin_command_module.yml
- import_playbook: runner__custom_bash_old_style_module.yml
- import_playbook: runner__custom_bash_want_json_module.yml
- import_playbook: runner__custom_binary_producing_json.yml
- import_playbook: runner__custom_binary_producing_junk.yml
- import_playbook: runner__custom_binary_single_null.yml
- import_playbook: runner__custom_python_json_args_module.yml
- import_playbook: runner__custom_python_new_style_module.yml
- import_playbook: runner__custom_python_want_json_module.yml

@ -1,8 +1,5 @@
---
- hosts: all
gather_facts: false
tasks:
- name: "Run hostname"
command: hostname
with_sequence: start=1 end=100
with_sequence: start=1 end={{end|default(100)}}

@ -0,0 +1,5 @@
- hosts: all
tasks:
- custom_bash_old_style_module:
foo: true
with_sequence: start=1 end={{end|default(100)}}

@ -0,0 +1,5 @@
- hosts: all
tasks:
- custom_bash_want_json_module:
foo: true
with_sequence: start=1 end={{end|default(100)}}

@ -0,0 +1,5 @@
- hosts: all
tasks:
- custom_binary_producing_json:
foo: true
with_sequence: start=1 end={{end|default(100)}}

@ -0,0 +1,6 @@
- hosts: all
tasks:
- custom_binary_producing_junk:
foo: true
with_sequence: start=1 end={{end|default(100)}}
ignore_errors: true

@ -0,0 +1,6 @@
- hosts: all
tasks:
- custom_binary_single_null:
foo: true
with_sequence: start=1 end={{end|default(100)}}
ignore_errors: true

@ -0,0 +1,5 @@
- hosts: all
tasks:
- custom_python_json_args_module:
foo: true
with_sequence: start=1 end={{end|default(100)}}

@ -0,0 +1,5 @@
- hosts: all
tasks:
- custom_python_new_style_module:
foo: true
with_sequence: start=1 end={{end|default(100)}}

@ -0,0 +1,5 @@
- hosts: all
tasks:
- custom_python_want_json_module:
foo: true
with_sequence: start=1 end={{end|default(100)}}
Loading…
Cancel
Save