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

Add Vault 1.15.x to integration tests #1103

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ jobs:
- "vault=1.12.*"
- "vault=1.13.*"
- "vault=1.14.*"
# - "vault=1.15.*"
# https://github.com/hvac/hvac/issues/1075
- "vault=1.15.*"

steps:
- uses: actions/checkout@v4
Expand Down
30 changes: 17 additions & 13 deletions tests/integration_tests/api/auth_methods/test_kubernetes.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import logging
from unittest import TestCase
from unittest import skipIf
from unittest import TestCase, skipIf

from parameterized import parameterized, param
from parameterized import param, parameterized

from hvac import exceptions
from tests import utils
Expand Down Expand Up @@ -84,16 +83,21 @@ def test_configure(
):
kubernetes_host = "https://192.168.99.100:8443"
if raises:
with self.assertRaises(raises) as cm:
self.client.auth.kubernetes.configure(
kubernetes_host=kubernetes_host,
kubernetes_ca_cert=kubernetes_ca_cert,
token_reviewer_jwt=token_reviewer_jwt,
pem_keys=pem_keys,
mount_point=self.TEST_MOUNT_POINT,
disable_local_ca_jwt=disable_local_ca_jwt,
)
self.assertIn(member=exception_message, container=str(cm.exception))
# Vault version 1.15.0 removed requirement for JWT to be valid. Disabling param 4 if version >= 1.15.0
if not (
utils.vault_version_ge("1.15.0")
and raises == exceptions.InternalServerError
):
with self.assertRaises(raises) as cm:
self.client.auth.kubernetes.configure(
kubernetes_host=kubernetes_host,
kubernetes_ca_cert=kubernetes_ca_cert,
token_reviewer_jwt=token_reviewer_jwt,
pem_keys=pem_keys,
mount_point=self.TEST_MOUNT_POINT,
disable_local_ca_jwt=disable_local_ca_jwt,
)
self.assertIn(member=exception_message, container=str(cm.exception))
else:
configure_response = self.client.auth.kubernetes.configure(
kubernetes_host=kubernetes_host,
Expand Down