Make the 'modules.conf' generation in the LDAP selftest simpler
[jra/samba/.git] / selftest / target / Samba4.pm
index 09138cf0aa7541e52cd7943439febe8fec33f7c2..71dddf69392d99a85aa9f8eb10ec1373b94bcb9d 100644 (file)
@@ -242,77 +242,32 @@ sub mk_openldap($$$)
        $ENV{PATH} = "$olpath/usr/local/sbin:/usr/sbin:/sbin:$ENV{PATH}";
 
        unlink($modconf);
-       open(CONF, ">$modconf"); close(CONF);
 
-       if (system("slaptest -u -f $slapd_conf >&2") != 0) {
-               open(CONF, ">$modconf"); 
-               # enable slapd modules
-               print CONF "
-modulepath      $olroot/libexec/openldap
-moduleload     syncprov
-moduleload      memberof
-moduleload      refint
-";
-               close(CONF);
-       }
-       if (system("slaptest -u -f $slapd_conf >&2") != 0) {
-               open(CONF, ">$modconf"); 
-               # enable slapd modules
-               print CONF "
-modulepath      $olroot/libexec/openldap
-moduleload     back_hdb
-moduleload     syncprov
-moduleload      memberof
-moduleload      refint
-";
-               close(CONF);
-       }
+       #This code tries to guess what modules we need to load (if any) by trying different combinations in the modules.conf
 
-       if (system("slaptest -u -f $slapd_conf >&2") != 0) {
-               open(CONF, ">$modconf"); 
-               # enable slapd modules
-               print CONF "
-moduleload     back_hdb
-moduleload     syncprov
-moduleload      memberof
-moduleload      refint
-";
-               close(CONF);
-       }
+       # Try without any slapd modules
+       open(CONF, ">$modconf"); close(CONF);
 
        if (system("slaptest -u -f $slapd_conf >&2") != 0) {
                open(CONF, ">$modconf"); 
                # enable slapd modules
                print CONF "
-modulepath     /usr/lib/ldap
-moduleload     back_hdb
 moduleload     syncprov
 moduleload      memberof
 moduleload      refint
+moduleload      deref
 ";
                close(CONF);
        }
-
        if (system("slaptest -u -f $slapd_conf >&2") != 0) {
                open(CONF, ">$modconf"); 
-               # enable slapd modules (Fedora layout)
+               # enable slapd modules, and the module for back_hdb
                print CONF "
-modulepath     /usr/lib/openldap
-moduleload     syncprov
-moduleload      memberof
-moduleload      refint
-";
-               close(CONF);
-       }
-
-       if (system("slaptest -u -f $slapd_conf >&2") != 0) {
-               open(CONF, ">$modconf"); 
-               # enable slapd modules (Fedora x86_64 layout)
-               print CONF "
-modulepath     /usr/lib64/openldap
+moduleload     back_hdb
 moduleload     syncprov
 moduleload      memberof
 moduleload      refint
+moduleload      deref
 ";
                close(CONF);
        }