mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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_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> 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:
parent
eb9f606ffd
commit
a39af6b722
@ -309,4 +309,4 @@ jobs:
|
|||||||
test_suite: test_integration/test_subids.py
|
test_suite: test_integration/test_subids.py
|
||||||
template: *ci-ipa-4-10-latest
|
template: *ci-ipa-4-10-latest
|
||||||
timeout: 3600
|
timeout: 3600
|
||||||
topology: *master_1repl
|
topology: *master_1repl_1client
|
||||||
|
@ -1748,7 +1748,7 @@ jobs:
|
|||||||
test_suite: test_integration/test_subids.py
|
test_suite: test_integration/test_subids.py
|
||||||
template: *ci-ipa-4-10-latest
|
template: *ci-ipa-4-10-latest
|
||||||
timeout: 3600
|
timeout: 3600
|
||||||
topology: *master_1repl
|
topology: *master_1repl_1client
|
||||||
|
|
||||||
fedora-latest-ipa-4-10/test_custom_plugins:
|
fedora-latest-ipa-4-10/test_custom_plugins:
|
||||||
requires: [fedora-latest-ipa-4-10/build]
|
requires: [fedora-latest-ipa-4-10/build]
|
||||||
|
@ -1887,7 +1887,7 @@ jobs:
|
|||||||
test_suite: test_integration/test_subids.py
|
test_suite: test_integration/test_subids.py
|
||||||
template: *ci-ipa-4-10-latest
|
template: *ci-ipa-4-10-latest
|
||||||
timeout: 3600
|
timeout: 3600
|
||||||
topology: *master_1repl
|
topology: *master_1repl_1client
|
||||||
|
|
||||||
fedora-latest-ipa-4-10/test_custom_plugins:
|
fedora-latest-ipa-4-10/test_custom_plugins:
|
||||||
requires: [fedora-latest-ipa-4-10/build]
|
requires: [fedora-latest-ipa-4-10/build]
|
||||||
|
@ -1748,7 +1748,7 @@ jobs:
|
|||||||
test_suite: test_integration/test_subids.py
|
test_suite: test_integration/test_subids.py
|
||||||
template: *ci-ipa-4-10-previous
|
template: *ci-ipa-4-10-previous
|
||||||
timeout: 3600
|
timeout: 3600
|
||||||
topology: *master_1repl
|
topology: *master_1repl_1client
|
||||||
|
|
||||||
fedora-previous-ipa-4-10/test_custom_plugins:
|
fedora-previous-ipa-4-10/test_custom_plugins:
|
||||||
requires: [fedora-previous-ipa-4-10/build]
|
requires: [fedora-previous-ipa-4-10/build]
|
||||||
|
@ -17,6 +17,7 @@ from ipatests.test_integration.base import IntegrationTest
|
|||||||
|
|
||||||
class TestSubordinateId(IntegrationTest):
|
class TestSubordinateId(IntegrationTest):
|
||||||
num_replicas = 0
|
num_replicas = 0
|
||||||
|
num_clients = 1
|
||||||
topology = "star"
|
topology = "star"
|
||||||
|
|
||||||
def _parse_result(self, result):
|
def _parse_result(self, result):
|
||||||
@ -268,3 +269,40 @@ class TestSubordinateId(IntegrationTest):
|
|||||||
f"--subuid={subuid}"])
|
f"--subuid={subuid}"])
|
||||||
owner = self._parse_result(result)["owner"]
|
owner = self._parse_result(result)["owner"]
|
||||||
assert owner == uid
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user