ipatests: Verify that hbactest will return messages

Limit the sizelimit of the hbactest request to confirm that
the output includes a SearchResultTruncated message.

Fixes: https://pagure.io/freeipa/issue/9486

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
Rob Crittenden 2023-11-28 13:35:13 -05:00 committed by Florence Blanc-Renaud
parent 48846e98e5
commit d1e09c68af

View File

@ -134,6 +134,7 @@ class test_hbactest(XMLRPC_test):
assert ret['value']
assert ret['error'] is None
assert ret['matched'] is None
assert 'messages' not in ret
assert ret['notmatched'] is None
def test_c_hbactest_check_rules_enabled_detail(self):
@ -200,7 +201,23 @@ class test_hbactest(XMLRPC_test):
nodetail=True
)
def test_g_hbactest_clear_testing_data(self):
def test_g_hbactest_searchlimit_message(self):
"""
Test running 'ipa hbactest' with limited --sizelimit
We know there are at least 6 rules, 4 created here + 2 default.
"""
ret = api.Command['hbactest'](
user=self.test_user,
targethost=self.test_host,
service=self.test_service,
nodetail=True,
sizelimit=2,
)
assert ret['messages'] is not None
def test_h_hbactest_clear_testing_data(self):
"""
Clear data for HBAC test plugin testing.
"""