Fix ldapupdate.get_sub_dict() for missing named user

The named user may not be present when ipa-server-dns and bind are not
installed. NAMED_UID and NAMED_GID constants are only used with local
DNS support.

Fixes: https://pagure.io/freeipa/issue/8936
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Co-authored-by: François Cami <fcami@redhat.com>
Reviewed-By: Francois Cami <fcami@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Francois Cami <fcami@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Christian HeimesandFrançois Cami authored and Rob Crittenden committed 2021-08-02 09:53:36 -04:00
1 parent a4e13a3324
commit a1eb13cdbc
4 files changed
+62 -3

No files matched your search

@@ -547,6 +547,18 @@ jobs:
timeout: 4800
topology: *master_1repl_1client
fedora-latest-ipa-4-9/test_installation_TestInstallWithoutNamed:
requires: [fedora-latest-ipa-4-9/build]
priority: 50
job:
class: RunPytest
args:
build_url: '{fedora-latest-ipa-4-9/build_url}'
test_suite: test_integration/test_installation.py::TestInstallWithoutNamed
template: *ci-ipa-4-9-latest
timeout: 4800
topology: *master_1repl
fedora-latest-ipa-4-9/test_idviews:
requires: [fedora-latest-ipa-4-9/build]
priority: 50
@@ -547,6 +547,18 @@ jobs:
timeout: 4800
topology: *master_1repl_1client
fedora-previous-ipa-4-9/test_installation_TestInstallWithoutNamed:
requires: [fedora-previous-ipa-4-9/build]
priority: 50
job:
class: RunPytest
args:
build_url: '{fedora-previous-ipa-4-9/build_url}'
test_suite: test_integration/test_installation.py::TestInstallWithoutNamed
template: *ci-ipa-4-9-previous
timeout: 4800
topology: *master_1repl
fedora-previous-ipa-4-9/test_idviews:
requires: [fedora-previous-ipa-4-9/build]
priority: 50
@@ -1853,3 +1853,30 @@ class TestInstallWithoutSudo(IntegrationTest):
result = tasks.install_client(self.master, self.clients[0])
assert self.no_sudo_str not in result.stderr_text
assert self.sudo_version_str not in result.stdout_text
class TestInstallWithoutNamed(IntegrationTest):
num_replicas = 1
@classmethod
def remove_named(cls, host):
# remove the bind package and make sure the named user does not exist.
# https://pagure.io/freeipa/issue/8936
result = host.run_command(['id', 'named'], raiseonerr=False)
if result.returncode == 0:
tasks.uninstall_packages(host, ['bind'])
host.run_command(['userdel', constants.NAMED_USER])
assert host.run_command(
['id', 'named'], raiseonerr=False
).returncode == 1
@classmethod
def install(cls, mh):
for tgt in (cls.master, cls.replicas[0]):
cls.remove_named(tgt)
tasks.install_master(cls.master, setup_dns=False)
def test_replica0_install(self):
tasks.install_replica(
self.master, self.replicas[0], setup_ca=False, setup_dns=False
)