qb_vsnprintf_serialize was called with 'max_size' as the
limiting number for the length of the formatted log
message. But the buffer also needs to contain the
log header (given by 'actual_size'), so we now pass
't->max_line_length' as the maximum length of the
formatted log message to limit space to the actual
bytes left
Also added error checks to the blackbox calls at
the end of the test, as these now provide a proper
test that the BB is functioning. Before they were
masking failures.
if the message was too long, then msg_len was added to the
buffer size twice, thus causing potential data corruption
(seen VERY rarely in the CI test - or, at least, I think it was
this).
Also fix a double close() spotted by gcc13's -fanalyzer
build: fix several issues with building tests
- MAINTAINERCLEANFILES should not rely on conditionals
that could or could not clean files.
- EXTRA_DIST should not rely on conditonals that could
or could not add files to the final tarball.
sources should always ship.
- CLEANFILES should not rely on conditionals as
./configure can be done in between builds leaving
stray files around.
- (cosmetic) move distclean-local: target with clean-local.
- drop old ipc_sock.test, start.test and resources.test
shell files.
- fix make distcheck -j:
- stop shipping or not shipping libstat_wrapper.so.
libtool will only generate the .so when installing
a shared library (--enable-install-tests).
- make libstat_wrapper a module in a similar fashion
of _failure_injection.
- build ipc_sock.test in a similar fashion as ipc.test
and link as module _libstat_wrapper.la.
this solves multiple issues of having the binary
in the final test builddir, no need to detect if
libstat_wrapper.so is installed or not and workaround
libtool different linking methods for inst vs noinst
libraries.
- fix ipc.test linking with GLIB that should not be
dependent on HAVE_FAILURE_INJECTION.
Run tests in parallel with dependancies
Make sure the two IPC tests use different socket names
Shortedn some names so they fit with the new ipc-names
remove ipc-test-name-sock
Fix resources.test now that ipc_sock is being run properly
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Otherwise GCC complains about ‘__builtin_strncpy’ specified bound
depends on the length of the source argument.
Signed-off-by: Ferenc Wágner <wferi@debian.org>
Add --disable-tests to allow the user to disable tests. As a
side-effect, this will avoid the following build failure when check is
found:
libstat_wrapper.c:11:10: fatal error: gnu/lib-names.h: No such file or directory
11 | #include <gnu/lib-names.h>
| ^~~~~~~~~~~~~~~~~
This build failure is raised since version 2.0.5 and
78df90b180
Fixes:
- http://autobuild.buildroot.org/results/450cfc36d4fd6dc71c138bec45f05b5a2d92a08d
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
A timer in QB_POLL_ENTRY_JOBLIST doesn't necessarily
have a t->timerlist_handle so that deref can segv. Also
the comment assumes the timers are threaded - which as we have
decided is definitely not true. So it's safe to move the check
earlier.
In the tests, I've adjusted the timeouts so that they definitely
happen at different times. On some architectures they can fire
concurrently and in the wrong order.
... to make 2.71 happy. Also increase minimum version to 2.69 (10 years
old version so should be compatible enough).
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
fix a couple of errors reported by covscan
1. /usr/lib64/libqb/tests/resources.test:8:34: warning[SC2039]: In POSIX sh, UID is undefined.
1. /usr/lib64/libqb/tests/resources.test:8:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
1. /usr/lib64/libqb/tests/ipc_sock.test:10:34: warning[SC2039]: In POSIX sh, UID is undefined.
1. /usr/lib64/libqb/tests/ipc_sock.test:10:30: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
* tests: Run IPC with use-filesystem-sockets active
Provide an LD_PRELOAD library that simulates the presence
of /etc/libqb/use-filesystem-sockets so that we can test
that functionality without actually having the file on
the system and affecting everything else running on the
box.
* use $() rather than ``
* Cope with spaces in directory names
* Docs: quote DOXYGEN2MAN in Makefile.am rather than configure.ac
covscan complained we don't check the blackbox header when
reading it in. (quite reasonably)
Note that we still get a covscan error for ->shared_data, but that's
really impossible to verify in the read routine, so I'll leave the
covscan waiver to handle that.