1
0

test_win_ntp.py 849 B

12345678910111213141516171819202122232425262728293031323334
  1. # -*- coding: utf-8 -*-
  2. # Import Python libs
  3. from __future__ import absolute_import
  4. import pytest
  5. # Import Salt Testing libs
  6. from tests.support.case import ModuleCase
  7. from tests.support.unit import skipIf
  8. from tests.support.helpers import flaky
  9. # Import Salt Libs
  10. import salt.utils.platform
  11. @flaky
  12. @skipIf(not salt.utils.platform.is_windows(), 'Tests for only Windows')
  13. @pytest.mark.windows_whitelisted
  14. class NTPTest(ModuleCase):
  15. '''
  16. Validate windows ntp module
  17. '''
  18. @pytest.mark.destructive_test
  19. def test_ntp_set_servers(self):
  20. '''
  21. test ntp get and set servers
  22. '''
  23. ntp_srv = 'pool.ntp.org'
  24. set_srv = self.run_function('ntp.set_servers', [ntp_srv])
  25. self.assertTrue(set_srv)
  26. get_srv = self.run_function('ntp.get_servers')
  27. self.assertEqual(ntp_srv, get_srv[0])