1
0

test_win_ntp.py 805 B

12345678910111213141516171819202122232425262728293031
  1. # -*- coding: utf-8 -*-
  2. # Import Python libs
  3. from __future__ import absolute_import
  4. # Import Salt Testing libs
  5. from tests.support.case import ModuleCase
  6. from tests.support.unit import skipIf
  7. from tests.support.helpers import destructiveTest, flaky
  8. # Import Salt Libs
  9. import salt.utils.platform
  10. @flaky
  11. @skipIf(not salt.utils.platform.is_windows(), 'Tests for only Windows')
  12. class NTPTest(ModuleCase):
  13. '''
  14. Validate windows ntp module
  15. '''
  16. @destructiveTest
  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])