1
0

test_grains.py 822 B

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