mirror of
https://github.com/versity/versitygw.git
synced 2026-08-21 14:46:19 +00:00
test: ListObjectsV2 REST capability, initial multi-page testing
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
check_xml_element() {
|
||||
if [ $# -lt 3 ]; then
|
||||
log 2 "'check_xml_element' requires data source, expected value, XML tree"
|
||||
return 1
|
||||
fi
|
||||
local xpath='//'
|
||||
for tree_val in "${@:3}"; do
|
||||
xpath+='*[local-name()="'$tree_val'"]/'
|
||||
done
|
||||
xpath+='text()'
|
||||
if ! xml_val=$(xmllint --xpath "$xpath" "$1" 2>&1); then
|
||||
log 2 "error getting XML value matching $xpath: $xml_val"
|
||||
return 1
|
||||
fi
|
||||
if [ "$2" != "$xml_val" ]; then
|
||||
log 2 "XML data mismatch, expected '$2', actual '$xml_val'"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
Reference in New Issue
Block a user