1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

ctdb-tests: Add backtrace on abort to some tests

These are easier to debug with a backtrace.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue May  3 10:13:23 UTC 2022 on sn-devel-184
This commit is contained in:
Martin Schwenke 2022-02-28 15:44:59 +11:00 committed by Amitay Isaacs
parent d39377d6fc
commit 64275fc1a2
3 changed files with 18 additions and 2 deletions

View File

@ -29,6 +29,8 @@
#include "lib/util/util.h" #include "lib/util/util.h"
#include "lib/util/smb_strtox.h" #include "lib/util/smb_strtox.h"
#include "tests/src/test_backtrace.h"
/* /*
* ctdb_cluster_mutex.c is included below. This requires a few hacks... * ctdb_cluster_mutex.c is included below. This requires a few hacks...
*/ */
@ -663,6 +665,8 @@ int main(int argc, const char *argv[])
assert(ret == 0); assert(ret == 0);
alarm(60); alarm(60);
test_backtrace_setup();
test = argv[1]; test = argv[1];
mutex_string = argv[2]; mutex_string = argv[2];

View File

@ -36,6 +36,8 @@
#include "protocol/protocol_util.h" #include "protocol/protocol_util.h"
#include "tests/src/test_backtrace.h"
static void hexdump(uint8_t *buf, size_t len) static void hexdump(uint8_t *buf, size_t len)
{ {
size_t i; size_t i;
@ -238,6 +240,8 @@ int main(int argc, char **argv)
usage(argv[0]); usage(argv[0]);
} }
test_backtrace_setup();
if (strcmp(argv[1], "types") == 0) { if (strcmp(argv[1], "types") == 0) {
test_types(); test_types();
} else if (strcmp(argv[1], "arp") == 0) { } else if (strcmp(argv[1], "arp") == 0) {

View File

@ -945,7 +945,11 @@ def build(bld):
bld.SAMBA_BINARY('system_socket_test', bld.SAMBA_BINARY('system_socket_test',
source='tests/src/system_socket_test.c', source='tests/src/system_socket_test.c',
deps='talloc ctdb-protocol-util pcap', deps='''ctdb-tests-common
talloc
ctdb-protocol-util
pcap
''',
install_path='${CTDB_TEST_LIBEXECDIR}') install_path='${CTDB_TEST_LIBEXECDIR}')
bld.SAMBA_BINARY('porting_tests', bld.SAMBA_BINARY('porting_tests',
@ -1072,7 +1076,11 @@ def build(bld):
bld.SAMBA_BINARY('cluster_mutex_test', bld.SAMBA_BINARY('cluster_mutex_test',
source='tests/src/cluster_mutex_test.c', source='tests/src/cluster_mutex_test.c',
deps='samba-util talloc tevent', deps='''ctdb-tests-common
samba-util
talloc
tevent
''',
install_path='${CTDB_TEST_LIBEXECDIR}') install_path='${CTDB_TEST_LIBEXECDIR}')
if bld.env.HAVE_INFINIBAND: if bld.env.HAVE_INFINIBAND: