1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00
libwebsockets/scripts/h2spec.sh

42 lines
760 B
Bash
Raw Permalink Normal View History

2018-04-26 15:27:02 +08:00
#!/bin/bash
2018-04-27 11:19:09 +08:00
#
2018-04-26 15:27:02 +08:00
# run from the build subdir
2018-04-27 11:19:09 +08:00
#
echo
echo "----------------------------------------------"
echo "------- tests: h2spec"
echo
2018-04-26 15:27:02 +08:00
if [ ! -e h2spec ] ; then
wget https://github.com/summerwind/h2spec/releases/download/v2.1.0/h2spec_linux_amd64.tar.gz &&\
tar xf h2spec_linux_amd64.tar.gz
if [ ! -e h2spec ] ; then
echo "Couldn't get h2spec"
exit 1
fi
fi
cd ../minimal-examples/http-server/minimal-http-server-tls
../../../build/bin/lws-minimal-http-server-tls&
sleep 1s
P=$!
../../../build/h2spec -h 127.0.0.1 -p 7681 -t -k -S > /tmp/hlog
kill $P 2>/dev/null
wait $P 2>/dev/null
if [ ! -z "`cat /tmp/hlog | grep "Failures:"`" ] ; then
cat /tmp/hlog | sed '/Failures:/,$!d'
exit 1
fi
cat /tmp/hlog | sed '/Finished\ in/,$!d'
exit 0