mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-26 08:51:50 -06:00
3a42bc0960
Unit tests for ipa-extdom-extop plugin use nss_files.so.2 module to test the functionality instead of relying on SSSD API or nss_sss.so.2 module. The latter two cannot be used in build environment. nss_files.so.2 always tries to open /etc/passwd and /etc/group. In past, we overloaded 'fopen()' to change the path to opened file but this stops working after glibc consolidate file opening in nss_files with the code starting at https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=299210c1fa67e2dfb564475986fce11cd33db9ad, this method is not usable anymore and builds against glibc 2.31.9000+ fail in cmocka unit test execution in Rawhide. Apply an alternative approach that uses a new user namespace to unshare the test from its parent and chroot to the test data where expected /etc/passwd and /etc/group are provided. This method works only on Linux, thus only run the unit test on Linux. In case unshare() or chroot() fail, we have to skip tests that use nss_files.so.2. Fixes: https://pagure.io/freeipa/issue/8437 Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com> |
||
---|---|---|
.. | ||
test_data/etc | ||
back_extdom_nss_sss.c | ||
back_extdom_sss_idmap.c | ||
back_extdom.h | ||
ipa_extdom_cmocka_tests.c | ||
ipa_extdom_common.c | ||
ipa_extdom_extop.c | ||
ipa_extdom.h | ||
ipa-extdom-extop-conf.ldif | ||
Makefile.am | ||
README |