Commit ecb98f14 authored by Marek Vavruša's avatar Marek Vavruša

tests: use makefile from deckard, cleanup

parent 29fe41e4
[submodule "contrib/libfaketime"]
path = contrib/libfaketime
url = https://github.com/wolfcw/libfaketime.git
[submodule "contrib/libswrap"]
path = contrib/libswrap
url = https://gitlab.labs.nic.cz/labs/socket_wrapper.git
[submodule "tests/deckard"]
path = tests/deckard
url = https://gitlab.labs.nic.cz/knot/deckard.git
Subproject commit 18f5ec0671705bac190787a8612fc2a58b1be1d1
Subproject commit 96f9d58540f1ae6f219e85ce01a5818146bb49ee
Subproject commit 9f38df11af910ec2a0c09e6c49507e3c2877f4c8
Subproject commit 421a66cf3f1c957844b07e084af184c55a4210d2
# Config
deckard_DIR := tests/deckard
deckard_BIN := $(deckard_DIR)/deckard.py
TESTS := $(deckard_DIR)/sets/resolver
TESTS := sets/resolver
TEMPLATE := template/kresd.j2
# Targets
libfaketime_DIR := contrib/libfaketime
libfaketime := $(abspath $(libfaketime_DIR))/src/libfaketime$(LIBEXT).1
libswrap_DIR := contrib/libswrap
libswrap_cmake_DIR := $(libswrap_DIR)/obj
libswrap=$(abspath $(libswrap_cmake_DIR))/src/libsocket_wrapper$(LIBEXT).0
# Platform-specific targets
ifeq ($(PLATFORM),Darwin)
libfaketime := $(abspath $(libfaketime_DIR))/src/libfaketime.1$(LIBEXT)
libswrap := $(abspath $(libswrap_cmake_DIR))/src/libsocket_wrapper.0$(LIBEXT)
preload_syms := DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES="$(libfaketime):$(libswrap)"
else
preload_syms := LD_PRELOAD="$(libfaketime):$(libswrap)"
endif
# Synchronize submodules
$(deckard_BIN):
@git submodule update --init
$(libfaketime_DIR)/Makefile:
@git submodule update --init
# Build contrib libraries
$(libfaketime): $(libfaketime_DIR)/Makefile
@CFLAGS="" $(MAKE) -C $(libfaketime_DIR)
$(libswrap_DIR):
$(deckard_DIR):
@git submodule update --init
$(libswrap_cmake_DIR): $(libswrap_DIR)
@mkdir $(libswrap_cmake_DIR)
$(libswrap_cmake_DIR)/Makefile: $(libswrap_cmake_DIR)
@cd $(libswrap_cmake_DIR); cmake ..
$(libswrap): $(libswrap_cmake_DIR)/Makefile
@CFLAGS="-O2 -g" $(MAKE) -s -C $(libswrap_cmake_DIR)
# Test using Deckard
deckard: check-integration
check-integration: $(deckard_BIN) $(libswrap) $(libfaketime)
@$(preload_LIBS) $(preload_syms) python $(deckard_BIN) $(TESTS) $(abspath daemon/kresd) $(TEMPLATE) config
check-integration: $(deckard_DIR)
make -C $(deckard_DIR) TESTS=$(TESTS) DAEMON=$(abspath daemon/kresd) TEMPLATE=$(TEMPLATE)
.PHONY: deckard check-integration
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment