From: Matteo Nastasi (mop) Date: Wed, 20 Feb 2013 08:23:45 +0000 (+0100) Subject: enhanced test.php management and engine_test.sh added X-Git-Tag: v4.7.1~13 X-Git-Url: https://mop.ddnsfree.com/gitweb/?p=brisk.git;a=commitdiff_plain;h=eeef8a0eacaa2d3d0174dba8561ec860868bc1c6 enhanced test.php management and engine_test.sh added --- diff --git a/bin/engine_test.sh b/bin/engine_test.sh new file mode 100755 index 0000000..b6a3ca4 --- /dev/null +++ b/bin/engine_test.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# set -x +url="http://dodo.birds.lan/brisk/test.php" +# url="http://dodo.birds.lan/pippo.php" + +rm -f engine_test.log engine_test.out engine_test.in + +to=1 +while [ $# -gt 0 ]; do + case $1 in + -w) + USE_WGET=y + ;; + *) + to_tot=$1 + to=$to_tot + break + ;; + esac + shift +done + +rm -f engine_test.tmp +touch engine_test.tmp +if [ $to_tot -gt 10 ]; then + for i in $(seq 1 $((to / 10))); do + echo "_123456789abcdef_123456789abcdef_123456789abcdef_123456789abcdef_123456789abcdef_123456789abcdef_123456789abcdef_123456789abcdef_123456789abcdef_123456789abcdef" | tr -d '\n' >> engine_test.tmp + done + into=$((to / 10)) + into=$((into * 10)) + to=$((to - into)) +fi + +for i in $(seq 1 $to); do + echo "_123456789abcdef" | tr -d '\n' >> engine_test.tmp +done +in_md5="$(cat engine_test.tmp | tr -d '\n' | md5sum | cut -c 1-7)" +echo "data=" | tr -d '\n' > engine_test.in +cat engine_test.tmp >> engine_test.in + +if [ "$USE_WGET" = "y" ]; then + echo "Started wget, sent "$((to_tot * 16))" (MD5 $in_md5) ... " | tr -d '\n' + wget --post-file=engine_test.in -q -o engine_test.log -O engine_test.out "$url" +else + echo "Started curl, sent "$((to_tot * 16))" (MD5 $in_md5) ... " | tr -d '\n' + curl -d @engine_test.in -o engine_test.out "$url" > engine_test.log 2>&1 +fi +# rm engine_test.in +echo "returned "$(cat engine_test.out | wc -c)" (MD5 "$(cat engine_test.out | md5sum | cut -c 1-7)")." +echo diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 45b583c..b9f305a 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -2288,7 +2288,13 @@ class Room if (!(BRISK_DEBUG & DBG_ENGI)) return (FALSE); fprintf(STDERR, "TEST.PHP running\n"); - $content = "OK"; + if (isset($post['data'])) { + $content = $post['data']; + } + else { + $content = "NO DATA AVAILABLE"; + } + $header_out['Content-Type'] = 'text/plain'; $s_a_p->pendpage_try_addflush($new_socket, 20, $enc, $header_out, $content); return TRUE; break;