]> git.pld-linux.org Git - packages/syslog-ng.git/commitdiff
- added tests-fixes patch (fixes test_python_ack_tracker test); new 4 tests failing... auto/th/syslog-ng-3.29.1-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 25 Oct 2020 17:41:54 +0000 (18:41 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 25 Oct 2020 17:41:54 +0000 (18:41 +0100)
syslog-ng-tests-fixes.patch [new file with mode: 0644]
syslog-ng.spec

diff --git a/syslog-ng-tests-fixes.patch b/syslog-ng-tests-fixes.patch
new file mode 100644 (file)
index 0000000..7fc8c05
--- /dev/null
@@ -0,0 +1,114 @@
+From 1d90d844a39eb25ac3423f663b0409f61a064330 Mon Sep 17 00:00:00 2001
+From: Kokan <kokaipeter@gmail.com>
+Date: Thu, 27 Aug 2020 23:44:30 +0200
+Subject: [PATCH] python/ack_tracker/test: remove dead code
+
+Signed-off-by: Kokan <kokaipeter@gmail.com>
+---
+ modules/python/tests/test_python_ack_tracker.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/modules/python/tests/test_python_ack_tracker.c b/modules/python/tests/test_python_ack_tracker.c
+index a9ac43f687..2e42e75f3f 100644
+--- a/modules/python/tests/test_python_ack_tracker.c
++++ b/modules/python/tests/test_python_ack_tracker.c
+@@ -121,7 +121,6 @@ ParameterizedTest(struct AckTrackerFactoryTestParams *param, python_ack_tracker,
+   PyGILState_STATE gstate = PyGILState_Ensure();
+   PyObject *factory_args = Py_BuildValue("(N)", PyCFunction_New(&test_ack_callback, NULL));
+-  log_msg_new_empty();
+   PyObject *py_ack_tracker_factory_obj = PyObject_CallObject((PyObject *) param->ack_tracker_factory_type,
+                                                              factory_args);
+   Py_XDECREF(factory_args);
+From 46fa90bdd3adee5bcbb2687cf00c08925c504c07 Mon Sep 17 00:00:00 2001
+From: Kokan <kokaipeter@gmail.com>
+Date: Thu, 27 Aug 2020 23:44:30 +0200
+Subject: [PATCH] python/ack_tracker/test: split parameterized test
+
+Parameterized tests are the worst in Criterion. Specially with pointers and ASLR.
+
+Causes test to fail when executed with ASAN:
+```
+==3181004==ERROR: AddressSanitizer: SEGV on unknown address 0x7faeee7938a8 (pc 0x7f0f053880e7 bp 0x7faeee7938a0 sp 0x7ffe7fe59510 T0)
+==3181004==The signal is caused by a READ memory access.
+    #0 0x7f0f053880e7 in PyObject_Call (/usr/lib/libpython3.8.so.1.0+0x1420e7)
+    #1 0x4f7f7c in python_ack_tracker_test_ack_tracker_factory_impl /home/kokan/src/syslog-ng/build/../modules/python/tests/test_python_ack_tracker.c:124:42
+    #2 0x7f0f05225e3e in criterion_internal_test_main (/usr/lib/libcriterion.so.3+0x8e3e)
+    #3 0x4f7e34 in python_ack_tracker_test_ack_tracker_factory_jmp /home/kokan/src/syslog-ng/build/../modules/python/tests/test_python_ack_tracker.c:119:1
+    #4 0x7f0f05225308  (/usr/lib/libcriterion.so.3+0x8308)
+    #5 0x7f0f05236b4c  (/usr/lib/libcriterion.so.3+0x19b4c)
+    #6 0x7f0f04626151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
+    #7 0x41f43d in _start (/home/kokan/src/syslog-ng/build/modules/python/tests/Debug/test_python_ack_tracker+0x41f43d)
+```
+
+Signed-off-by: Kokan <kokaipeter@gmail.com>
+---
+ .../python/tests/test_python_ack_tracker.c    | 39 +++++++++++--------
+ 1 file changed, 22 insertions(+), 17 deletions(-)
+
+diff --git a/modules/python/tests/test_python_ack_tracker.c b/modules/python/tests/test_python_ack_tracker.c
+index 2e42e75f3f..b573dc0249 100644
+--- a/modules/python/tests/test_python_ack_tracker.c
++++ b/modules/python/tests/test_python_ack_tracker.c
+@@ -97,31 +97,36 @@ struct AckTrackerFactoryTestParams
+   AckTrackerType expected_ack_tracker_type;
+ };
+-ParameterizedTestParameters(python_ack_tracker, test_ack_tracker_factory)
++Test(python_ack_tracker, test_instant_ack_tracker_factory)
+ {
+-  static struct AckTrackerFactoryTestParams params[2];
++  PyGILState_STATE gstate = PyGILState_Ensure();
+-  /* PyAckTrackerFactory types and AckTrackerFactoryTestParams are all globals.
+-   * Static initialization order is undefined.
+-   */
+-  params[0] = (struct AckTrackerFactoryTestParams)
+-  {
+-    &py_instant_ack_tracker_factory_type, ACK_INSTANT
+-  };
+-  params[1] = (struct AckTrackerFactoryTestParams)
+-  {
+-    &py_consecutive_ack_tracker_factory_type, ACK_CONSECUTIVE
+-  };
++  PyObject *factory_args = Py_BuildValue("(N)", PyCFunction_New(&test_ack_callback, NULL));
++
++  PyObject *py_ack_tracker_factory_obj = PyObject_CallObject((PyObject *) &py_instant_ack_tracker_factory_type,
++                                                             factory_args);
++  Py_XDECREF(factory_args);
++
++  cr_assert_not_null(py_ack_tracker_factory_obj);
++  cr_assert(py_is_ack_tracker_factory(py_ack_tracker_factory_obj));
++
++  PyAckTrackerFactory *py_ack_tracker_factory = (PyAckTrackerFactory *) py_ack_tracker_factory_obj;
++  cr_assert_not_null(py_ack_tracker_factory->ack_tracker_factory);
++  cr_assert_eq(ack_tracker_factory_get_type(py_ack_tracker_factory->ack_tracker_factory),
++               ACK_INSTANT);
+-  return cr_make_param_array(struct AckTrackerFactoryTestParams, params, G_N_ELEMENTS(params));
++  Py_XDECREF(py_ack_tracker_factory);
++  PyGILState_Release(gstate);
+ }
+-ParameterizedTest(struct AckTrackerFactoryTestParams *param, python_ack_tracker, test_ack_tracker_factory)
++
++Test(python_ack_tracker, test_consecutive_ack_tracker_factory)
+ {
+   PyGILState_STATE gstate = PyGILState_Ensure();
+   PyObject *factory_args = Py_BuildValue("(N)", PyCFunction_New(&test_ack_callback, NULL));
+-  PyObject *py_ack_tracker_factory_obj = PyObject_CallObject((PyObject *) param->ack_tracker_factory_type,
++
++  PyObject *py_ack_tracker_factory_obj = PyObject_CallObject((PyObject *) &py_consecutive_ack_tracker_factory_type,
+                                                              factory_args);
+   Py_XDECREF(factory_args);
+@@ -131,7 +136,7 @@ ParameterizedTest(struct AckTrackerFactoryTestParams *param, python_ack_tracker,
+   PyAckTrackerFactory *py_ack_tracker_factory = (PyAckTrackerFactory *) py_ack_tracker_factory_obj;
+   cr_assert_not_null(py_ack_tracker_factory->ack_tracker_factory);
+   cr_assert_eq(ack_tracker_factory_get_type(py_ack_tracker_factory->ack_tracker_factory),
+-               param->expected_ack_tracker_type);
++               ACK_CONSECUTIVE);
+   Py_XDECREF(py_ack_tracker_factory);
+   PyGILState_Release(gstate);
index dd2dd85d024cfa0935f3f6dcdcd2db70463c0765..1a7b82052486f54c8f4a7c91c836abb0090ad5fb 100644 (file)
@@ -59,6 +59,9 @@ Source6:      https://github.com/buytenh/ivykis/archive/v%{libivykis_version}/ivykis-
 %endif
 Source7:       syslog-ng.service
 Patch0:                %{name}-datadir.patch
+# https://github.com/syslog-ng/syslog-ng/commit/1d90d844a39eb25ac3423f663b0409f61a064330.patch
+# https://github.com/syslog-ng/syslog-ng/commit/46fa90bdd3adee5bcbb2687cf00c08925c504c07.patch
+Patch1:                %{name}-tests-fixes.patch
 Patch2:                %{name}-nolibs.patch
 Patch3:                %{name}-systemd.patch
 Patch4:                man-paths.patch
@@ -366,6 +369,7 @@ rmdir lib/ivykis
 %endif
 
 %patch0 -p1
+%patch1 -p1
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
This page took 0.08113 seconds and 4 git commands to generate.