test: update resize to use jpg

master
Sean McBride 4 years ago
parent f9d6a22ac4
commit f477653893

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

@ -26,9 +26,9 @@ run_functional_tests() {
ext="$RANDOM"
# Small
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_small.jpg" --output "/tmp/result_${ext}_small.png" "${hostname}:10000" 2> /dev/null 1> /dev/null; then
pixel_differences="$(compare -identify -metric AE "/tmp/result_${ext}_small.png" expected_result_small.png null: 2>&1 > /dev/null)"
rm -f "/tmp/result_${ext}_small.png"
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_small.jpg" --output "/tmp/result_${ext}_small.jpg" "${hostname}:10000" 2> /dev/null 1> /dev/null; then
pixel_differences="$(compare -identify -metric AE "/tmp/result_${ext}_small.jpg" expected_result_small.jpg null: 2>&1 > /dev/null)"
rm -f "/tmp/result_${ext}_small.jpg"
if [[ "$pixel_differences" != "0" ]]; then
echo "Small FAIL" >> "$results_directory/result.txt"
echo "$pixel_differences pixel differences detected" >> "$results_directory/result.txt"
@ -40,9 +40,9 @@ run_functional_tests() {
fi
# Medium
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_medium.jpg" --output "/tmp/result_${ext}_medium.png" "${hostname}:10001" 2> /dev/null 1> /dev/null; then
pixel_differences="$(compare -identify -metric AE "/tmp/result_${ext}_medium.png" expected_result_medium.png null: 2>&1 > /dev/null)"
rm -f "/tmp/result_${ext}_medium.png"
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_medium.jpg" --output "/tmp/result_${ext}_medium.jpg" "${hostname}:10001" 2> /dev/null 1> /dev/null; then
pixel_differences="$(compare -identify -metric AE "/tmp/result_${ext}_medium.jpg" expected_result_medium.jpg null: 2>&1 > /dev/null)"
rm -f "/tmp/result_${ext}_medium.jpg"
if [[ "$pixel_differences" != "0" ]]; then
echo "Medium FAIL" >> "$results_directory/result.txt"
echo "$pixel_differences pixel differences detected" >> "$results_directory/result.txt"
@ -54,9 +54,9 @@ run_functional_tests() {
fi
# Large
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_large.jpg" --output "/tmp/result_${ext}_large.png" "${hostname}:10002" 2> /dev/null 1> /dev/null; then
pixel_differences="$(compare -identify -metric AE "/tmp/result_${ext}_large.png" expected_result_large.png null: 2>&1 > /dev/null)"
rm -f "/tmp/result_${ext}_large.png"
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@shrinking_man_large.jpg" --output "/tmp/result_${ext}_large.jpg" "${hostname}:10002" 2> /dev/null 1> /dev/null; then
pixel_differences="$(compare -identify -metric AE "/tmp/result_${ext}_large.jpg" expected_result_large.jpg null: 2>&1 > /dev/null)"
rm -f "/tmp/result_${ext}_large.jpg"
if [[ "$pixel_differences" != "0" ]]; then
echo "Large FAIL" >> "$results_directory/result.txt"
echo "$pixel_differences pixel differences detected" >> "$results_directory/result.txt"

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

@ -32,9 +32,9 @@ experiment_client() {
for ((i = 0; i < total_count; i++)); do
ext="$RANDOM"
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@flower.jpg" --output "$tmpfs_dir/result_$ext.png" "$hostname:10000" 2> /dev/null 1> /dev/null; then
if curl -H 'Expect:' -H "Content-Type: image/jpg" --data-binary "@flower.jpg" --output "$tmpfs_dir/result_$ext.jpg" "$hostname:10000" 2> /dev/null 1> /dev/null; then
pixel_differences="$(compare -identify -metric AE "$tmpfs_dir/result_$ext.png" expected_result.png null: 2>&1 > /dev/null)"
pixel_differences="$(compare -identify -metric AE "$tmpfs_dir/result_$ext.jpg" expected_result.jpg null: 2>&1 > /dev/null)"
if [[ "$pixel_differences" == "0" ]]; then
success_count=$((success_count + 1))

Loading…
Cancel
Save