ipatests: Test to check that ResponseNotReady error is not displayed when user session cache is deleted

Pagure: https://pagure.io/freeipa/issue/7752

Signed-off-by: Sudhir Menon <sumenon@redhat.com>
Reviewed-By: Mohammad Rizwan <myusuf@redhat.com>
Reviewed-By: Anuja More <amore@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
Sudhir Menon 2021-03-16 14:22:38 +05:30 committed by Florence Blanc-Renaud
parent c14d52f436
commit 0c2530efe5

View File

@ -1489,3 +1489,36 @@ class TestIPACommand(IntegrationTest):
self.master.run_command(['date', '-s', '-15Years']) self.master.run_command(['date', '-s', '-15Years'])
assert isrgrootx1_nick in result assert isrgrootx1_nick in result
class TestIPACommandWithoutReplica(IntegrationTest):
"""
Execute tests with scenarios having only single
IPA server and no replica
"""
@classmethod
def install(cls, mh):
tasks.install_master(cls.master, setup_dns=True)
def test_client_doesnot_throw_responsenotready_error(self):
"""
This testcase checks that ipa command
doesn't throw http.client.ResponseNotReady error
when current users session is deleted from the cache
"""
user = 'ipauser1'
orig_pwd = 'Password123'
tasks.kinit_admin(self.master)
tasks.user_add(self.master, user, password=orig_pwd)
# kinit as admin on ipa-server and run ipa command
tasks.kinit_admin(self.master, raiseonerr=False)
self.master.run_command(['ipa', 'user-show', "ipauser1"])
# Delete the current user session cache on IPA server
self.master.run_command(
"rm -fv /run/ipa/ccaches/admin@{}-*".format(
self.master.domain.realm
)
)
# Run the command again after cache is removed
self.master.run_command(['ipa', 'user-show', 'ipauser1'])