summaryrefslogtreecommitdiffstats
path: root/common/elapi/elapi_test
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-09-17 00:01:09 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-10-05 10:32:08 -0400
commit8140cea7b4e3d3c9c6003eb6ae30e5e0fdd7c1ae (patch)
tree3f6ec4cf35410fa2c19c2dc448d311d4bd0ef4b3 /common/elapi/elapi_test
parentea7d823fa584b36e9a34a43c32dc476beede5ea2 (diff)
downloadsssd-8140cea7b4e3d3c9c6003eb6ae30e5e0fdd7c1ae.tar.gz
sssd-8140cea7b4e3d3c9c6003eb6ae30e5e0fdd7c1ae.tar.xz
sssd-8140cea7b4e3d3c9c6003eb6ae30e5e0fdd7c1ae.zip
ELAPI Event resolver
Started working on the async processing and realised that I need to have a good copy of the event with all the fields resolved so this patch has some foundation for the async functions (module elapi_async.c) but they are mostly stubbed out. The actual code will be added down the road. Instead the patch focuses on the code introduced in elapi_resolve.c module and the use of the functions from it. It also adds the implementation of the high level calls that initialize ELAPI with the external callbacks to be used during async processing (elapi_log.c).
Diffstat (limited to 'common/elapi/elapi_test')
-rw-r--r--common/elapi/elapi_test/Makefile.am4
-rw-r--r--common/elapi/elapi_test/elapi_ut.c21
2 files changed, 20 insertions, 5 deletions
diff --git a/common/elapi/elapi_test/Makefile.am b/common/elapi/elapi_test/Makefile.am
index 76f06e0c4..dcf1707cc 100644
--- a/common/elapi/elapi_test/Makefile.am
+++ b/common/elapi/elapi_test/Makefile.am
@@ -30,11 +30,15 @@ libelapi_test_la_SOURCES = \
../elapi_sink.c \
../elapi_basic.c \
../elapi_basic.h \
+ ../elapi_resolve.c \
+ ../elapi_async.c \
../elapi_event.h \
../elapi_priv.h \
../elapi_sink.h \
../elapi_log.h \
../elapi_async.h \
+ ../elapi_fd.h \
+ ../elapi_tm.h \
../elapi.h \
../providers/file/file_provider.c \
../providers/file/file_provider.h \
diff --git a/common/elapi/elapi_test/elapi_ut.c b/common/elapi/elapi_test/elapi_ut.c
index 0a8234322..1046ed0e6 100644
--- a/common/elapi/elapi_test/elapi_ut.c
+++ b/common/elapi/elapi_test/elapi_ut.c
@@ -208,8 +208,8 @@ int complex_event_test(void)
return error;
}
- col_debug_collection(template, COL_TRAVERSE_FLAT);
- col_debug_collection(event, COL_TRAVERSE_FLAT);
+ col_debug_collection(template, COL_TRAVERSE_DEFAULT);
+ col_debug_collection(event, COL_TRAVERSE_DEFAULT);
error = elapi_log(E_TARGET_DEBUG, event);
@@ -233,8 +233,9 @@ int complex_event_test(void)
"%d(int_number),", -200,
"%u(unsigned_number)", 300,
"%ld(long_number)", -1234567,
+ "%lu(long_unsigned)", -1234567,
E_MESSAGE,
- "%(stamp), %s(sub_string), %(int_number), %(unsigned_number), %(long_unsigned_number), %(bin), %e(double_number)",
+ "%(stamp), %(sub_string), %(int_number), %(unsigned_number), %(long_unsigned_number), %(bin), %(double_number)",
E_EOARG);
if (error) {
@@ -270,8 +271,11 @@ int complex_event_test(void)
col_destroy_collection(col);
- col_debug_collection(template, COL_TRAVERSE_FLAT);
- col_debug_collection(event, COL_TRAVERSE_FLAT);
+ col_debug_collection(template, COL_TRAVERSE_DEFAULT);
+
+ printf("\nPRINTING EVENT\n\n");
+ printf("\nPRINTING EVENT, removed message added bin\n\n");
+ col_debug_collection(event, COL_TRAVERSE_DEFAULT);
if ((error = col_create_collection(&col, "test", 0)) ||
@@ -300,6 +304,10 @@ int complex_event_test(void)
return error;
}
+ printf("\nPRINTING EVENT, removed message, added bin,\n"
+ "added test collection with zzz & zzz2\n\n");
+
+ col_debug_collection(event, COL_TRAVERSE_DEFAULT);
col_destroy_collection(col);
if ((error = col_create_collection(&col, "flat", 0)) ||
@@ -326,6 +334,9 @@ int complex_event_test(void)
return error;
}
+ printf("\nPRINTING EVENT, added flat collection with zzz & zzz2\n\n");
+
+ col_debug_collection(event, COL_TRAVERSE_DEFAULT);
col_destroy_collection(col);
error = elapi_copy_event(&event_copy, event);