Commit 421a66cf authored by Marek Vavrusa's avatar Marek Vavrusa

bugfixes, cleanup

parent aac89ca9
# Defaults
TESTS ?= sets/resolver
DAEMON ?= kresd
TEMPLATE ?= kresd.j2
TEMPLATE ?= template/kresd.j2
CONFIG ?= config
LIBEXT := .so
......@@ -37,7 +37,7 @@ depend: $(libfaketime) $(libcwrap)
$(libfaketime_DIR)/Makefile:
@git submodule update --init
$(libfaketime): $(libfaketime_DIR)/Makefile
@CFLAGS="-O2 -g" $(MAKE) -C $(libfaketime_DIR)
@CFLAGS="-O0 -g" $(MAKE) -C $(libfaketime_DIR)
$(libcwrap_DIR):
@git submodule update --init
$(libcwrap_cmake_DIR):$(libcwrap_DIR)
......@@ -45,7 +45,7 @@ $(libcwrap_cmake_DIR):$(libcwrap_DIR)
$(libcwrap_cmake_DIR)/Makefile: $(libcwrap_cmake_DIR)
@cd $(libcwrap_cmake_DIR); cmake ..
$(libcwrap): $(libcwrap_cmake_DIR)/Makefile
@CFLAGS="-O2 -g" $(MAKE) -C $(libcwrap_cmake_DIR)
@CFLAGS="-O0 -g" $(MAKE) -C $(libcwrap_cmake_DIR)
.PHONY: depend all
......@@ -26,6 +26,7 @@ def del_files(path_to):
for f in files:
os.unlink(os.path.join(root, f))
VERBOSE = 0
DEFAULT_IFACE = 0
CHILD_IFACE = 0
TMPDIR = ""
......@@ -59,6 +60,11 @@ if TMPDIR == "" or os.path.isdir(TMPDIR) is False:
TMPDIR = tempfile.mkdtemp(suffix=''.join(random.choice(string.lowercase) for i in range(20 - len(TMPDIR))), prefix='tmp')
os.environ["SOCKET_WRAPPER_DIR"] = TMPDIR
if "VERBOSE" in os.environ:
try:
VERBOSE = int(os.environ["VERBOSE"])
except: pass
def get_next(file_in):
""" Return next token from the input stream. """
while True:
......@@ -290,7 +296,7 @@ def play_object(path, binary_name, config_name, j2template, binary_additional_pa
server.stop()
daemon_proc.terminate()
daemon_proc.wait()
if 'VERBOSE' in os.environ:
if VERBOSE:
print('[ LOG ]\n%s' % open('%s/server.log' % TMPDIR).read())
# Do not clear files if the server crashed (for analysis)
del_files(TMPDIR)
......
......@@ -418,7 +418,7 @@ class Scenario:
def play(self, saddr, paddr):
""" Play given scenario. """
self.child_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.child_sock.settimeout(2)
self.child_sock.settimeout(3)
self.child_sock.connect((paddr, 53))
if len(self.steps) == 0:
......
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