qa: add 6 x h2load tests

This commit is contained in:
Andy Green 2018-04-27 11:19:09 +08:00
parent 82adc07c0a
commit ae688609a0
9 changed files with 95 additions and 4 deletions

View File

@ -30,7 +30,7 @@ install:
# - Rscript -e 'covr::coveralls()'
script:
- if [ "$COVERITY_SCAN_BRANCH" != 1 -a "$TRAVIS_OS_NAME" = "osx" ]; then mkdir build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/opt/openssl" $CMAKE_ARGS .. && cmake --build .; else if [ "$COVERITY_SCAN_BRANCH" != 1 -a "$TRAVIS_OS_NAME" = "linux" ]; then mkdir build && cd build && if [ "$LWS_METHOD" = "lwsws" ] ; then cmake -DLWS_OPENSSL_LIBRARIES="/usr/local/lib/libssl.so;/usr/local/lib/libcrypto.so" -DLWS_OPENSSL_INCLUDE_DIRS="/usr/local/include/openssl" $CMAKE_ARGS .. && cmake --build . && sudo make install && ../minimal-examples/selftests.sh && ../scripts/h2spec.sh && ../test-apps/attack.sh && ../scripts/autobahn-test.sh ; else cmake $CMAKE_ARGS .. && cmake --build . ; fi ; fi ; fi
- if [ "$COVERITY_SCAN_BRANCH" != 1 -a "$TRAVIS_OS_NAME" = "osx" ]; then mkdir build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/opt/openssl" $CMAKE_ARGS .. && cmake --build .; else if [ "$COVERITY_SCAN_BRANCH" != 1 -a "$TRAVIS_OS_NAME" = "linux" ]; then mkdir build && cd build && if [ "$LWS_METHOD" = "lwsws" ] ; then cmake -DLWS_OPENSSL_LIBRARIES="/usr/local/lib/libssl.so;/usr/local/lib/libcrypto.so" -DLWS_OPENSSL_INCLUDE_DIRS="/usr/local/include/openssl" $CMAKE_ARGS .. && cmake --build . && sudo make install && ../minimal-examples/selftests.sh && ../scripts/h2spec.sh && ../test-apps/attack.sh && ../scripts/h2load.sh && ../scripts/autobahn-test.sh ; else cmake $CMAKE_ARGS .. && cmake --build . ; fi ; fi ; fi
sudo: required
dist: trusty
addons:

View File

@ -1837,7 +1837,7 @@ if (LWS_WITH_GENERIC_SESSIONS AND LWS_ROLE_WS)
target_link_libraries(protocol_lws_messageboard sqlite3 )
endif(WIN32)
endif(LWS_WITH_GENERIC_SESSIONS)
endif(LWS_WITH_GENERIC_SESSIONS AND LWS_ROLE_WS)
endif(LWS_WITH_PLUGINS AND LWS_WITH_SHARED)

View File

@ -21,6 +21,7 @@ attack.sh|225|Correctness, robustness and security tests for http parser
Autobahn Server|480|Testing lws ws client, including permessage-deflate
Autobahn Client|480|Testing lws ws server, including permaessage-deflate
h2spec|146|Http/2 server compliance suite (in strict mode)
h2load|6|Http/2 server load tool (checks 10K / 100K in h1 and h2, at 1, 10, 100 concurrency)
The over 1,400 tests run on every commit take most of an hour to complete.
If any problems are found, it breaks the travis build, generating an email.

View File

@ -8,6 +8,11 @@
#
# build $ ../minimal-examples/selftests.sh
echo
echo "----------------------------------------------"
echo "------- tests: lws minimal example selftests"
echo
LOGGING_PATH=/tmp/logs

View File

@ -8,6 +8,11 @@
# It will use the minimal echo client and server to run
# autobahn ws tests as both client and server.
echo
echo "----------------------------------------------"
echo "------- tests: autobahn as client"
echo
set -u
PARALLEL=8
@ -138,6 +143,11 @@ fi
# 2) lws-as-server tests
echo
echo "----------------------------------------------"
echo "------- tests: autobahn as server"
echo
$SERV -p 9001 -d7 &
wstest -m fuzzingclient
R=$?

63
scripts/h2load.sh Executable file
View File

@ -0,0 +1,63 @@
#!/bin/bash
#
# run from the build dir
echo
echo "----------------------------------------------"
echo "------- tests: h2load"
echo
PW=`pwd`
cd ../minimal-examples/http-server/minimal-http-server-tls
$PW/bin/lws-minimal-http-server-tls &
R=$!
sleep 0.5s
# check h1 with various loads
h2load -n 10000 -c 1 --h1 https://127.0.0.1:7681
if [ $? -ne 0 ] ; then
Q=$?
kill $R
wait $R
exit $Q
fi
h2load -n 10000 -c 10 --h1 https://127.0.0.1:7681
if [ $? -ne 0 ] ; then
Q=$?
kill $R
wait $R
exit $Q
fi
h2load -n 100000 -c 100 --h1 https://127.0.0.1:7681
if [ $? -ne 0 ] ; then
Q=$?
kill $R
wait $R
exit $Q
fi
# check h2 with various loads
h2load -n 10000 -c 1 https://127.0.0.1:7681
if [ $? -ne 0 ] ; then
Q=$?
kill $R
wait $R
exit $Q
fi
h2load -n 10000 -c 10 https://127.0.0.1:7681
if [ $? -ne 0 ] ; then
Q=$?
kill $R
wait $R
exit $Q
fi
h2load -n 100000 -c 100 https://127.0.0.1:7681
Q=$?
kill $R
wait $R
exit $Q

View File

@ -1,6 +1,13 @@
#!/bin/bash
#
# run from the build subdir
#
echo
echo "----------------------------------------------"
echo "------- tests: h2spec"
echo
if [ ! -e h2spec ] ; then
wget https://github.com/summerwind/h2spec/releases/download/v2.1.0/h2spec_linux_amd64.tar.gz &&\

View File

@ -8,7 +8,7 @@ then
if [ "$LWS_METHOD" == "lwsws" ];
then
sudo apt-get install -y -qq realpath;
sudo apt-get install -y -qq realpath libjemalloc1 libev4
sudo apt-get remove python-six
sudo pip install six>=1.9
sudo pip install Twisted==16.0.0

View File

@ -4,6 +4,11 @@
#
# Requires the library to have been built with cmake .. -DCMAKE_BUILD_TYPE=DEBUG
echo
echo "----------------------------------------------"
echo "------- tests: lws attack.sh"
echo
SERVER=127.0.0.1
PORT=7681
LOG=/tmp/lwslog