-
Notifications
You must be signed in to change notification settings - Fork 67
RHOAIENG-33693: Add LlamaStack image validation tests and related fixture #618
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
Merged
dbasunag
merged 13 commits into
opendatahub-io:main
from
Artemon-line:RHOAIENG-33693-mr-image-validation
Sep 25, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a9886f3
Add LlamaStack image validation tests and related fixture
Artemon-line e3f5a8b
Add LlamaStack image validation tests and related fixture
Artemon-line 7fb6f5d
Merge branch 'main' into RHOAIENG-33693-mr-image-validation
Artemon-line 70a19c9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 104fdb1
Merge branch 'main' into RHOAIENG-33693-mr-image-validation
Artemon-line 7355717
refactor: update LlamaStack test fixtures and constants
Artemon-line ccc72f5
Merge branch 'main' of github.com:Artemon-line/opendatahub-tests into…
Artemon-line f07dcfe
Merge remote-tracking branch 'upstream/main' into RHOAIENG-33693-mr-i…
Artemon-line 7e6e10e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 71d2b22
refactor: fix review suggestions
Artemon-line f192438
Merge branch 'RHOAIENG-33693-mr-image-validation' of github.com:Artem…
Artemon-line 3b02840
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 972802c
Merge branch 'main' into RHOAIENG-33693-mr-image-validation
Artemon-line File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,19 @@ | ||
| from typing import Generator, Any | ||
|
|
||
| import pytest | ||
| from kubernetes.dynamic import DynamicClient | ||
|
|
||
| from ocp_resources.pod import Pod | ||
| from tests.llama_stack.constants import LLS_CORE_POD_FILTER | ||
| from utilities.general import wait_for_pods_by_labels | ||
|
|
||
|
|
||
| @pytest.fixture(scope="class") | ||
| def lls_pods(admin_client: DynamicClient, model_namespace) -> Generator[Pod, Any, Any]: | ||
| """Get the LLS core deployment pod.""" | ||
| yield wait_for_pods_by_labels( | ||
| admin_client=admin_client, | ||
| namespace=model_namespace.name, | ||
| label_selector=LLS_CORE_POD_FILTER, | ||
| expected_num_pods=1, | ||
| )[0] | ||
46 changes: 46 additions & 0 deletions
46
tests/llama_stack/image_validation/test_verify_lls_rhoai_images.py
This file contains hidden or 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 @@ | ||
| from typing import Self, Set | ||
|
|
||
| from kubernetes.dynamic import DynamicClient | ||
| from ocp_resources.pod import Pod | ||
| import pytest | ||
| from simple_logger.logger import get_logger | ||
|
|
||
| from utilities.general import validate_container_images | ||
|
|
||
|
|
||
| LOGGER = get_logger(name=__name__) | ||
|
|
||
|
|
||
| @pytest.mark.usefixtures("llama_stack_distribution") | ||
| @pytest.mark.parametrize( | ||
| "model_namespace", | ||
| [ | ||
| pytest.param( | ||
| {"name": "test-llamastack-image-validation"}, | ||
| ) | ||
| ], | ||
| indirect=True, | ||
| ) | ||
| @pytest.mark.rawdeployment | ||
| @pytest.mark.downstream_only | ||
| class TestLLSImages: | ||
| """ | ||
| Tests to verify that LLS (LlamaStack) Distribution image meets the requirements: | ||
| 1. Images are hosted in registry.redhat.io | ||
| 2. Images use sha256 digest instead of tags | ||
| 3. Images are listed in the CSV's relatedImages section | ||
| """ | ||
|
|
||
| @pytest.mark.smoke | ||
| def test_verify_lls_operator_images( | ||
| self: Self, | ||
| admin_client: DynamicClient, | ||
| lls_pods: Pod, | ||
| related_images_refs: Set[str], | ||
| ): | ||
| validation_errors = [] | ||
| for pod in [lls_pods]: | ||
| validation_errors.extend(validate_container_images(pod=pod, valid_image_refs=related_images_refs)) | ||
|
|
||
| if validation_errors: | ||
| pytest.fail("\n".join(validation_errors)) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.