1
0

test_win_ntp.py 809 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. from tests.support.helpers import destructiveTest, flaky, slowTest
  7. from tests.support.unit import skipIf
  8. @flaky
  9. @skipIf(not salt.utils.platform.is_windows(), "Tests for only Windows")
  10. @pytest.mark.windows_whitelisted
  11. class NTPTest(ModuleCase):
  12. """
  13. Validate windows ntp module
  14. """
  15. @destructiveTest
  16. @slowTest
  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])