Skip to content

Commit

Permalink
Some debugging to inspect travis failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaska committed Jan 24, 2016
1 parent 5936a47 commit 1e6ab50
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test_pytest_ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ def test_become(testdir, option):
import pytest
import ansible
import re
import os
@pytest.mark.ansible(inventory='%s', host_pattern='localhost')
def test_func(ansible_module):
contacted = ansible_module.ping()
Expand All @@ -321,14 +322,17 @@ def test_func(ansible_module):
assert contacted
assert len(contacted) == len(ansible_module.inventory_manager.list_hosts('localhost'))
for result in contacted.values():
print result
print os.environ
assert 'failed' in result
assert result['failed']
if ansible.__version__.startswith('2'):
assert 'module_stderr' in result
assert 'sudo: a password is required' in result['module_stderr']
else:
assert 'msg' in result
assert re.match('\[sudo via ansible, [^\]]*\] password:', result['msg'])
assert re.match('\[sudo via ansible, [^\]]*\] password:', result['msg']) is not None
# "sudo: must be setuid root"
''' % str(option.inventory)
testdir.makepyfile(src)
Expand Down

0 comments on commit 1e6ab50

Please sign in to comment.