-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
18 lines (16 loc) · 823 Bytes
/
Copy pathMakefile
File metadata and controls
18 lines (16 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec
.PHONY: build
build:
go build
sudo setcap 'cap_net_bind_service=+ep' webserver_binding
.PHONY: test
test: build
grep -q "nameserver 127.0.0.1" /etc/resolv.conf || (echo "You need to configure your system resolver for this test" > /dev/stderr; false )
./webserver_binding dns & \
[ "$$(dig +short one.one.one.one)" = "127.0.0.1" ] || ( echo "Your resolver is not talking to the local test DNS server"> /dev/stderr; pkill -f webserver_binding; false)
./webserver_binding server & \
./webserver_binding client & \
while true; do netstat -np | egrep ':80.*ESTABLISHED'; sleep 1; done &
sleep 25; dig +short one.one.one.one; echo "Test timeout"; pkill -f webserver_binding