diff -u nagios3-3.4.1/debian/control nagios3-3.4.1/debian/control --- nagios3-3.4.1/debian/control +++ nagios3-3.4.1/debian/control @@ -1,7 +1,8 @@ Source: nagios3 Section: net Priority: optional -Maintainer: Debian Nagios Maintainer Group +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian Nagios Maintainer Group Uploaders: sean finney , Alexander Wirt , Jan Wagner @@ -18,6 +19,7 @@ libperl-dev, libpng-dev, po-debconf +XS-Testsuite: autopkgtest Package: nagios3-common Architecture: all diff -u nagios3-3.4.1/debian/changelog nagios3-3.4.1/debian/changelog --- nagios3-3.4.1/debian/changelog +++ nagios3-3.4.1/debian/changelog @@ -1,3 +1,10 @@ +nagios3 (3.4.1-4ubuntu1) saucy; urgency=low + + * Merge from Debian unstable (LP: #1199883). Remaining changes: + - debian/tests: autopkgtests + + -- Yolanda Robla Wed, 10 Jul 2013 16:05:25 +0200 + nagios3 (3.4.1-4) unstable; urgency=high * [cd50049] Add missing check command in initscript (Closes: #680615) @@ -12,6 +19,12 @@ -- Alexander Wirt Thu, 27 Jun 2013 00:40:30 +0200 +nagios3 (3.4.1-3ubuntu1) saucy; urgency=low + + * debian/tests: Add autopkgtest. + + -- Yolanda Mon, 27 May 2013 11:10:34 +0200 + nagios3 (3.4.1-3) unstable; urgency=low * Fix several overflows in getcgi.cgi and history.cgi only in patch2: unchanged: --- nagios3-3.4.1.orig/debian/tests/control +++ nagios3-3.4.1/debian/tests/control @@ -0,0 +1,3 @@ +Tests: nagios3 daemon +Depends: nagios3 +Restrictions: needs-root only in patch2: unchanged: --- nagios3-3.4.1.orig/debian/tests/nagios3 +++ nagios3-3.4.1/debian/tests/nagios3 @@ -0,0 +1,14 @@ +#!/bin/bash +#---------------- +# Testing nagios3 +#---------------- +set -e +result=$(python `dirname $0`/get_nagios_output.py /etc/nagios3/nagios.cfg 2>&1) + +if [ "$result" == "0" ]; then + echo "OK" + exit 0 +else + echo $result + exit 1 +fi only in patch2: unchanged: --- nagios3-3.4.1.orig/debian/tests/daemon +++ nagios3-3.4.1/debian/tests/daemon @@ -0,0 +1,12 @@ +#!/bin/bash +#----------------------- +# Testing nagios3 daemon +#----------------------- +set -e +if pidof -x nagios3 > /dev/null; then + echo "OK" + exit 0 +else + echo "ERROR: NAGIOS IS NOT RUNNING" + exit 1 +fi only in patch2: unchanged: --- nagios3-3.4.1.orig/debian/tests/get_nagios_output.py +++ nagios3-3.4.1/debian/tests/get_nagios_output.py @@ -0,0 +1,24 @@ +import sys +import subprocess +import re + + +if __name__ == '__main__': + try: + file_name = sys.argv[1] + + # call nagios with the given config file and parse output + output = subprocess.check_output("nagios3 -v " + file_name, shell=True) + if output: + # check for total errors expression + regex = re.compile(r"^.*Total\s*Errors:\s*(\d+).*$", re.VERBOSE | re.IGNORECASE | re.MULTILINE) + r = regex.search(output) + if r: + errors = r.group(1) + print errors + exit() + print "ERROR: THERE WAS A PROBLEM PARSING ERRORS" + except Exception as e: + print "ERROR: CANNOT FIND CONFIG FILE NAME" + +