Skip to content

Commit 2199377

Browse files
committed
tests: add full lighttpd test
1 parent fe69dee commit 2199377

File tree

3 files changed

+86
-0
lines changed

3 files changed

+86
-0
lines changed

tests/full/lighttpd/lighttpd.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
server.document-root = var.CWD + "/tests/full/lighttpd"
2+
server.bind = "0.0.0.0"
3+
server.port = 8000
4+
server.errorlog = "/dev/stderr"
5+
server.breakagelog = "/dev/stderr"
6+
server.modules = ( )
7+
mimetype.assign = (
8+
".html" => "text/html",
9+
".txt" => "text/plain",
10+
".jpg" => "image/jpeg",
11+
".png" => "image/png"
12+
)

tests/full/lighttpd/rules.mk

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
include mk/subdir_pre.mk
2+
3+
ft_lighttpd_parentdir := $(TEST_DISTFILES)/full-lighttpd
4+
5+
###################################
6+
# Build lighttpd
7+
8+
ft_lighttpd_ver := 1.4.55
9+
ft_lighttpd_tar := $(ft_lighttpd_parentdir)/lighttpd-$(ft_lighttpd_ver).tar.gz
10+
ft_lighttpd_build := $(ft_lighttpd_parentdir)/lighttpd-$(ft_lighttpd_ver)
11+
ft_lighttpd_server := $(ft_lighttpd_build)/src/lighttpd
12+
ft_lighttpd_config := $(d)/lighttpd.conf
13+
14+
# Download lighttpd tarball
15+
$(ft_lighttpd_tar):
16+
mkdir -p $(dir $@)
17+
wget -O $@ https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-$(ft_lighttpd_ver).tar.gz
18+
19+
# Extract lighttpd tarball
20+
$(ft_lighttpd_build): $(ft_lighttpd_tar)
21+
tar xf $< -C $(ft_lighttpd_parentdir)
22+
touch $(@)
23+
24+
# Build lighttpd
25+
$(ft_lighttpd_server): $(ft_lighttpd_build)
26+
(cd $(ft_lighttpd_build) && ./configure --disable-ipv6 --without-bzip2)
27+
$(MAKE) -C $(ft_lighttpd_build)
28+
touch $@
29+
30+
###################################
31+
# Build wrk2
32+
33+
ft_lighttpd_wrk_ver := 44a94c17d8e6a0bac8559b53da76848e430cb7a7
34+
ft_lighttpd_wrk_build := $(ft_lighttpd_parentdir)/wrk2
35+
ft_lighttpd_client := $(ft_lighttpd_parentdir)/wrk2/wrk
36+
37+
$(ft_lighttpd_wrk_build):
38+
rm -rf $@
39+
git clone --depth 1 https://github.com/giltene/wrk2.git $@
40+
cd $@ && git checkout $(ft_lighttpd_wrk_ver)
41+
sed -i -s 's/CFLAGS *:=.*/\0 -g/' $(ft_lighttpd_wrk_build)/Makefile
42+
43+
$(ft_lighttpd_client): $(ft_lighttpd_wrk_build)
44+
$(MAKE) -C $(ft_lighttpd_wrk_build)
45+
46+
###################################
47+
48+
tests-full-lighttpd: $(ft_lighttpd_server) $(ft_lighttpd_client)
49+
tests-full: tests-full-lighttpd
50+
51+
run-tests-full-lighttpd-server: tests-full-lighttpd test-full-wrapdeps
52+
$(FTWRAP) -d 500 \
53+
-P '$(ft_lighttpd_server) -D -m $(ft_lighttpd_build)/src/.libs/\
54+
-f $(ft_lighttpd_config)' \
55+
-c '$(ft_lighttpd_client) -t2 -c100 -d10s -R2000 \
56+
http://$$TAS_IP:8000/lighttpd.conf'
57+
58+
run-tests-full-lighttpd-client: tests-full-lighttpd test-full-wrapdeps
59+
$(FTWRAP) -d 500 \
60+
-C '$(ft_lighttpd_server) -D -m $(ft_lighttpd_build)/src/.libs/\
61+
-f $(ft_lighttpd_config)' \
62+
-p '$(ft_lighttpd_client) -t2 -c100 -d10s -R2000 \
63+
http://$$LINUX_IP:8000/lighttpd.conf'
64+
65+
run-tests-full-lighttpd: run-tests-full-lighttpd-server run-tests-full-lighttpd-client
66+
run-tests-full: run-tests-full-lighttpd
67+
68+
.PHONY: tests-full-lighttpd run-tests-full-lighttpd \
69+
run-tests-full-lighttpd-server run-tests-full-lighttpd-client
70+
71+
include mk/subdir_post.mk

tests/full/rules.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ include $(dir)/rules.mk
3636
dir := $(d)/nodejs
3737
include $(dir)/rules.mk
3838

39+
dir := $(d)/lighttpd
40+
include $(dir)/rules.mk
41+
3942
#########################
4043

4144
DEPS += $(FULLTEST_OBJS:.o=.d) $(FTWRAP_OBJS:.o=.d)

0 commit comments

Comments
 (0)