• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2#
3# run from the build subdir
4#
5
6echo
7echo "----------------------------------------------"
8echo "-------   tests: h2spec"
9echo
10
11
12if [ ! -e h2spec ] ; then
13	wget https://github.com/summerwind/h2spec/releases/download/v2.1.0/h2spec_linux_amd64.tar.gz &&\
14	tar xf h2spec_linux_amd64.tar.gz
15	if [ ! -e h2spec ] ; then
16		echo "Couldn't get h2spec"
17		exit 1
18	fi
19fi
20
21cd ../minimal-examples/http-server/minimal-http-server-tls
22../../../build/bin/lws-minimal-http-server-tls&
23
24sleep 1s
25
26P=$!
27../../../build/h2spec -h 127.0.0.1 -p 7681 -t -k -S > /tmp/hlog
28kill $P 2>/dev/null
29wait $P 2>/dev/null
30
31if [ ! -z "`cat /tmp/hlog | grep "Failures:"`" ] ; then
32	cat /tmp/hlog | sed '/Failures:/,$!d'
33
34	exit 1
35fi
36
37cat /tmp/hlog | sed '/Finished\ in/,$!d'
38
39
40exit 0
41
42