Last active
May 26, 2019 22:14
-
-
Save rnrbarbosa/4f8faf7054ad7f9973d7e55803298b0e 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
from pytest import fixture | |
from kubernetes import client, config | |
@pytest.fixture | |
def pods(): | |
config.load_kube_config() | |
v1 = client.CoreV1Api() | |
pods = v1.list_pod_for_all_namespaces(watch=False) | |
return pods |
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
minikube start --extra-config=apiserver.runtime-config=settings.k8s.io/v1alpha1=true |
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
import pytest | |
def test_pods(pods): | |
for p in pods.items: | |
print(p.metadata.name) | |
assert p.status.phase in ['Running','Completed'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment