samba4: When running samba_dnsupdate during tests, use the test
[kai/samba-autobuild/.git] / selftest / target / Samba4.pm
index fb67c43350ecf6665dbcfd4f717983b28878d314..1e53c21dec3e0eba6b62c7072e0ca54c934e2d2e 100644 (file)
@@ -587,17 +587,17 @@ sub provision_raw_step1($$)
        log level = $ctx->{server_loglevel}
        lanman auth = Yes
        rndc command = true
-        dns update command = $ENV{SRCDIR_ABS}/source4/scripting/bin/samba_dnsupdate --all-interfaces --use-file=$ctx->{dns_host_file}
-        spn update command = $ENV{SRCDIR_ABS}/source4/scripting/bin/samba_spnupdate
-        resolv:host file = $ctx->{dns_host_file}
+       dns update command = $ENV{SRCDIR_ABS}/source4/scripting/bin/samba_dnsupdate --all-interfaces --use-file=$ctx->{dns_host_file} -s $ctx->{smb_conf}
+       spn update command = $ENV{SRCDIR_ABS}/source4/scripting/bin/samba_spnupdate -s $ctx->{smb_conf}
+       resolv:host file = $ctx->{dns_host_file}
        dreplsrv:periodic_startup_interval = 0
        dsdb:schema update allowed = yes
 
-        passdb backend = samba4
+       passdb backend = samba4
 
-        # remove this again, when our smb2 client library
-        # supports signin on compound related requests
-        server signing = on
+       # remove this again, when our smb2 client library
+       # supports signin on compound related requests
+       server signing = on
 ";
 
        if (defined($ctx->{sid_generator}) && $ctx->{sid_generator} ne "internal") {
@@ -679,7 +679,8 @@ nogroup:x:65534:nobody
                SAMBA_TEST_FIFO => "$ctx->{prefix}/samba_test.fifo",
                SAMBA_TEST_LOG => "$ctx->{prefix}/samba_test.log",
                SAMBA_TEST_LOG_POS => 0,
-               NSS_WRAPPER_WINBIND_SO_PATH => Samba::bindir_path($self, "default/nsswitch/libnss-winbind.so")
+               NSS_WRAPPER_WINBIND_SO_PATH => Samba::bindir_path($self, "default/nsswitch/libnss-winbind.so"),
+                LOCAL_PATH => $ctx->{share}
        };
 
        return $ret;
@@ -705,17 +706,17 @@ sub provision($$$$$$$$)
 {
        my ($self, $prefix, $server_role, $hostname,
            $domain, $realm, $functional_level,
-           $password, $kdc_ipv4, $extra_smbconf_options) = @_;
+           $password, $kdc_ipv4, $extra_smbconf_options, $extra_smbconf_shares) = @_;
 
        my $ctx = $self->provision_raw_prepare($prefix, $server_role,
                                               $hostname,
                                               $domain, $realm, $functional_level,
                                               $password, $kdc_ipv4);
 
-       $ctx->{tmpdir} = "$ctx->{prefix_abs}/tmp";
-       push(@{$ctx->{directories}}, "$ctx->{tmpdir}");
-       push(@{$ctx->{directories}}, "$ctx->{tmpdir}/test1");
-       push(@{$ctx->{directories}}, "$ctx->{tmpdir}/test2");
+       $ctx->{share} = "$ctx->{prefix_abs}/share";
+       push(@{$ctx->{directories}}, "$ctx->{share}");
+       push(@{$ctx->{directories}}, "$ctx->{share}/test1");
+       push(@{$ctx->{directories}}, "$ctx->{share}/test2");
        my $msdfs = "no";
        $msdfs = "yes" if ($server_role eq "domain controller");
        $ctx->{smb_conf_extra_options} = "
@@ -728,30 +729,30 @@ sub provision($$$$$$$$)
        $extra_smbconf_options
 
 [tmp]
-       path = $ctx->{tmpdir}
+       path = $ctx->{share}
        read only = no
        posix:sharedelay = 10000
        posix:oplocktimeout = 3
-       posix:writetimeupdatedelay = 500000
+       posix:writetimeupdatedelay = 50000
 
 [xcopy_share]
-       path = $ctx->{tmpdir}
+       path = $ctx->{share}
        read only = no
        posix:sharedelay = 10000
        posix:oplocktimeout = 3
-       posix:writetimeupdatedelay = 500000
+       posix:writetimeupdatedelay = 50000
        create mask = 777
        force create mode = 777
 
 [test1]
-       path = $ctx->{tmpdir}/test1
+       path = $ctx->{share}/test1
        read only = no
        posix:sharedelay = 10000
        posix:oplocktimeout = 3
        posix:writetimeupdatedelay = 50000
 
 [test2]
-       path = $ctx->{tmpdir}/test2
+       path = $ctx->{share}/test2
        read only = no
        posix:sharedelay = 10000
        posix:oplocktimeout = 3
@@ -768,7 +769,7 @@ sub provision($$$$$$$$)
        # Or the server tries s4u2self/s4u2proxy to impersonate the client
 
 [simple]
-       path = $ctx->{tmpdir}
+       path = $ctx->{share}
        read only = no
        ntvfs handler = simple
 
@@ -783,6 +784,8 @@ sub provision($$$$$$$$)
 [cifsposix]
        copy = simple
        ntvfs handler = cifsposix
+
+$extra_smbconf_shares
 ";
 
        if (defined($self->{ldap})) {
@@ -837,7 +840,7 @@ sub provision_member($$$)
                                   "2008",
                                   "locMEMpass3",
                                   $dcvars->{SERVER_IP},
-                                  "");
+                                  "", "");
        unless ($ret) {
                return undef;
        }
@@ -902,7 +905,7 @@ sub provision_rpc_proxy($$$)
                                   "2008",
                                   "locRPCproxypass4",
                                   $dcvars->{SERVER_IP},
-                                  $extra_smbconf_options);
+                                  $extra_smbconf_options, "");
 
        unless ($ret) {
                return undef;
@@ -1089,6 +1092,8 @@ sub provision_dc($$)
        my ($self, $prefix) = @_;
 
        print "PROVISIONING DC...";
+        my $extra_conf_options = "netbios aliases = localDC1-a
+allow dns updates = True";
        my $ret = $self->provision($prefix,
                                   "domain controller",
                                   "localdc",
@@ -1096,7 +1101,7 @@ sub provision_dc($$)
                                   "samba.example.com",
                                   "2008",
                                   "locDCpass1",
-                                  undef, "netbios aliases = localDC1-a");
+                                  undef, $extra_conf_options, "");
 
        return undef unless(defined $ret);
        unless($self->add_wins_config("$prefix/private")) {
@@ -1147,7 +1152,7 @@ sub provision_fl2003dc($$)
                                   "samba2003.example.com",
                                   "2003",
                                   "locDCpass6",
-                                  undef, "");
+                                  undef, "", "");
 
        unless($self->add_wins_config("$prefix/private")) {
                warn("Unable to add wins configuration");
@@ -1169,7 +1174,7 @@ sub provision_fl2008r2dc($$)
                                   "samba2008R2.example.com",
                                   "2008_R2",
                                   "locDCpass7",
-                                  undef, "");
+                                  undef, "", "");
 
        unless ($self->add_wins_config("$prefix/private")) {
                warn("Unable to add wins configuration");
@@ -1197,8 +1202,8 @@ sub provision_rodc($$$)
                return undef;
        }
 
-       $ctx->{tmpdir} = "$ctx->{prefix_abs}/tmp";
-       push(@{$ctx->{directories}}, "$ctx->{tmpdir}");
+       $ctx->{share} = "$ctx->{prefix_abs}/share";
+       push(@{$ctx->{directories}}, "$ctx->{share}");
 
        $ctx->{smb_conf_extra_options} = "
        max xmit = 32K
@@ -1213,11 +1218,11 @@ sub provision_rodc($$$)
        read only = yes
 
 [tmp]
-       path = $ctx->{tmpdir}
+       path = $ctx->{share}
        read only = no
        posix:sharedelay = 10000
        posix:oplocktimeout = 3
-       posix:writetimeupdatedelay = 500000
+       posix:writetimeupdatedelay = 50000
 
 ";
 
@@ -1262,13 +1267,62 @@ sub provision_plugin_s4_dc($$)
 {
        my ($self, $prefix) = @_;
 
+       my $prefix_abs = abs_path($prefix);
+
+       my $bindir_abs = abs_path($self->{bindir});
+       my $lockdir="$prefix_abs/lockdir";
+
        my $extra_smbconf_options = "
-server services = -smb +s3fs
-dcerpc endpoint servers = -unixinfo -spoolss -winreg -wkssvc -srvsvc
+        server services = -smb +s3fs
+        xattr_tdb:file = $prefix_abs/statedir/xattr.tdb
+
+       kernel oplocks = no
+       kernel change notify = no
+
+       syslog = no
+       printing = bsd
+       printcap name = /dev/null
+
+       max protocol = SMB2
+       read only = no
+       server signing = auto
+
+       smbd:sharedelay = 100000
+       smbd:writetimeupdatedelay = 500000
+       create mask = 755
+       dos filemode = yes
+
+        vfs objects = acl_xattr xattr_tdb streams_depot
+
+        dcerpc endpoint servers = -winreg -srvsvc
+
+       printcap name = /dev/null
+
+       printing = vlp
+       print command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb print %p %s
+       lpq command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lpq %p
+       lp rm command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lprm %p %j
+       lp pause command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lppause %p %j
+       lp resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb lpresume %p %j
+       queue pause command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queuepause %p
+       queue resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queueresume %p
+       lpq cache time = 0
+
+";
+
+       my $extra_smbconf_shares = "
+
+[tmpcase]
+       copy = tmp
+       case sensitive = yes
 
-[IPC\$]
-       vfs objects = dfs_samba4
+[tmpguest]
+       copy = tmp
+        guest ok = yes
 
+[hideunread]
+       copy = tmp
+       hide unreadable = yes
 ";
 
        print "PROVISIONING PLUGIN S4 DC...";
@@ -1279,7 +1333,8 @@ dcerpc endpoint servers = -unixinfo -spoolss -winreg -wkssvc -srvsvc
                                   "plugin.samba.example.com",
                                   "2008",
                                   "locDCpass1",
-                                  undef, $extra_smbconf_options);
+                                  undef, $extra_smbconf_options,
+                                   $extra_smbconf_shares);
 
        return undef unless(defined $ret);
        unless($self->add_wins_config("$prefix/private")) {