SUSE / BCI-tests

This repository contains the tests for the SUSE Base Container Images
Apache License 2.0
10 stars 22 forks source link

[postfix] update tests for changes in logging #569

Closed Priyankasaggu11929 closed 2 months ago

Priyankasaggu11929 commented 2 months ago

Follow up changes in tests, post merge of PR https://github.com/SUSE/BCI-dockerfile-generator/pull/1541

CI tests will give proper signal, when ^ PR is merged, and registry.opensuse.org have refreshed image tags.

dcermak commented 2 months ago

@Priyankasaggu11929 can you please rebase?

Priyankasaggu11929 commented 2 months ago

@Priyankasaggu11929 can you please rebase?

rebased just now.

Priyankasaggu11929 commented 2 months ago

Now every test includes the following lines:

    auto_container.connection.check_output(
        "postconf maillog_file=/var/log/postfix.log && postfix reload"
    )

Shouldn't this become part of the container image instead? Or why is this needed?

It was part of the extended Containefile before this PR, but now with the recent changes from https://github.com/SUSE/BCI-dockerfile-generator/pull/1541 - postfix container entrypoint script sets maillog_file=/dev/stdout and any override in the extended container doesn't work (because entrypoint still remains the final step when container starts).

So, I'm trying to update config when container is already started & reload postfix.

Directing logs to a file is needed in order to check/verify the mail status. We don't have journalctl in the container.

dcermak commented 2 months ago

It was part of the extended Containefile before this PR, but now with the recent changes from SUSE/BCI-dockerfile-generator#1541 - postfix container entrypoint script sets maillog_file=/dev/stdout and any override in the extended container doesn't work (because entrypoint still remains the final step when container starts).

So, I'm trying to update config when container is already started & reload postfix.

Directing logs to a file is needed in order to check/verify the mail status. We don't have journalctl in the container.

Would it help you to have direct access to the container logs via pytest_container?

EDIT: I went ahead and implemented it, it turned out to be pretty simple: https://github.com/dcermak/pytest_container/pull/219

Priyankasaggu11929 commented 2 months ago

Would it help you to have direct access to the container logs via pytest_container?

EDIT: I went ahead and implemented it, it turned out to be pretty simple: dcermak/pytest_container#219

Thank you, Dan. Yea, I think direct container logs will help here. I'll test on Monday with the new function, and update.