Code

sysdb.git
10 years agoMerged branch 'master' of git://git.tokkee.org/sysdb.
Sebastian Harl [Sun, 1 Dec 2013 16:34:48 +0000 (17:34 +0100)]
Merged branch 'master' of git://git.tokkee.org/sysdb.

Conflicts:
t/Makefile.am
t/libsysdb_test.c
t/libsysdb_test.h

10 years ago.gitignore: Added check test logs.
Sebastian Harl [Sun, 1 Dec 2013 16:02:06 +0000 (17:02 +0100)]
.gitignore: Added check test logs.

10 years agot/: Added initial tests for core/object.
Sebastian Harl [Sun, 1 Dec 2013 16:01:15 +0000 (17:01 +0100)]
t/: Added initial tests for core/object.

10 years agoobject: Be more specific about requirements for the 'destroy' callback.
Sebastian Harl [Sun, 1 Dec 2013 15:57:14 +0000 (16:57 +0100)]
object: Be more specific about requirements for the 'destroy' callback.

10 years agoobject: Ensure that a type's destroy callback is called if init fails.
Sebastian Harl [Sun, 1 Dec 2013 15:55:13 +0000 (16:55 +0100)]
object: Ensure that a type's destroy callback is called if init fails.

Else, failed init may leak memory.

10 years agofrontend: Unified error reporting to the client.
Sebastian Harl [Thu, 28 Nov 2013 17:28:26 +0000 (18:28 +0100)]
frontend: Unified error reporting to the client.

Keep track of the latest error in a connection object and report that back to
the client in case a command handler failed.

10 years agostore: Let tojson() embed errors into JSON rather than aborting.
Sebastian Harl [Thu, 28 Nov 2013 17:17:28 +0000 (18:17 +0100)]
store: Let tojson() embed errors into JSON rather than aborting.

10 years agoRenamed sdb_session_start() to sdb_fe_session_start().
Sebastian Harl [Thu, 28 Nov 2013 16:50:56 +0000 (17:50 +0100)]
Renamed sdb_session_start() to sdb_fe_session_start().

10 years agofrontend: Added a simple 'LIST' command.
Sebastian Harl [Thu, 28 Nov 2013 16:48:48 +0000 (17:48 +0100)]
frontend: Added a simple 'LIST' command.

This command sends a JSON representation of the whole store to the client.

10 years agostore: Replaced store_dump() with store_tojson().
Sebastian Harl [Thu, 28 Nov 2013 16:47:04 +0000 (17:47 +0100)]
store: Replaced store_dump() with store_tojson().

The new function serializes the store as JSON and writes the result to a
string buffer.

10 years agostrbuf test: Further extended the incremental append test.
Sebastian Harl [Thu, 28 Nov 2013 16:42:06 +0000 (17:42 +0100)]
strbuf test: Further extended the incremental append test.

10 years agoutils strbuf: Handle nul-byte correctly.
Sebastian Harl [Thu, 28 Nov 2013 16:34:56 +0000 (17:34 +0100)]
utils strbuf: Handle nul-byte correctly.

A corner-case was not handled correctly before: when writing just enough
characters to the buffer that it would then be full, a resize was attempted
without changing the size of the buffer, leading to an endless loop in
vappend(). This was caused by not taking into account the space required for
the trailing nul-byte.

A test-case which exposes this problem has also been added.

10 years agosrc/Makefile: Install all public header files.
Sebastian Harl [Tue, 26 Nov 2013 17:47:37 +0000 (18:47 +0100)]
src/Makefile: Install all public header files.

10 years agofrontend: Moved all connection handling operations into connection.c.
Sebastian Harl [Tue, 26 Nov 2013 17:42:58 +0000 (18:42 +0100)]
frontend: Moved all connection handling operations into connection.c.

connection_obj_t was merged into sdb_conn_t which now inherits from
sdb_object_t. The connection object is now private to the library and defined
in the new header file connection-private.h.

11 years agofrontend: Report back invalid commands.
Sebastian Harl [Sat, 23 Nov 2013 08:59:14 +0000 (09:59 +0100)]
frontend: Report back invalid commands.

11 years agofrontend: Handle STARTUP and PING commands.
Sebastian Harl [Sat, 23 Nov 2013 08:50:50 +0000 (09:50 +0100)]
frontend: Handle STARTUP and PING commands.

Implemented an initial, trivial "framework" for session handling /
authentication. Simply send back OK status for now.

Fixed preconditions for initialization and handling of commands.

11 years agofrontend: Moved connection init/close to connection.c.
Sebastian Harl [Tue, 12 Nov 2013 16:39:53 +0000 (17:39 +0100)]
frontend: Moved connection init/close to connection.c.

11 years agofrontend/sock: Fixed an info message.
Sebastian Harl [Mon, 11 Nov 2013 08:25:46 +0000 (09:25 +0100)]
frontend/sock: Fixed an info message.

;-)

11 years agofrontend/connection: Reset state after handling a command.
Sebastian Harl [Mon, 11 Nov 2013 08:22:21 +0000 (09:22 +0100)]
frontend/connection: Reset state after handling a command.

11 years agofrontend/connection: Try to handle as much as possible in read().
Sebastian Harl [Mon, 11 Nov 2013 08:18:13 +0000 (09:18 +0100)]
frontend/connection: Try to handle as much as possible in read().

Else, we might have to wait for more data before being able to process a
command.

11 years agofrontend: Added module for generic connection handling.
Sebastian Harl [Mon, 11 Nov 2013 08:17:31 +0000 (09:17 +0100)]
frontend: Added module for generic connection handling.

11 years agoMerged branch 'master' of git://git.tokkee.org/sysdb.
Sebastian Harl [Thu, 7 Nov 2013 14:47:07 +0000 (15:47 +0100)]
Merged branch 'master' of git://git.tokkee.org/sysdb.

11 years agosocket frontend: Notify about incomplete commands before closing connections.
Sebastian Harl [Thu, 7 Nov 2013 06:49:44 +0000 (07:49 +0100)]
socket frontend: Notify about incomplete commands before closing connections.

11 years agoutils strbuf: Advance buffer position in sdb_strbuf_read().
Sebastian Harl [Thu, 7 Nov 2013 06:48:59 +0000 (07:48 +0100)]
utils strbuf: Advance buffer position in sdb_strbuf_read().

11 years agosocket frontend: Read incoming commands into a buffer.
Sebastian Harl [Wed, 6 Nov 2013 21:25:53 +0000 (22:25 +0100)]
socket frontend: Read incoming commands into a buffer.

Handle commands once all of them has been read. Give preference to reading
data over handling a command in order not to block clients or exhaust
operating system buffers.

11 years agostrbuf_test: Added some NULL tests.
Sebastian Harl [Thu, 31 Oct 2013 18:09:05 +0000 (19:09 +0100)]
strbuf_test: Added some NULL tests.

These are mainly to check that the functions do no segfault but report an
error.

11 years agostrbuf_test: Added tests for len / nil-termination after skip().
Sebastian Harl [Thu, 31 Oct 2013 18:00:50 +0000 (19:00 +0100)]
strbuf_test: Added tests for len / nil-termination after skip().

11 years agoutils strbuf: Added sdb_strbuf_skip().
Sebastian Harl [Thu, 31 Oct 2013 17:56:06 +0000 (18:56 +0100)]
utils strbuf: Added sdb_strbuf_skip().

This function may be used to remove bytes and the beginning of the buffer.

11 years agosocket frontend: Merged connection_obj_t and connection_t.
Sebastian Harl [Wed, 30 Oct 2013 10:16:48 +0000 (11:16 +0100)]
socket frontend: Merged connection_obj_t and connection_t.

There's no reason for two separate structs.

11 years agoutils strbuf: Added sdb_strbuf_read().
Sebastian Harl [Tue, 29 Oct 2013 09:06:42 +0000 (10:06 +0100)]
utils strbuf: Added sdb_strbuf_read().

This function may be used to read from an open file into the buffer.

11 years agoutils strbuf: Added memcpy and memappend functions.
Sebastian Harl [Tue, 29 Oct 2013 08:47:57 +0000 (09:47 +0100)]
utils strbuf: Added memcpy and memappend functions.

These functions may be used to write arbitrary data to a string buffer.

11 years agosocket frontend: Cleaned up main handler loop a bit.
Sebastian Harl [Sat, 26 Oct 2013 12:23:56 +0000 (14:23 +0200)]
socket frontend: Cleaned up main handler loop a bit.

11 years agosocket frontend: Try to reopen a connection if it has been closed.
Sebastian Harl [Sat, 26 Oct 2013 12:14:11 +0000 (14:14 +0200)]
socket frontend: Try to reopen a connection if it has been closed.

11 years agosocket frontend: Close sockets on error as well.
Sebastian Harl [Sat, 26 Oct 2013 12:10:04 +0000 (14:10 +0200)]
socket frontend: Close sockets on error as well.

11 years agosocket frontend: Close listening sockets before returning.
Sebastian Harl [Sat, 26 Oct 2013 12:05:42 +0000 (14:05 +0200)]
socket frontend: Close listening sockets before returning.

Also, cleaned up listener handling a bit.

11 years agosocket frontend: Disallow duplicate listen_and_serve() calls.
Sebastian Harl [Sat, 26 Oct 2013 11:51:06 +0000 (13:51 +0200)]
socket frontend: Disallow duplicate listen_and_serve() calls.

… and fixed a memory leak.

11 years agosocket frontend: Don't use UTF-8 in comments ;-)
Sebastian Harl [Fri, 25 Oct 2013 17:07:17 +0000 (19:07 +0200)]
socket frontend: Don't use UTF-8 in comments ;-)

11 years agosocket frontend: Let handler read from open connection.
Sebastian Harl [Fri, 25 Oct 2013 17:04:56 +0000 (19:04 +0200)]
socket frontend: Let handler read from open connection.

Close the connection on EOF and pass back the connection to the main loop in
case no data is currently available (read() would block).

11 years agosocket frontend: Pass socket object to handler threads.
Sebastian Harl [Fri, 25 Oct 2013 17:03:32 +0000 (19:03 +0200)]
socket frontend: Pass socket object to handler threads.

This will allow them to pass back connections to the main loop.

11 years agosocket frontend: Renamed accept_connection → connection_accept.
Sebastian Harl [Fri, 25 Oct 2013 16:59:40 +0000 (18:59 +0200)]
socket frontend: Renamed accept_connection → connection_accept.

11 years agosocket frontend: Use nonblocking I/O for open connections.
Sebastian Harl [Fri, 25 Oct 2013 16:57:28 +0000 (18:57 +0200)]
socket frontend: Use nonblocking I/O for open connections.

11 years agosocket frontend: Split connection accepting into its own function.
Sebastian Harl [Fri, 25 Oct 2013 15:50:17 +0000 (17:50 +0200)]
socket frontend: Split connection accepting into its own function.

11 years agosocket frontend: Manage open connections in listen_and_serve().
Sebastian Harl [Fri, 25 Oct 2013 15:40:57 +0000 (17:40 +0200)]
socket frontend: Manage open connections in listen_and_serve().

For that purpose, added a new object data type wrapping a connection. All open
connections are managed in a linked-link in the socket object. The main loop
now also waits data to be available on an open connection and then passed on
the connection object to the connection handler thread which is then supposed
to handle requests (not implemented yet).

11 years agochannel_test: Updated timeout check according to latest changes.
Sebastian Harl [Fri, 25 Oct 2013 15:30:12 +0000 (17:30 +0200)]
channel_test: Updated timeout check according to latest changes.

I.e. check errno rather than the return value.

11 years agoutils llist: Added sdb_llist_iter_remove_current().
Sebastian Harl [Fri, 25 Oct 2013 15:23:32 +0000 (17:23 +0200)]
utils llist: Added sdb_llist_iter_remove_current().

This function may be used to remove the current (the one returned by the last
sdb_llist_iter_get_next() call) iterator value from the list.

Note, that this function is not safe if another iterator is used in parallel
at the same time.

11 years agoMade log prefixes slightly more generic.
Sebastian Harl [Tue, 22 Oct 2013 16:53:34 +0000 (18:53 +0200)]
Made log prefixes slightly more generic.

Changed "plugin" to "core" and "sock" to "frontend". Those names better
identify the context in which the error happened.

11 years agodaemon: Terminate backend thread after frontends have stopped.
Sebastian Harl [Tue, 22 Oct 2013 07:10:38 +0000 (09:10 +0200)]
daemon: Terminate backend thread after frontends have stopped.

11 years agodaemon: Exit if adding a listener fails.
Sebastian Harl [Tue, 22 Oct 2013 07:08:37 +0000 (09:08 +0200)]
daemon: Exit if adding a listener fails.

11 years agosocket frontend: Improved error reporting.
Sebastian Harl [Tue, 22 Oct 2013 07:00:55 +0000 (09:00 +0200)]
socket frontend: Improved error reporting.

11 years agodaemon: Added "Listen" config option.
Sebastian Harl [Tue, 22 Oct 2013 06:54:20 +0000 (08:54 +0200)]
daemon: Added "Listen" config option.

The main thread listens on all configured addresses and serves requests
through the frontend socket module. The backend collector loop now runs in its
own background thread.

11 years agofrontend: Use channel shutdown to synchronize handler thread shutdown.
Sebastian Harl [Mon, 21 Oct 2013 07:15:24 +0000 (09:15 +0200)]
frontend: Use channel shutdown to synchronize handler thread shutdown.

This allows the handler to fully control the shutdown procedure.
pthread_cancel did not play well with pthread_cond_*wait in multiple threads
and the respective locked mutex.

11 years agoutils channel: Added sdb_channel_shutdown().
Sebastian Harl [Mon, 21 Oct 2013 07:10:08 +0000 (09:10 +0200)]
utils channel: Added sdb_channel_shutdown().

This function initiates a shutdown of the channel, forbidding any subsequent
writes. However, readers are still able to empty the buffer. Then, EBADF will
be returned through errno. This allows for graceful shutdowns.

11 years agoutils channel: Normalize time before passing it to phtread_cond_timedwait.
Sebastian Harl [Mon, 21 Oct 2013 06:59:03 +0000 (08:59 +0200)]
utils channel: Normalize time before passing it to phtread_cond_timedwait.

11 years agoutils channel: Unlock mutex before returning on error.
Sebastian Harl [Sun, 20 Oct 2013 20:20:36 +0000 (22:20 +0200)]
utils channel: Unlock mutex before returning on error.

11 years agoutils channel: Update timeout in channel_select when needed.
Sebastian Harl [Sun, 20 Oct 2013 19:56:44 +0000 (21:56 +0200)]
utils channel: Update timeout in channel_select when needed.

11 years agoutils channel: Let channel_select() set errno.
Sebastian Harl [Sun, 20 Oct 2013 19:38:23 +0000 (21:38 +0200)]
utils channel: Let channel_select() set errno.

11 years agoutils channel: Changed abstime argument to a timeout.
Sebastian Harl [Sun, 20 Oct 2013 19:30:55 +0000 (21:30 +0200)]
utils channel: Changed abstime argument to a timeout.

11 years agofrontend/sock: Added loop control to the socket handler.
Sebastian Harl [Sun, 20 Oct 2013 14:54:12 +0000 (16:54 +0200)]
frontend/sock: Added loop control to the socket handler.

11 years agoAdded framework for frontend connection handling.
Sebastian Harl [Sun, 20 Oct 2013 14:30:45 +0000 (16:30 +0200)]
Added framework for frontend connection handling.

frontend/sock supports UNIX domain sockets for now. It doesn't do much expect
for managing listening sockets and accepting connections on them which are
then handled in the background. So far, each connection is closed right away.

11 years agot/utils/channel_test: Added a test-case for sdb_channel_select().
Sebastian Harl [Sun, 20 Oct 2013 13:37:03 +0000 (15:37 +0200)]
t/utils/channel_test: Added a test-case for sdb_channel_select().

11 years agoutils channel: Added sdb_channel_select().
Sebastian Harl [Sun, 20 Oct 2013 13:35:35 +0000 (15:35 +0200)]
utils channel: Added sdb_channel_select().

This function behaves similar to select(2) providing to passively block on a
channel operation until it becomes ready for reading and / or writing.
Optionally, a deadline may be specified.

11 years agoutils/channel: Use a mutex instead of a rwlock.
Sebastian Harl [Sat, 19 Oct 2013 09:58:11 +0000 (11:58 +0200)]
utils/channel: Use a mutex instead of a rwlock.

All access to the channel needs to be fully synchronized.

11 years agot/utils/channel_test: Added some more write/read tests.
Sebastian Harl [Sat, 19 Oct 2013 09:55:07 +0000 (11:55 +0200)]
t/utils/channel_test: Added some more write/read tests.

11 years agot/: Added tests for the channel implementation.
Sebastian Harl [Sat, 19 Oct 2013 08:52:48 +0000 (10:52 +0200)]
t/: Added tests for the channel implementation.

11 years agoutils/channel: Added an asynchronous I/O multiplexer.
Sebastian Harl [Sat, 19 Oct 2013 08:50:11 +0000 (10:50 +0200)]
utils/channel: Added an asynchronous I/O multiplexer.

A channel is a buffered pipe supporting multiple parallel readers and writers.

11 years agoconfigure: Don't fail if CHECK is not available.
Sebastian Harl [Tue, 15 Oct 2013 07:05:23 +0000 (09:05 +0200)]
configure: Don't fail if CHECK is not available.

11 years agostrbuf.h: Include unistd.h.
Sebastian Harl [Mon, 14 Oct 2013 21:15:54 +0000 (23:15 +0200)]
strbuf.h: Include unistd.h.

Required for ssize_t on GCC 4.4.

11 years agostore: Make sure not to store duplicate host entries.
Sebastian Harl [Wed, 2 Oct 2013 19:54:35 +0000 (21:54 +0200)]
store: Make sure not to store duplicate host entries.

11 years agodaemon: Treat parser errors different from daemon/libsysdb errors.
Sebastian Harl [Wed, 2 Oct 2013 19:39:13 +0000 (21:39 +0200)]
daemon: Treat parser errors different from daemon/libsysdb errors.

11 years agoplugin: Unregister all callbacks if module/plugin init failed.
Sebastian Harl [Wed, 2 Oct 2013 09:07:03 +0000 (11:07 +0200)]
plugin: Unregister all callbacks if module/plugin init failed.

11 years agoutils llist: Fixed a segfault in functions doing lookups.
Sebastian Harl [Wed, 2 Oct 2013 09:06:08 +0000 (11:06 +0200)]
utils llist: Fixed a segfault in functions doing lookups.

11 years agoutils llist: Made lookup's user-data a constant pointer.
Sebastian Harl [Wed, 2 Oct 2013 09:04:42 +0000 (11:04 +0200)]
utils llist: Made lookup's user-data a constant pointer.

11 years agoutils llist: Added sdb_llist_remove().
Sebastian Harl [Mon, 30 Sep 2013 16:24:33 +0000 (18:24 +0200)]
utils llist: Added sdb_llist_remove().

11 years agoutils llist: Updated documentation.
Sebastian Harl [Mon, 30 Sep 2013 16:19:36 +0000 (18:19 +0200)]
utils llist: Updated documentation.

11 years agoutils llist: Added lookup callback type to be used for llist_search.
Sebastian Harl [Mon, 30 Sep 2013 16:16:26 +0000 (18:16 +0200)]
utils llist: Added lookup callback type to be used for llist_search.

Lookups should be more flexible than comparing two objects.

11 years agoutils llist: Added sdb_llist_cmp_cb type.
Sebastian Harl [Wed, 25 Sep 2013 20:11:20 +0000 (22:11 +0200)]
utils llist: Added sdb_llist_cmp_cb type.

This is to make sure that comparators always use the same signature.

11 years agoplugin: Removed sdb_ prefix from private functions.
Sebastian Harl [Wed, 25 Sep 2013 19:49:42 +0000 (21:49 +0200)]
plugin: Removed sdb_ prefix from private functions.

11 years agoplugin: Store real plugin name and filename in the context.
Sebastian Harl [Wed, 25 Sep 2013 19:43:32 +0000 (21:43 +0200)]
plugin: Store real plugin name and filename in the context.

11 years agoplugin: Store plugin info attributes in the plugin context.
Sebastian Harl [Wed, 25 Sep 2013 09:02:01 +0000 (11:02 +0200)]
plugin: Store plugin info attributes in the plugin context.

11 years agoplugin: Manage all context information in the core.
Sebastian Harl [Wed, 25 Sep 2013 08:53:06 +0000 (10:53 +0200)]
plugin: Manage all context information in the core.

Store the new dynamic context in callbacks. The daemon may no longer set the
context before loading a plugin. Instead, sdb_plugin_load now accepts a second
parameter specifying the public context attributes.

11 years agoplugin: Made plugin context a dynamic object.
Sebastian Harl [Wed, 18 Sep 2013 08:40:36 +0000 (10:40 +0200)]
plugin: Made plugin context a dynamic object.

A custom type is used for that. The previous context type is used as a public
member of the new internal type. Thus, the external interface does not change.

11 years agoplugin: Dynamically allocate plugin info attributes.
Sebastian Harl [Wed, 18 Sep 2013 08:26:05 +0000 (10:26 +0200)]
plugin: Dynamically allocate plugin info attributes.

This will allow to keep the information around forever.

11 years agounit tests: Added basic tests for unixsock utils; mocking libc I/O functions.
Sebastian Harl [Mon, 16 Sep 2013 07:07:20 +0000 (09:07 +0200)]
unit tests: Added basic tests for unixsock utils; mocking libc I/O functions.

GNU libc's fopencookie is used to mock fdopen() and socket handling. This
allows to mock a UNIX socket.

11 years agoutils unixsock: Explicitely enable line-buffering.
Sebastian Harl [Mon, 16 Sep 2013 07:01:59 +0000 (09:01 +0200)]
utils unixsock: Explicitely enable line-buffering.

The module is based on that, so say it explicitely.

11 years agot/utils/strbuf_test: Added lists of golden data for various checks.
Sebastian Harl [Mon, 9 Sep 2013 17:22:07 +0000 (19:22 +0200)]
t/utils/strbuf_test: Added lists of golden data for various checks.

This makes it much easier to add more checks for particular functions.

11 years agosysdb.h.in: Reintroduced SDB_STATIC_ARRAY_LEN().
Sebastian Harl [Fri, 6 Sep 2013 06:53:38 +0000 (08:53 +0200)]
sysdb.h.in: Reintroduced SDB_STATIC_ARRAY_LEN().

Previously only added to the auto-generated sysdb.h :-/ D'oh!

11 years agot/: Added unit tests for the string buffer utilities.
Sebastian Harl [Fri, 6 Sep 2013 06:41:16 +0000 (08:41 +0200)]
t/: Added unit tests for the string buffer utilities.

11 years agoutils strbuf: Fixed a wrong assertion.
Sebastian Harl [Thu, 5 Sep 2013 16:27:10 +0000 (18:27 +0200)]
utils strbuf: Fixed a wrong assertion.

11 years agoutils strbuf: Allow the initial size to be zero.
Sebastian Harl [Wed, 4 Sep 2013 20:41:03 +0000 (22:41 +0200)]
utils strbuf: Allow the initial size to be zero.

11 years agot/utils/: Name test-cases after the tested function.
Sebastian Harl [Wed, 4 Sep 2013 08:59:49 +0000 (10:59 +0200)]
t/utils/: Name test-cases after the tested function.

This might make it possible to do coverage tests.

11 years agot/utils/dbi_test: Added test queries covering 2-5 columns.
Sebastian Harl [Wed, 4 Sep 2013 08:52:09 +0000 (10:52 +0200)]
t/utils/dbi_test: Added test queries covering 2-5 columns.

11 years agot/utils/dbi_test: Fixed further indexing.
Sebastian Harl [Wed, 4 Sep 2013 08:48:29 +0000 (10:48 +0200)]
t/utils/dbi_test: Fixed further indexing.

11 years agot/utils/dbi_test: Fixed indexing into the golden_data array.
Sebastian Harl [Tue, 3 Sep 2013 18:05:52 +0000 (20:05 +0200)]
t/utils/dbi_test: Fixed indexing into the golden_data array.

11 years agot/utils/dbi_test: Added missing cases in dbi_result_get_field_length_idx().
Sebastian Harl [Tue, 3 Sep 2013 09:05:38 +0000 (11:05 +0200)]
t/utils/dbi_test: Added missing cases in dbi_result_get_field_length_idx().

11 years agot/utils/dbi_test: Verify the received data.
Sebastian Harl [Tue, 3 Sep 2013 09:03:32 +0000 (11:03 +0200)]
t/utils/dbi_test: Verify the received data.

11 years agot/utils/dbi_test: Added mock queries covering various corner cases.
Sebastian Harl [Mon, 2 Sep 2013 16:28:22 +0000 (18:28 +0200)]
t/utils/dbi_test: Added mock queries covering various corner cases.

11 years agot/utils/dbi_test: Mock some actual query results; added simple query.
Sebastian Harl [Mon, 2 Sep 2013 16:24:02 +0000 (18:24 +0200)]
t/utils/dbi_test: Mock some actual query results; added simple query.

The unit-test now supports mocking arbitrary query results. For that,
appropriate mocks for the dbi_result_get*() functions have been added.

The test now executes a simple query returning one column of data.

11 years agot/libsysdb_test: Use a list of test-suite creators.
Sebastian Harl [Wed, 28 Aug 2013 19:16:47 +0000 (21:16 +0200)]
t/libsysdb_test: Use a list of test-suite creators.

… rather than adding a new block for each new test-suite.

11 years agot/utils/dbi_test: Added a simple test-case for query execution.
Sebastian Harl [Wed, 28 Aug 2013 19:09:35 +0000 (21:09 +0200)]
t/utils/dbi_test: Added a simple test-case for query execution.

Added simple mocks for query and result handling.

11 years agot/: Added initial version of unit tests for utils/dbi.
Sebastian Harl [Tue, 27 Aug 2013 16:08:32 +0000 (18:08 +0200)]
t/: Added initial version of unit tests for utils/dbi.

The test cases mocks out any (expected) calls to libdbi.