mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-26 17:01:14 -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> |
||
---|---|---|
.. | ||
group | ||
passwd |