Skip to content

PS-9771 fix of component_keyring_kmip test fro usage with PyKMIP docker#5646

Merged
lukin-oleksiy merged 1 commit intopercona:8.0from
lukin-oleksiy:PS-9771-8.0-keyring_kmip_tests
Jul 25, 2025
Merged

PS-9771 fix of component_keyring_kmip test fro usage with PyKMIP docker#5646
lukin-oleksiy merged 1 commit intopercona:8.0from
lukin-oleksiy:PS-9771-8.0-keyring_kmip_tests

Conversation

@lukin-oleksiy
Copy link
Copy Markdown
Contributor

https://perconadev.atlassian.net/browse/PS-9771

Tests results updated to pass with PyKMIP docker image from https://github.com/Percona-Lab/pxb-jenkins-images
README added to de-mystify KMIP tests

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

--echo # ----------------------------------------------------------------------

--exec python std_data/kmip_clear.py
#--exec python std_data/kmip_clear.py
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clang-diagnostic-error
invalid preprocessing directive

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why?

Copy link
Copy Markdown
Contributor Author

@lukin-oleksiy lukin-oleksiy Jul 24, 2025

Choose a reason for hiding this comment

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

We use new docker container every time, no need to waste time for cleanup. Also, python module might be missing in the docker image that runs tests

@@ -22,7 +22,7 @@

# Create local keyring config
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clang-diagnostic-error
invalid preprocessing directive

--let KEYRING_CONFIG_CONTENT = `SELECT CONCAT('{ \"path\": \"', '$KEYRING_KMIP_PATH', '\", \"server_addr\": \"', '$KMIP_ADDR', '\", \"server_port\": \"', '$KMIP_PORT', '\", \"client_ca\": \"', '$KMIP_CLIENT_CA', '\", \"client_key\": \"', '$KMIP_CLIENT_KEY', '\", \"server_ca\": \"', '$KMIP_SERVER_CA', '\", \"object_group\": \"', 'test-object-group', '\" }')`
--source include/keyring_tests/helper/local_keyring_create_config.inc

# Create local manifest file for current server instance
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clang-diagnostic-error
invalid preprocessing directive

@@ -14,7 +14,7 @@

# Create global keyring config
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clang-diagnostic-error
invalid preprocessing directive

--let KEYRING_CONFIG_CONTENT = `SELECT CONCAT('{ \"path\": \"', '$KEYRING_KMIP_PATH','\", \"server_addr\": \"127.0.0.1\", \"server_port\": \"5696\", \"client_ca\": \"/tmp/certs/mysql-client-cert.pem\", \"client_key\":\"/tmp/certs/mysql-client-key.pem\", \"server_ca\":\"/tmp/certs/vault-kmip-ca.pem\" }')`
--source include/keyring_tests/helper/global_keyring_create_customized_config.inc

# Restart server with manifest file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

clang-diagnostic-error
invalid preprocessing directive

# Create local keyring config
--let KEYRING_KMIP_PATH = `SELECT CONCAT( '$MYSQLTEST_VARDIR', '/keyring_kmip')`
--let KEYRING_CONFIG_CONTENT = `SELECT CONCAT('{ \"path\": \"', '$KEYRING_KMIP_PATH', '\", \"server_addr\": \"', '$KMIP_ADDR', '\", \"server_port\": \"', '$KMIP_PORT', '\", \"client_ca\": \"', '$KMIP_CLIENT_CA', '\", \"client_key\": \"', '$KMIP_CLIENT_KEY', '\", \"server_ca\": \"', '$KMIP_SERVER_CA', '\" }')`
--let KEYRING_CONFIG_CONTENT = `SELECT CONCAT('{ \"path\": \"', '$KEYRING_KMIP_PATH', '\", \"server_addr\": \"', '$KMIP_ADDR', '\", \"server_port\": \"', '$KMIP_PORT', '\", \"client_ca\": \"', '$KMIP_CLIENT_CA', '\", \"client_key\": \"', '$KMIP_CLIENT_KEY', '\", \"server_ca\": \"', '$KMIP_SERVER_CA', '\", \"object_group\": \"', 'test-object-group', '\" }')`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here and everywhere, there is a very convenient JSON_OBJECT() MySQL function

--let KEYRING_CONFIG_CONTENT = `SELECT JSON_OBJECT('path', '$KEYRING_KMIP_PATH', 'server_addr', '$KMIP_ADDR', ...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right. But I do not want to "change the world" :) I just added a group to config.

--echo # ----------------------------------------------------------------------

--exec python std_data/kmip_clear.py
#--exec python std_data/kmip_clear.py
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why?

@lukin-oleksiy lukin-oleksiy force-pushed the PS-9771-8.0-keyring_kmip_tests branch 3 times, most recently from f30e2b3 to e21dc69 Compare July 24, 2025 08:27
Copy link
Copy Markdown
Collaborator

@percona-ysorokin percona-ysorokin left a comment

Choose a reason for hiding this comment

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

LGTM

https://perconadev.atlassian.net/browse/PS-9771

Tests results updated to pass with PyKMIP docker image from
https://github.com/Percona-Lab/pxb-jenkins-images;
README added to de-mystify KMIP tests;
No cleanup after KMIP tests, we use new docker every time.
The KMIP keyring backend now checks connexction during initialization,
reports error and fails if connection is not successful.
@lukin-oleksiy lukin-oleksiy force-pushed the PS-9771-8.0-keyring_kmip_tests branch from e21dc69 to 9ea32fd Compare July 25, 2025 06:11
@lukin-oleksiy lukin-oleksiy merged commit 4e7a830 into percona:8.0 Jul 25, 2025
7 of 23 checks passed
@lukin-oleksiy lukin-oleksiy deleted the PS-9771-8.0-keyring_kmip_tests branch July 25, 2025 06:32
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.

2 participants