generated from RedHatQE/python-template-repository
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [WIP] add test for Raw kserve auth Signed-off-by: Milind Waykole <[email protected]> * [WIP] add test for Raw kserve auth Signed-off-by: Milind Waykole <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [WIP] add test for Raw kserve auth Signed-off-by: Milind Waykole <[email protected]> * [WIP] add test for Raw kserve auth Signed-off-by: Milind Waykole <[email protected]> * [WIP] add test for Raw kserve auth Signed-off-by: Milind Waykole <[email protected]> * [WIP] add test for Raw kserve auth Signed-off-by: Milind Waykole <[email protected]> * [WIP] add test for Raw kserve auth Signed-off-by: Milind Waykole <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * addressed comments Signed-off-by: Milind Waykole <[email protected]> * addressed comments Signed-off-by: Milind Waykole <[email protected]> * addressed comments Signed-off-by: Milind Waykole <[email protected]> * addressed comments Signed-off-by: Milind Waykole <[email protected]> * addressed comments Signed-off-by: Milind Waykole <[email protected]> --------- Signed-off-by: Milind Waykole <[email protected]> Co-authored-by: Milind Waykole <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
de42f37
commit 768cdc3
Showing
5 changed files
with
159 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
tests/model_serving/model_server/authentication/test_kserve_token_authentication_raw.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import pytest | ||
|
||
from tests.model_serving.model_server.utils import verify_inference_response | ||
from utilities.constants import ModelFormat, ModelStoragePath, Protocols, ModelInferenceRuntime | ||
from utilities.inference_utils import Inference | ||
|
||
pytestmark = pytest.mark.usefixtures("valid_aws_config") | ||
|
||
|
||
@pytest.mark.rawdeployment | ||
@pytest.mark.parametrize( | ||
"model_namespace, s3_models_storage_uri", | ||
[ | ||
pytest.param( | ||
{"name": "kserve-raw-token-authentication"}, | ||
{"model-dir": ModelStoragePath.FLAN_T5_SMALL}, | ||
) | ||
], | ||
indirect=True, | ||
) | ||
class TestKserveTokenAuthenticationRawForRest: | ||
@pytest.mark.smoke | ||
@pytest.mark.dependency(name="test_model_authentication_using_rest_raw") | ||
def test_model_authentication_using_rest_raw(self, http_s3_caikit_raw_inference_service, http_raw_inference_token): | ||
"""Verify RAW Kserve model query with token using REST""" | ||
verify_inference_response( | ||
inference_service=http_s3_caikit_raw_inference_service, | ||
runtime=ModelInferenceRuntime.CAIKIT_TGIS_RUNTIME, | ||
inference_type=Inference.ALL_TOKENS, | ||
protocol=Protocols.HTTPS, | ||
model_name=ModelFormat.CAIKIT, | ||
use_default_query=True, | ||
token=http_raw_inference_token, | ||
) | ||
|
||
@pytest.mark.dependency(name="test_disabled_raw_model_authentication") | ||
def test_disabled_raw_model_authentication(self, patched_remove_raw_authentication_isvc): | ||
"""Verify model query after authentication is disabled""" | ||
verify_inference_response( | ||
inference_service=patched_remove_raw_authentication_isvc, | ||
runtime=ModelInferenceRuntime.CAIKIT_TGIS_RUNTIME, | ||
inference_type=Inference.ALL_TOKENS, | ||
protocol=Protocols.HTTP, | ||
model_name=ModelFormat.CAIKIT, | ||
use_default_query=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters