|
| 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 |
0 commit comments