summaryrefslogtreecommitdiffstats
path: root/common/elapi/elapi_test
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-08-25 16:54:01 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-09-08 19:25:16 -0400
commitc5461b548d303e6e66e20048544814338b46efb5 (patch)
treeddf98cf7e498349739fb0c8e9612a0f962e14c41 /common/elapi/elapi_test
parent7a9bee06e2bc5bcc75659e9a46bdffa870951d7a (diff)
downloadsssd-c5461b548d303e6e66e20048544814338b46efb5.tar.gz
sssd-c5461b548d303e6e66e20048544814338b46efb5.tar.xz
sssd-c5461b548d303e6e66e20048544814338b46efb5.zip
ELAPI sinks and providers
This patch drills down to the next level of ELAPI functionality. I adds the creation and loading of the sinks. It also implements a skeleton for the first low level provider which will be capable of writing to a file. The configuration ini file is extended to define new configuration parameters and their meanings.
Diffstat (limited to 'common/elapi/elapi_test')
-rw-r--r--common/elapi/elapi_test/Makefile.am14
-rw-r--r--common/elapi/elapi_test/elapi_ut.conf27
2 files changed, 36 insertions, 5 deletions
diff --git a/common/elapi/elapi_test/Makefile.am b/common/elapi/elapi_test/Makefile.am
index b16102c83..cac0ead6d 100644
--- a/common/elapi/elapi_test/Makefile.am
+++ b/common/elapi/elapi_test/Makefile.am
@@ -5,7 +5,8 @@ topdir=$(srcdir)/../..
AM_CFLAGS = -DELAPI_DEFAULT_CONFIG_DIR=\"$(srcdir)\" \
-DELAPI_DEFAULT_CONFIG_APP_DIR=\"$(srcdir)\" \
-DELAPI_DEFAULT_APP_NAME=\"elapi_ut\" \
- -DELAPI_DEFAULT_APP_NAME_SIZE=127
+ -DELAPI_DEFAULT_APP_NAME_SIZE=127 \
+ -DELAPI_UTEST
if HAVE_GCC
AM_CFLAGS += \
@@ -13,26 +14,31 @@ if HAVE_GCC
-Wcast-align -Wwrite-strings
endif
-AM_CPPFLAGS = -I$(topdir) -I$(topdir)/ini -I$(topdir)/trace -I$(topdir)/collection -I$(topdir)/elapi $(TRACE_LEVEL)
+AM_CPPFLAGS = -I$(topdir) -I$(topdir)/ini -I$(topdir)/trace -I$(topdir)/collection -I$(topdir)/elapi \
+ -I$(topdir)/elapi/providers/file $(TRACE_LEVEL)
ACLOCAL_AMFLAGS = -I m4
# Build library
noinst_LTLIBRARIES = libelapi_test.la
+
libelapi_test_la_SOURCES = \
../elapi_event.c \
../elapi_log.c \
../elapi_internal.c \
+ ../elapi_sink.c \
../elapi_event.h \
../elapi_priv.h \
../elapi_sink.h \
../elapi_log.h \
../elapi_async.h \
- ../elapi.h
+ ../elapi.h \
+ ../providers/file/file_provider.c \
+ ../providers/file/file_provider.h
# Build unit test
check_PROGRAMS = elapi_ut
elapi_ut_SOURCES = elapi_ut.c
-elapi_ut_LDADD = libelapi_test.la ../../ini/libini_config.la ../../collection/libcollection.la
+elapi_ut_LDADD = libelapi_test.la ../../ini/libini_config.la ../../collection/libcollection.la -ldl
TESTS = elapi_ut
diff --git a/common/elapi/elapi_test/elapi_ut.conf b/common/elapi/elapi_test/elapi_ut.conf
index d15a4550d..a5ad7a0b2 100644
--- a/common/elapi/elapi_test/elapi_ut.conf
+++ b/common/elapi/elapi_test/elapi_ut.conf
@@ -79,19 +79,44 @@ sinks = logfile, syslog
; In this case the ELAPI will try to load shared library with the name
; constructed using specified value. In the given example
; ELAPI will try to load libelapi_sink_custom_audit.so library.
-; The general pattern is: libelapi_sink_<source>.so
+; The general pattern is: libelapi_sink_<provider>.so
+;
+; required - (optional)
+; Defines whether it is a required sink?
+; If not present the dispatcher will return error at load time.
+;
+; onerror - if the sink got an error what should dispatcher do?
+; 0 - retry (default)
+; 1 - disable
+;
+; timeout - for how long one should wait before trying to revive the sink
+; default is 60 seconds
+;
+; synch - yes/no (default no) - a flag that forces the sink to act synchronously
+; even if it can support async operations
[debugfile]
provider=file
+required=true
+onerror=1
+timeout=90
[logfile]
provider=file
+required=true
+onerror=0
+timeout=60
[auditfile]
provider=file
+required=true
+onerror=1
+timeout=90
[stderr]
provider=stderr
+synch=false
[syslog]
provider=syslog
+synch=yes