From 793696fd9a8ca77c30d2b30caa57b85164e4b9a6 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 27 May 2016 16:49:19 -0400 Subject: [PATCH] Log info about K8S environment Change-Id: Ic01f41f121b9d2c15a70281d90b3726b9292878a --- k8sclient/tests/test_k8sclient.py | 2 +- tools/kube-init.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/k8sclient/tests/test_k8sclient.py b/k8sclient/tests/test_k8sclient.py index 79ce486..72affe6 100644 --- a/k8sclient/tests/test_k8sclient.py +++ b/k8sclient/tests/test_k8sclient.py @@ -48,7 +48,7 @@ class TestK8sclient(base.TestCase): api = apiv_api.ApivApi(client) endpoints = api.list_endpoints() - self.assertEquals(1, len(endpoints.items)) + self.assertTrue(len(endpoints.items) > 0) @unittest.skipUnless( _is_k8s_running(), "Kubernetes is not available") diff --git a/tools/kube-init.sh b/tools/kube-init.sh index 6184c33..6fc5502 100755 --- a/tools/kube-init.sh +++ b/tools/kube-init.sh @@ -79,6 +79,31 @@ echo "SUCCESS" echo "Cluster created!" echo "" +echo "Dump Kubernetes Objects..." +./kubectl -s=http://127.0.0.1:8080 get componentstatuses +./kubectl -s=http://127.0.0.1:8080 get configmaps +./kubectl -s=http://127.0.0.1:8080 get daemonsets +./kubectl -s=http://127.0.0.1:8080 get deployments +./kubectl -s=http://127.0.0.1:8080 get events +./kubectl -s=http://127.0.0.1:8080 get endpoints +./kubectl -s=http://127.0.0.1:8080 get horizontalpodautoscalers +./kubectl -s=http://127.0.0.1:8080 get ingress +./kubectl -s=http://127.0.0.1:8080 get jobs +./kubectl -s=http://127.0.0.1:8080 get limitranges +./kubectl -s=http://127.0.0.1:8080 get nodes +./kubectl -s=http://127.0.0.1:8080 get namespaces +./kubectl -s=http://127.0.0.1:8080 get pods +./kubectl -s=http://127.0.0.1:8080 get persistentvolumes +./kubectl -s=http://127.0.0.1:8080 get persistentvolumeclaims +./kubectl -s=http://127.0.0.1:8080 get quota +./kubectl -s=http://127.0.0.1:8080 get resourcequotas +./kubectl -s=http://127.0.0.1:8080 get replicasets +./kubectl -s=http://127.0.0.1:8080 get replicationcontrollers +./kubectl -s=http://127.0.0.1:8080 get secrets +./kubectl -s=http://127.0.0.1:8080 get serviceaccounts +./kubectl -s=http://127.0.0.1:8080 get services + + echo "Running tests..." set -x -e # Yield execution to venv command