diff options
-rw-r--r-- | ansible/roles/kube-prometheus-stack/molecule/default/tests/test_default.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ansible/roles/kube-prometheus-stack/molecule/default/tests/test_default.py b/ansible/roles/kube-prometheus-stack/molecule/default/tests/test_default.py new file mode 100644 index 00000000..ad2d90c3 --- /dev/null +++ b/ansible/roles/kube-prometheus-stack/molecule/default/tests/test_default.py @@ -0,0 +1,32 @@ +import yaml + + +def test_prometheus_helm_package(host): + assert host.file('/opt/onap/downloads/' + 'kube-prometheus-stack-18.0.4.tgz').exists + + +def test_helm_values_file(host): + y = None + f = host.file('/opt/onap/kube_prometheus_values.yaml') + assert f.exists + assert f.is_file + try: + y = yaml.safe_load(f.content) + except yaml.YAMLError: + assert False + assert y['grafana']['adminPassword'] == 'grafana' + assert (y['grafana']['env']['GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH'] == + '/var/lib/grafana/dashboards/grafana_home.json') + assert (y['grafana']['persistence']['storageClassName'] == + 'kube-prometheus-grafana') + assert (y['prometheus']['prometheusSpec']['storageSpec'] + ['volumeClaimTemplate']['spec']['storageClassName'] == + 'kube-prometheus-prometheus') + + +def test_grafana_dashboards(host): + assert host.file('/nfs/kube-prometheus/kube-prometheus-grafana/' + 'dashboards/custom/grafana_dashboard.json').exists + assert host.file('/nfs/kube-prometheus/kube-prometheus-grafana/' + 'dashboards/grafana_home.json').exists |