Skip to content
Snippets Groups Projects
Commit d80ce775 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

tests-extra: module detection with dynamic linking

parent 2463d50a
No related branches found
No related tags found
No related merge requests found
......@@ -22,20 +22,29 @@ class KnotModule(object):
type(self).count += 1
@classmethod
def check(self):
def _check_cmd(cls):
if params.libtool_bin:
prefix = [params.libtool_bin, "exec"]
else:
prefix = []
return prefix + ["objdump", "-t", params.knot_bin]
@classmethod
def check(cls):
'''Checks the server binary for the module code'''
try:
proc = Popen(["objdump", "-t", params.knot_bin],
stdout=PIPE, stderr=PIPE, universal_newlines=True)
proc = Popen(cls._check_cmd(), stdout=PIPE, stderr=PIPE,
universal_newlines=True)
(out, err) = proc.communicate()
if re.search(self.src_name, out):
if re.search(cls.src_name, out):
return
raise Skip()
except:
raise Skip("Module '%s' not detected" % self.conf_name)
raise Skip("Module '%s' not detected" % cls.conf_name)
def get_conf_ref(self):
return "%s/%s" % (self.conf_name, self.conf_id)
......
......@@ -41,6 +41,8 @@ valgrind_flags = get_param("KNOT_TEST_VALGRIND_FLAGS",
gdb_bin = get_binary("KNOT_TEST_GDB", "gdb")
# KNOT_TEST_VGDB - vgdb binary.
vgdb_bin = get_binary("KNOT_TEST_VGDB", "vgdb")
# KNOT_TEST_LIBTOOL - libtool script.
libtool_bin = get_binary("KNOT_TEST_LIBTOOL", "../libtool")
# KNOT_TEST_KNOT - Knot binary.
knot_bin = get_binary("KNOT_TEST_KNOT", "../src/knotd")
# KNOT_TEST_KNOTC - Knot control binary.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment