[syslog-ng] Improve test coverage: remove a couple of errors and really run the SQL test. Patches: syslog-ng-3.2

Jose Pedro Oliveira jpo at fedoraproject.org
Sun Jan 15 18:59:41 UTC 2012


commit 56892a2396fa27a4229994d2f4b731f5e4734ac0
Author: Jose Pedro Oliveira <jpo at di.uminho.pt>
Date:   Sun Jan 15 18:59:22 2012 +0000

    Improve test coverage: remove a couple of errors and really run the SQL test.
    Patches: syslog-ng-3.2.5-tests-functional-control.py.patch and
    syslog-ng-3.2.5-tests-functional-sql-test.patch.

 syslog-ng-3.2.5-tests-functional-control.py.patch |   12 +++++++
 syslog-ng-3.2.5-tests-functional-sql-test.patch   |   33 +++++++++++++++++++++
 syslog-ng.spec                                    |   12 +++++++-
 3 files changed, 56 insertions(+), 1 deletions(-)
---
diff --git a/syslog-ng-3.2.5-tests-functional-control.py.patch b/syslog-ng-3.2.5-tests-functional-control.py.patch
new file mode 100644
index 0000000..26ef2e2
--- /dev/null
+++ b/syslog-ng-3.2.5-tests-functional-control.py.patch
@@ -0,0 +1,12 @@
+diff -ruN syslog-ng-3.2.5/tests/functional/control.py syslog-ng-3.2.5-modified/tests/functional/control.py
+--- syslog-ng-3.2.5/tests/functional/control.py	2010-11-20 08:47:33.000000000 +0000
++++ syslog-ng-3.2.5-modified/tests/functional/control.py	2012-01-15 04:56:14.948239475 +0000
+@@ -35,7 +35,7 @@
+         for (root, dirs, files) in os.walk(os.path.abspath(os.path.join(os.environ['top_builddir'], 'modules'))):
+             module_path = ':'.join(map(lambda x: root + '/' + x, dirs))
+             break
+-        rc = os.execl('../../syslog-ng/syslog-ng', '../../syslog-ng/syslog-ng', '-f', 'test.conf', '--fd-limit', '1024', '-F', verbose_opt, '-p', 'syslog-ng.pid', '-R', 'syslog-ng.persist', '--no-caps', '--enable-core', '--seed', '--module-path', module_path)
++        rc = os.execl('../../syslog-ng/syslog-ng', '../../syslog-ng/syslog-ng', '-f', 'test.conf', '--fd-limit', '1024', '-F', verbose_opt, '-p', '/var/tmp/syslog-ng.pid', '-c', '/var/tmp/syslog-ng.ctl', '-R', '/var/tmp/syslog-ng.persist', '--no-caps', '--enable-core', '--seed', '--module-path', module_path)
+         sys.exit(rc)
+     time.sleep(5)
+     print_user("Syslog-ng started")
diff --git a/syslog-ng-3.2.5-tests-functional-sql-test.patch b/syslog-ng-3.2.5-tests-functional-sql-test.patch
new file mode 100644
index 0000000..848e2ca
--- /dev/null
+++ b/syslog-ng-3.2.5-tests-functional-sql-test.patch
@@ -0,0 +1,33 @@
+diff -ruN syslog-ng-3.2.5/tests/functional/globals.py syslog-ng-3.2.5-modified/tests/functional/globals.py
+--- syslog-ng-3.2.5/tests/functional/globals.py	2011-10-08 11:34:21.000000000 +0100
++++ syslog-ng-3.2.5-modified/tests/functional/globals.py	2012-01-15 05:34:12.641744234 +0000
+@@ -7,7 +7,7 @@
+     return False
+ 
+ def has_module(module):
+-    avail_mods = os.popen('../../syslog-ng/syslog-ng -V | grep ^Available-Modules: ', 'r').read()
++    avail_mods = os.popen('../../syslog-ng/syslog-ng -V | grep ^Enable-', 'r').read()
+     if avail_mods.find(module) != -1:
+         return True
+     return False
+diff -ruN syslog-ng-3.2.5/tests/functional/test_sql.py syslog-ng-3.2.5-modified/tests/functional/test_sql.py
+--- syslog-ng-3.2.5/tests/functional/test_sql.py	2011-10-08 11:34:21.000000000 +0100
++++ syslog-ng-3.2.5-modified/tests/functional/test_sql.py	2012-01-15 05:37:56.699303941 +0000
+@@ -28,7 +28,7 @@
+ 
+ def check_env():
+ 
+-    if not has_module('afsql'):
++    if not has_module('SQL'):
+         print 'afsql module is not available, skipping SQL test'
+         return False
+     paths=('/opt/syslog-ng/bin', '/usr/bin', '/usr/local/bin')
+@@ -45,7 +45,7 @@
+         soext='.sl'
+ 
+     found = False
+-    paths = (os.environ.get('dbd_dir', None), '/usr/local/lib/dbd', '/usr/lib/dbd', '/opt/syslog-ng/lib/dbd')
++    paths = (os.environ.get('dbd_dir', None), '/usr/local/lib/dbd', '/usr/lib/dbd', '/usr/lib64/dbd', '/opt/syslog-ng/lib/dbd')
+     for pth in paths:
+         if pth and os.path.isfile('%s/libdbdsqlite3%s' % (pth, soext)):
+             found = True
diff --git a/syslog-ng.spec b/syslog-ng.spec
index c334694..aa6a078 100644
--- a/syslog-ng.spec
+++ b/syslog-ng.spec
@@ -5,7 +5,7 @@
 
 Name: syslog-ng
 Version: 3.2.5
-Release: 4%{?dist}
+Release: 5%{?dist}
 Summary: Next-generation syslog server
 
 Group: System Environment/Daemons
@@ -18,6 +18,8 @@ Source2: syslog-ng.logrotate
 Patch0: syslog-ng-3.2.4-disable-ssl-tests.patch
 Patch1: syslog-ng-3.2.5-syslog-ng.service.patch
 Patch2: syslog-ng-3.3.4-afunix.c-diagnostic-messages.patch
+Patch3: syslog-ng-3.2.5-tests-functional-control.py.patch
+Patch4: syslog-ng-3.2.5-tests-functional-sql-test.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -83,6 +85,8 @@ developing applications that use %{name}.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 # fix perl path
 %{__sed} -i 's|^#!/usr/local/bin/perl|#!%{__perl}|' contrib/relogger.pl
@@ -253,6 +257,7 @@ fi
 %{_mandir}/man8/syslog-ng.8*
 
 %files libdbi
+%defattr(-,root,root,-)
 %{_libdir}/%{name}/libafsql.so
 
 %files devel
@@ -262,6 +267,11 @@ fi
 
 
 %changelog
+* Sun Jan 15 2012 Jose Pedro Oliveira <jpo at di.uminho.pt> - 3.2.5-5
+- Improve test coverage: remove a couple of errors and really run the SQL test.
+  Patches: syslog-ng-3.2.5-tests-functional-control.py.patch and
+  syslog-ng-3.2.5-tests-functional-sql-test.patch.
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.2.5-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list