Open khaije1 opened 7 years ago
It looks like you may not be on the latest code. Could you do a git pull and try again please?
Well noted. I retried by adding the latest infratest module from https://raw.githubusercontent.com/ssplatt/saltstack-infratest-module/master/infratest.py to my roots folder as '_modules/infratest.py'
This produced a similar error to the first one.
Notably I only get this error when the file or package doesn't exist. This is on Salt version 2016.11.6
[root@salt-master-d1 _modules]# salt-call infratest.run_all details=True
[WARNING ] /var/cache/salt/minion/extmods/modules/infratest.py:25: DeprecationWarning: get_backend() is deprecated, use get_host() instead
conn = testinfra.get_backend('local://')
[WARNING ] /var/cache/salt/minion/extmods/modules/infratest.py:26: DeprecationWarning: get_module() is deprecated, use new host API
File = conn.get_module("File")
[ERROR ] An un-handled exception was caught by salt's global exception handler:
AssertionError: Unexpected exit code 1 for CommandResult(command='stat -c %U /root/.ssh/authorized_keys', exit_status=1, stdout=None, stderr='stat: cannot stat \xe2\x80\
x98/root/.ssh/authorized_keys\xe2\x80\x99: No such file or directory\n')
Traceback (most recent call last):
File "/bin/salt-call", line 11, in <module>
salt_call()
File "/usr/lib/python2.7/site-packages/salt/scripts.py", line 379, in salt_call
client.run()
File "/usr/lib/python2.7/site-packages/salt/cli/call.py", line 58, in run
caller.run()
File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 134, in run
ret = self.call()
File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 197, in call
ret['return'] = func(*args, **kwargs)
File "/var/cache/salt/minion/extmods/modules/infratest.py", line 733, in run_all
file_user(key, vals['user'])
File "/var/cache/salt/minion/extmods/modules/infratest.py", line 172, in file_user
if File(thing).user == expected:
File "/usr/lib/python2.7/site-packages/testinfra/modules/file.py", line 190, in user
return self.check_output("stat -c %%U %s", self.path)
File "/usr/lib/python2.7/site-packages/testinfra/host.py", line 85, in check_output
'Unexpected exit code %s for %s' % (out.rc, out))
AssertionError: Unexpected exit code 1 for CommandResult(command='stat -c %U /root/.ssh/authorized_keys', exit_status=1, stdout=None, stderr='stat: cannot stat \xe2\x80\
x98/root/.ssh/authorized_keys\xe2\x80\x99: No such file or directory\n')
Traceback (most recent call last):
File "/bin/salt-call", line 11, in <module>
salt_call()
File "/usr/lib/python2.7/site-packages/salt/scripts.py", line 379, in salt_call
client.run()
File "/usr/lib/python2.7/site-packages/salt/cli/call.py", line 58, in run
caller.run()
File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 134, in run
ret = self.call()
File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 197, in call
ret['return'] = func(*args, **kwargs)
File "/var/cache/salt/minion/extmods/modules/infratest.py", line 733, in run_all
file_user(key, vals['user'])
File "/var/cache/salt/minion/extmods/modules/infratest.py", line 172, in file_user
if File(thing).user == expected:
File "/usr/lib/python2.7/site-packages/testinfra/modules/file.py", line 190, in user
return self.check_output("stat -c %%U %s", self.path)
File "/usr/lib/python2.7/site-packages/testinfra/host.py", line 85, in check_output
'Unexpected exit code %s for %s' % (out.rc, out))
AssertionError: Unexpected exit code 1 for CommandResult(command='stat -c %U /root/.ssh/authorized_keys', exit_status=1, stdout=None, stderr='stat: cannot stat \xe2\x80\
x98/root/.ssh/authorized_keys\xe2\x80\x99: No such file or directory\n')
[root@salt-master-d1 _modules]#
The below pillar/infratest config caused an unhandled exception that prevents the results from returning. The error for the package test is below but the file error is very similar.
Thanks for the project and let me know if I can provide any info or assistance!