From 22dab2795ae1b0deae89d0676598f3ce10df3f87 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 15 Jun 2025 22:26:24 +1200 Subject: [PATCH] 'Generic Commit' --- testing/test.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/testing/test.sh b/testing/test.sh index deeac9b..44161bf 100755 --- a/testing/test.sh +++ b/testing/test.sh @@ -481,12 +481,18 @@ if echo "${RESPONSE}" | jq -r '.error' | grep -q "Too many authentication attemp die "Expected no rate limit error, got: ${RESPONSE}" fi -# delete the object -TODELHASH=$(curl -s "${HOSTURL}/hash/test:latest" | jq -r '.hash') -echo "deleting test:latest ${TODELHASH}" +curl -s "${HOSTURL}/meta/${HASH}" | jq -if ! curl -s -H "Authorization: Bearer ${WRITE_TOKEN}" "${HOSTURL}/deleteobject?hash=${TODELHASH}" | jq -r '.result' | grep -q 'success'; then - die "failed to delete ${TODELHASH}" +# delete the object (only if it exists) +TODELHASH=$(curl -s "${HOSTURL}/hash/test:form_updated" | jq -r '.hash') +if [ "${TODELHASH}" != "null" ] && [ -n "${TODELHASH}" ]; then + echo "deleting test:form_updated ${TODELHASH}" + if ! curl -s -H "Authorization: Bearer ${WRITE_TOKEN}" "${HOSTURL}/deleteobject?hash=${TODELHASH}" | jq -r '.result' | grep -q 'success'; then + die "failed to delete ${TODELHASH}" + fi +else + echo "test:form_updated not found, skipping deletion" + echo "HASH=${HASH}, TODELHASH=${TODELHASH}" fi #------------------------------------------------------------------------------------------------