mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't fail on git_pillar tests when destructive tests are not enable
This fixes the following when running `python tests/runtests.py --ext-pillar`:
-------- Tests with Errors ------------------------------------------------------------------------------------------------------------------------
-> tearDownClass (integration.pillar.test_git_pillar.TestGitPythonSSH) ...........................................................................
Traceback (most recent call last):
File ".../salt/tests/support/gitfs.py", line 481, in tearDownClass
if cls.case.sshd_proc is not None:
AttributeError: 'NoneType' object has no attribute 'sshd_proc'
...................................................................................................................................................
-> tearDownClass (integration.pillar.test_git_pillar.TestPygit2SSH) ..............................................................................
Traceback (most recent call last):
File ".../salt/tests/support/gitfs.py", line 481, in tearDownClass
if cls.case.sshd_proc is not None:
AttributeError: 'NoneType' object has no attribute 'sshd_proc'
...................................................................................................................................................
-----------------------------------------------------------------------------------------------------------------------------------------------------
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
(cherry picked from commit 84e9fce9bb
)
This commit is contained in:
parent
46514818a5
commit
ba150a5182
1 changed files with 2 additions and 0 deletions
|
@ -538,6 +538,8 @@ class GitPillarSSHTestBase(GitPillarTestBase, SSHDMixin):
|
|||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
if cls.case is None:
|
||||
return
|
||||
if cls.case.sshd_proc is not None:
|
||||
cls.case.sshd_proc.send_signal(signal.SIGTERM)
|
||||
cls.case.run_state('user.absent', name=cls.username, purge=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue