Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Test trasformation SSSD does not crash in nss responder after … #7831

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aborah-sudo
Copy link
Contributor

…netgroup timeout when backend is offline

SSSD does not crash in nss responder after netgroup timeout when backend is offline

Comment on lines 353 to 351
if isinstance(provider, (AD)):
bad_ldap_uri = "typo.dc.%s" % hostname
client.sssd.dom("test").update(ad_server=bad_ldap_uri)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if isinstance(provider, (AD)):
bad_ldap_uri = "typo.dc.%s" % hostname
client.sssd.dom("test").update(ad_server=bad_ldap_uri)
if isinstance(provider, (AD)) or isinstance(provider, (Samba)):
bad_ldap_uri = "typo.dc.%s" % hostname
client.sssd.dom("test").update(ad_server=bad_ldap_uri)

Comment on lines 361 to 363
if isinstance(provider, (Samba)):
bad_ldap_uri = "typo.dc.%s" % hostname
client.sssd.dom("test").update(ad_server=bad_ldap_uri)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if isinstance(provider, (Samba)):
bad_ldap_uri = "typo.dc.%s" % hostname
client.sssd.dom("test").update(ad_server=bad_ldap_uri)

bad_ldap_uri = "typo.dc.%s" % hostname
client.sssd.dom("test").update(ad_server=bad_ldap_uri)

if isinstance(provider, (IPA)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if isinstance(provider, (IPA)):
elif isinstance(provider, (IPA)):

bad_ldap_uri = "typo.dc.%s" % hostname
client.sssd.dom("test").update(ad_server=bad_ldap_uri)

if isinstance(provider, (LDAP)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if isinstance(provider, (LDAP)):
elif isinstance(provider, (LDAP)):

client.host.conn.run(pgrep)

pid_nss2 = client.host.conn.run(pid_nss).stdout
assert pid_nss1 == pid_nss2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add meaningfull assert message.



@pytest.mark.importance("low")
@pytest.mark.ticket(bz=1406437)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we can drop the allocation error check and if everything else is covered elsewhere drop it altogether.

@pytest.mark.topology(KnownTopologyGroup.AnyProvider)
def test_netgroup__nss_responder(client: Client, provider: GenericProvider):
"""
:title: SSSD does not crash in nss responder after netgroup timeout when backend is offline
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:title: SSSD does not crash in nss responder after netgroup timeout when backend is offline
:title: SSSD nss responder handles correctly netgroup timeout when backend is offline

6. Verify that the SSSD processes (sssd, sssd_be, sssd_nss, sssd_pam) are still running and that the
sssd_nss process ID has not changed, indicating that SSSD has not crashed or restarted unexpectedly
:expectedresults:
1. SSSD configured with incorrect server backend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. SSSD configured with incorrect server backend
1. SSSD configured with incorrect server URI

1. Depending on the type of provider (AD, IPA, Samba, or LDAP), the script updates the SSSD configuration
with an incorrect server URI (e.g., typo.dc.hostname)
2. SSSD is restarted again to apply the new configuration
3. Checks the status of the SSSD domain to ensure it is offline due to the misconfigured server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Checks the status of the SSSD domain to ensure it is offline due to the misconfigured server
3. Check the status of the SSSD domain.

:expectedresults:
1. SSSD configured with incorrect server backend
2. SSSD restarted
3. SSSD Offline
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. SSSD Offline
3. SSSD domain is offline

2. SSSD restarted
3. SSSD Offline
4. Pid of sssd_nss captured
5. Netgroup info cant be retrieve
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. Netgroup info cant be retrieve
5. Netgroup info can't be retrieved.

3. SSSD Offline
4. Pid of sssd_nss captured
5. Netgroup info cant be retrieve
6. SSSD not crashed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
6. SSSD not crashed
6. SSSD nss responder has the same pid as before.

Comment on lines 348 to 350
result = client.tools.getent.netgroup(netgroup.name)
assert result is not None
assert result.members[0].user == "user-1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result = client.tools.getent.netgroup(netgroup.name)
assert result is not None
assert result.members[0].user == "user-1"

Not a test step.

netgroup = provider.netgroup("ng-1").add().add_member(user=user)

result = client.tools.getent.netgroup(netgroup.name)
assert result is not None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert result is not None
assert result is not None, "Could not get netgroup ng-1"

Copy link
Contributor

@jakub-vavra-cz jakub-vavra-cz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline

src/tests/system/tests/test_netgroups.py Show resolved Hide resolved
…netgroup timeout when backend is offline

SSSD does not crash in nss responder after netgroup timeout when backend is offline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants