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:
parent
75620220b6
commit
9985995a9d
8 changed files with 12 additions and 0 deletions
|
@ -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):
|
||||||
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')
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
- 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 @@
|
||||||
- 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
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# 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
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# 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:
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
---
|
---
|
||||||
- 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
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# 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
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
# 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
|
||||||
|
|
Loading…
Reference in a new issue