]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/workunits: add new collections to telemetry upgrade workunits (reef)
authorLaura Flores <lflores@ibm.com>
Thu, 5 Dec 2024 22:46:19 +0000 (22:46 +0000)
committerLaura Flores <lflores@ibm.com>
Fri, 17 Jan 2025 22:46:38 +0000 (16:46 -0600)
This commit changes the workunit that tests the upgrade path from
reef to x.

The logic to verify collections is now much more robust. Previously,
the test relied on developers to make it aware of any new collections
it needed to verify. Now, I have added logic to check that the # of
known collections matches the # of reported collections. If it does not,
the test errors out, which will force developers to add any new
collections to the upgrade test along with adding it to the telemetry
code.

The test also verifies all collections instead of focusing only on new
collections that were added after the base collections.

Signed-off-by: Laura Flores <lflores@ibm.com>
qa/workunits/test_telemetry_reef.sh
qa/workunits/test_telemetry_reef_x.sh

index e8b07ec13032ff4453d9b34d44154b3fd1a99566..d0d24c97ffaae658c57dd26b15eecedcb7c8f1b6 100755 (executable)
@@ -1,44 +1,52 @@
 #!/bin/bash -ex
 
-# Set up ident details for cluster
-ceph config set mgr mgr/telemetry/channel_ident true
-ceph config set mgr mgr/telemetry/organization 'ceph-qa'
-ceph config set mgr mgr/telemetry/description 'upgrade test cluster'
+# Opt in to new collections right away to avoid "TELEMETRY_CHANGED"
+# warning (see https://tracker.ceph.com/issues/64458)
+ceph telemetry on --license sharing-1-0
 
+# The last_opt_revision remains at 1 since last_opt_revision
+# was phased out for fresh installs of quincy.
+LAST_OPT_REVISION=$(ceph config get mgr mgr/telemetry/last_opt_revision)
+if [ $LAST_OPT_REVISION -ne 1 ]; then
+    echo "last_opt_revision is incorrect"
+    exit 1
+fi
 
-#Run preview commands
-ceph telemetry preview
-ceph telemetry preview-device
-ceph telemetry preview-all
+# Check the warning:
+ceph -s
+
+# Verify collections
+REPORTED_COLLECTIONS=$(ceph telemetry collection ls)
+NUM_REPORTED_COLLECTIONS=$(echo "$REPORTED_COLLECTIONS" | awk '/^NAME/ {flag=1; next} flag' | wc -l)
+KNOWN_COLLECTIONS=("basic_base" "basic_mds_metadata" "basic_pool_options_bluestore"
+                   "basic_pool_usage" "basic_rook_v01" "basic_usage_by_class" "crash_base"
+                  "device_base" "ident_base" "perf_memory_metrics" "perf_perf")
+
+if ! [[ $NUM_REPORTED_COLLECTIONS == "${#KNOWN_COLLECTIONS[@]}" ]];
+then
+    echo "Number of reported collections ($NUM_REPORTED_COLLECTIONS) does not match KNOWN_COLLECTIONS ("${#KNOWN_COLLECTIONS[@]}")."
+    exit 1
+fi
 
-# Assert that new collections are available
-COLLECTIONS=$(ceph telemetry collection ls)
-NEW_COLLECTIONS=("perf_perf" "basic_mds_metadata" "basic_pool_usage" "basic_rook_v01" "perf_memory_metrics")
-for col in ${NEW_COLLECTIONS[@]}; do
-    if ! [[ $COLLECTIONS == *$col* ]];
+for col in ${KNOWN_COLLECTIONS[@]}; do
+    if ! [[ $REPORTED_COLLECTIONS == *$col* ]];
     then
         echo "COLLECTIONS does not contain" "'"$col"'."
        exit 1
     fi
 done
 
-# Opt-in
-ceph telemetry on --license sharing-1-0
-
-# Enable perf channel
-ceph telemetry enable channel perf
-
-# For quincy, the last_opt_revision remains at 1 since last_opt_revision
-# was phased out for fresh installs of quincy.
-LAST_OPT_REVISION=$(ceph config get mgr mgr/telemetry/last_opt_revision)
-if [ $LAST_OPT_REVISION -ne 1 ]; then
-    echo "last_opt_revision is incorrect"
-    exit 1
-fi
+#Run preview commands
+ceph telemetry preview
+ceph telemetry preview-device
+ceph telemetry preview-all
 
 # Run show commands
 ceph telemetry show
 ceph telemetry show-device
-ceph telemetry show-all
+ceph telemetry show
+
+# Opt out
+ceph telemetry off
 
 echo OK
index ced20aea2e499f2f881eb668363912207724883c..d617fb169cdc471ec76fca9daf15d4a5428bf531 100755 (executable)
@@ -15,10 +15,21 @@ fi
 # Check the warning:
 ceph -s
 
-COLLECTIONS=$(ceph telemetry collection ls)
-NEW_COLLECTIONS=("perf_perf" "basic_mds_metadata" "basic_pool_usage" "basic_rook_v01" "perf_memory_metrics" "basic_pool_flags")
-for col in ${NEW_COLLECTIONS[@]}; do
-    if ! [[ $COLLECTIONS == *$col* ]];
+# Verify collections
+REPORTED_COLLECTIONS=$(ceph telemetry collection ls)
+NUM_REPORTED_COLLECTIONS=$(echo "$REPORTED_COLLECTIONS" | awk '/^NAME/ {flag=1; next} flag' | wc -l)
+KNOWN_COLLECTIONS=("basic_base" "basic_mds_metadata" "basic_pool_flags" "basic_pool_options_bluestore"
+                  "basic_pool_usage" "basic_rook_v01" "basic_usage_by_class" "crash_base" "device_base"
+                  "ident_base" "perf_memory_metrics" "perf_perf")
+
+if ! [[ $NUM_REPORTED_COLLECTIONS == "${#KNOWN_COLLECTIONS[@]}" ]];
+then
+    echo "Number of reported collections ($NUM_REPORTED_COLLECTIONS) does not match KNOWN_COLLECTIONS ("${#KNOWN_COLLECTIONS[@]}")."
+    exit 1
+fi
+
+for col in ${KNOWN_COLLECTIONS[@]}; do
+    if ! [[ $REPORTED_COLLECTIONS == *$col* ]];
     then
         echo "COLLECTIONS does not contain" "'"$col"'."
        exit 1