Skip to content

Switch KMIP testing to cosmian#575

Open
dutow wants to merge 3 commits into
percona:mainfrom
dutow:kmip-cosmian-tap
Open

Switch KMIP testing to cosmian#575
dutow wants to merge 3 commits into
percona:mainfrom
dutow:kmip-cosmian-tap

Conversation

@dutow
Copy link
Copy Markdown
Collaborator

@dutow dutow commented May 4, 2026

PyKMIP seems to be abandonware and requires an older python version. This commt switches instead to use a Cosmian based kmip test, which also moves the server setup inside the TAP test to simplify local deployment.

Test assumes that the required binaries are installed and are user executable.

(Should we use something other than perl for testing?)

@dutow dutow force-pushed the kmip-cosmian-tap branch from 08306b2 to e56bf6f Compare May 5, 2026 09:00
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.67%. Comparing base (1b1180b) to head (89c85c2).
⚠️ Report is 1 commits behind head on main.

❌ Your project status has failed because the head coverage (76.27%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #575   +/-   ##
=======================================
  Coverage   57.67%   57.67%           
=======================================
  Files          68       68           
  Lines       10758    10758           
  Branches     2650     2650           
=======================================
  Hits         6205     6205           
- Misses       3279     3280    +1     
+ Partials     1274     1273    -1     
Components Coverage Δ
access 81.73% <ø> (ø)
bin 63.76% <ø> (ø)
catalog 78.05% <ø> (ø)
common 88.23% <ø> (ø)
encryption 57.02% <ø> (ø)
keyring 65.55% <ø> (ø)
src 87.33% <ø> (ø)
smgr 89.54% <ø> (+0.90%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dutow dutow force-pushed the kmip-cosmian-tap branch 3 times, most recently from deb2bb8 to 59f03d4 Compare May 5, 2026 10:56
Copy link
Copy Markdown
Collaborator

@jeltz jeltz left a comment

Choose a reason for hiding this comment

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

Just two small comments.

Comment thread ci_scripts/ubuntu-deps.sh
Comment thread ci_scripts/ubuntu-deps.sh

# Cosmian KMS
wget https://package.cosmian.com/kms/5.21.0/deb/$(dpkg --print-architecture)/non-fips/static/cosmian-kms-server-non-fips-static-openssl_5.21.0_$(dpkg --print-architecture).deb
sudo dpkg -i cosmian-kms-server-non-fips-static-openssl_5.21.0_$(dpkg --print-architecture).deb
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.

Should we add a variable for the architecture?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Would that be more reliable than calling dpkg?

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.

No, my idea was jsut to reduce duplicated calls to dpkg.

Copy link
Copy Markdown
Collaborator

@jeltz jeltz left a comment

Choose a reason for hiding this comment

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

I cannot say I was happy with doing this review. Feels like it would have needed quite a bit more work before it would actually have been ready for review.

Comment thread t/CosmianKms.pm
diag("COSMIAN_KMS_BIN=$override is not executable; ignoring");
}

for my $dir (File::Spec->path)
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.

This seems overkill. Why not just check if it is in the current path?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Because perl doesn't have a built in for that, a short if seems a good alternative to me vs adding a new package dependency

Comment thread t/CosmianKms.pm Outdated
Comment thread t/CosmianKms.pm Outdated

# Cosmian needs the openssl legacy provider to read the P12 bundle.
# Search known module dirs across distros; on Ubuntu CI the post-install
# chmod in ci_scripts/ubuntu-deps.sh exposes cosmian's bundled copy.
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.

I don't really get why the code below is necessary and I do not really feel the comment explains it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, maybe I could make this comment better, basically cosmian-kms needs OPENSSL_MODULES set

Comment thread t/CosmianKms.pm Outdated
# is present (the Ubuntu .deb installs /etc/cosmian/kms.toml and
# cosmian's `-c` flag's help text says "All other command line
# arguments and environment variables are ignored once the
# configuration file is loaded"). Always launch via -c <our toml>.
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.

This comment adds no value as far as I can see.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hm, maybe. I left it there because this was really annoying

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.

I don't really see how this comment adds anything. It is annoying but not really anything we need to document since they already do it.

Comment thread ci_scripts/ubuntu-deps.sh
Comment thread t/CosmianKms.pm Outdated
Comment thread t/kmip.pl Outdated
Comment thread t/kmip.pl Outdated
Comment thread t/kmip.pl Outdated
Comment thread t/kmip.pl
@dutow dutow force-pushed the kmip-cosmian-tap branch 2 times, most recently from 120ae67 to 8c80cbb Compare May 6, 2026 09:45
dutow added 2 commits May 6, 2026 10:52
PyKMIP seems to be abandonware and requires an older python version.
This commt switches instead to use a Cosmian based kmip test, which also
moves the server setup inside the TAP test to simplify local deployment.

Test assumes that the required binaries are installed and are user
executable.
Verify pg_tde fails fast when KMIP endpoint accepts TCP but immediately
closes (no TLS, no KMIP). Uses a fork()ed accept-then-close listener on
an ephemeral port, expecting the provider registration to surface an
SSL/handshake/EOF error rather than hanging.
@dutow dutow force-pushed the kmip-cosmian-tap branch 2 times, most recently from 796d8c8 to 2849472 Compare May 6, 2026 10:01
@dutow dutow requested a review from jeltz May 6, 2026 10:02
@dutow dutow force-pushed the kmip-cosmian-tap branch from 2849472 to 89c85c2 Compare May 6, 2026 17:08
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