From de27e282f99c5a551c5657610cc62c2236e2e9ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Mon, 13 Feb 2017 11:16:03 +0100 Subject: [PATCH] Changed some tests exit codes (refs #20453). --- tests/test_nginx_conf_valid.sh | 4 +++- tests/test_nginx_status.py | 1 + tests/test_nginx_vhosts.py | 2 +- tests/test_ntp.py | 2 +- tests/test_postfix.py | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_nginx_conf_valid.sh b/tests/test_nginx_conf_valid.sh index b50ce14f..2a735552 100755 --- a/tests/test_nginx_conf_valid.sh +++ b/tests/test_nginx_conf_valid.sh @@ -3,5 +3,7 @@ set -e if ( which nginx >/dev/null ); then - nginx -t + nginx -t +else + exit 2 fi diff --git a/tests/test_nginx_status.py b/tests/test_nginx_status.py index d2543111..61260da3 100755 --- a/tests/test_nginx_status.py +++ b/tests/test_nginx_status.py @@ -10,6 +10,7 @@ import sys if not os.path.exists('/etc/nginx'): print('Nginx dir does not exists, test skipped.') + sys.exit(2) else: print('Checking http://127.0.0.1:1080/nginx_status response.') try: diff --git a/tests/test_nginx_vhosts.py b/tests/test_nginx_vhosts.py index 46009f46..f9dc59cb 100755 --- a/tests/test_nginx_vhosts.py +++ b/tests/test_nginx_vhosts.py @@ -20,7 +20,7 @@ This script checks for all enabled vhosts in Nginx conf that: nginx_dir = '/etc/nginx/sites-enabled' if not os.path.exists(nginx_dir): print('Nginx dir does not exists ("%s").' % nginx_dir) - sys.exit(0) + sys.exit(2) # check that Wowza is installed wowza_dir = '/usr/local/WowzaStreamingEngine' diff --git a/tests/test_ntp.py b/tests/test_ntp.py index 393a582c..eb4a957e 100755 --- a/tests/test_ntp.py +++ b/tests/test_ntp.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # Copyright 2017, Florent Thiery ''' -Check that the server is synchronized with the configured NTP server. +Checks that the server is synchronized with the configured NTP server. ''' import os import sys diff --git a/tests/test_postfix.py b/tests/test_postfix.py index 7cdebf28..0e343931 100755 --- a/tests/test_postfix.py +++ b/tests/test_postfix.py @@ -9,7 +9,7 @@ import sys if not os.path.exists('/etc/postfix'): - print('Postfix dir does not exists, test skipped.') + print('Postfix dir does not exists, please install postfix.') sys.exit(1) else: # check that postfix listens the port 25 correctly -- GitLab