1
0

test_grains.py 823 B

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