Skip to content

[autobackport: sssd-2-9] tests: Add incomplete triples and complex hierarchy netgroup tests#8281

Merged
madhuriupadhye merged 2 commits intoSSSD:sssd-2-9from
sssd-bot:SSSD-sssd-backport-pr8262-to-sssd-2-9
Dec 11, 2025
Merged

[autobackport: sssd-2-9] tests: Add incomplete triples and complex hierarchy netgroup tests#8281
madhuriupadhye merged 2 commits intoSSSD:sssd-2-9from
sssd-bot:SSSD-sssd-backport-pr8262-to-sssd-2-9

Conversation

@sssd-bot
Copy link
Contributor

@sssd-bot sssd-bot commented Dec 9, 2025

This is an automatic backport of PR#8262 tests: Add incomplete triples and complex hierarchy netgroup tests to branch sssd-2-9, created by @madhuriupadhye.

Caution

@madhuriupadhye The patches did not apply cleanly. It is necessary to resolve conflicts before merging this pull request. Commits that introduced conflict are marked with CONFLICT!.

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-pr8262-to-sssd-2-9
git checkout SSSD-sssd-backport-pr8262-to-sssd-2-9
git push sssd-bot SSSD-sssd-backport-pr8262-to-sssd-2-9 --force

Original commits
90fd802 - tests: Remove hardcoded domain and fix type errors in netgroup tests
63771a1 - tests: Add netgroup tests for incomplete triples and complex hierarchy

Backported commits

  • 8932551 - CONFLICT! tests: Remove hardcoded domain and fix type errors in netgroup tests
  • 448510d - CONFLICT! tests: Add netgroup tests for incomplete triples and complex hierarchy

Conflicting Files Information (check for deleted and re-added files)

  • CONFLICT! tests: Remove hardcoded domain and fix type errors in netgroup tests
On branch SSSD-sssd-backport-pr8262-to-sssd-2-9
You are currently cherry-picking commit 90fd80240.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/tests/system/tests/test_netgroups.py

no changes added to commit (use "git add" and/or "git commit -a")
```* CONFLICT! tests: Add netgroup tests for incomplete triples and complex hierarchy

On branch SSSD-sssd-backport-pr8262-to-sssd-2-9
You are currently cherry-picking commit 63771a1.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
(use "git add ..." to mark resolution)
both modified: src/tests/system/tests/test_netgroups.py

no changes added to commit (use "git add" and/or "git commit -a")


---

**Original Pull Request Body**

Adds two new netgroup tests.

1. test_netgroup__incomplete_triples - Verifies netgroups with missing host/user/domain fields work correctly

2. test_netgroups__complex_hierarchy - Verifies multi-level nested netgroups resolve inherited members correctly

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several new tests for netgroups, but the automatic backport process has resulted in multiple unresolved merge conflicts within src/tests/system/tests/test_netgroups.py. These conflicts are critical and prevent the code from being functional or reviewable. I have marked the locations of the conflicts. Please resolve them before this pull request can be merged.

@ikerexxe
Copy link
Contributor

ikerexxe commented Dec 9, 2025

@madhuriupadhye you should amend the commits instead of creating a new one to tackle the conflicts

@alexey-tikhonov
Copy link
Member

@madhuriupadhye you should amend the commits instead of creating a new one to tackle the conflicts

And a commit message(s).

@madhuriupadhye madhuriupadhye force-pushed the SSSD-sssd-backport-pr8262-to-sssd-2-9 branch 2 times, most recently from a1b216f to 4aec2b5 Compare December 9, 2025 12:09
@madhuriupadhye
Copy link
Contributor

@madhuriupadhye you should amend the commits instead of creating a new one to tackle the conflicts

fixed.

Copy link
Contributor

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

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

There are still a set of conflicts present in commit 1, please remove them there

@madhuriupadhye
Copy link
Contributor

There are still a set of conflicts present in commit 1, please remove them there

@madhuriupadhye madhuriupadhye force-pushed the SSSD-sssd-backport-pr8262-to-sssd-2-9 branch from 4aec2b5 to 236f84e Compare December 10, 2025 16:41
@madhuriupadhye
Copy link
Contributor

There are still a set of conflicts present in commit 1, please remove them there

fixed. Request to check again.

Copy link
Contributor

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

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

LGTM

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.

LGTM

Add new test cases to verify netgroup functionality with incomplete
triples and complex nested hierarchies.

New tests:
- test_netgroup__incomplete_triples: Verify netgroups with various
  incomplete triple combinations (empty, only host, only user, only
  domain, missing host, missing user, missing domain)
- test_netgroups__complex_hierarchy: Verify netgroups with multiple
  levels of nesting (base -> mid -> top) work correctly and return
  the expected combination of direct triples and inherited members

Signed-off-by: Madhuri Upadhye <mupadhye@redhat.com>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Jakub Vávra <jvavra@redhat.com>
(cherry picked from commit 63771a1)
Replace hardcoded "ldap.test" domain strings with dynamic `provider.domain`
and fix type checking errors in netgroup tests.

Changes:
- Remove `raise ValueError` and `pytest.skip` isinstance checks since
  topology markers already restrict tests to LDAP, AD, and Samba providers
- Change function signatures from `GenericProvider` to `AD | LDAP | Samba`
  to match the topology decorators
- Replace all hardcoded "ldap.test" with `provider.domain` for dynamic
  domain resolution across different provider topologies
- Rework parametrized test to use boolean flag and format string with
  `{domain}` placeholder for runtime substitution
- Fix type errors by passing netgroup names as strings instead of objects
  to `add_member(ng=...)` calls
- Fix type conflict by using separate variable names (`passwd_result`,
  `group_result`) for different entry types

Affected tests:
- test_netgroup__user_attribute_membernisnetgroup_uses_group_dn
- test_netgroup__lookup_nested_groups
- test_netgroup__lookup_nested_groups_with_host_and_domain_values_present
- test_netgroup__uid_gt_2147483647

Signed-off-by: Madhuri Upadhye <mupadhye@redhat.com>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Jakub Vávra <jvavra@redhat.com>
(cherry picked from commit 90fd802)
@sssd-bot
Copy link
Contributor Author

The pull request was accepted by @jakub-vavra-cz with the following PR CI status:


🟢 CodeQL (success)
🟢 rpm-build:centos-stream-9-x86_64:upstream (success)
🟢 ci / prepare (success)
🟢 ci / system (centos-9) (success)
🟢 Static code analysis / codeql (success)
🟢 Static code analysis / pre-commit (success)
🟢 Static code analysis / python-system-tests (success)


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

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.

5 participants