Skip to content

[autobackport: sssd-2-13] tests: clear sssd cache in teardown of AD idmap range tests - #9505

Merged
spoore1 merged 1 commit into
SSSD:sssd-2-13from
sssd-bot:SSSD-sssd-backport-pr9412-to-sssd-2-13
Oct 20, 2026
Merged

spoore1 merged 1 commit into
SSSD:sssd-2-13from
sssd-bot:SSSD-sssd-backport-pr9412-to-sssd-2-13

Conversation

@sssd-bot

Copy link
Copy Markdown
Contributor

This is an automatic backport of PR#9412 tests: clear sssd cache in teardown of AD idmap range tests to branch sssd-2-13, created by @spoore1.

Please make sure this backport is correct.

Note

The commits were cherry-picked without conflicts.

You can push changes to this pull request

git remote add sssd-bot git@github.com:sssd-bot/sssd.git
git fetch sssd-bot refs/heads/SSSD-sssd-backport-pr9412-to-sssd-2-13
git checkout SSSD-sssd-backport-pr9412-to-sssd-2-13
git push sssd-bot SSSD-sssd-backport-pr9412-to-sssd-2-13 --force

Original commits
493e37f - tests: clear sssd cache in teardown of AD idmap range tests

Backported commits

  • 9ed21f4 - tests: clear sssd cache in teardown of AD idmap range tests

Original Pull Request Body

Reset cache between idmap range tests to avoid invalid cache entries that cause failures for the next test.

Details from Claude:

The Testidmaprange tests in test_id_mapping.py set a small ldap_idmap_range_size and let sssd cache an idmap slice computed under that value. Each test restored sssd.conf at the end via sssd_conf(action='delete'), but never cleared the sssd cache, and that restore line was skipped whenever the test body failed an assertion first.

As a result, the cached idmap slice (computed under the small range_size) survived into later tests. Once the default range_size was restored, the AD backend re-read the stale slice from the cache and rejected it on startup:

sdap_idmap_add_domain: BUG: Range maximum exceeds the global
maximum: 3082911935 > 2000200000
sdap_idmap_init: Could not add domain ... Unexpected ID map
configuration ... remove the sssd cache
sssm_ad_init: Unable to init AD module [22]: Invalid argument

sssd_be then exited (code 3), sssd failed to start, and every subsequent AD test that performs a realm join + sssd restart failed

Add an autouse teardown fixture that restores the default idmap configuration and clears the sssd cache after every test, so it runs even when a test fails. Remove the now-redundant inline sssd_conf(action='delete') cleanup from each test.

Assisted-by: Claude Code (Opus 4.8)

Reset cache between idmap range tests to avoid invalid cache entries
that cause failures for the next test.

Details from Claude:

The Testidmaprange tests in test_id_mapping.py set a small
ldap_idmap_range_size and let sssd cache an idmap slice computed
under that value. Each test restored sssd.conf at the end via
sssd_conf(action='delete'), but never cleared the sssd cache, and
that restore line was skipped whenever the test body failed an
assertion first.

As a result, the cached idmap slice (computed under the small
range_size) survived into later tests. Once the default range_size
was restored, the AD backend re-read the stale slice from the cache
and rejected it on startup:

    sdap_idmap_add_domain: BUG: Range maximum exceeds the global
    maximum: 3082911935 > 2000200000
    sdap_idmap_init: Could not add domain ... Unexpected ID map
    configuration ... remove the sssd cache
    sssm_ad_init: Unable to init AD module [22]: Invalid argument

sssd_be then exited (code 3), sssd failed to start, and every
subsequent AD test that performs a realm join + sssd restart failed

Add an autouse teardown fixture that restores the default idmap
configuration and clears the sssd cache after every test, so it runs
even when a test fails. Remove the now-redundant inline
sssd_conf(action='delete') cleanup from each test.

Assisted-by: Claude Code (Opus 4.8)
Reviewed-by: Madhuri Upadhye <mupadhye@redhat.com>
(cherry picked from commit 493e37f)
@sssd-bot

Copy link
Copy Markdown
Contributor Author

The pull request was accepted by @madhuriupadhye with the following PR CI status:


🟢 CodeQL (success)
🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 testing-farm:centos-stream-10-x86_64:upstream (success)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)
🟢 ci / prepare (success)
🟢 ci / system (centos-10) (success)
🟢 ci / system (fedora-44) (success)
🟢 Static code analysis / codeql (success)
🟢 Static code analysis / files-changed (success)
🟢 Static code analysis / pre-commit (success)
➖ Static code analysis / python-system-tests (skipped)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

@sssd-bot
sssd-bot force-pushed the SSSD-sssd-backport-pr9412-to-sssd-2-13 branch from 9ed21f4 to feed02b Compare October 20, 2026 07:42
@spoore1
spoore1 merged commit 091f577 into SSSD:sssd-2-13 Oct 20, 2026
12 checks passed
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