Conversation
04d63da to
41f4721
Compare
0d25058 to
35e2399
Compare
| bucket_list=$(xmllint --xpath '//*[local-name()="Bucket"]/*[local-name()="Name"]/text()' "$1") | ||
| local response | ||
| if ! response=$(xmllint --xpath '//*[local-name()="Bucket"]/*[local-name()="Name"]/text()' "$1" 2>&1); then | ||
| if [[ "$response" == *"XPath set is empty" ]]; then |
There was a problem hiding this comment.
xmllint often appends a newline or specific formatting to its error messages. Using a wildcard at the beginning of the check—or checking the exit status directly—makes it more bulletproof
if [[ "$response" == *"XPath set is empty"* ]]; then
|
|
||
| local response error | ||
| if ! response=$(check_count_and_keys "$1" "$3" "${@:5}" 2>&1); then | ||
| log 2 "error checking count and keys: $xml_file" |
There was a problem hiding this comment.
xml_file hasn't been defined here, it happens after this if block.
|
|
||
| xml_data="$response" | ||
| if ! check_if_element_exists "$xml_data" "$2" "ListBucketResult" "StartAfter"; then | ||
| log 2 "error checking if element '$key' exists" |
There was a problem hiding this comment.
key isn't defined here, probably mean $2?
| } | ||
|
|
||
| list_objects_delimiter() { | ||
| run assert_param_count "ListObjects version" 1 $# |
There was a problem hiding this comment.
this is all using run/assert - but that should be done at the test level, not in the helpers.
There was a problem hiding this comment.
It's a common call for two tests with just a version change, can move it though
tests/drivers/rest.sh
Outdated
| fi | ||
| status_line_idx=1 | ||
| status_code="" | ||
| continue_count=0 |
tests/drivers/xml.sh
Outdated
| return 1 | ||
| fi | ||
| if check_if_element_exists "$1" "$2" "${@:3}"; then | ||
| log 2 "element '$2' should not exist in data (data: $(cat "$1"))" |
There was a problem hiding this comment.
Just a risk here is the file is really big this log line could be really bloated.
9d1f4c7 to
a53e9a1
Compare
a53e9a1 to
1632c8c
Compare
No description provided.