]> git.proxmox.com Git - ceph.git/blob - ceph/qa/workunits/test_telemetry_pacific_x.sh
bump version to 18.2.2-pve1
[ceph.git] / ceph / qa / workunits / test_telemetry_pacific_x.sh
1 #!/bin/bash -ex
2
3 # Assert that we're still opted in
4 LAST_OPT_REVISION=$(ceph config get mgr mgr/telemetry/last_opt_revision)
5 if [ $LAST_OPT_REVISION -ne 3 ]; then
6 echo "last_opt_revision is incorrect"
7 exit 1
8 fi
9
10 # Check the warning:
11 STATUS=$(ceph -s)
12 if ! [[ $STATUS == *"Telemetry requires re-opt-in"* ]]
13 then
14 echo "STATUS does not contain re-opt-in warning"
15 exit 1
16 fi
17
18 # Check new collections
19 COLLECTIONS=$(ceph telemetry collection ls)
20 NEW_COLLECTIONS=("perf_perf" "basic_mds_metadata" "basic_pool_usage" "basic_rook_v01" "perf_memory_metrics")
21 for col in ${NEW_COLLECTIONS[@]}; do
22 if ! [[ $COLLECTIONS == *$col* ]];
23 then
24 echo "COLLECTIONS does not contain" "'"$col"'."
25 exit 1
26 fi
27 done
28
29 # Run preview commands
30 ceph telemetry preview
31 ceph telemetry preview-device
32 ceph telemetry preview-all
33
34 # Opt in to new collections
35 ceph telemetry on --license sharing-1-0
36 ceph telemetry enable channel perf
37
38 # Check the warning:
39 timeout=60
40 STATUS=$(ceph -s)
41 until [[ $STATUS != *"Telemetry requires re-opt-in"* ]] || [ $timeout -le 0 ]; do
42 STATUS=$(ceph -s)
43 sleep 1
44 timeout=$(( timeout - 1 ))
45 done
46 if [ $timeout -le 0 ]; then
47 echo "STATUS should not contain re-opt-in warning at this point"
48 exit 1
49 fi
50
51 # Run show commands
52 ceph telemetry show
53 ceph telemetry show-device
54 ceph telemetry show
55
56 # Opt out
57 ceph telemetry off
58
59 echo OK