From bc326f14d7b527f3b5e6e2531fbdc9add17bf9a8 Mon Sep 17 00:00:00 2001 From: Michal Ptacek Date: Wed, 5 Apr 2017 12:37:49 +0100 Subject: [PATCH] enables experimental collectd ci job - this change will enable testing of collectd-ceilometer-plugin in the upstream ci Change-Id: Ie9e5fc1316e3a4a76945100d977313e8b3540d44 Closes-Bug: #1675072 --- devstack/gate/devstackgaterc | 12 ++++++++++ devstack/gate/post_test_hook_bin.sh | 36 +++++++++++++++++++++++++++++ devstack/gate/post_test_hook_src.sh | 36 +++++++++++++++++++++++++++++ devstack/gate/pre_test_hook_bin.sh | 4 ++++ devstack/gate/pre_test_hook_src.sh | 4 ++++ 5 files changed, 92 insertions(+) create mode 100644 devstack/gate/devstackgaterc create mode 100644 devstack/gate/post_test_hook_bin.sh create mode 100644 devstack/gate/post_test_hook_src.sh create mode 100644 devstack/gate/pre_test_hook_bin.sh create mode 100644 devstack/gate/pre_test_hook_src.sh diff --git a/devstack/gate/devstackgaterc b/devstack/gate/devstackgaterc new file mode 100644 index 0000000..32a8ae3 --- /dev/null +++ b/devstack/gate/devstackgaterc @@ -0,0 +1,12 @@ +#!/bin/bash -xe + +export DEVSTACK_GATE_LIBVIRT_TYPE=kvm +export DEVSTACK_GATE_TEMPEST=0 +export DEVSTACK_LOCAL_CONFIG=' +COLLECTD_INSTALL=True +COLLECTD_CEILOMETER_VERBOSE=True +COLLECTD_CEILOMETER_ENABLED=True +COLLECTD_GNOCCHI_ENABLED=True +CEILOMETER_BACKEND=mysql +GNOCCHI_USE_KEYSTONE=True +' diff --git a/devstack/gate/post_test_hook_bin.sh b/devstack/gate/post_test_hook_bin.sh new file mode 100644 index 0000000..5fb58b4 --- /dev/null +++ b/devstack/gate/post_test_hook_bin.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# we need to verify that db contains collectd metrics +# give it ~10 mins + +date +echo "Stacking is finished with all endpoints/services running" +echo "Need to restart collectd, which went into some wrong state" +echo "or ceilometer-collectd-plugin timeouts before establishing" +echo "connections to both gnocchi & ceilometer" +sudo service collectd status +sudo service collectd restart + +retry_count=1 +max_retry_count=20 +export PATH=/usr/sbin:$PATH +source /opt/stack/new/devstack/openrc admin + +while [ "$retry_count" -le "$max_retry_count" ]; do + if [ $(openstack metric metric list | grep interface | wc -l) -eq 0 ] || [ $(ceilometer meter-list -l 1000 | grep interface | wc -l) -eq 0 ]; then + echo "Testing metric interface not yet visible in db $retry_count/$max_retry_count" + else + echo "Testing metric obtained from db" + exit 0 + fi + let retry_count="$retry_count+1" + sleep 30 +done + +date +echo "[ERROR] Testing metric interface not visible in db!" +echo "Let's check collectd status:" +sudo service collectd status + +exit 1 + diff --git a/devstack/gate/post_test_hook_src.sh b/devstack/gate/post_test_hook_src.sh new file mode 100644 index 0000000..5fb58b4 --- /dev/null +++ b/devstack/gate/post_test_hook_src.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# we need to verify that db contains collectd metrics +# give it ~10 mins + +date +echo "Stacking is finished with all endpoints/services running" +echo "Need to restart collectd, which went into some wrong state" +echo "or ceilometer-collectd-plugin timeouts before establishing" +echo "connections to both gnocchi & ceilometer" +sudo service collectd status +sudo service collectd restart + +retry_count=1 +max_retry_count=20 +export PATH=/usr/sbin:$PATH +source /opt/stack/new/devstack/openrc admin + +while [ "$retry_count" -le "$max_retry_count" ]; do + if [ $(openstack metric metric list | grep interface | wc -l) -eq 0 ] || [ $(ceilometer meter-list -l 1000 | grep interface | wc -l) -eq 0 ]; then + echo "Testing metric interface not yet visible in db $retry_count/$max_retry_count" + else + echo "Testing metric obtained from db" + exit 0 + fi + let retry_count="$retry_count+1" + sleep 30 +done + +date +echo "[ERROR] Testing metric interface not visible in db!" +echo "Let's check collectd status:" +sudo service collectd status + +exit 1 + diff --git a/devstack/gate/pre_test_hook_bin.sh b/devstack/gate/pre_test_hook_bin.sh new file mode 100644 index 0000000..c9990a4 --- /dev/null +++ b/devstack/gate/pre_test_hook_bin.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo collectd-ceilometer-plugin pre-test-hook executed + diff --git a/devstack/gate/pre_test_hook_src.sh b/devstack/gate/pre_test_hook_src.sh new file mode 100644 index 0000000..c9990a4 --- /dev/null +++ b/devstack/gate/pre_test_hook_src.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo collectd-ceilometer-plugin pre-test-hook executed +