unit-tests: Support strongswan.conf defined plugin list and base directory
authorThomas Egerer <thomas.egerer@secunet.com>
Thu, 13 Feb 2014 07:55:13 +0000 (08:55 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 30 Apr 2014 15:22:48 +0000 (17:22 +0200)
tests.load and tests.plugindir to allow the specification of the plugins
to be loaded and the directory to load them from.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
src/libstrongswan/tests/tests.c

index 9f2adfd..d95ddd9 100644 (file)
@@ -35,8 +35,14 @@ static bool test_runner_init(bool init)
 {
        if (init)
        {
-               plugin_loader_add_plugindirs(PLUGINDIR, PLUGINS);
-               if (!lib->plugins->load(lib->plugins, PLUGINS))
+               char *plugins, *plugindir;
+
+               plugins = lib->settings->get_str(lib->settings,
+                                                                               "tests.load", PLUGINS);
+               plugindir = lib->settings->get_str(lib->settings,
+                                                                               "tests.plugindir", PLUGINDIR);
+               plugin_loader_add_plugindirs(plugindir, plugins);
+               if (!lib->plugins->load(lib->plugins, plugins))
                {
                        return FALSE;
                }