Commit bc274b92 authored by Geoff Simmons's avatar Geoff Simmons

Miscellaneous fixes to get 'make distcheck' working.

parent f486af3c
Pipeline #375 skipped
...@@ -22,6 +22,9 @@ endif ...@@ -22,6 +22,9 @@ endif
include doxygen-include.am include doxygen-include.am
EXTRA_DIST = README.rst autogen.sh m4/* $(DX_CONFIG) doc/html EXTRA_DIST = README.rst autogen.sh $(DX_CONFIG) doc/html
doc/html: doxygen-run doc/html: doxygen-run
clean-local:
-rm -rf doc/
...@@ -12,7 +12,7 @@ libtrackrdr_file_la_SOURCES = \ ...@@ -12,7 +12,7 @@ libtrackrdr_file_la_SOURCES = \
$(top_srcdir)/include/mq.h \ $(top_srcdir)/include/mq.h \
$(top_srcdir)/include/config_common.h \ $(top_srcdir)/include/config_common.h \
$(top_srcdir)/include/miniobj.h \ $(top_srcdir)/include/miniobj.h \
$(top_srcdir)/src/config_common.c \ $(top_builddir)/src/config_common.c \
mq.c mq.c
libtrackrdr_file_la_LDFLAGS = -version-info ${CURRENT}:${REVISION}:${AGE} libtrackrdr_file_la_LDFLAGS = -version-info ${CURRENT}:${REVISION}:${AGE}
...@@ -32,4 +32,6 @@ if HAVE_RST2MAN ...@@ -32,4 +32,6 @@ if HAVE_RST2MAN
${RST2MAN} README.rst $@ ${RST2MAN} README.rst $@
endif endif
EXTRA_DIST = README.rst
CLEANFILES = *~ CLEANFILES = *~
...@@ -19,7 +19,7 @@ libtrackrdr_kafka_la_SOURCES = \ ...@@ -19,7 +19,7 @@ libtrackrdr_kafka_la_SOURCES = \
worker.c \ worker.c \
callback.c \ callback.c \
config.c \ config.c \
$(top_srcdir)/src/config_common.c $(top_builddir)/src/config_common.c
libtrackrdr_kafka_la_LIBADD = \ libtrackrdr_kafka_la_LIBADD = \
${PTHREAD_LIBS} \ ${PTHREAD_LIBS} \
...@@ -42,4 +42,6 @@ if HAVE_RST2MAN ...@@ -42,4 +42,6 @@ if HAVE_RST2MAN
${RST2MAN} README.rst $@ ${RST2MAN} README.rst $@
endif endif
EXTRA_DIST = README.rst
CLEANFILES = *~ CLEANFILES = *~
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include <pcre.h> #include <pcre.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "../config.h" #include "config.h"
#endif #endif
#include "mq.h" #include "mq.h"
......
AM_CPPFLAGS = -I$(top_srcdir)/include AM_CPPFLAGS = -I$(top_srcdir)/include -DTESTDIR=\"$(srcdir)/\"
TESTS = test_partition test_kafka TESTS = test_partition test_kafka
...@@ -66,3 +66,5 @@ test_send_ssl_LDADD = \ ...@@ -66,3 +66,5 @@ test_send_ssl_LDADD = \
-lrdkafka -lz -lpthread -lrt -lzookeeper_mt -lpcre -lrdkafka -lz -lpthread -lrt -lzookeeper_mt -lpcre
CLEANFILES = kafka.log zoo.log *~ CLEANFILES = kafka.log zoo.log *~
EXTRA_DIST = kafka.conf kafka_ssl.conf
...@@ -37,6 +37,10 @@ ...@@ -37,6 +37,10 @@
/* Automake exit code for "skipped" in make check */ /* Automake exit code for "skipped" in make check */
#define EXIT_SKIPPED 77 #define EXIT_SKIPPED 77
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define KAFKA_CONFIG "kafka.conf" #define KAFKA_CONFIG "kafka.conf"
#define NWORKERS 1 #define NWORKERS 1
...@@ -51,7 +55,7 @@ static char ...@@ -51,7 +55,7 @@ static char
printf("... testing Kafka global initialization\n"); printf("... testing Kafka global initialization\n");
err = MQ_GlobalInit(NWORKERS, KAFKA_CONFIG); err = MQ_GlobalInit(NWORKERS, TESTDIR KAFKA_CONFIG);
VMASSERT(err == NULL, "MQ_GlobalInit: %s", err); VMASSERT(err == NULL, "MQ_GlobalInit: %s", err);
return NULL; return NULL;
......
AUTOMAKE_OPTIONS = subdir-objects AUTOMAKE_OPTIONS = subdir-objects
AM_CPPFLAGS = @VARNISH_CFLAGS@ -I$(top_srcdir)/include AM_CPPFLAGS = @VARNISH_CFLAGS@ -I$(top_srcdir)/include -I$(builddir)/.. \
-DTESTDIR=\"$(srcdir)/\"
TESTS = test_parse test_data test_append test_mq test_spmcq \ TESTS = test_parse test_data test_append test_mq test_spmcq \
test_config test_spmcq_loop.sh test_worker regress.sh test_config test_spmcq_loop.sh test_worker regress.sh
...@@ -8,6 +9,10 @@ TESTS = test_parse test_data test_append test_mq test_spmcq \ ...@@ -8,6 +9,10 @@ TESTS = test_parse test_data test_append test_mq test_spmcq \
check_PROGRAMS = test_parse test_data test_append test_mq \ check_PROGRAMS = test_parse test_data test_append test_mq \
test_spmcq test_config test_worker test_spmcq test_config test_worker
dist_check_SCRIPTS = test_spmcq_loop.sh regress.sh
AM_TESTS_ENVIRONMENT = TESTDIR=$(srcdir)
CLEANFILES = testing.log stderr.txt trackrdrd.pid trackrdrd_*.conf.new CLEANFILES = testing.log stderr.txt trackrdrd.pid trackrdrd_*.conf.new
DISTCLEANFILES = mq_test.log mq_log.log DISTCLEANFILES = mq_test.log mq_log.log
...@@ -105,3 +110,7 @@ test_worker_LDADD = \ ...@@ -105,3 +110,7 @@ test_worker_LDADD = \
../config.$(OBJEXT) \ ../config.$(OBJEXT) \
../config_common.$(OBJEXT) \ ../config_common.$(OBJEXT) \
@VARNISH_LIBS@ @VARNISH_LIBS@
EXTRA_DIST = file_mq.conf test.conf trackrdrd_001.conf trackrdrd_002.conf \
trackrdrd_003.conf trackrdrd_010.conf varnish.binlog \
varnish.legacy.binlog
...@@ -16,6 +16,7 @@ echo '... testing messages & log output at debug level against known checksums' ...@@ -16,6 +16,7 @@ echo '... testing messages & log output at debug level against known checksums'
LOG=mq_log.log LOG=mq_log.log
MSG=mq_test.log MSG=mq_test.log
TESTDIR="${TESTDIR:-.}"
# #
# $1 the binary log to read # $1 the binary log to read
...@@ -26,6 +27,12 @@ MSG=mq_test.log ...@@ -26,6 +27,12 @@ MSG=mq_test.log
function regress { function regress {
rm -f $LOG $MSG rm -f $LOG $MSG
if [ "$TESTDIR" != "." ]; then
cp $TESTDIR/$1 .
cp $TESTDIR/test.conf .
cp $TESTDIR/file_mq.conf .
fi
../trackrdrd -D -f $1 -l $LOG -d -c test.conf ../trackrdrd -D -f $1 -l $LOG -d -c test.conf
# Check ckums of the log with and without logs from the worker thread, # Check ckums of the log with and without logs from the worker thread,
...@@ -67,4 +74,8 @@ echo '... legacy VCL_Log syntax' ...@@ -67,4 +74,8 @@ echo '... legacy VCL_Log syntax'
regress 'varnish.legacy.binlog' '3334052518 375477' '3908916621 57319' \ regress 'varnish.legacy.binlog' '3334052518 375477' '3908916621 57319' \
'1139478852 48689' '1139478852 48689'
if [ "$TESTDIR" != "." ]; then
rm -f varnish.binlog varnish.legacy.binlog test.conf file_mq.conf
fi
exit 0 exit 0
...@@ -44,6 +44,10 @@ ...@@ -44,6 +44,10 @@
/***** defines ****************************************************************/ /***** defines ****************************************************************/
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define DEFAULT_USER "nobody" #define DEFAULT_USER "nobody"
#define DEFAULT_PID_FILE "/var/run/trackrdrd.pid" #define DEFAULT_PID_FILE "/var/run/trackrdrd.pid"
#define DEFAULT_RESTART_PAUSE 1 #define DEFAULT_RESTART_PAUSE 1
...@@ -121,19 +125,21 @@ static char ...@@ -121,19 +125,21 @@ static char
static char static char
*readAndCompare(const char * confName) *readAndCompare(const char * testDir, const char * confFile)
{ {
int err; int err;
char confNameNew[512]; char confName[512], confNameNew[512];
err = CONF_ReadDefault(); err = CONF_ReadDefault();
VMASSERT(err == 0, "Error code during reading default config: %i", err); VMASSERT(err == 0, "Error code during reading default config: %i", err);
strcpy(confName, testDir);
strcat(confName, confFile);
err = CONF_ReadFile(confName, CONF_Add); err = CONF_ReadFile(confName, CONF_Add);
VMASSERT(err == 0, VMASSERT(err == 0,
"Error code during reading config \"%s\": %i", confName, err); "Error code during reading config \"%s\": %i", confName, err);
// verbose("Config is:\n%s", getConfigContent()); // verbose("Config is:\n%s", getConfigContent());
strcpy(confNameNew, confName); strcpy(confNameNew, confFile);
strcat(confNameNew, ".new"); strcat(confNameNew, ".new");
saveConfig(confNameNew); saveConfig(confNameNew);
VMASSERT(!TEST_compareFiles(confName, confNameNew), VMASSERT(!TEST_compareFiles(confName, confNameNew),
...@@ -152,9 +158,9 @@ static const char ...@@ -152,9 +158,9 @@ static const char
LOG_Open("trackrdrd"); LOG_Open("trackrdrd");
LOG_SetLevel(7); LOG_SetLevel(7);
returnIfNotNull(readAndCompare("trackrdrd_001.conf")); returnIfNotNull(readAndCompare(TESTDIR, "trackrdrd_001.conf"));
returnIfNotNull(readAndCompare("trackrdrd_002.conf")); returnIfNotNull(readAndCompare(TESTDIR, "trackrdrd_002.conf"));
returnIfNotNull(readAndCompare("trackrdrd_003.conf")); returnIfNotNull(readAndCompare(TESTDIR, "trackrdrd_003.conf"));
return NULL; return NULL;
} }
...@@ -185,8 +191,8 @@ static const char ...@@ -185,8 +191,8 @@ static const char
printf("... testing CONF_ReadFile\n"); printf("... testing CONF_ReadFile\n");
returnIfNotNull( returnIfNotNull(
readAndFindError("trackrdrd_010.conf", readAndFindError(TESTDIR "trackrdrd_010.conf",
"Error in trackrdrd_010.conf line 12 " "Error in " TESTDIR "trackrdrd_010.conf line 12 "
"(Invalid argument): " "(Invalid argument): "
"'unknown.module = /my/path/module.so'\n")); "'unknown.module = /my/path/module.so'\n"));
return NULL; return NULL;
......
...@@ -37,6 +37,10 @@ ...@@ -37,6 +37,10 @@
#include "../trackrdrd.h" #include "../trackrdrd.h"
#include "vas.h" #include "vas.h"
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define MQ_MODULE "../mq/file/.libs/libtrackrdr-file.so" #define MQ_MODULE "../mq/file/.libs/libtrackrdr-file.so"
#define MQ_CONFIG "file_mq.conf" #define MQ_CONFIG "file_mq.conf"
...@@ -87,7 +91,7 @@ static char ...@@ -87,7 +91,7 @@ static char
printf("... testing MQ global initialization\n"); printf("... testing MQ global initialization\n");
config.nworkers = NWORKERS; config.nworkers = NWORKERS;
strcpy(config.mq_config_file, MQ_CONFIG); strcpy(config.mq_config_file, TESTDIR MQ_CONFIG);
err = mqf.global_init(config.nworkers, config.mq_config_file); err = mqf.global_init(config.nworkers, config.mq_config_file);
VMASSERT(err == NULL, "MQ_GlobalInit: %s", err); VMASSERT(err == NULL, "MQ_GlobalInit: %s", err);
......
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
#include "../trackrdrd.h" #include "../trackrdrd.h"
#include "../data.h" #include "../data.h"
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define DEBUG 0 #define DEBUG 0
#define debug_print(fmt, ...) \ #define debug_print(fmt, ...) \
do { if (DEBUG) fprintf(stderr, fmt, __VA_ARGS__); } while(0) do { if (DEBUG) fprintf(stderr, fmt, __VA_ARGS__); } while(0)
...@@ -113,7 +117,7 @@ static char ...@@ -113,7 +117,7 @@ static char
CONF_Init(); CONF_Init();
config.nworkers = NWORKERS; config.nworkers = NWORKERS;
strcpy(config.mq_config_file, MQ_CONFIG); strcpy(config.mq_config_file, TESTDIR MQ_CONFIG);
error = mqf.global_init(config.nworkers, config.mq_config_file); error = mqf.global_init(config.nworkers, config.mq_config_file);
VMASSERT(error == NULL, "MQ_GlobalInit failed: %s", error); VMASSERT(error == NULL, "MQ_GlobalInit failed: %s", error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment