redhat-cop / openshift-toolkit

A collection of code samples to help you get started with OpenShift
Apache License 2.0
232 stars 150 forks source link

Post install validation #71

Closed etsauer closed 5 years ago

etsauer commented 5 years ago

This addition attempts to answer the question, "how can I confirm that the cluster is in the architectural state I expect it to be in". I've put together a small set (to start) of test cases that can be run using the kubernetes Python client and pytest framework.

huddlesj commented 5 years ago

@etsauer: Need to add a couple entries to the requirements.txt

[root@master01 validation]# git diff
diff --git a/validation/requirements.txt b/validation/requirements.txt
index 807e21b..cb7411f 100644
--- a/validation/requirements.txt
+++ b/validation/requirements.txt
@@ -1 +1,3 @@
 kubernetes
+pytest
+jsonpath_ng
[root@master01 validation]#
etsauer commented 5 years ago

@sabre1041 agree, I think this thing could use some way to configure the tests. For now I would say this works as a "good example" to start from, and probably requires some reworking to fit a cluster in the wild. Do you think we should explore the configuration as part of this PR?

sabre1041 commented 5 years ago

@etsauer We can look into the addoption functionality.

https://docs.pytest.org/en/latest/example/simple.html

However, this would be an effort in a subsequent PR

huddlesj commented 5 years ago

Tested on a fresh environment this morning and script is working.

sabre1041 commented 5 years ago

Merging

@etsauer can you create an issue to track future enhancements that were called out in this PR?