test: Do not fail imageresize on curl non 0 exit status

main
Sean McBride 4 years ago
parent 5f2804939c
commit 69c82ead61

@ -25,7 +25,7 @@ for ((i = 0; i < total_count; i++)); do
ext="$RANDOM"
# Small
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_small.jpg" --output "result_${ext}_small.png" localhost:10000; then
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_small.jpg" --output "result_${ext}_small.png" localhost:10000 2> /dev/null 1> /dev/null; then
pixel_differences="$(compare -identify -metric AE "result_${ext}_small.png" expected_result_small.png null: 2>&1 > /dev/null)"
echo "Pixel Differences: $pixel_differences"
if [[ "$pixel_differences" != "0" ]]; then
@ -34,11 +34,11 @@ for ((i = 0; i < total_count; i++)); do
exit 1
fi
else
echo "curl failed with $?"
echo "curl failed with ${?}. See man curl for meaning."
fi
# Medium
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_medium.jpg" --output "result_${ext}_medium.png" localhost:10001; then
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_medium.jpg" --output "result_${ext}_medium.png" localhost:10001 2> /dev/null 1> /dev/null; then
pixel_differences="$(compare -identify -metric AE "result_${ext}_medium.png" expected_result_medium.png null: 2>&1 > /dev/null)"
echo "Pixel Differences: $pixel_differences"
if [[ "$pixel_differences" != "0" ]]; then
@ -47,11 +47,11 @@ for ((i = 0; i < total_count; i++)); do
exit 1
fi
else
echo "curl failed with $?"
echo "curl failed with ${?}. See man curl for meaning."
fi
# Large
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_large.jpg" --output "result_${ext}_large.png" localhost:10002; then
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_large.jpg" --output "result_${ext}_large.png" localhost:10002 2> /dev/null 1> /dev/null; then
pixel_differences="$(compare -identify -metric AE "result_${ext}_large.png" expected_result_large.png null: 2>&1 > /dev/null)"
echo "Pixel Differences: $pixel_differences"
if [[ "$pixel_differences" != "0" ]]; then
@ -60,7 +60,7 @@ for ((i = 0; i < total_count; i++)); do
exit 1
fi
else
echo "curl failed with $?"
echo "curl failed with ${?}. See man curl for meaning."
fi
success_count=$((success_count + 1))

@ -16,7 +16,7 @@ fi
if [ "$1" != "-d" ]; then
PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" &
sleep 2
sleep 3
else
echo "Running under gdb"
fi
@ -27,16 +27,20 @@ total_count=10
for ((i = 0; i < total_count; i++)); do
echo "$i"
ext="$RANDOM"
curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@flower.jpg" --output "result_$ext.png" localhost:10000 2> /dev/null 1> /dev/null || exit 1
pixel_differences="$(compare -identify -metric AE "result_$ext.png" expected_result.png null: 2>&1 > /dev/null)"
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@flower.jpg" --output "result_$ext.png" localhost:10000 2> /dev/null 1> /dev/null; then
if [[ "$pixel_differences" == "0" ]]; then
success_count=$((success_count + 1))
pixel_differences="$(compare -identify -metric AE "result_$ext.png" expected_result.png null: 2>&1 > /dev/null)"
if [[ "$pixel_differences" == "0" ]]; then
success_count=$((success_count + 1))
else
echo "FAIL"
echo "$pixel_differences pixel differences detected"
exit 1
fi
else
echo "FAIL"
echo "$pixel_differences pixel differences detected"
exit 1
echo "curl failed with ${?}. See man curl for meaning."
fi
done

Loading…
Cancel
Save