Skip to content

Commit

Permalink
ipatests: always skip additional input for group-add-member --external
Browse files Browse the repository at this point in the history
'ipa group-add-member groupname --external some-object' will attempt to
ask interactive questions about other optional parameters (users and
groups) if only external group member was specified. This leads to a
timeout in the tests as there is no input provided.

Do not wait for the entry that would never come by using 'ipa -n'.

Related: https://pagure.io/freeipa/issue/8236
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Sergey Orlov <sorlov@redhat.com>
  • Loading branch information
abbra committed Mar 25, 2020
1 parent 45b5384 commit c1c45df
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ipatests/test_integration/test_sssd.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import re

import pytest
import subprocess
import textwrap

from ipatests.test_integration.base import IntegrationTest
Expand All @@ -19,7 +20,6 @@
from ipaplatform.osinfo import osinfo
from ipaplatform.paths import paths
from ipapython.dn import DN
from ipalib import errors


class TestSSSDWithAdTrust(IntegrationTest):
Expand Down Expand Up @@ -318,9 +318,8 @@ def test_ext_grp_with_ldap(self):
self.master.run_command(
['ipa', 'group-add-member', '--group', ext_group, user])
self.master.run_command([
'ipa', 'group-add-member', '--external',
self.users['ad']['name'], ext_group,
'--users=', '--groups='])
'ipa', '-n', 'group-add-member', '--external',
self.users['ad']['name'], ext_group])
tasks.clear_sssd_cache(self.master)
tasks.clear_sssd_cache(client)
try:
Expand All @@ -344,11 +343,11 @@ def test_external_group_member_mismatch(self, user_origin):
master.run_command(['ipa', 'group-add', '--external',
'ext-ipatest'])
try:
master.run_command(['ipa', 'group-add-member',
master.run_command(['ipa', '-n', 'group-add-member',
'ext-ipatest',
'--external',
self.users[user_origin]['name']])
except errors.ValidationError:
except subprocess.CalledProcessError:
# Only 'ipa' origin should throw a validation error
assert user_origin == 'ipa'
finally:
Expand Down

0 comments on commit c1c45df

Please sign in to comment.