Created
September 9, 2025 16:56
-
-
Save ngotzmann/c49c3cbcbc7cc87e5efd064aa7e6828a to your computer and use it in GitHub Desktop.
RobotFramework Kubernetes Pods Test
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
| *** Settings *** | |
| Library KubeLibrary | |
| Library Collections | |
| Variables config.yml | |
| *** Test Cases *** | |
| Check Kubernetes Clusters Healthy | |
| Check Health of K8S | |
| Check Pods Running | |
| Check Pod Existence And Health | |
| *** Keywords *** | |
| Check Health of K8S | |
| FOR ${cluster} IN @{kubernetes_cluster} | |
| Reload Kubeconfig ${cluster} | |
| Get Healthcheck | |
| ${healthy_nodes}= Get Healthy Nodes Count | |
| Should Be Equal ${healthy_nodes} ${cluster.number_of_nodes} | |
| END | |
| Reload Kubeconfig | |
| [Arguments] ${cluster} | |
| Reload Config ${cluster['kubeconfig']} | |
| Check Pod Existence And Health | |
| FOR ${cluster} IN @{kubernetes_cluster} | |
| Reload Kubeconfig ${cluster} | |
| FOR ${expected_pod} IN @{cluster['pods']} | |
| ${running_pods}= List Namespaced Pod By Pattern ${expected_pod['name_pattern']} ${expected_pod['namespace']} | |
| Length Should Be ${running_pods} ${expected_pod['required']} | |
| FOR ${single_running_pod} IN @{running_pods} | |
| ${status}= Read Namespaced Pod Status ${single_running_pod.metadata.name} ${single_running_pod.metadata.namespace} | |
| Should Be True '${status.phase}'=='Running' | |
| END | |
| END | |
| END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment