Skip to content

Commit 758044b

Browse files
authored
test: Include ipc_sock.test in the libqb-tests rpm (#463)
...but don't run it unless we are root
1 parent ccdaada commit 758044b

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Diff for: tests/Makefile.am

+7-4
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,12 @@ endif
113113

114114
bench_log_SOURCES = bench-log.c
115115
bench_log_LDADD = $(top_builddir)/lib/libqb.la
116+
libdir= $(TESTDIR)
116117

117-
lib_LTLIBRARIES = libstat_wrapper.la
118+
if HAVE_CHECK
118119
libstat_wrapper_la_SOURCES = libstat_wrapper.c
119120
libstat_wrapper_la_LIBADD = -ldl
120-
libdir= $(TESTDIR)
121121

122-
if HAVE_CHECK
123122
EXTRA_DIST += start.test resources.test ipc_sock.test
124123
EXTRA_DIST += blackbox-segfault.sh
125124

@@ -128,11 +127,12 @@ TESTS_ENVIRONMENT = export PATH=.:../tools:$$PATH;
128127

129128
resources.log: rb.log log.log ipc.log
130129

131-
check_LTLIBRARIES =
132130
check_PROGRAMS = array.test ipc.test list.test log.test loop.test \
133131
map.test rb.test util.test tlist.test \
134132
crash_test_dummy file_change_bytes
135133
dist_check_SCRIPTS = start.test resources.test blackbox-segfault.sh ipc_sock.test
134+
#lib_LTLIBRARIES = libstat_wrapper.la
135+
check_LTLIBRARIES =
136136

137137
if HAVE_SLOW_TESTS
138138
TESTS += util.test
@@ -143,6 +143,9 @@ if INSTALL_TESTS
143143
testsuitedir = $(TESTDIR)
144144
testsuite_PROGRAMS = $(check_PROGRAMS)
145145
testsuite_SCRIPTS = $(dist_check_SCRIPTS) test.conf
146+
lib_LTLIBRARIES = libstat_wrapper.la
147+
else
148+
noinst_LTLIBRARIES = libstat_wrapper.la
146149
endif
147150

148151
file_change_bytes_SOURCES = file_change_bytes.c

Diff for: tests/ipc_sock.test

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
# Run the IPC tests under the stat wrapper,
44
# this simulates /etc/libqb/use-filesystem-sockets existing
55
# so we can test both options without breaking other things
6-
# that might be running on this system
6+
# that might be running on this system.
77
#
8-
if [ "$(uname -s)" = "Linux" ]
8+
# This creates sockets in /var/run so needs to be root
9+
#
10+
if [ "$(uname -s)" = "Linux" -a "$UID" = "0" ]
911
then
1012
if [ -f "$(pwd)/.libs/libstat_wrapper.so" ]
1113
then

Diff for: tests/resources.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ EXPECTED_DLOCK=6
55
EXPECTED_LEFTOVER=2
66

77
# Linux also runs filesystem socket tests
8-
if [ "$(uname -s)" = "Linux" ]
8+
if [ "$(uname -s)" = "Linux" -a "$UID" = "0" ]
99
then
1010
EXPECTED_DLOCK=12
1111
EXPECTED_LEFTOVER=4

0 commit comments

Comments
 (0)