diff --git a/tests/test_ntp.py b/tests/test_ntp.py index a43c6033627318985e0ab41f3fd18f5dbd4ae846..fa5d8a3ba2bf80b5cd5f16c78bae2e8243d0e9f2 100755 --- a/tests/test_ntp.py +++ b/tests/test_ntp.py @@ -44,7 +44,15 @@ if not os.path.isfile('../utils.py'): es_utils = imp.load_source('es_utils', '../utils.py') conf = es_utils.load_conf() -expected_servers = [s.strip() for s in (conf.get('NTP_SERVER') or 'ntp.ubuntu.com').split(',')] + +expected_servers = None +if conf.get('NTP_SERVER'): + expected_servers = [s.strip() for s in conf['NTP_SERVER'].split(',')] +if not expected_servers: + if 'Ubuntu' in subprocess.getoutput('lsb_release -a'): + expected_servers = ['ntp.ubuntu.com'] + else: + expected_servers = ['0.debian.pool.ntp.org'] with open(ntpconf, 'r') as f: content = f.read()