Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
trackrdrd
Commits
e17de669
Commit
e17de669
authored
Nov 15, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Miscellaneous fixes to get 'make distcheck' working.
parent
a86d18b0
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
64 additions
and
17 deletions
+64
-17
Makefile.am
Makefile.am
+4
-1
Makefile.am
src/mq/file/Makefile.am
+3
-1
Makefile.am
src/mq/kafka/Makefile.am
+3
-1
mq.c
src/mq/kafka/mq.c
+1
-1
Makefile.am
src/mq/kafka/test/Makefile.am
+3
-1
test_kafka.c
src/mq/kafka/test/test_kafka.c
+5
-1
Makefile.am
src/test/Makefile.am
+10
-1
regress.sh
src/test/regress.sh
+11
-0
test_config.c
src/test/test_config.c
+14
-8
test_mq.c
src/test/test_mq.c
+5
-1
test_worker.c
src/test/test_worker.c
+5
-1
No files found.
Makefile.am
View file @
e17de669
...
...
@@ -22,6 +22,9 @@ endif
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
clean-local
:
-
rm
-rf
doc/
src/mq/file/Makefile.am
View file @
e17de669
...
...
@@ -12,7 +12,7 @@ libtrackrdr_file_la_SOURCES = \
$(top_srcdir)
/include/mq.h
\
$(top_srcdir)
/include/config_common.h
\
$(top_srcdir)
/include/miniobj.h
\
$(top_
src
dir)
/src/config_common.c
\
$(top_
build
dir)
/src/config_common.c
\
mq.c
libtrackrdr_file_la_LDFLAGS
=
-version-info
${
CURRENT
}
:
${
REVISION
}
:
${
AGE
}
...
...
@@ -32,4 +32,6 @@ if HAVE_RST2MAN
${RST2MAN}
README.rst
$@
endif
EXTRA_DIST
=
README.rst
CLEANFILES
=
*
~
src/mq/kafka/Makefile.am
View file @
e17de669
...
...
@@ -19,7 +19,7 @@ libtrackrdr_kafka_la_SOURCES = \
worker.c
\
callback.c
\
config.c
\
$(top_
src
dir)
/src/config_common.c
$(top_
build
dir)
/src/config_common.c
libtrackrdr_kafka_la_LIBADD
=
\
${
PTHREAD_LIBS
}
\
...
...
@@ -42,4 +42,6 @@ if HAVE_RST2MAN
${RST2MAN}
README.rst
$@
endif
EXTRA_DIST
=
README.rst
CLEANFILES
=
*
~
src/mq/kafka/mq.c
View file @
e17de669
...
...
@@ -41,7 +41,7 @@
#include <pcre.h>
#ifdef HAVE_CONFIG_H
#include "
../
config.h"
#include "config.h"
#endif
#include "mq.h"
...
...
src/mq/kafka/test/Makefile.am
View file @
e17de669
AM_CPPFLAGS
=
-I
$(top_srcdir)
/include
AM_CPPFLAGS
=
-I
$(top_srcdir)
/include
-DTESTDIR
=
\"
$(srcdir)
/
\"
TESTS
=
test_partition test_kafka
...
...
@@ -66,3 +66,5 @@ test_send_ssl_LDADD = \
-lrdkafka
-lz
-lpthread
-lrt
-lzookeeper_mt
-lpcre
CLEANFILES
=
kafka.log zoo.log
*
~
EXTRA_DIST
=
kafka.conf kafka_ssl.conf
src/mq/kafka/test/test_kafka.c
View file @
e17de669
...
...
@@ -37,6 +37,10 @@
/* Automake exit code for "skipped" in make check */
#define EXIT_SKIPPED 77
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define KAFKA_CONFIG "kafka.conf"
#define NWORKERS 1
...
...
@@ -51,7 +55,7 @@ static char
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
);
return
NULL
;
...
...
src/test/Makefile.am
View file @
e17de669
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
\
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 \
check_PROGRAMS
=
test_parse test_data test_append test_mq
\
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
DISTCLEANFILES
=
mq_test.log mq_log.log
...
...
@@ -105,3 +110,7 @@ test_worker_LDADD = \
../config.
$(OBJEXT)
\
../config_common.
$(OBJEXT)
\
@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
src/test/regress.sh
View file @
e17de669
...
...
@@ -16,6 +16,7 @@ echo '... testing messages & log output at debug level against known checksums'
LOG
=
mq_log.log
MSG
=
mq_test.log
TESTDIR
=
"
${
TESTDIR
:-
.
}
"
#
# $1 the binary log to read
...
...
@@ -26,6 +27,12 @@ MSG=mq_test.log
function
regress
{
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
# Check ckums of the log with and without logs from the worker thread,
...
...
@@ -67,4 +74,8 @@ echo '... legacy VCL_Log syntax'
regress
'varnish.legacy.binlog'
'3334052518 375477'
'3908916621 57319'
\
'1139478852 48689'
if
[
"
$TESTDIR
"
!=
"."
]
;
then
rm
-f
varnish.binlog varnish.legacy.binlog test.conf file_mq.conf
fi
exit
0
src/test/test_config.c
View file @
e17de669
...
...
@@ -44,6 +44,10 @@
/***** defines ****************************************************************/
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define DEFAULT_USER "nobody"
#define DEFAULT_PID_FILE "/var/run/trackrdrd.pid"
#define DEFAULT_RESTART_PAUSE 1
...
...
@@ -121,19 +125,21 @@ static char
static
char
*
readAndCompare
(
const
char
*
confNam
e
)
*
readAndCompare
(
const
char
*
testDir
,
const
char
*
confFil
e
)
{
int
err
;
char
confNameNew
[
512
];
char
confName
[
512
],
confName
New
[
512
];
err
=
CONF_ReadDefault
();
VMASSERT
(
err
==
0
,
"Error code during reading default config: %i"
,
err
);
strcpy
(
confName
,
testDir
);
strcat
(
confName
,
confFile
);
err
=
CONF_ReadFile
(
confName
,
CONF_Add
);
VMASSERT
(
err
==
0
,
"Error code during reading config
\"
%s
\"
: %i"
,
confName
,
err
);
// verbose("Config is:\n%s", getConfigContent());
strcpy
(
confNameNew
,
conf
Nam
e
);
strcpy
(
confNameNew
,
conf
Fil
e
);
strcat
(
confNameNew
,
".new"
);
saveConfig
(
confNameNew
);
VMASSERT
(
!
TEST_compareFiles
(
confName
,
confNameNew
),
...
...
@@ -152,9 +158,9 @@ static const char
LOG_Open
(
"trackrdrd"
);
LOG_SetLevel
(
7
);
returnIfNotNull
(
readAndCompare
(
"trackrdrd_001.conf"
));
returnIfNotNull
(
readAndCompare
(
"trackrdrd_002.conf"
));
returnIfNotNull
(
readAndCompare
(
"trackrdrd_003.conf"
));
returnIfNotNull
(
readAndCompare
(
TESTDIR
,
"trackrdrd_001.conf"
));
returnIfNotNull
(
readAndCompare
(
TESTDIR
,
"trackrdrd_002.conf"
));
returnIfNotNull
(
readAndCompare
(
TESTDIR
,
"trackrdrd_003.conf"
));
return
NULL
;
}
...
...
@@ -185,8 +191,8 @@ static const char
printf
(
"... testing CONF_ReadFile
\n
"
);
returnIfNotNull
(
readAndFindError
(
"trackrdrd_010.conf"
,
"Error in trackrdrd_010.conf line 12 "
readAndFindError
(
TESTDIR
"trackrdrd_010.conf"
,
"Error in
"
TESTDIR
"
trackrdrd_010.conf line 12 "
"(Invalid argument): "
"'unknown.module = /my/path/module.so'
\n
"
));
return
NULL
;
...
...
src/test/test_mq.c
View file @
e17de669
...
...
@@ -37,6 +37,10 @@
#include "../trackrdrd.h"
#include "vas.h"
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define MQ_MODULE "../mq/file/.libs/libtrackrdr-file.so"
#define MQ_CONFIG "file_mq.conf"
...
...
@@ -87,7 +91,7 @@ static char
printf
(
"... testing MQ global initialization
\n
"
);
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
);
VMASSERT
(
err
==
NULL
,
"MQ_GlobalInit: %s"
,
err
);
...
...
src/test/test_worker.c
View file @
e17de669
...
...
@@ -40,6 +40,10 @@
#include "../trackrdrd.h"
#include "../data.h"
#ifndef TESTDIR
# define TESTDIR "./"
#endif
#define DEBUG 0
#define debug_print(fmt, ...) \
do { if (DEBUG) fprintf(stderr, fmt, __VA_ARGS__); } while(0)
...
...
@@ -113,7 +117,7 @@ static char
CONF_Init
();
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
);
VMASSERT
(
error
==
NULL
,
"MQ_GlobalInit failed: %s"
,
error
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment