ipatests: ipa-client-install --subid adds entry in nsswitch.conf

This testcase checks that when ipa-client-install command
is run with --subid option, /etc/nsswitch.conf file is updated
with the below entry

subid: nss
Related: https://pagure.io/freeipa/issue/9159

Since the newly added testsuite required client
system, hence modified the below yaml files to change the topology
from *master_1repl to *master_1repl_1client in the below files

gating.yaml
nightly_latest.yaml
nightly_latest_selinux.yaml
nightly_latest_testing.yaml
nightly_previous.yaml
nightly_rawhide.yaml

Signed-off-by: Sudhir Menon <sumenon@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Michal Polovka <mpolovka@redhat.com>
Reviewed-By: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Sudhir Menon 2022-06-23 16:14:39 +05:30 committed by Rob Crittenden
parent 4105fee2cf
commit e3e7c98ac5
7 changed files with 44 additions and 6 deletions

View File

@ -309,4 +309,4 @@ jobs:
test_suite: test_integration/test_subids.py
template: *ci-master-latest
timeout: 3600
topology: *master_1repl
topology: *master_1repl_1client

View File

@ -1748,7 +1748,7 @@ jobs:
test_suite: test_integration/test_subids.py
template: *ci-master-latest
timeout: 3600
topology: *master_1repl
topology: *master_1repl_1client
fedora-latest/test_custom_plugins:
requires: [fedora-latest/build]

View File

@ -1887,7 +1887,7 @@ jobs:
test_suite: test_integration/test_subids.py
template: *ci-master-latest
timeout: 3600
topology: *master_1repl
topology: *master_1repl_1client
fedora-latest/test_custom_plugins:
requires: [fedora-latest/build]

View File

@ -2027,7 +2027,7 @@ jobs:
test_suite: test_integration/test_subids.py
template: *ci-master-latest
timeout: 3600
topology: *master_1repl
topology: *master_1repl_1client
testing-fedora/test_custom_plugins:
requires: [testing-fedora/build]

View File

@ -2166,7 +2166,7 @@ jobs:
test_suite: test_integration/test_subids.py
template: *ci-master-latest
timeout: 3600
topology: *master_1repl
topology: *master_1repl_1client
testing-fedora/test_custom_plugins:
requires: [testing-fedora/build]

View File

@ -1748,7 +1748,7 @@ jobs:
test_suite: test_integration/test_subids.py
template: *ci-master-previous
timeout: 3600
topology: *master_1repl
topology: *master_1repl_1client
fedora-previous/test_custom_plugins:
requires: [fedora-previous/build]

View File

@ -17,6 +17,7 @@ from ipatests.test_integration.base import IntegrationTest
class TestSubordinateId(IntegrationTest):
num_replicas = 0
num_clients = 1
topology = "star"
def _parse_result(self, result):
@ -268,3 +269,40 @@ class TestSubordinateId(IntegrationTest):
f"--subuid={subuid}"])
owner = self._parse_result(result)["owner"]
assert owner == uid
def test_nsswitch_doesnot_contain_subid_entry(self):
"""
This testcase checks that when ipa-client-install
is installed without subid option, the nsswitch.conf
does not contain subid entry or does not use sss as
source for subid
"""
cmd = self.clients[0].run_command(
["grep", "^subid", "/etc/nsswitch.conf"],
raiseonerr=False
)
# a source is defined for the subid database.
# Ensure it is not "sss"
if cmd.returncode == 0:
assert 'sss' not in cmd.stdout_text
else:
# grep command returncode 1 means no matching line
# was found = no source is defined for the subid database,
# which is valid other return codes would
# mean an error occurred
assert cmd.returncode == 1
def test_nsswitch_is_updated_with_subid_entry(self):
"""
This test case checks that when ipa-client-install
is installed with --subid option, the nsswitch.conf
file is modified with the entry 'subid: sss'
"""
tasks.uninstall_client(self.clients[0])
tasks.install_client(self.master, self.clients[0],
extra_args=['--subid'])
cmd = self.clients[0].run_command(
["grep", "^subid", "/etc/nsswitch.conf"]
)
subid = cmd.stdout_text.split()
assert ['subid:', 'sss'] == subid