Signed-off-by: Alexey Kodanev <alexey.koda...@oracle.com> --- testcases/network/stress/http/http-stress | 5 ++- testcases/network/stress/http/http-stress01-rmt | 15 +++++++++++-- testcases/network/stress/http/http-stress02-rmt | 25 +++++++++++++++------- 3 files changed, 32 insertions(+), 13 deletions(-)
diff --git a/testcases/network/stress/http/http-stress b/testcases/network/stress/http/http-stress index 1dd2f4b..db18237 100644 --- a/testcases/network/stress/http/http-stress +++ b/testcases/network/stress/http/http-stress @@ -58,7 +58,8 @@ test01() { tst_resm TINFO "http client download test file" - tst_rhost_run -s -c "http-stress01-rmt $(tst_ipaddr) http_file" + tst_rhost_run -s -c "http-stress01-rmt $(tst_ipaddr) \ + http_file $DOWNLOAD_BIGFILESIZE" tst_resm TPASS "Test is finished successfully" } @@ -68,7 +69,7 @@ test02() tst_resm TINFO "clients request data asynchronously $NS_DURATION sec" tst_rhost_run -s -c "http-stress02-rmt $(tst_ipaddr) http_file \ - $NS_DURATION $CONNECTION_TOTAL" + $DOWNLOAD_BIGFILESIZE $NS_DURATION $CONNECTION_TOTAL" tst_resm TPASS "Test is finished successfully" } diff --git a/testcases/network/stress/http/http-stress01-rmt b/testcases/network/stress/http/http-stress01-rmt index 2567889..9799007 100644 --- a/testcases/network/stress/http/http-stress01-rmt +++ b/testcases/network/stress/http/http-stress01-rmt @@ -24,20 +24,29 @@ TST_TOTAL=1 . test_net.sh -tst_check_cmds curl +tst_check_cmds awk curl # Check the arguments -[ $# -ne 2 ] && tst_brkm TBROK "Usage: $0 server_ipaddr filename" +[ $# -ne 3 ] && tst_brkm TBROK "Usage: $0 server_ipaddr filename filesize" server_ipaddr="$1" filename="$2" +filesize="$3" echo $server_ipaddr | grep -F ':' > /dev/null if [ $? -eq 0 ]; then server_ipaddr='['$server_ipaddr']' fi -curl -g "http://$server_ipaddr/$filename" -o /dev/null || \ +out=$(curl --noproxy '*' -sS -g "http://$server_ipaddr/$filename" -o /dev/null \ + -w "time=%{time_total} size=%{size_download} speed=%{speed_download}") + +tst_resm TINFO "stat: $out" +recv_filesize=$(echo "$out" | awk '{print $2}') + +if [ $recv_filesize != "size=$filesize" ]; then + tst_resm TINFO "expected file size '$filesize'" tst_brkm TBROK "Failed to get http://${server_ipaddr}/${filename}" +fi tst_exit diff --git a/testcases/network/stress/http/http-stress02-rmt b/testcases/network/stress/http/http-stress02-rmt index b59a75e..db21be4 100644 --- a/testcases/network/stress/http/http-stress02-rmt +++ b/testcases/network/stress/http/http-stress02-rmt @@ -24,16 +24,17 @@ TST_TOTAL=1 . test_net.sh -tst_check_cmds curl +tst_check_cmds awk curl -if [ $# -ne 4 ]; then - tst_brkm TBROK "Usage: $0 server_addr filename duration connections" +if [ $# -ne 5 ]; then + tst_brkm TBROK "Usage: $0 server_addr fname fsize duration connections" fi server_ipaddr="$1" filename="$2" -duration="$3" -connections="$4" +filesize="$3" +duration="$4" +connections="$5" echo $server_ipaddr | grep -F ':' > /dev/null if [ $? -eq 0 ]; then @@ -55,13 +56,21 @@ while true ; do continue; fi - # Login to the server - curl -s -g "http://$server_ipaddr/$filename" > /dev/null 2>&1 & + curl --noproxy '*' -s -g "http://$server_ipaddr/$filename" \ + -o /dev/null & done killall -qw -s SIGPIPE curl -curl -g "http://$server_ipaddr/$filename" -o /dev/null || \ +out=$(curl --noproxy '*' -sS -g "http://$server_ipaddr/$filename" -o /dev/null \ + -w "time=%{time_total} size=%{size_download} speed=%{speed_download}") + +tst_resm TINFO "stat: $out" +recv_filesize=$(echo "$out" | awk '{print $2}') + +if [ $recv_filesize != "size=$filesize" ]; then + tst_resm TINFO "expected file size '$filesize'" tst_brkm TBROK "Failed to get http://$server_ipaddr/$filename" +fi tst_exit -- 1.7.1 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list