*** Settings ***
Documentation     Integration tests for container infrastructure resource types.
...               Verifies all 7 container infra types are registered,
...               have correct parent/child relationships, and load from YAML.
Resource          ${CURDIR}/common.resource
Suite Setup       Setup Test Environment
Suite Teardown    Cleanup Test Environment

*** Variables ***
${HELPER}    ${CURDIR}/helper_resource_type_container_infra.py

*** Test Cases ***
All Container Infra Types In BUILTIN_TYPES
    [Documentation]    Verify all 7 container infra types in BUILTIN_TYPES
    [Tags]    container    registration    smoke
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    check-registration
    ...    timeout=60s    on_timeout=kill
    Should Be Equal As Integers    ${result.rc}    0
    ...    Registration check failed: ${result.stderr}
    Should Contain    ${result.stdout}    check-registration-ok

Container Instance Updated With Children
    [Documentation]    Verify container-instance has mount/exec-env/port children
    [Tags]    container    parent-child
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    check-instance-children
    ...    timeout=60s    on_timeout=kill
    Should Be Equal As Integers    ${result.rc}    0
    ...    Instance children check failed: ${result.stderr}
    Should Contain    ${result.stdout}    check-instance-children-ok

Container Runtime Hierarchy
    [Documentation]    Verify runtime -> image -> instance DAG hierarchy
    [Tags]    container    hierarchy
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    check-hierarchy
    ...    timeout=60s    on_timeout=kill
    Should Be Equal As Integers    ${result.rc}    0
    ...    Hierarchy check failed: ${result.stderr}
    Should Contain    ${result.stdout}    check-hierarchy-ok

Container YAML Schema Loading
    [Documentation]    Load all 7 container YAML configs and verify schema
    [Tags]    container    yaml    schema
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    check-yaml-loading
    ...    timeout=60s    on_timeout=kill
    Should Be Equal As Integers    ${result.rc}    0
    ...    YAML loading failed: ${result.stderr}
    Should Contain    ${result.stdout}    check-yaml-loading-ok
