|
|
@ -25,7 +25,7 @@ for ((i = 0; i < total_count; i++)); do
|
|
|
|
ext="$RANDOM"
|
|
|
|
ext="$RANDOM"
|
|
|
|
|
|
|
|
|
|
|
|
# Small
|
|
|
|
# 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)"
|
|
|
|
pixel_differences="$(compare -identify -metric AE "result_${ext}_small.png" expected_result_small.png null: 2>&1 > /dev/null)"
|
|
|
|
echo "Pixel Differences: $pixel_differences"
|
|
|
|
echo "Pixel Differences: $pixel_differences"
|
|
|
|
if [[ "$pixel_differences" != "0" ]]; then
|
|
|
|
if [[ "$pixel_differences" != "0" ]]; then
|
|
|
@ -34,11 +34,11 @@ for ((i = 0; i < total_count; i++)); do
|
|
|
|
exit 1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "curl failed with $?"
|
|
|
|
echo "curl failed with ${?}. See man curl for meaning."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Medium
|
|
|
|
# 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)"
|
|
|
|
pixel_differences="$(compare -identify -metric AE "result_${ext}_medium.png" expected_result_medium.png null: 2>&1 > /dev/null)"
|
|
|
|
echo "Pixel Differences: $pixel_differences"
|
|
|
|
echo "Pixel Differences: $pixel_differences"
|
|
|
|
if [[ "$pixel_differences" != "0" ]]; then
|
|
|
|
if [[ "$pixel_differences" != "0" ]]; then
|
|
|
@ -47,11 +47,11 @@ for ((i = 0; i < total_count; i++)); do
|
|
|
|
exit 1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "curl failed with $?"
|
|
|
|
echo "curl failed with ${?}. See man curl for meaning."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Large
|
|
|
|
# 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)"
|
|
|
|
pixel_differences="$(compare -identify -metric AE "result_${ext}_large.png" expected_result_large.png null: 2>&1 > /dev/null)"
|
|
|
|
echo "Pixel Differences: $pixel_differences"
|
|
|
|
echo "Pixel Differences: $pixel_differences"
|
|
|
|
if [[ "$pixel_differences" != "0" ]]; then
|
|
|
|
if [[ "$pixel_differences" != "0" ]]; then
|
|
|
@ -60,7 +60,7 @@ for ((i = 0; i < total_count; i++)); do
|
|
|
|
exit 1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "curl failed with $?"
|
|
|
|
echo "curl failed with ${?}. See man curl for meaning."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
success_count=$((success_count + 1))
|
|
|
|
success_count=$((success_count + 1))
|
|
|
|