Title: #464: SYSDB: Properly handle name/gid override when using domain resolution order
On (08/12/17 16:53), fidencio wrote:
Sure thing. I'd appreciate some guidance on how to write a valid
test for this case, considering it involves an AD-IPA trust setup.
Unit test cover execution of function and therefore does not require any
"AD-IPA trust setup". Unit test != integration test.
You pass some arguments to function and expect some result.
+fail if expected result is different.
Unit testing sometimes requires preparing mock object. It is a simulated
objects that mimic the behavior of real objects in controlled ways
It is a huge benefit because sometimes it is complicated to reproduce some
state with integration tests.
There is lot of resources on net about unit testing[2,3,4]
And we have quite hight code coverage in sysdb (73.8 % of functions)
BTW the function `sysdb_getgrgid` is already used in more than one unit test
test_nested_groups.c, test_sysdb_ts_cache, sysdb-tests.c.
See the full comment at https://github.com/SSSD/sssd/pull/464#issuecomment-350441705