diff --git a/.travis.yml b/.travis.yml index 17262e70e..2b230ce54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/CMakeLists.txt b/CMakeLists.txt index f2ce419e5..b545af316 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/README.md b/README.md index 2305fbb61..bc6d1554c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/minimal-examples/selftests.sh b/minimal-examples/selftests.sh index a3f97033e..7c860419c 100755 --- a/minimal-examples/selftests.sh +++ b/minimal-examples/selftests.sh @@ -8,6 +8,11 @@ # # build $ ../minimal-examples/selftests.sh +echo +echo "----------------------------------------------" +echo "------- tests: lws minimal example selftests" +echo + LOGGING_PATH=/tmp/logs diff --git a/scripts/autobahn-test.sh b/scripts/autobahn-test.sh index 550c5e744..22b0cf1e7 100755 --- a/scripts/autobahn-test.sh +++ b/scripts/autobahn-test.sh @@ -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=$? diff --git a/scripts/h2load.sh b/scripts/h2load.sh new file mode 100755 index 000000000..e6d18c48d --- /dev/null +++ b/scripts/h2load.sh @@ -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 + diff --git a/scripts/h2spec.sh b/scripts/h2spec.sh index 518cdc660..57bb4e74a 100755 --- a/scripts/h2spec.sh +++ b/scripts/h2spec.sh @@ -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 &&\ diff --git a/scripts/travis_install.sh b/scripts/travis_install.sh index 299041cbe..0f6287de5 100755 --- a/scripts/travis_install.sh +++ b/scripts/travis_install.sh @@ -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 diff --git a/test-apps/attack.sh b/test-apps/attack.sh index 18e005ed5..38c6cd5f8 100755 --- a/test-apps/attack.sh +++ b/test-apps/attack.sh @@ -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