mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add pillar ssh integration tests
This commit is contained in:
parent
f2f6817e86
commit
c7f5af1274
2 changed files with 44 additions and 0 deletions
|
@ -6,3 +6,6 @@ base:
|
|||
- generic
|
||||
- blackout
|
||||
- sub
|
||||
'localhost':
|
||||
- generic
|
||||
- blackout
|
||||
|
|
41
tests/integration/ssh/test_pillar.py
Normal file
41
tests/integration/ssh/test_pillar.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import
|
||||
|
||||
# Import Salt Testing Libs
|
||||
from tests.support.case import SSHCase
|
||||
from tests.support.unit import skipIf
|
||||
|
||||
# Import Salt Libs
|
||||
import salt.utils
|
||||
|
||||
|
||||
@skipIf(salt.utils.is_windows(), 'salt-ssh not available on Windows')
|
||||
class SSHPillarTest(SSHCase):
|
||||
'''
|
||||
testing pillar with salt-ssh
|
||||
'''
|
||||
def test_pillar_items(self):
|
||||
'''
|
||||
test pillar.items with salt-ssh
|
||||
'''
|
||||
ret = self.run_function('pillar.items')
|
||||
self.assertDictContainsSubset({'monty': 'python'}, ret)
|
||||
self.assertDictContainsSubset(
|
||||
{'knights': ['Lancelot', 'Galahad', 'Bedevere', 'Robin']},
|
||||
ret)
|
||||
|
||||
def test_pillar_get(self):
|
||||
'''
|
||||
test pillar.get with salt-ssh
|
||||
'''
|
||||
ret = self.run_function('pillar.get', ['monty'])
|
||||
self.assertEqual(ret, 'python')
|
||||
|
||||
def test_pillar_get_doesnotexist(self):
|
||||
'''
|
||||
test pillar.get when pillar does not exist with salt-ssh
|
||||
'''
|
||||
ret = self.run_function('pillar.get', ['doesnotexist'])
|
||||
self.assertEqual(ret, '')
|
Loading…
Add table
Reference in a new issue