diff --git a/operator/operator-robot-image/robot/tests/image_tests/image_tests.robot b/operator/operator-robot-image/robot/tests/image_tests/image_tests.robot index dfa476e..db6694d 100644 --- a/operator/operator-robot-image/robot/tests/image_tests/image_tests.robot +++ b/operator/operator-robot-image/robot/tests/image_tests/image_tests.robot @@ -6,6 +6,15 @@ Library String Library Collections Library PlatformLibrary managed_by_operator=%{RABBIT_IS_MANAGED_BY_OPERATOR} +*** Keywords *** +Get Image Tag + [Arguments] ${image} + ${parts}= Split String ${image} : + ${length}= Get Length ${parts} + Run Keyword If ${length} > 1 Return From Keyword ${parts[2]} + Run Keywords + ... Log To Console \n[ERROR] Image ${parts} has no tag: ${image}\nMonitored images list: ${MONITORED_IMAGES} + ... AND Fail Some images were not found, please check your .helpers template and description.yaml in the repository *** Test Cases *** Test Hardcoded Images @@ -13,7 +22,15 @@ Test Hardcoded Images ${stripped_resources}= Strip String ${MONITORED_IMAGES} characters=, mode=right @{list_resources} = Split String ${stripped_resources} , FOR ${resource} IN @{list_resources} - ${type} ${name} ${container_name} ${image}= Split String ${resource} + ${type} ${name} ${container_name} ${image}= Split String ${resource} ${resource_image}= Get Resource Image ${type} ${name} %{NAMESPACE} ${container_name} - Should Be Equal ${resource_image} ${image} - END \ No newline at end of file + + ${expected_tag}= Get Image Tag ${image} + ${actual_tag}= Get Image Tag ${resource_image} + + Log To Console \n[COMPARE] ${resource}: Expected tag = ${expected_tag}, Actual tag = ${actual_tag} + + Run Keyword And Continue On Failure Should Be Equal ${actual_tag} ${expected_tag} + + END +