1
0

test_grains.py 767 B

12345678910111213141516171819202122232425262728
  1. # -*- coding: utf-8 -*-
  2. # Import Python libs
  3. from __future__ import absolute_import, print_function, unicode_literals
  4. # Import Salt Testing Libs
  5. from tests.support.case import SSHCase
  6. from tests.support.unit import skipIf
  7. # Import Salt Libs
  8. import salt.utils.platform
  9. @skipIf(salt.utils.platform.is_windows(), 'salt-ssh not available on Windows')
  10. class SSHGrainsTest(SSHCase):
  11. '''
  12. testing grains with salt-ssh
  13. '''
  14. def test_grains_items(self):
  15. '''
  16. test grains.items with salt-ssh
  17. '''
  18. ret = self.run_function('grains.items')
  19. grain = 'Linux'
  20. if salt.utils.platform.is_darwin():
  21. grain = 'Darwin'
  22. self.assertEqual(ret['kernel'], grain)
  23. self.assertTrue(isinstance(ret, dict))