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

Python bindings in integration tests #485

Merged
merged 6 commits into from
Aug 22, 2023

Conversation

engelmi
Copy link
Member

@engelmi engelmi commented Aug 21, 2023

This PR addresses #411 and #419 (partially).

It introduces the python3-bluechi in the integration tests to be able to easily use the public D-Bus API of the bluechi controller. For this, a separate python script needs to be "injected" into the controller container - this PR adds a function to do this easily.

It also fixes a wrongly renamed data file - where the internal metrics API was missing the internal part. In addition, a missing return statement in the generator skeleton for getting properties has been added. After both fixes, the python bindings were re-generated.

tests/bluechi_test/container.py Outdated Show resolved Hide resolved
tests/bluechi_test/container.py Outdated Show resolved Hide resolved
tests/containers/integration-test-base Outdated Show resolved Hide resolved
@engelmi engelmi force-pushed the python-bindings-in-integration-tests branch 3 times, most recently from 62cff80 to 4cfbd85 Compare August 21, 2023 08:58
@engelmi engelmi force-pushed the python-bindings-in-integration-tests branch 3 times, most recently from 2f523ce to 29fe5cf Compare August 21, 2023 15:14
@engelmi engelmi force-pushed the python-bindings-in-integration-tests branch 2 times, most recently from 6981ed6 to 3ff88cd Compare August 22, 2023 06:31
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

src/bindings/python/bluechi/api.py Outdated Show resolved Hide resolved
tests/bluechi_test/container.py Outdated Show resolved Hide resolved
tests/tests/tier0/monitor-open-close/python/monitor.py Outdated Show resolved Hide resolved
During the renaming, the data file for the internal
metrics interface on the agent has dropped the
.internal. part - this causes the auto-generation
to fail. Re-adding it.

Signed-off-by: Michael Engel <mengel@redhat.com>
The skeleton for generating get functions for properties
is missing a return statement, resulting in a None
return value. This commit adds it and re-generates the
bindings

Signed-off-by: Michael Engel <mengel@redhat.com>
Added the python3-bluechi package to be installed in
the local and snapshot container image and the required
dasbus dependency in the base image so that the bindings
can be used in the integration tests.
Since there is a breaking change in dasbas@v1.7 in the
naming of a data type, this import is wrapped with a
try so that both versions can be supported.

Signed-off-by: Michael Engel <mengel@redhat.com>
Signed-off-by: Michael Engel <mengel@redhat.com>
Fixes #411.
The python bindings access the system bus where the
bluechi controller is running. Therefore, it is
required to run in inside the container for the
integration test. To enable this, a helper function
has been implemented and used for the monitor
open-close test.

Signed-off-by: Michael Engel <mengel@redhat.com>
Addresses #419 by listening for the node state changed
signal and stopping the bluechi-agent service.

Signed-off-by: Michael Engel <mengel@redhat.com>
@engelmi engelmi force-pushed the python-bindings-in-integration-tests branch from 3ff88cd to 86ce2f3 Compare August 22, 2023 09:41
Copy link
Contributor

@ygalblum ygalblum 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 1817015 into main Aug 22, 2023
10 checks passed
@engelmi engelmi deleted the python-bindings-in-integration-tests branch August 22, 2023 11:53
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.

Add integration tests: node disconnect/reconnect Add integration tests: create and close monitor
4 participants