test_win_ntp.py 744 B

123456789101112131415161718192021222324252627
  1. import pytest
  2. import salt.utils.platform
  3. from tests.support.case import ModuleCase
  4. from tests.support.helpers import destructiveTest, flaky, slowTest
  5. from tests.support.unit import skipIf
  6. @flaky
  7. @skipIf(not salt.utils.platform.is_windows(), "Tests for only Windows")
  8. @pytest.mark.windows_whitelisted
  9. class NTPTest(ModuleCase):
  10. """
  11. Validate windows ntp module
  12. """
  13. @destructiveTest
  14. @slowTest
  15. def test_ntp_set_servers(self):
  16. """
  17. test ntp get and set servers
  18. """
  19. ntp_srv = "pool.ntp.org"
  20. set_srv = self.run_function("ntp.set_servers", [ntp_srv])
  21. self.assertTrue(set_srv)
  22. get_srv = self.run_function("ntp.get_servers")
  23. self.assertEqual(ntp_srv, get_srv[0])