Title: #547: Tests for #511
We've decided to split the fix/tests in two different PRs.
To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/547/head:pr547
git checkout pr547