Commit 82996cd 1 parent bdc7160 commit 82996cd Copy full SHA for 82996cd
File tree 3 files changed +62
-3
lines changed
3 files changed +62
-3
lines changed Original file line number Diff line number Diff line change @@ -113,11 +113,16 @@ endif
113
113
bench_log_SOURCES = bench-log.c
114
114
bench_log_LDADD = $(top_builddir ) /lib/libqb.la
115
115
116
+ lib_LTLIBRARIES = libstat_wrapper.la
117
+ libstat_wrapper_la_SOURCES = libstat_wrapper.c
118
+ libstat_wrapper_la_LIBADD = -ldl
119
+ libdir = $(TESTDIR )
120
+
116
121
if HAVE_CHECK
117
- EXTRA_DIST += start.test resources.test
122
+ EXTRA_DIST += start.test resources.test ipc_sock.test
118
123
EXTRA_DIST += blackbox-segfault.sh
119
124
120
- TESTS = start.test array.test map.test rb.test list.test log.test blackbox-segfault.sh loop.test ipc.test resources.test
125
+ TESTS = start.test array.test map.test rb.test list.test log.test blackbox-segfault.sh loop.test ipc.test ipc_sock.test resources.test
121
126
TESTS_ENVIRONMENT = export PATH=.:../tools:$$PATH;
122
127
123
128
resources.log : rb.log log.log ipc.log
@@ -126,7 +131,7 @@ check_LTLIBRARIES =
126
131
check_PROGRAMS = array.test ipc.test list.test log.test loop.test \
127
132
map.test rb.test util.test \
128
133
crash_test_dummy file_change_bytes
129
- dist_check_SCRIPTS = start.test resources.test blackbox-segfault.sh
134
+ dist_check_SCRIPTS = start.test resources.test blackbox-segfault.sh ipc_sock.test
130
135
131
136
if HAVE_SLOW_TESTS
132
137
TESTS += util.test
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ #
3
+ # Run the IPC tests under the stat wrapper,
4
+ # this simulates /etc/libqb/use-filesystem-sockets existing
5
+ # so we can test both options without breaking other things
6
+ # that might be running on this system
7
+ #
8
+ if [ " ` uname -s` " = " Linux" ]
9
+ then
10
+ if [ -f ` pwd` /.libs/libstatwrapper.so ]
11
+ then
12
+ export LD_PRELOAD=` pwd` /.libs/libstat_wrapper.so
13
+ else
14
+ export LD_PRELOAD=` pwd` /libstat_wrapper.so
15
+ fi
16
+ ./ipc.test
17
+ else
18
+ exit 0
19
+ fi
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Simulate FORCESOCKETSFILE existing for the IPC tests
3
+ */
4
+
5
+ #include <stdio.h>
6
+ #include <dlfcn.h>
7
+ #include <string.h>
8
+ #include <sys/stat.h>
9
+ #include "../include/config.h"
10
+ #if defined(QB_LINUX ) || defined(QB_CYGWIN )
11
+ #include <gnu/lib-names.h>
12
+ #endif
13
+
14
+ int __xstat (int __ver , const char * __filename , struct stat * __stat_buf )
15
+ {
16
+ #if defined(QB_LINUX ) || defined(QB_CYGWIN )
17
+ static int opened = 0 ;
18
+ static void * dlhandle ;
19
+ static int (* real_xstat )(int __ver , const char * __filename , void * __stat_buf );
20
+
21
+ if (!opened ) {
22
+ dlhandle = dlopen (LIBC_SO , RTLD_NOW );
23
+ real_xstat = dlsym (dlhandle , "__xstat" );
24
+ opened = 1 ;
25
+ }
26
+
27
+ if (strcmp (__filename , FORCESOCKETSFILE ) == 0 ) {
28
+ return 0 ; /* it exists! */
29
+ }
30
+
31
+ return real_xstat (__ver , __filename , __stat_buf );
32
+ #else
33
+ return -1 ; /* Error in the unlikely event we get called on *BSD* */
34
+ #endif
35
+ }
You can’t perform that action at this time.
0 commit comments