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

test_basic_ldapagent breaks test_setup_ds_as_non_root* tests #5877

Closed
vashirov opened this issue Aug 1, 2023 · 2 comments · Fixed by #5878
Closed

test_basic_ldapagent breaks test_setup_ds_as_non_root* tests #5877

vashirov opened this issue Aug 1, 2023 · 2 comments · Fixed by #5878
Labels
needs triage The issue will be triaged during scrum

Comments

@vashirov
Copy link
Member

vashirov commented Aug 1, 2023

Issue Description
test_basic_ldapagent creates non-readable by others agent.conf file:

# ls /etc/dirsrv/config/ -la
total 28
drwxr-xr-x. 2 root root    96 Aug  1 09:02 .
drwxr-xr-x. 6 root root    71 Aug  1 09:09 ..
-rw-rw----. 1 root root    91 Aug  1 09:02 agent.conf
-rw-r--r--. 1 root root  1676 May 22 08:44 certmap.conf
-rw-r--r--. 1 root root  1006 May 22 08:44 ldap-agent.conf
-rw-r--r--. 1 root root 15142 May 22 08:44 slapd-collations.conf

It also doesn't delete it after the test is finished.

This breaks test_setup_ds_as_non_root* tests, since dscreate ds-root tries to copy everything under /etc/dirsrv/config to a non-root user directory and fails:

+ dscreate ds-root /home/user1/test_setup_ds_as_non_root_with_default_options/root /home/user1/test_setup_ds_as_non_root_with_default_options/bin
Traceback (most recent call last):
  File "/usr/sbin/dscreate", line 99, in <module>
    result = args.func(inst, log, args)
  File "/usr/local/lib/python3.9/site-packages/lib389/cli_ctl/instance.py", line 220, in prepare_ds_root
    copytree(dir, destdir, dirs_exist_ok=True)
  File "/usr/lib64/python3.9/shutil.py", line 568, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/usr/lib64/python3.9/shutil.py", line 522, in _copytree
    raise Error(errors)
shutil.Error: [('/etc/dirsrv/config/agent.conf', '/home/user1/test_setup_ds_as_non_root_with_default_options/root//etc/dirsrv/config/agent.conf', "[Errno 13] Permission denied: '/etc/dirsrv/config/agent.conf'")]
@vashirov vashirov added the needs triage The issue will be triaged during scrum label Aug 1, 2023
@vashirov
Copy link
Member Author

vashirov commented Aug 1, 2023

We don't see this breakage in GH CI because each test suite is executed separately, but when all test suites are ran on the same machine, they can affect execution of the other test suite(s).

vashirov added a commit that referenced this issue Aug 2, 2023
…ests

Bug Description:
`test_basic_ldapagent` creates `agent.conf` file that can't be read by
non-root user in `test_setup_ds_as_non_root*` tests.

Fix Description:
Move `agent.conf` file creation to a fixture to ensure it is deleted
after the test is finished.

Fixes: #5877

Reviewed-by: @bsimonova (Thanks!)
vashirov added a commit that referenced this issue Aug 2, 2023
…ests

Bug Description:
`test_basic_ldapagent` creates `agent.conf` file that can't be read by
non-root user in `test_setup_ds_as_non_root*` tests.

Fix Description:
Move `agent.conf` file creation to a fixture to ensure it is deleted
after the test is finished.

Fixes: #5877

Reviewed-by: @bsimonova (Thanks!)
vashirov added a commit that referenced this issue Aug 2, 2023
…ests

Bug Description:
`test_basic_ldapagent` creates `agent.conf` file that can't be read by
non-root user in `test_setup_ds_as_non_root*` tests.

Fix Description:
Move `agent.conf` file creation to a fixture to ensure it is deleted
after the test is finished.

Fixes: #5877

Reviewed-by: @bsimonova (Thanks!)
vashirov added a commit that referenced this issue Aug 2, 2023
…ests

Bug Description:
`test_basic_ldapagent` creates `agent.conf` file that can't be read by
non-root user in `test_setup_ds_as_non_root*` tests.

Fix Description:
Move `agent.conf` file creation to a fixture to ensure it is deleted
after the test is finished.

Fixes: #5877

Reviewed-by: @bsimonova (Thanks!)
vashirov added a commit that referenced this issue Aug 2, 2023
…ests

Bug Description:
`test_basic_ldapagent` creates `agent.conf` file that can't be read by
non-root user in `test_setup_ds_as_non_root*` tests.

Fix Description:
Move `agent.conf` file creation to a fixture to ensure it is deleted
after the test is finished.

Fixes: #5877

Reviewed-by: @bsimonova (Thanks!)
@vashirov
Copy link
Member Author

vashirov commented Aug 2, 2023

744cb41..edb4356 389-ds-base-2.0 -> 389-ds-base-2.0
86c736b..2c35f73 389-ds-base-2.1 -> 389-ds-base-2.1
8d74381..143ea65 389-ds-base-2.2 -> 389-ds-base-2.2
bd3140f..ca41bf5 389-ds-base-2.3 -> 389-ds-base-2.3

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

Successfully merging a pull request may close this issue.

1 participant