Skip to content

Commit

Permalink
hosts: Add IPA IPA trust feature detection
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-stephenson committed Feb 25, 2025
1 parent 1f8bf38 commit 935556e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sssd_test_framework/hosts/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def features(self) -> dict[str, bool]:
[ -f "/usr/bin/sss_ssh_knownhosts" ] && echo "knownhosts" || :
systemctl cat sssd.service | grep -q "If service configured to be run under" && echo "non-privileged" || :
strings /usr/lib64/sssd/libsss_ldap_common.so | grep ldap_use_ppolicy && echo "ldap_use_ppolicy" || :
strings /usr/lib64/sssd/libsss_ipa.so | grep -q ipa_ctx_new && echo "ipa-ipa-trust" || :
# enumerate (bool) Feature is only supported for domains with id_provider = ldap or id_provider = proxy.
MANWIDTH=10000 man sssd.conf | grep -q "id_provider = ldap or id_provider = proxy" && \
echo "limited_enumeration" || :
Expand All @@ -69,6 +70,7 @@ def features(self) -> dict[str, bool]:
"ldap_use_ppolicy": False,
"knownhosts": False,
"limited_enumeration": False,
"ipa-ipa-trust": False,
}

self._features.update({k: True for k in result.stdout_lines})
Expand Down
3 changes: 3 additions & 0 deletions sssd_test_framework/hosts/ipa.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,16 @@ def features(self) -> dict[str, bool]:
[ -f "/usr/libexec/sssd/passkey_child" ] && \
ipa help user | grep user-add-passkey 1> /dev/null && \
echo "passkey" || :
ipa trust-add --help | grep 'Trust type' | grep 'ipa' 1> /dev/null && \
echo "ipa-ipa-trust" || :
""",
log_level=ProcessLogLevel.Error,
)

# Set default values
self._features = {
"passkey": False,
"ipa-ipa-trust": False,
}

self._features.update({k: True for k in result.stdout_lines})
Expand Down

0 comments on commit 935556e

Please sign in to comment.