chore(test): fix deprecated call or syntax

This commit is contained in:
Edouard Vanbelle
2026-06-11 03:06:47 +02:00
parent 595273277b
commit 140cbb440e
9 changed files with 24 additions and 24 deletions
+1 -1
View File
@@ -365,7 +365,7 @@ Authorization: Bearer {{henry_token}}
HTTP 200
[Asserts]
jsonpath "$.items[?(@.resource.id=='{{perm_folder_id}}')].resource_type" == "folder"
jsonpath "$.items[?(@.resource.id=='{{perm_folder_id}}')].permissions" includes "read"
jsonpath "$.items[?(@.resource.id=='{{perm_folder_id}}')].permissions" contains "read"
# ── Mutations still denied (Viewer has no Update/Create/Delete) ─
POST {{base_url}}/api/folders
+2 -2
View File
@@ -12,7 +12,7 @@
# 6 wrong attempts from spoofed X-Forwarded-For: IP1
# lock (admin, IP1), but the SAME correct credential
# from spoofed X-Forwarded-For: IP2 still succeeds.
# Depends on OXICLOUD_TRUST_PROXY_HEADERS=true in
# Depends on OXICLOUD_TRUST_PROXY_CIDR=0.0.0.0/0 in
# tests/common/server.env so the server honours the
# X-Forwarded-For header on localhost.
#
@@ -191,7 +191,7 @@ header "WWW-Authenticate" contains "Basic"
# (admin, 10.0.0.2 — released by the success), neither of
# which any other test touches.
#
# Requires: OXICLOUD_TRUST_PROXY_HEADERS=true in
# Requires: OXICLOUD_TRUST_PROXY_CIDR=0.0.0.0/0 in
# tests/common/server.env.
# ─────────────────────────────────────────────────────────────
+1 -1
View File
@@ -60,4 +60,4 @@ OXICLOUD_MAGIC_LINK_SEND_PER_EMAIL_PER_HOUR=2
OXICLOUD_MAGIC_LINK_SEND_PER_IP_PER_HOUR=50
# permits IP spoofing for tests
OXICLOUD_TRUST_PROXY_HEADERS=true
OXICLOUD_TRUST_PROXY_CIDR=0.0.0.0/0
+2 -2
View File
@@ -43,8 +43,8 @@ dedup_check() { curl -s -H "Authorization: Bearer $TOKEN" "$base_url/api/dedup/c
purge_from_trash() {
local name="$1"
local tid
tid=$(rest_get "/api/trash" \
| jq -r --arg n "$name" 'first(.[] | select(.name == $n) | .id) // empty')
tid=$(rest_get "/api/trash/resources" \
| jq -r --arg n "$name" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty')
[[ -n "$tid" ]] && rest_delete "/api/trash/$tid" > /dev/null || true
}
+6 -6
View File
@@ -73,8 +73,8 @@ dedup_check() { curl -s -H "Authorization: Bearer $TOKEN" "$base_url/api/dedup/c
purge_from_trash() {
local name="$1"
local tid
tid=$(rest_get "/api/trash" \
| jq -r --arg n "$name" 'first(.[] | select(.name == $n) | .id) // empty')
tid=$(rest_get "/api/trash/resources" \
| jq -r --arg n "$name" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty')
[[ -n "$tid" ]] && rest_delete "/api/trash/$tid" > /dev/null || true
}
@@ -179,8 +179,8 @@ echo " step 4: trash + permanently delete $FILE_A..."
ST=$(rest_delete "/api/files/$FILE_A_ID")
[[ "$ST" == "204" ]] || fail "DELETE $FILE_A expected 204, got $ST"
TRASH_A=$(rest_get "/api/trash" \
| jq -r --arg n "$FILE_A" 'first(.[] | select(.name == $n) | .id) // empty')
TRASH_A=$(rest_get "/api/trash/resources" \
| jq -r --arg n "$FILE_A" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty')
[[ -n "$TRASH_A" ]] || fail "File A not found in trash"
ST=$(rest_delete "/api/trash/$TRASH_A")
[[ "$ST" == "200" ]] || fail "Permanent delete file A expected 200, got $ST"
@@ -206,8 +206,8 @@ echo " step 6: trash + permanently delete $FILE_B..."
ST=$(rest_delete "/api/files/$FILE_B_ID")
[[ "$ST" == "204" ]] || fail "DELETE $FILE_B expected 204, got $ST"
TRASH_B=$(rest_get "/api/trash" \
| jq -r --arg n "$FILE_B" 'first(.[] | select(.name == $n) | .id) // empty')
TRASH_B=$(rest_get "/api/trash/resources" \
| jq -r --arg n "$FILE_B" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty')
[[ -n "$TRASH_B" ]] || fail "File B not found in trash"
ST=$(rest_delete "/api/trash/$TRASH_B")
[[ "$ST" == "200" ]] || fail "Permanent delete file B expected 200, got $ST"
+4 -4
View File
@@ -113,8 +113,8 @@ for REMOTE in "$FILE_A" "$FILE_B"; do
echo " cleanup: deleting existing $REMOTE (id=$EXISTING_ID)"
rest_delete "/api/files/$EXISTING_ID" > /dev/null
fi
STALE=$(rest_get "/api/trash" \
| jq -r --arg n "$REMOTE" 'first(.[] | select(.name == $n) | .id) // empty')
STALE=$(rest_get "/api/trash/resources" \
| jq -r --arg n "$REMOTE" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty')
if [[ -n "$STALE" ]]; then
echo " cleanup: purging $REMOTE from trash (id=$STALE)"
rest_delete "/api/trash/$STALE" > /dev/null
@@ -221,8 +221,8 @@ echo " cleanup..."
for REMOTE in "$FILE_A" "$FILE_B"; do
ST=$(webdav_delete "$REMOTE")
[[ "$ST" == "204" ]] || fail "WebDAV DELETE $REMOTE expected 204, got $ST"
TRASH_ITEM=$(rest_get "/api/trash" \
| jq -r --arg n "$REMOTE" 'first(.[] | select(.name == $n) | .id) // empty')
TRASH_ITEM=$(rest_get "/api/trash/resources" \
| jq -r --arg n "$REMOTE" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty')
if [[ -n "$TRASH_ITEM" ]]; then
rest_delete "/api/trash/$TRASH_ITEM" > /dev/null
fi
@@ -51,8 +51,8 @@ rest_delete() { curl -s -o /dev/null -w "%{http_code}" -X DELETE -H "Authorizati
purge_from_trash() {
local name="$1"
local tid
tid=$(rest_get "/api/trash" \
| jq -r --arg n "$name" 'first(.[] | select(.name == $n) | .id) // empty')
tid=$(rest_get "/api/trash/resources" \
| jq -r --arg n "$name" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty')
[[ -n "$tid" ]] && rest_delete "/api/trash/$tid" > /dev/null || true
}
+2 -2
View File
@@ -49,8 +49,8 @@ rest_delete() { curl -s -o /dev/null -w "%{http_code}" -X DELETE -H "Authorizati
purge_from_trash() {
local name="$1"
local tid
tid=$(rest_get "/api/trash" \
| jq -r --arg n "$name" 'first(.[] | select(.name == $n) | .id) // empty')
tid=$(rest_get "/api/trash/resources" \
| jq -r --arg n "$name" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty')
[[ -n "$tid" ]] && rest_delete "/api/trash/$tid" > /dev/null || true
}
+4 -4
View File
@@ -132,8 +132,8 @@ else
fi
echo " cleanup: checking trash for '$REMOTE'..."
STALE=$(rest_get "/api/trash" \
| jq -r --arg n "$REMOTE" 'first(.[] | select(.name == $n) | .id) // empty')
STALE=$(rest_get "/api/trash/resources" \
| jq -r --arg n "$REMOTE" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty')
if [[ -n "$STALE" ]]; then
echo " cleanup: found trash item id=$STALE — purging..."
ST=$(rest_delete "/api/trash/$STALE")
@@ -221,8 +221,8 @@ echo " cleanup: WebDAV DELETE → $STATUS"
[[ "$STATUS" == "204" ]] || fail "WebDAV DELETE expected 204, got $STATUS"
pass "WebDAV DELETE → 204"
TRASH_ITEM=$(rest_get "/api/trash" \
| jq -r --arg n "$REMOTE" '.[] | select(.name == $n) | .id // empty')
TRASH_ITEM=$(rest_get "/api/trash/resources" \
| jq -r --arg n "$REMOTE" 'first(.items[] | select(.resource.name == $n) | .resource.id) // empty')
if [[ -n "$TRASH_ITEM" ]]; then
ST=$(rest_delete "/api/trash/$TRASH_ITEM")
echo " cleanup: DELETE /api/trash/$TRASH_ITEM → $ST"