Skip to content

Commit

Permalink
Tests: sss_cache prints spurious error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aborah-sudo authored and pbrezina committed Oct 1, 2021
1 parent f092548 commit b22f619
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion src/tests/multihost/alltests/test_sssctl_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pytest
from sssd.testlib.common.utils import sssdTools
from sssd.testlib.common.paths import SSSD_DEFAULT_CONF
from sssd.testlib.common.exceptions import SSSDException


def client_version(multihost):
Expand All @@ -23,7 +24,9 @@ class Testsssctl(object):
This is test case class for sssctl suite
"""
@pytest.mark.tier1_2
def test_0001_bz1640576(self, multihost, localusers):
def test_0001_bz1640576(self, multihost,
backupsssdconf,
localusers):
"""
:title: IDM-SSSD-TC: sssctl: sssctl reports incorrect
information about local user's cache entry expiration time
Expand Down Expand Up @@ -80,3 +83,49 @@ def test_0002_bz1599207(self, multihost,
raiseonerr=False)
assert 'Cache entry creation date' in \
cmd.stdout_text and cmd.returncode == 0

@pytest.mark.tier1_2
def test_0003_bz1661182(self, multihost,
backupsssdconf):
"""
:title: sss_cache prints spurious error messages
when invoked from shadow-utils on package install
:id: 8f2868d2-1ece-11ec-ac6d-845cf3eff344
:bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1661182
:steps:
1. Configure sssd without any domain
2. Restart sssd (sssd should not be
running after this)
3. Modify existing local user usermod -a -G wheel user1
4. This message
[sss_cache] [confdb_get_domains] (0x0010):
No domains configured, fatal error!
must not appear in console
:expectedresults:
1. Should succeed
2. Should succeed
3. Should succeed
4. Should succeed
"""
tools = sssdTools(multihost.client[0])
ldap_params = {'enable_files_domain': 'false'}
tools.sssd_conf('sssd', ldap_params)
with pytest.raises(SSSDException):
multihost.client[0].service_sssd('restart')
ps_cmd = "> /var/log/sssd/sssd.log"
multihost.client[0].run_command(ps_cmd)
ps_cmd = "useradd user1_test"
multihost.client[0].run_command(ps_cmd)
ps_cmd = "usermod -a -G wheel user1_test"
cmd = multihost.client[0].run_command(ps_cmd)
assert 'No domains configured, fatal error!' \
not in cmd.stdout_text
ps_cmd = "userdel user1_test"
multihost.client[0].run_command(ps_cmd)
for ps_cmd in ('sss_cache -U',
'sss_cache -G',
'sss_cache -E',
'sss_cache -u non-existinguser'):
cmd = multihost.client[0].run_command(ps_cmd)
assert 'No domains configured, fatal error!' \
not in cmd.stdout_text

0 comments on commit b22f619

Please sign in to comment.