mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-25 06:38:02 -05:00
ipatests: test ipa-getkeytab server option
Test various usages of the -s/--server option: * -s is defined, use it as the server * no -s, use the host value from /etc/ipa/default.conf * -s is '_srv_', do DNS discovery https://pagure.io/freeipa/issue/8478 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
1 parent
0114d24ea1
commit
7a13200fd8
1 file changed
+58
@@ -1467,6 +1467,64 @@ class TestIPACommand(IntegrationTest):
|
||||
assert 'This account is currently not available' in \
|
||||
result.stdout_text
|
||||
|
||||
def test_ipa_getkeytab_server(self):
|
||||
"""
|
||||
Exercise the ipa-getkeytab server options
|
||||
|
||||
This relies on the behavior that without a TGT
|
||||
ipa-getkeytab will quit and not do much of anything.
|
||||
|
||||
A bogus keytab and principal are passed in to satisfy the
|
||||
minimum requirements.
|
||||
"""
|
||||
tasks.kdestroy_all(self.master)
|
||||
|
||||
# Pass in a server name to use
|
||||
result = self.master.run_command(
|
||||
[
|
||||
paths.IPA_GETKEYTAB,
|
||||
"-k",
|
||||
"/tmp/keytab",
|
||||
"-p",
|
||||
"foo",
|
||||
"-s",
|
||||
self.master.hostname,
|
||||
"-v",
|
||||
], raiseonerr=False).stderr_text
|
||||
|
||||
assert 'Using provided server %s' % self.master.hostname in result
|
||||
|
||||
# Don't pass in a name, should use /etc/ipa/default.conf
|
||||
result = self.master.run_command(
|
||||
[
|
||||
paths.IPA_GETKEYTAB,
|
||||
"-k",
|
||||
"/tmp/keytab",
|
||||
"-p",
|
||||
"foo",
|
||||
"-v",
|
||||
], raiseonerr=False).stderr_text
|
||||
|
||||
assert (
|
||||
'Using server from config %s' % self.master.hostname
|
||||
in result
|
||||
)
|
||||
|
||||
# Use DNS SRV lookup
|
||||
result = self.master.run_command(
|
||||
[
|
||||
paths.IPA_GETKEYTAB,
|
||||
"-k",
|
||||
"/tmp/keytab",
|
||||
"-p",
|
||||
"foo",
|
||||
"-s",
|
||||
"_srv_",
|
||||
"-v",
|
||||
], raiseonerr=False).stderr_text
|
||||
|
||||
assert 'Discovered server %s' % self.master.hostname in result
|
||||
|
||||
|
||||
class TestIPACommandWithoutReplica(IntegrationTest):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user