On 12/12/18 2:08 AM, PiBa-NL wrote:
Hi List,

Didn't have time yet to bisect when it went wrong. But attached testfile produces the following output after 3 curl requests at different speeds, this seems to trigger a problem as the hash of the downloaded content is nolonger the same as it should be, (in my actual environment its a 2MB javascript file that comes from a iis server behind haproxy.). Took already a few hours more than desired to come up with a seemingly reliable reproduction. 1.9-dev10 is the first one i put on my production environment as i think release is imminent so it 'should' be pretty stable ;), (yes i know..i shouldn't assume..) before it was using 1.8.14.. So was quick to revert to that 1.8 again :).

Hello Pieter,

I think your scripts would deserve to be used in haproxy sources as reg tests.

Why not sending them to the ML?

Find attached to this mail a patch to make it work both on Linux and Freebsd systems.

If you decide to send us, you would have to modify the LUA code so that the HTTP service would not produce pseudo-random HTTP contents (bote that I had to modify the MD5 checksum to make it work on Linux).

Regards,

Fred.

diff --git a/reg-tests/filters/b00005.vtc b/reg-tests/filters/b00005.vtc
index 0cb62633..81567210 100644
--- a/reg-tests/filters/b00005.vtc
+++ b/reg-tests/filters/b00005.vtc
@@ -34,40 +34,16 @@ shell {
     if [ "${h1_fe1_addr}" = "::1" ] ; then
         HOST="\[::1\]"
     fi
-    curl --compressed -k "https://$HOST:${h1_fe1_port}"; -o 
${tmpdir}/outputfile1.bin
-    curl --compressed -k "https://$HOST:${h1_fe1_port}"; -o 
${tmpdir}/outputfile3.bin --limit-rate 300K
-    curl --compressed -k "https://$HOST:${h1_fe1_port}"; -o 
${tmpdir}/outputfile2.bin --limit-rate 500K
-} -run
 
-shell {
-    md5sum=$(md5 -q ${tmpdir}/outputfile1.bin)
-    if [ "$md5sum" =  "f0d51d274ebc7696237efec272a38c41" ]
-    then
-      echo "File1 all OK"
-    else
-      echo "File1 not OK $md5sum "
-      testfailed=1
-    fi
+    md5=$(which md5 || which md5sum)
 
-    md5sum=$(md5 -q ${tmpdir}/outputfile2.bin)
-    if [ "$md5sum" =  "f0d51d274ebc7696237efec272a38c41" ]
-    then
-      echo "File2 all OK"
-    else
-      echo "File2 not OK $md5sum "
-      testfailed=1
+    if [ -z $md5 ] ; then
+        echo "MD5 checksum utility not found"
+        exit 1
     fi
 
-    md5sum=$(md5 -q ${tmpdir}/outputfile3.bin)
-    if [ "$md5sum" =  "f0d51d274ebc7696237efec272a38c41" ]
-    then
-      echo "File3 all OK"
-    else
-      echo "File3 not OK $md5sum "
-      testfailed=1
-    fi
-
-    if [ -n "$testfailed" ]; then
-      exit 1
-    fi
-} -run
\ No newline at end of file
+    for opt in "" "--limit-rate 300K" "--limit-rate 500K" ; do
+        checksum=$(curl --compressed -k "https://$HOST:${h1_fe1_port}"; $opt | 
$md5 | cut -d ' ' -f1)
+        if [ "$checksum" != "0a55287fd57c5e4d19f48a9e33e53b05" ] ; then exit 
1; fi
+    done
+} -run

Reply via email to