]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: update QA tests to include cephadm-exporter 38681/head
authorPaul Cuzner <pcuzner@redhat.com>
Tue, 22 Dec 2020 21:40:41 +0000 (10:40 +1300)
committerPaul Cuzner <pcuzner@redhat.com>
Tue, 22 Dec 2020 23:24:52 +0000 (12:24 +1300)
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 <pcuzner@redhat.com>
qa/workunits/cephadm/test_cephadm.sh

index e5100d8cc9a8f803606e973d8cc73446360fdee7..a02986567f461736b4fc90c036fd00a5f3f9fc4e 100755 (executable)
@@ -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