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

Fix multihost tests #888

Merged
merged 4 commits into from
Apr 19, 2024
Merged

Fix multihost tests #888

merged 4 commits into from
Apr 19, 2024

Conversation

engelmi
Copy link
Member

@engelmi engelmi commented Apr 19, 2024

Even after changing the SELinux policy back to permissive mode (#885), quite a lot of integration tests on multihost mode were still failing. This PR contains multiple commits tackling these issues:

Use different file name for ctrl config

concatenate stderr and stdout in sshclient

The client for the podman container seems to concatenate stderr and stdout in its output parameter. In the SSH client stderr and stdout are different return variables. In order to not break the exec_run API of the Client class and still get a uniform behavior of both clients, lets concat stderr and stdout in the SSH client.

actively check if bluechi_machine_lib exists

In order to avoid failing mkdir calls on subsequent tests for the bluechi_machine_lib, an active check is being made. If it doesn't exist yet, we create the directory and the library files. These files are not tracked and thus not deleted after a test. This way, we only create the lib once.

switch order of restoring created and changed files

When creating files, we first keep track of them in the list for newly created ones. If a file is already in that list and another file with the same path (dir+name) is created we keep create a backup and track it.
For clean-up we need to reverse that order - first restore tracked backup files and then remove created files. This ensures that there are no dangling files.


  1. Example run with test failures:
    http://artifacts.osci.redhat.com/testing-farm/c028903c-1611-4a93-be04-686594d8a210/

  2. Example run after fixes:
    http://artifacts.osci.redhat.com/testing-farm/754765a9-2181-462a-b4e3-688adf697743/
    The flaky propagate test failed, unfortunately. This will be tackled in Integration Test for proxy service propagation is flaky #874)

Relates to: #879

When creating files, we first keep track of them in
the list for newly created ones. If a file is already
in that list and another file with the same path
(dir+name) is created we keep create a backup and
track it.
For clean-up we need to reverse that order - first
restore tracked backup files and then remove created
files. This ensures that there are no dangling files.

Signed-off-by: Michael Engel <[email protected]>
Relates to: #879

In order to avoid failing mkdir calls on subsequent
tests for the bluechi_machine_lib, an active check is
being made. If it doesn't exist yet, we create the
directory and the library files. These files are not
tracked and thus not deleted after a test. This way,
we only create the lib once.

Signed-off-by: Michael Engel <[email protected]>
Relates to: #879

The client for the podman container seems to
concatenate stderr and stdout in its output parameter.
In the SSH client stderr and stdout are different
return variables. In order to not break the `exec_run` API
of the Client class and still get a uniform behavior of
both clients, lets concat stderr and stdout in the SSH client.

Signed-off-by: Michael Engel <[email protected]>
Relates to: #879

Signed-off-by: Michael Engel <[email protected]>
@coveralls
Copy link

coveralls commented Apr 19, 2024

Coverage Status

coverage: 84.585%. remained the same
when pulling bc59f01 on fix-multihost-tests
into d686335 on main.

Copy link
Member

@mwperina mwperina left a comment

Choose a reason for hiding this comment

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

LGTM

@engelmi engelmi merged commit 5f9ea5e into main Apr 19, 2024
21 checks passed
@engelmi engelmi deleted the fix-multihost-tests branch April 19, 2024 12:16
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.

3 participants