diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl
index 01b90e95a1c..a7cac6210b5 100644
--- a/src/test/ldap/t/001_auth.pl
+++ b/src/test/ldap/t/001_auth.pl
@@ -16,8 +16,8 @@ if ($^O eq 'darwin')
 elsif ($^O eq 'linux')
 {
 	$slapd = '/usr/sbin/slapd';
-	$ldap_schema_dir = '/etc/ldap/schema' if -f '/etc/ldap/schema';
-	$ldap_schema_dir = '/etc/openldap/schema' if -f '/etc/openldap/schema';
+	$ldap_schema_dir = '/etc/ldap/schema' if -d '/etc/ldap/schema';
+	$ldap_schema_dir = '/etc/openldap/schema' if -d '/etc/openldap/schema';
 }
 elsif ($^O eq 'freebsd')
 {