From: Paul Cuzner Date: Tue, 22 Dec 2020 21:40:41 +0000 (+1300) Subject: cephadm: update QA tests to include cephadm-exporter X-Git-Tag: v16.1.0~123^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bd8036a9006d46903bed990029a961510a865bca;p=ceph.git cephadm: update QA tests to include cephadm-exporter Test updated to include deployment of a cluster with cephadm-exporter active. Tests include varifying config (token), the state of it's threads are all active and a check that the placement pattern is for all hosts Signed-off-by: Paul Cuzner --- diff --git a/qa/workunits/cephadm/test_cephadm.sh b/qa/workunits/cephadm/test_cephadm.sh index e5100d8cc9a8..a02986567f46 100755 --- a/qa/workunits/cephadm/test_cephadm.sh +++ b/qa/workunits/cephadm/test_cephadm.sh @@ -216,7 +216,8 @@ $CEPHADM bootstrap \ --output-pub-ssh-key $TMPDIR/ceph.pub \ --allow-overwrite \ --skip-mon-network \ - --skip-monitoring-stack + --skip-monitoring-stack \ + --with-exporter test -e $CONFIG test -e $KEYRING rm -f $ORIG_CONFIG @@ -389,6 +390,20 @@ is_available "alertmanager.yml" "$cond" 10 cond="curl 'http://localhost:9093' | grep -q 'Alertmanager'" is_available "alertmanager" "$cond" 10 +# Fetch the token we need to access the exporter API +token=$($CEPHADM shell --fsid $FSID --config $CONFIG --keyring $KEYRING ceph cephadm get-exporter-config | jq -r '.token') +[[ ! -z "$token" ]] + +# check all exporter threads active +cond="curl -k -s -H \"Authorization: Bearer $token\" \ + https://localhost:9443/v1/metadata/health | \ + jq -r '.tasks | select(.disks == \"active\" and .daemons == \"active\" and .host == \"active\")'" +is_available "exporter_threads_active" "$cond" 3 + +# check we deployed for all hosts +host_pattern=$($CEPHADM shell --fsid $FSID --config $CONFIG --keyring $KEYRING ceph orch ls cephadm-exporter --format json | jq -r '.[0].placement.host_pattern') +[[ "$host_pattern" = "*" ]] + ## run # WRITE ME