From 37258427894436dc1d90b6f6545c20ffc7a18231 Mon Sep 17 00:00:00 2001
From: Nicolas KAROLAK <nicolas@karolak.fr>
Date: Tue, 18 Sep 2018 11:20:36 +0200
Subject: [PATCH] fix(test_fail2ban): exit if not running

---
 tests/test_fail2ban.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/test_fail2ban.py b/tests/test_fail2ban.py
index 80436ea4..d54ef24f 100755
--- a/tests/test_fail2ban.py
+++ b/tests/test_fail2ban.py
@@ -109,6 +109,8 @@ def main():
     if not check_service_running("fail2ban"):
         u.warning("fail2ban is not running")
         warnings += 1
+        # warning exit if not running
+        sys.exit(3)
     else:
         u.success("fail2ban is running")
 
@@ -123,7 +125,7 @@ def main():
 
     if errors:
         sys.exit(1)
-    if warnings:
+    elif warnings:
         sys.exit(3)
     else:
         sys.exit(0)
-- 
GitLab