This allows locally built lustre utils to look for files outside of
the normal libdir location, and thus be tested without a full install.
Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: I0f3c3446ddc9aed3cf494c597f4c0a4c432478de
Reviewed-on: http://review.whamcloud.com/10468
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
snprintf(filename, sizeof(filename), PLUGIN_DIR"/mount_%s.so", fsname);
handle = dlopen(filename, RTLD_LAZY);
snprintf(filename, sizeof(filename), PLUGIN_DIR"/mount_%s.so", fsname);
handle = dlopen(filename, RTLD_LAZY);
+
+ /* Check for $LUSTRE environment variable from test-framework.
+ * This allows using locally built modules to be used.
+ */
+ if (handle == NULL) {
+ char *dirname;
+ dirname = getenv("LUSTRE");
+ if (dirname) {
+ snprintf(filename, sizeof(filename),
+ "%s/utils/.libs/mount_%s.so",
+ dirname, fsname);
+ handle = dlopen(filename, RTLD_LAZY);
+ }
+ }
+
+ /* Do not clutter up console with missing types */
- /* Do not clutter up console with missing types */
return NULL;
ops = malloc(sizeof(*ops));
return NULL;
ops = malloc(sizeof(*ops));