Adding some tests for the grains, pillar and mine functions in the cache runner. These will also ensure that the relevant functions in salt.utils.master.MasterPillarUtil are functioning properly.

This commit is contained in:
Gareth J. Greenaway 2018-08-09 09:40:14 -07:00 committed by rallytime
parent b0d5acbe0d
commit 8108a4d31a
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -8,6 +8,9 @@ from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing libs
from tests.support.case import ShellCase
import logging
log = logging.getLogger(__name__)
class ManageTest(ShellCase):
'''
@ -34,3 +37,39 @@ class ManageTest(ShellCase):
ret = self.run_run_plus('cache.flush', bank='cachetest/runner', key='test_cache')
ret = self.run_run_plus('cache.list', bank='cachetest/runner')
self.assertNotIn('test_cache', ret['return'])
def test_grains(self):
'''
Test cache.grains
'''
# Store the data
ret = self.run_run_plus(
'cache.grains',
tgt='minion'
)
self.assertIn('minion', ret['return'])
def test_pillar(self):
'''
Test cache.pillar
'''
# Store the data
ret = self.run_run_plus(
'cache.pillar',
tgt='minion'
)
self.assertIn('minion', ret['return'])
def test_mine(self):
'''
Test cache.mine
'''
# Store the data
ret = self.run_run_plus(
'cache.mine',
tgt='minion'
)
self.assertIn('minion', ret['return'])