Created
June 23, 2018 16:11
-
-
Save samirbehara-zz/8b09a362ee843ee24bdf971607dcc9d7 to your computer and use it in GitHub Desktop.
This file contains 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
def test_kubernetes_pod_status_is_running(k8s_client): | |
podlist = k8s_client.list_namespaced_pod("default") | |
# Iterate through all the pods in the default namespace and verify that they are Running | |
for item in podlist.items: | |
pod = k8s_client.read_namespaced_pod_status(namespace='default', name=item.metadata.name) | |
print("%s\t%s\t" % (item.metadata.name, item.metadata.namespace)) | |
print(pod.status.phase) | |
assert(pod.status.phase == "Running" ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment