Static library libsss_test_common calls tevent functions directly (in module
common_tev.c), but it was not linked with tevent library.
Compilation will fail if sssd is linked with "-Wl,--as-needed"
/usr/bin/ld: ./.libs/libsss_test_common.a(common_tev.o): undefined reference to symbol 'tevent_context_init@(a)TEVENT_0.9.9'
/usr/bin/ld: note: 'tevent_context_init@(a)TEVENT_0.9.9' is defined in DSO /usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../lib64/libtevent.so so try adding it to the linker command line
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../lib64/libtevent.so: could not read symbols: Invalid operation
clang: error: linker command failed with exit code 1 (use -v to see invocation)
nm ./libsss_test_common.a | grep tevent
Simple patch is attached.
I have attached the test patch for negcache.c module along with the mail.
I could not write test for the last function sss_ncache_prepopulate(). I
have doubt regarding the initialization of the arguments to be passed to
sss_ncache_prepopulate(). Please review the patch.
As was discussed yesterday, I'm working on the sssd dbus infrastructure,
so we can have rich access to sssd information via Dbus. Jakub has been
working on implementing methods that expose that.
These are infrastructure patches, that take the basic DBus support that
sssd has (ie: sbus) and start to mature it so that we can handle things
like properties, NNN-instances of objects, automatic introspection,
object manager, automatic unpacking of args for handlers, and so on.
As I mentioned earlier, some of these concepts may seem foreign, for
example using DBus interface definitions to drive things.
However this has many benefits as we get into implementing more dbus stuff:
* Removes boiler-plate all over the place.
* Lets the compiler check dbus interface implementations and usage.
* Makes it possible to do complex stuff (PropertiesChanged or
ObjectManager) that would otherwise be insane.
I have tried to balance things and not go crazy with changing style all
over the place and keep to the sssd way of doing things most of the time.
Yes, this does involve a codegen, much like flex or bison. It has real
concrete benefits. While it is possible to handcraft the necessary meta
data structs (see patch 0001), you lose compile-time checking and some
The codegen generates as little code as possible, and we have tests to
verify that it is correct (thanks Sumit for that idea).
It's important to note that an interface, and an implemented instance of
that interface are two different things.
There's a lot more to do. Next up will be implementing automatic
introspection generation, and property access.
If you prefer to access this as a branch, see:
I had libref_array1-0.1.1 and libini_config2-0.6.1 (which were built
from ding-libs-0.1.3) installed in the system. Few days ago I built the
new ding-libs-0.3.0.1 source which, among others, yielded a binary
After installation of libini_config3, ldd -r
undefined symbol: ref_array_copy (/usr/lib64/libini_config.so.3)
which is a sign that libini_config3 needs a newer libref_array1,
but the package manager did not catch it because the release
following commit 8c201905d5f0720b62d036eb2308f81f4530cfad
failed to do one of:
(1) changing the SONAME of ref_array, or
(2) using symbol versions
to indicate the new backwards-incompatibility. People, -version-info
1:0:0 => -version-info 2:0:1 is not enough! You must either
(1) -version-info 2:0:0, or
Attached patches fix warnings with compiler flag Wmissing-prototypes.
In my opinion, it is better declare function with static modifier if function
is not part of public API.
patch 0002-Use-static-modifier-for-unit-test-functions.patch helps me find out
that negative_test was not execupted as part of INI unit tests.
It is better to have declaration in private header file, beacuse it prevents
copy&paste errors. Declaration in file ini/ini_valueobj_ut.c was wrong.
The last patch enables extra compiler warnings including Wmissing-prototypes.
While I was working on symbol maps for ding_libs, I found out two declarations
of function were misspelled in the public header file. It looks like nobody
used this function, because symbols in library are correct
[root@unused-4-233 ~]# objdump -T /usr/lib64/libcollection.so | grep col_insert_unsi
0000000000006d50 g DF .text 000000000000003b Base col_insert_unsigned_property_with_ref
0000000000006af0 g DF .text 000000000000003a Base col_insert_unsigned_property
Problem is fixed with simple replacement s/ng/gn/
I can see a problem. I am not sure if we should bump SONAME,
because ABI of library is not changed, but API is technically
changed in imcompatible way (two functions were removed and two functions were
added). It looks like nobody used this functions, because it is impossible to
link program with wrong declaration.
this is the first unit test for nested groups. It covers only the most
basic situation when we are trying to resolve one group with no members.
Even though it is only one test, the patch set is quite big. This is
because it creates the possibility to mock providers related modules.
Most of the patches are just a preparation for unit testing providers.
Moves the code around to reduce number of dependencies. (E.g. you do not
want to load fail over when you are testing nested groups.)
Mocks basic SDAP interface.
Mocks sysdb objects - currently user and rfc2307bis group. You can
decide what set of attributes the object should posses. For example,
creating a user requires only basedn and name parameter, to construct
originalDN and name attributes. The rest is provided by (attrname,
value) pairs via variadic function.
mock_sysdb_user(mem_ctx, basedn, name, SYSDB_UIDNUM, uid, ...)
get_attr_type() translates the sysdb attribute name to proper data type.
This should be extended as needed.
Adds provider tests related common object files and cflags in makefile
New macro sss_will_return_always(fn, value). This can be used to mock
function data in such way that any call of mock() will return the value.
It was just pushed also to cmocka upstream as will_return_always().
Removes a noisy debug message.
I would like to get this reviewed before I continue with more test
cases, so the framework is tuned enough.
I also created new macro called fail_msg, which will make the test fail
printing a message. I didn't use this macro in the end, but it made its
way to cmocka upstream.
Function ini_config_serialize was declared in the header file ini_configobj.h,
but this header file was not included in implementation module ini_serialize.c
Functions print_config_parsing_errors, print_file_parsing_errors were declared
in the header file ini_config.h, but this header file was not included
in implementation module ini_print.c
Simple patch is attached.
Here is the 4th and I hope the last version of my DEBUG macro refactoring
Changes from the last version:
* Rebase on fresh master (761777f).
* Fix invocations of the updated "debug_fn" function to not assume it
filters by debug level (found by Jakub).
* Add patch to update debug levels in "sss_semanage_error_callback".
* Add patch to update debug level in a "backup_file" invocation.
* Add patch to reflow the new "debug_fn" to make it match coding
conventions better, as per Jakub's request (although I didn't make a
separate function as it doesn't seem to be necessary).
* Re-run both mass update scripts, instead of cherry-picking.
* Remove mentions of old/new debug levels in the patch removing the
conversion function (the last one).
I built and tested the final results with "chmake", but did no other tests.