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

More shared functions and test log readability #545

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hhorak
Copy link
Member

@hhorak hhorak commented Jan 5, 2024

This combines two changes that both improve test script, so I did not bother to split it to two commits. One is using more functions from the test-lib shared library, and second is removing expected warnings from the test log, to make the log more readable and easier to spot the issues.

This PR builds on top of #544 and #543 (to avoid merge conflicts), and those PRs must be merged before.

…ume"

This reverts commit 62a0e88.

Creating a new volume directory was actually NOOP, because the variable
volume_options was not updated. What we need to get rid of SELinux
messages that this fix tried to address is to properly shut down
previous container. That will be done in the following commit.

Background:
podman's :Z modificator for volumes works the way that the latest
container run with the same volume directory mounted with :Z modificator
has access, the previous containers are kept running, but access to the
shared directory is suddenly removed. That caused the first instance of
PostgreSQL server to crash with SIGSEGV actually, while triggering some
SELinux error message during that.
With keeping the container running, we see SELinux error messages and
sudden crash of the PostgreSQL container. Let's properly shut down the
container before using its volume privately mounted into a different
container.

Background:
podman's :Z modificator for volumes works the way that the latest
container run with the same volume directory mounted with :Z modificator
has access, the previous containers are kept running, but access to the
shared directory is suddenly removed. That caused the first instance of
PostgreSQL server to crash with SIGSEGV actually, while triggering some
SELinux error message during that.
… data when changing password

Fix also postgresql_cmd function that should not ignore SQL errors
(thus using ON_ERROR_STOP option now) and was often called with an
interactive input using <<< but podman run is run in non-interactive
mode, resulting in the SQL commands to not be printed, so checking
them later did not work and errors are not visible.
Using -c option solves this.

Function test_postgresql was called with a parameter that was not
used anywhere. This function used CREATE EXTENSION to test proper
PostgreSQL functionality, that only admin have permissions for.
So, the parameter of test_postgresql function was changed to have
a useful meaning. The meaning is that only if the parameter is
"admin", the CREATE EXTENSION statement is run to not see
"Not enough permissions" error when the contianer is run as a
normal user.
This combines two changes that both improve test script, so I did not
bother to split it to two commits. One is using more functions from the
test-lib shared library, and second is removing expected warnings from
the test log, to make the log more readable and easier to spot the
issues.
@hhorak hhorak marked this pull request as draft January 5, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant