test_manage.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. @pytest.mark.windows_whitelisted
  9. @pytest.mark.usefixtures("salt_sub_minion")
  10. class ManageTest(ShellCase):
  11. """
  12. Test the manage runner
  13. """
  14. @pytest.mark.slow_test(seconds=30) # Test takes >10 and <=30 seconds
  15. def test_up(self):
  16. """
  17. manage.up
  18. """
  19. ret = self.run_run_plus("manage.up", timeout=60)
  20. self.assertIn("minion", ret["return"])
  21. self.assertIn("sub_minion", ret["return"])
  22. self.assertTrue(any("- minion" in out for out in ret["out"]))
  23. self.assertTrue(any("- sub_minion" in out for out in ret["out"]))
  24. @pytest.mark.slow_test(seconds=30) # Test takes >10 and <=30 seconds
  25. def test_down(self):
  26. """
  27. manage.down
  28. """
  29. ret = self.run_run_plus("manage.down", timeout=60)
  30. self.assertNotIn("minion", ret["return"])
  31. self.assertNotIn("sub_minion", ret["return"])
  32. self.assertNotIn("minion", ret["out"])
  33. self.assertNotIn("sub_minion", ret["out"])