test_manage.py 995 B

12345678910111213141516171819202122232425262728293031323334
  1. # -*- coding: utf-8 -*-
  2. '''
  3. Tests for the salt-run command
  4. '''
  5. # Import Python libs
  6. from __future__ import absolute_import, print_function, unicode_literals
  7. # Import Salt Testing libs
  8. from tests.support.case import ShellCase
  9. class ManageTest(ShellCase):
  10. '''
  11. Test the manage runner
  12. '''
  13. def test_up(self):
  14. '''
  15. manage.up
  16. '''
  17. ret = self.run_run_plus('manage.up', timeout=60)
  18. self.assertIn('minion', ret['return'])
  19. self.assertIn('sub_minion', ret['return'])
  20. self.assertTrue(any('- minion' in out for out in ret['out']))
  21. self.assertTrue(any('- sub_minion' in out for out in ret['out']))
  22. def test_down(self):
  23. '''
  24. manage.down
  25. '''
  26. ret = self.run_run_plus('manage.down', timeout=60)
  27. self.assertNotIn('minion', ret['return'])
  28. self.assertNotIn('sub_minion', ret['return'])
  29. self.assertNotIn('minion', ret['out'])
  30. self.assertNotIn('sub_minion', ret['out'])