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

tests: updated with 'policy' modules, tweaks

parent 3da8d2c8
......@@ -27,11 +27,12 @@ env:
- CFLAGS="${CFLAGS} -O0 -g -fPIC"
- LD_LIBRARY_PATH="${HOME}/.local/lib"
- DYLD_LIBRARY_PATH="${HOME}/.local/lib"
- MAKEOPTS="-j2"
- SOCKET_WRAPPER_DIR="${HOME}/test-dir"
before_script:
- ./scripts/bootstrap-depends.sh ${HOME}/.local
- mkdir ${SOCKET_WRAPPER_DIR}
script:
- make ${MAKEOPTS} install COVERAGE=1 PREFIX=${HOME}/.local
- make -j2 install COVERAGE=1 PREFIX=${HOME}/.local
- make check COVERAGE=1 PREFIX=${HOME}/.local
after_success:
- test $TRAVIS_OS_NAME = linux && coveralls -i lib -i daemon -x ".c" --gcov-options '\-lp'
......
......@@ -27,6 +27,6 @@ $(libfaketime): $(libfaketime_DIR)/Makefile
@CFLAGS="" $(MAKE) -C $(libfaketime_DIR)
check-integration: $(libfaketime)
$(preload_LIBS) $(preload_syms) tests/test_integration.py $(TESTS) daemon/kresd ./kresd.j2 config
$(preload_LIBS) $(preload_syms) tests/test_integration.py $(TESTS) $(abspath daemon/kresd) ./kresd.j2 config
.PHONY: check-integration
net.listen('{{SELF_ADDR}}',53)
cache.size = 1*MB
modules = {'stats', 'block', 'hints'}
modules = {'stats', 'policy', 'hints'}
hints.root({['k.root-servers.net'] = '{{ROOT_ADDR}}'})
option('NO_MINIMIZE', {{NO_MINIMIZE}})
option('ALLOW_LOCAL', true)
......
#!/usr/bin/env python
import traceback
class Test:
""" Small library to imitate CMocka output. """
......@@ -26,7 +25,7 @@ class Test:
passed += 1
print('[ OK ] %s' % name)
except Exception as e:
print('[ FAIL ] %s (%s) at %s' % (name, str(e), traceback.print_exc()[0]))
print('[ FAIL ] %s (%s)' % (name, str(e)))
# Clear test set
self.tests = []
......
......@@ -224,7 +224,6 @@ def play_object(path, binary_name, config_name, j2template, binary_additional_pa
daemon_env = os.environ.copy()
setup_env(daemon_env, config, config_name, j2template)
# Start binary
binary_name = os.path.abspath(binary_name)
daemon_proc = None
daemon_log = open('%s/server.log' % TMPDIR, 'w')
daemon_args = [binary_name] + binary_additional_pars
......@@ -237,6 +236,7 @@ def play_object(path, binary_name, config_name, j2template, binary_additional_pa
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
while True:
if daemon_proc.poll() != None:
print(open('%s/server.log' % TMPDIR).read())
raise Exception('process died "%s", logs in "%s"' % (os.path.basename(binary_name), TMPDIR))
try:
sock.connect((testserver.get_local_addr_str(socket.AF_INET, CHILD_IFACE), 53))
......
# Preload libraries
preload_PATH := tests:contrib/libfaketime/src
preload_PATH := $(abspath contrib/libfaketime/src)
ifeq ($(PLATFORM),Darwin)
preload_LIBS := @DYLD_FORCE_FLAT_NAMESPACE=1 \
DYLD_LIBRARY_PATH="$(preload_PATH):${DYLD_LIBRARY_PATH}"
......
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