test_manage.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # -*- coding: utf-8 -*-
  2. """
  3. Tests for the salt-run command
  4. """
  5. from __future__ import absolute_import, print_function, unicode_literals
  6. import pytest
  7. from tests.support.case import ShellCase
  8. from tests.support.helpers import slowTest
  9. @pytest.mark.windows_whitelisted
  10. @pytest.mark.usefixtures("salt_sub_minion")
  11. class ManageTest(ShellCase):
  12. """
  13. Test the manage runner
  14. """
  15. @slowTest
  16. def test_up(self):
  17. """
  18. manage.up
  19. """
  20. ret = self.run_run_plus("manage.up", timeout=60)
  21. self.assertIn("minion", ret["return"])
  22. self.assertIn("sub_minion", ret["return"])
  23. self.assertTrue(any("- minion" in out for out in ret["out"]))
  24. self.assertTrue(any("- sub_minion" in out for out in ret["out"]))
  25. @slowTest
  26. def test_down(self):
  27. """
  28. manage.down
  29. """
  30. ret = self.run_run_plus("manage.down", timeout=60)
  31. self.assertNotIn("minion", ret["return"])
  32. self.assertNotIn("sub_minion", ret["return"])
  33. self.assertNotIn("minion", ret["out"])
  34. self.assertNotIn("sub_minion", ret["out"])