tests/hwtable: set multipath_dir in local configuration
[multipath-tools/.git] / tests / hwtable.c
index 9146ecc..1cd788a 100644 (file)
@@ -250,14 +250,19 @@ static void write_defaults(const struct hwt_state *hwt)
        static struct key_value defaults[] = {
                { "config_dir", NULL },
                { "bindings_file", NULL },
+               { "multipath_dir", NULL },
                { "detect_prio", "no" },
                { "detect_checker", "no" },
        };
        char buf[sizeof(tmplate) + sizeof(bindings_name)];
+       char dirbuf[PATH_MAX];
 
        snprintf(buf, sizeof(buf), "%s/%s", hwt->tmpname, bindings_name);
        defaults[0].value = hwt->dirname;
        defaults[1].value = buf;
+       assert_ptr_not_equal(getcwd(dirbuf, sizeof(dirbuf)), NULL);
+       strncat(dirbuf, "/lib", sizeof(dirbuf));
+       defaults[2].value = dirbuf;
        write_section(hwt->config_file, "defaults",
                      ARRAY_SIZE(defaults), defaults);
 }