salt/tests/integration/ssh/test_grains.py

29 lines
767 B
Python
Raw Normal View History

2017-11-08 18:41:11 +00:00
# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
2017-11-08 18:41:11 +00:00
# Import Salt Testing Libs
from tests.support.case import SSHCase
from tests.support.unit import skipIf
# Import Salt Libs
2017-11-13 17:35:31 +00:00
import salt.utils.platform
2017-11-08 18:41:11 +00:00
2017-11-13 17:35:31 +00:00
@skipIf(salt.utils.platform.is_windows(), 'salt-ssh not available on Windows')
2017-11-08 18:41:11 +00:00
class SSHGrainsTest(SSHCase):
'''
testing grains with salt-ssh
'''
def test_grains_items(self):
'''
test grains.items with salt-ssh
'''
ret = self.run_function('grains.items')
grain = 'Linux'
2018-01-12 17:27:08 +00:00
if salt.utils.platform.is_darwin():
grain = 'Darwin'
self.assertEqual(ret['kernel'], grain)
2017-11-08 18:41:11 +00:00
self.assertTrue(isinstance(ret, dict))