From 798c7b3be60c200d48a40127173c1cd3278aedc1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu>
Date: Mon, 12 Nov 2018 16:24:39 +0100
Subject: [PATCH] Handle Debian NTP server.

---
 tests/test_ntp.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/test_ntp.py b/tests/test_ntp.py
index a43c6033..fa5d8a3b 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()
-- 
GitLab