test_win_ntp.py 829 B

12345678910111213141516171819202122232425262728293031
  1. # -*- coding: utf-8 -*-
  2. from __future__ import absolute_import
  3. import pytest
  4. import salt.utils.platform
  5. from tests.support.case import ModuleCase
  6. @pytest.mark.flaky(max_runs=4)
  7. @pytest.mark.windows_whitelisted
  8. @pytest.mark.skipif(
  9. not salt.utils.platform.is_windows(), reason="Test is Windows specific."
  10. )
  11. class NTPTest(ModuleCase):
  12. """
  13. Validate windows ntp module
  14. """
  15. @pytest.mark.destructive_test
  16. @pytest.mark.slow_test(seconds=30) # Test takes >10 and <=30 seconds
  17. def test_ntp_set_servers(self):
  18. """
  19. test ntp get and set servers
  20. """
  21. ntp_srv = "pool.ntp.org"
  22. set_srv = self.run_function("ntp.set_servers", [ntp_srv])
  23. self.assertTrue(set_srv)
  24. get_srv = self.run_function("ntp.get_servers")
  25. self.assertEqual(ntp_srv, get_srv[0])