From 2c37657ad5fb2ba3f155cdc14366165601b91a1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florent=20Thi=C3=A9ry?= <florent.thiery@ubicast.eu>
Date: Mon, 27 Feb 2017 17:04:54 +0100
Subject: [PATCH] add warning return code (3), do not consider ssl as failure

---
 tester.py         | 3 +++
 tests/test_ssl.py | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tester.py b/tester.py
index 84d639b6..f9b6c578 100755
--- a/tester.py
+++ b/tester.py
@@ -29,6 +29,7 @@ class Logger(object):
     def flush(self):
         pass
 
+
 log_buffer = StringIO()
 sys.stdout = Logger(sys.stdout, log_buffer)
 sys.stderr = sys.stdout
@@ -194,6 +195,8 @@ class Tester():
                 successes += 1
             elif p.returncode == 2:
                 status = '\033[94mnot testable\033[0m'
+            elif p.returncode == 3:
+                status = '\033[93mwarning\033[0m'
             else:
                 status = '\033[91mfailure\033[0m'
                 failures += 1
diff --git a/tests/test_ssl.py b/tests/test_ssl.py
index 9e66764d..ea1fddf6 100755
--- a/tests/test_ssl.py
+++ b/tests/test_ssl.py
@@ -43,4 +43,7 @@ for s in conf_servers:
     except requests.exceptions.SSLError:
         print('%sSSL certificate for %s is not valid%s' % (RED, url, DEF))
         all_ok = False
-sys.exit(int(not all_ok))
+if not all_ok:
+    sys.exit(3)
+else:
+    sys.exit(0)
-- 
GitLab