URL: https://github.com/SSSD/sssd/pull/5719 Author: aborah-sudo Title: #5719: Tests: fix sss_cache to also reset cached timestamp Action: opened
PR body: """ Issue: https://github.com/SSSD/sssd/issues/5596 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1902280 """ To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/5719/head:pr5719 git checkout pr5719
From 03c1ba4d638f91969d97d385525f230b4ff1f56d Mon Sep 17 00:00:00 2001 From: Anuj Borah <abo...@redhat.com> Date: Mon, 19 Jul 2021 19:49:15 +0530 Subject: [PATCH] Tests: fix sss_cache to also reset cached timestamp Issue: https://github.com/SSSD/sssd/issues/5596 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1902280 --- src/tests/multihost/alltests/test_krb5.py | 52 ++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/src/tests/multihost/alltests/test_krb5.py b/src/tests/multihost/alltests/test_krb5.py index e94b7be763..943bfeaf31 100644 --- a/src/tests/multihost/alltests/test_krb5.py +++ b/src/tests/multihost/alltests/test_krb5.py @@ -5,7 +5,8 @@ """ from __future__ import print_function import pytest -from sssd.testlib.common.utils import sssdTools +import ldap +from sssd.testlib.common.utils import sssdTools, LdapOperations from sssd.testlib.common.expect import pexpect_ssh from sssd.testlib.common.exceptions import SSHLoginException @@ -13,6 +14,9 @@ @pytest.mark.usefixtures('setup_sssd_krb', 'create_posix_usersgroups') @pytest.mark.krb5 class TestKrbWithLogin(object): + """ + Tests krb5 related bugs + """ @pytest.mark.tier1 def test_0001_krb5_not_working_based_on_k5login(self, multihost, @@ -130,3 +134,49 @@ def test_0002_generating_lot_of(self, multihost, backupsssdconf): 'name=foo1@example1,cn=users,cn=example1,cn=sysdb') assert "dn: name=foo1@example1,cn=users,cn=example1,cn=sysdb" \ in cmd_search2.stdout_text + + @pytest.mark.tier1 + def test_0001_krb5_not_working_based_on_k5login(self, + multihost, + backupsssdconf): + """ + :title: krb5: fix sss_cache to also reset cached timestamp + :bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1902280 + :id: c310f1b4-e89b-11eb-84ce-845cf3eff344 + :steps: + 1. Make a change to group entry in LDAP + 2. Run 'ssh_cache -E' on clients + 3. Check with 'getent group' on clients to see if correct\ + :expectedresults: + 1. Should succeed + 2. Should succeed + 3. Should succeed + """ + tools = sssdTools(multihost.client[0]) + domain_name = tools.get_domain_section_name() + client = sssdTools(multihost.client[0]) + domain_params = {'ldap_schema': 'rfc2307bis', + 'ldap_group_member': 'uniquemember', + 'debug_level': '9'} + client.sssd_conf(f'domain/{domain_name}', domain_params) + multihost.client[0].service_sssd('restart') + breakpoint() + get_ent = multihost.client[0].run_command("getent group " + "ldapusers@example1") + assert "foo9@example1" in get_ent.stdout_text + user_dn = 'uid=foo9,ou=People,dc=example,dc=test' + group_dn = 'cn=ldapusers,ou=Groups,dc=example,dc=test' + ldap_uri = 'ldap://%s' % (multihost.master[0].sys_hostname) + ds_rootdn = 'cn=Directory Manager' + ds_rootpw = 'Secret123' + ldap_inst = LdapOperations(ldap_uri, ds_rootdn, ds_rootpw) + del_member = [(ldap.MOD_DELETE, 'uniqueMember', + user_dn.encode('utf-8'))] + (ret, _) = ldap_inst.modify_ldap(group_dn, del_member) + assert ret == 'Success' + multihost.client[0].run_command("sss_cache -G") + multihost.client[0].run_command("sss_cache -E") + get_ent1 = multihost.client[0].run_command("getent group " + "ldapusers@example1") + assert "foo9@example1" not in get_ent1.stdout_text + assert get_ent.stdout_text != get_ent1.stdout_text
_______________________________________________ sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure