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 in clu/dsconf_config_test.py uses the lib389 library in /usr/local with pip #6546

Open
mmatsuya opened this issue Jan 27, 2025 · 0 comments
Labels
needs triage The issue will be triaged during scrum

Comments

@mmatsuya
Copy link
Collaborator

Issue Description

Tests in dirsrvtests/tests/suites/clu/dsconf_config_test.py added by #5798
was not fail with the old package without the fix. Because the lib389 installed by pip was used for the test.

The clu test should use the system lib389 which was installed on the system.
Because the command binary installed on the system is used for the test.

At least in RHEL9, the default sys.path has /usr/local path, and it has higher priority than
/usr/lib{,64}/python3.x/site-packages which contains the system lib389. And, it can be
changed with PYTHONPATH env variable. By setting PYTHONPATH without /usr/local,
the system lib389 is forcibly used for the test.

Package Version and Platform:

  • Platform: RHEL9
  • Package and version: 389-ds-base-2.4.5-12.el9_4.x86_64

Steps to Reproduce
Steps to reproduce the behavior:

  1. Use the old version without the fix for Issue 5798
  2. Run dirsrvtests/tests/suites/clu/dsconf_config_test.py test

Expected results
dirsrvtests/tests/suites/clu/dsconf_config_test.py fails with the old version.
dirsrvtests/tests/suites/clu/dsconf_config_test.py didn't fail with the new version with the fix for Issue 5798

@mmatsuya mmatsuya added the needs triage The issue will be triaged during scrum label Jan 27, 2025
mmatsuya added a commit to mmatsuya/389-ds-base that referenced this issue Jan 27, 2025
The clu test should use the lib389 python module from the installed one
on the system, since the command also comes from the system.
If PYTHONPATH env variable exists, remove /usr/local path from that.
As a result, the path without /usr/local takes a priority in sys.path.
If PYTHONPATH doesn't exist, use sys.path and set PYTHONPATH without
the /usr/local path.

Relates to: 389ds#6546

Author: Masahiro Matsuya

Reviewed by: ???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage The issue will be triaged during scrum
Projects
None yet
Development

No branches or pull requests

1 participant