Commit 9985995a by Michael DeHaan

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

parent 75620220
...@@ -22,6 +22,9 @@ class TestCallbacks(object): ...@@ -22,6 +22,9 @@ class TestCallbacks(object):
def set_playbook(self, playbook): def set_playbook(self, playbook):
self.playbook = playbook self.playbook = playbook
def on_no_hosts_remaining(self):
pass
def on_start(self): def on_start(self):
EVENTS.append('start') EVENTS.append('start')
......
...@@ -35,6 +35,7 @@ class TestRunner(unittest.TestCase): ...@@ -35,6 +35,7 @@ class TestRunner(unittest.TestCase):
forks=1, forks=1,
background=0, background=0,
pattern='all', pattern='all',
transport='local',
) )
self.cwd = os.getcwd() self.cwd = os.getcwd()
self.test_dir = os.path.join(self.cwd, 'test') self.test_dir = os.path.join(self.cwd, 'test')
......
--- ---
- hosts: aliasgroup - hosts: aliasgroup
connection: local
vars: vars:
test_file: /tmp/ansible-alias-test test_file: /tmp/ansible-alias-test
tasks: tasks:
...@@ -9,6 +10,7 @@ ...@@ -9,6 +10,7 @@
- action: command removes=$test_file rm -f $test_file - action: command removes=$test_file rm -f $test_file
- hosts: all - hosts: all
connection: local
gather_facts: False gather_facts: False
tasks: tasks:
- action: command true - action: command true
......
# Test that playbooks support YAML lists of hosts. # Test that playbooks support YAML lists of hosts.
--- ---
- hosts: [host1, host2, host3] - hosts: [host1, host2, host3]
connection: local
tasks: tasks:
- action: command true - action: command true
# simple test of lookup plugins in with_* # simple test of lookup plugins in with_*
--- ---
- hosts: all - hosts: all
connection: local
vars: vars:
empty_list: [] empty_list: []
tasks: tasks:
......
--- ---
- hosts: all - hosts: all
connection: local
gather_facts: False gather_facts: False
tasks: tasks:
- action: debug msg="$variable" - action: debug msg="$variable"
- hosts: all - hosts: all
connection: local
vars: vars:
- ugly: var - ugly: var
gather_facts: False gather_facts: False
......
# extremely simple test of the most basic of playbook engine/functions # extremely simple test of the most basic of playbook engine/functions
--- ---
- hosts: all - hosts: all
connection: local
# the 'weasels' string should show up in the output # the 'weasels' string should show up in the output
......
--- ---
# Test iterating over lines of stdout stored in a register. # Test iterating over lines of stdout stored in a register.
- hosts: localhost - hosts: localhost
connection: local
vars: vars:
small_file: /etc/resolv.conf small_file: /etc/resolv.conf
temp_file: /tmp/ansible_result_list.tmp temp_file: /tmp/ansible_result_list.tmp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment