-
Notifications
You must be signed in to change notification settings - Fork 256
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 netgroup #7831
base: master
Are you sure you want to change the base?
Conversation
e798b58
to
05ae5f2
Compare
client.host.conn.run(pgrep) | ||
|
||
pid_nss2 = client.host.conn.run(pid_nss).stdout | ||
assert pid_nss1 == pid_nss2 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6. SSSD not crashed | |
6. SSSD nss responder has the same pid as before. |
result = client.tools.getent.netgroup(netgroup.name) | ||
assert result is not None | ||
assert result.members[0].user == "user-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert result is not None | |
assert result is not None, "Could not get netgroup ng-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline
a23466f
to
0e5f2df
Compare
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to mention script or the type of provider. Thus, replace by: Update SSSD configuration with an incorrect server URI (e.g., typo.dc.hostname).
In addition, this belongs to setup
phase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This belongs to setup
phase, not to steps
:title: SSSD nss responder handles correctly netgroup timeout when backend is offline | ||
:setup: | ||
1. A user (user-1) and a netgroup (ng-1) are created, and the user is added as a member of the netgroup | ||
2. SSSD is restarted with a clean configuration to ensure no stale data is present |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SSSD should be restarted only once, and it should be after the configuration has been updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also belongs to setup
phase, not to steps
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this step necessary? What is the added value it brings us?
pid_nss1 = client.host.conn.run(pid_nss).stdout | ||
|
||
# request for netgroup | ||
assert not client.tools.getent.netgroup(netgroup.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert not client.tools.getent.netgroup(netgroup.name) | |
assert not client.tools.getent.netgroup(netgroup.name), f"Netgroup {netgroup.name} was unexpectedly retrieved." |
:steps: | ||
1. The getent command is used to retrieve the netgroup information and user is member of the netgroup | ||
2. Wait for 30 seconds to allow the cache to expire and be refreshed | ||
3. The ldbsearch command is used to query the SSSD cache database (cache_test.ldb) | ||
to verify that second user is now part of the netgroup in the cache | ||
:expectedresults: | ||
1. Retrieves the netgroup information and user is member of the netgroup | ||
2. Successfully wait | ||
3. Second user is now part of the netgroup in the cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:steps: | |
1. The getent command is used to retrieve the netgroup information and user is member of the netgroup | |
2. Wait for 30 seconds to allow the cache to expire and be refreshed | |
3. The ldbsearch command is used to query the SSSD cache database (cache_test.ldb) | |
to verify that second user is now part of the netgroup in the cache | |
:expectedresults: | |
1. Retrieves the netgroup information and user is member of the netgroup | |
2. Successfully wait | |
3. Second user is now part of the netgroup in the cache | |
:steps: | |
1. The getent command succeds in retrieving the netgroup | |
2. Verify that user is member of the netgroup | |
3. Wait for 30 seconds to allow the cache to expire and be refreshed. | |
The ldbsearch command is used to query the SSSD cache database (cache_test.ldb) | |
to verify that second user is now part of the netgroup in the cache | |
:expectedresults: | |
1. Retrieved the netgroup information | |
2. User is member of the netgroup | |
3. Second user is now part of the netgroup in the ldb cache |
triple = netgrp.get("netgroupTriple") | ||
assert triple is not None, "Empty tripple!" | ||
assert user2.name in triple[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this? Should not we check user is in ng-1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that what i am doing here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what is "netgroupTriple" ? You are not creating it nor mentioning in the steps.
Can You clarify the steps/results. Why is there suddenly triple instead of ng-1?
…netgroup timeout when backend is offline SSSD does not crash in nss responder after netgroup timeout when backend is offline
|
||
# Check backend status | ||
assert client.sssd.default_domain is not None, "Failed to load default domain!" | ||
assert not client.sssctl.domain_status(client.sssd.default_domain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a failure message indicating what failed in this assert
Test transformation net group with generic provider