|
11 | 11 | from ocp_resources.config_map import ConfigMap |
12 | 12 | from ocp_resources.route import Route |
13 | 13 | from ocp_resources.service import Service |
14 | | -from tests.model_registry.model_catalog.constants import DEFAULT_CATALOG_ID |
| 14 | +from tests.model_registry.model_catalog.constants import DEFAULT_CATALOG_ID, CATALOG_CONTAINER |
15 | 15 | from tests.model_registry.model_catalog.utils import ( |
16 | 16 | validate_model_catalog_enabled, |
17 | 17 | execute_get_command, |
18 | 18 | validate_model_catalog_resource, |
19 | 19 | validate_default_catalog, |
20 | 20 | get_validate_default_model_catalog_source, |
21 | 21 | extract_schema_fields, |
| 22 | + get_model_catalog_pod, |
22 | 23 | ) |
23 | 24 | from tests.model_registry.utils import get_rest_headers |
24 | 25 | from utilities.user_utils import UserTestSession |
@@ -100,6 +101,20 @@ def test_model_catalog_resources_exists( |
100 | 101 | def test_operator_pod_enabled_model_catalog(self: Self, model_registry_operator_pod: Pod): |
101 | 102 | assert validate_model_catalog_enabled(pod=model_registry_operator_pod) |
102 | 103 |
|
| 104 | + def test_model_catalog_uses_postgres(self: Self, admin_client: DynamicClient, model_registry_namespace: str): |
| 105 | + """ |
| 106 | + Validate that model catalog pod is using PostgreSQL database |
| 107 | + """ |
| 108 | + model_catalog_pods = get_model_catalog_pod( |
| 109 | + client=admin_client, |
| 110 | + model_registry_namespace=model_registry_namespace, |
| 111 | + label_selector="app.kubernetes.io/name=model-catalog", |
| 112 | + ) |
| 113 | + assert len(model_catalog_pods) == 1 |
| 114 | + model_catalog_pod = model_catalog_pods[0] |
| 115 | + model_catalog_pod_log = model_catalog_pod.log(container=CATALOG_CONTAINER) |
| 116 | + assert "Successfully connected to PostgreSQL database" in model_catalog_pod_log |
| 117 | + |
103 | 118 |
|
104 | 119 | @pytest.mark.parametrize( |
105 | 120 | "user_token_for_api_calls,", |
|
0 commit comments