2017-11-08 18:41:11 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
# Import Python libs
|
2017-12-15 18:14:18 +00:00
|
|
|
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')
|
2018-01-03 18:58:28 +00:00
|
|
|
grain = 'Linux'
|
2018-01-12 17:27:08 +00:00
|
|
|
if salt.utils.platform.is_darwin():
|
2018-01-03 18:58:28 +00:00
|
|
|
grain = 'Darwin'
|
|
|
|
self.assertEqual(ret['kernel'], grain)
|
2017-11-08 18:41:11 +00:00
|
|
|
self.assertTrue(isinstance(ret, dict))
|