my $opt_libsocket_wrapper_so_path = "";
my $opt_libuid_wrapper_so_path = "";
my $opt_libasan_so_path = "";
+my $opt_libcrypt_so_path = "";
my $opt_use_dns_faking = 0;
my @testlists = ();
'socket_wrapper_so_path=s' => \$opt_libsocket_wrapper_so_path,
'uid_wrapper_so_path=s' => \$opt_libuid_wrapper_so_path,
'asan_so_path=s' => \$opt_libasan_so_path,
+ 'crypt_so_path=s' => \$opt_libcrypt_so_path,
'use-dns-faking' => \$opt_use_dns_faking
);
if ($opt_libasan_so_path) {
if ($ld_preload) {
- $ld_preload = "$opt_libasan_so_path:$ld_preload";
+ if ($opt_libcrypt_so_path) {
+ $ld_preload = "$opt_libasan_so_path:$opt_libcrypt_so_path:$ld_preload";
+ } else {
+ $ld_preload = "$opt_libasan_so_path:$ld_preload";
+ }
} else {
- $ld_preload = "$opt_libasan_so_path";
+ if ($opt_libcrypt_so_path) {
+ $ld_preload = "$opt_libasan_so_path:$opt_libcrypt_so_path";
+ } else {
+ $ld_preload = "$opt_libasan_so_path";
+ }
}
}
# Have the selftest.pl LD_PRELOAD libasan in the right spot
env.OPTIONS += " --asan_so_path=" + libasan
+ if CONFIG_SET(opt, 'HAVE_CRYPT_R'):
+ # We try to find the correct libcrypt automatically
+ libcrypt = Utils.cmd_output(
+ 'ldd bin/modules/ldb/password_hash.so | awk \'/libcrypt.so/ { print $3 }\'',
+ silent=True).strip()
+ libcrypt = libcrypt.decode('utf8')
+ env.OPTIONS += " --crypt_so_path=" + libcrypt
+
subunit_cache = None
# We use the full path rather than relative path to avoid problems on some platforms (ie. solaris 8).
env.CORE_COMMAND = '${PERL} ${srcdir}/selftest/selftest.pl --target=${SELFTEST_TARGET} --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude=${srcdir}/selftest/skip ${TESTLISTS} ${OPTIONS} ${TESTS}'