Fix URL redirection in captive portal mode (also client submodule update); add stresstest script (WIP); add commented line in d3dapi wrapper to use strace.

This commit is contained in:
Wouter R 2013-08-26 16:15:45 +02:00
parent 6e61a6fdd2
commit c915906395
4 changed files with 47 additions and 3 deletions

43
extra/api-stresstest.sh Executable file
View File

@ -0,0 +1,43 @@
#!/bin/sh
# TODO
# - have wget run POST requests
# - 'gcode' posten?
# - try to reproduce client behaviour more closely? (currently uhttpd is not exhibiting the strange behaviour)
# - shorter timeouts
# - add threading/subprocess-spawning?
# -? http://www.unix.com/shell-programming-scripting/36030-time-command-usage-sh-script.html
# - more wget options:
# * '-O <file>' or -O - to check response content?
# * -S to show server response headers
# * -T n to set all timeouts
WIFIBOX_IP=192.168.5.1
#WIFIBOX_IP=192.168.10.1
API_BASE=$WIFIBOX_IP/d3dapi
WGET=wget
#REQUEST_PATH=network/status
REQUEST_PATH=printer/print
#POST_PARMS=--post-data=xyzzy
POST_PARMS=--post-file=lorem.txt
RETRIES=1
counter=0
while true; do
#$WGET -q -O - $POST_PARMS -t $RETRIES $API_BASE/$REQUEST_PATH 2>&1 >/dev/null
$WGET -q -O - $POST_PARMS -t $RETRIES $API_BASE/$REQUEST_PATH 2>&1 >/dev/null
#check $? (and time spent?)
#print line every 100 counts or when a timeout/error occurs?
if [ $? -gt 0 ]; then
echo "response error at counter: $counter"
fi
if [ `expr $counter % 25` -eq 0 ]; then
echo "counter: $counter"
fi
counter=`expr $counter + 1`
done

View File

@ -172,7 +172,7 @@ end
--[[ Add/remove webserver 404 redirection and denial of dirlisting ]]
function reconf.wwwredir_add(dirtyList)
uci:set('uhttpd', 'main', 'error_page', '/www/index.html')
uci:set('uhttpd', 'main', 'error_page', '/redirect.html')
uci:set('uhttpd', 'main', 'no_dirlist', '1')
bothBits(dirtyList, 'uhttpd')
end

View File

@ -9,7 +9,8 @@ LOG_FILE=/tmp/wifibox.log
cd $SCRIPT_PATH
echo "CGI invocation" >> $LOG_FILE
strace - /tmp/trace-$$.log $LUA ./cmdmain.lua $@ 2>> $LOG_FILE
#strace -o /tmp/trace-$$.log -ff $LUA ./cmdmain.lua $@ 2>> $LOG_FILE
$LUA ./cmdmain.lua $@ 2>> $LOG_FILE
exit $?

@ -1 +1 @@
Subproject commit 2ee3c5bfd07a003edd713cee20a69d9b727c5c29
Subproject commit 733ddea61698beb0fbe6b2c4d3a33aba02dcf772