Skip to content

Commit

Permalink
ipatests: Verify that hbactest will return messages
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rcritten authored and flo-renaud committed Feb 13, 2024
1 parent e4c7c98 commit e5579fb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion ipatests/test_xmlrpc/test_hbactest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def test_b_hbactest_check_rules_nodetail(self):
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):
Expand Down Expand Up @@ -200,7 +201,23 @@ def test_f_hbactest_check_sourcehost_option_is_deprecated(self):
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.
"""
Expand Down

0 comments on commit e5579fb

Please sign in to comment.