1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Make tests use the local connection type, fix missing callback in tests.

This commit is contained in:
Michael DeHaan 2012-11-19 10:30:30 -05:00
parent 75620220b6
commit 9985995a9d
8 changed files with 12 additions and 0 deletions

View file

@ -22,6 +22,9 @@ class TestCallbacks(object):
def set_playbook(self, playbook):
self.playbook = playbook
def on_no_hosts_remaining(self):
pass
def on_start(self):
EVENTS.append('start')

View file

@ -35,6 +35,7 @@ class TestRunner(unittest.TestCase):
forks=1,
background=0,
pattern='all',
transport='local',
)
self.cwd = os.getcwd()
self.test_dir = os.path.join(self.cwd, 'test')

View file

@ -1,5 +1,6 @@
---
- hosts: aliasgroup
connection: local
vars:
test_file: /tmp/ansible-alias-test
tasks:
@ -9,6 +10,7 @@
- action: command removes=$test_file rm -f $test_file
- hosts: all
connection: local
gather_facts: False
tasks:
- action: command true

View file

@ -1,5 +1,6 @@
# Test that playbooks support YAML lists of hosts.
---
- hosts: [host1, host2, host3]
connection: local
tasks:
- action: command true

View file

@ -1,6 +1,7 @@
# simple test of lookup plugins in with_*
---
- hosts: all
connection: local
vars:
empty_list: []
tasks:

View file

@ -1,10 +1,12 @@
---
- hosts: all
connection: local
gather_facts: False
tasks:
- action: debug msg="$variable"
- hosts: all
connection: local
vars:
- ugly: var
gather_facts: False

View file

@ -1,6 +1,7 @@
# extremely simple test of the most basic of playbook engine/functions
---
- hosts: all
connection: local
# the 'weasels' string should show up in the output

View file

@ -1,6 +1,7 @@
---
# Test iterating over lines of stdout stored in a register.
- hosts: localhost
connection: local
vars:
small_file: /etc/resolv.conf
temp_file: /tmp/ansible_result_list.tmp