update script test

This commit is contained in:
voltsrage
2026-06-18 15:12:12 +08:00
parent 7d630fbbd9
commit c0cd75856c
2 changed files with 300 additions and 0 deletions
+6
View File
@@ -109,6 +109,12 @@ echo ""
echo "[1/${TOTAL_STEPS}] Listing thresholds"
resp="$(request GET "${BASE_URL}/api/v1/alert-thresholds")"
assert_status "200" "${resp}"
threshold_count="$(jq -r '.data | length' "${resp}")"
if [[ "${threshold_count}" -lt 12 ]]; then
echo "Expected at least 12 alert thresholds, found ${threshold_count}."
exit 1
fi
echo "OK: ${threshold_count} threshold(s) configured"
threshold_id="$(jq -r '.data[] | select(.observationCode=="HEART_RATE") | .id' "${resp}" | head -n 1)"
if [[ -z "${threshold_id}" || "${threshold_id}" == "null" ]]; then
echo "Could not find HEART_RATE threshold id."