]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: Add a test for smbclient --machine-pass without secrets.tdb
authorAndrew Bartlett <abartlet@samba.org>
Tue, 28 Aug 2012 23:10:40 +0000 (09:10 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 28 Aug 2012 23:10:40 +0000 (09:10 +1000)
Errors in handling the upgrade case without a matching secrets.tdb caused segfaults
in the server.  This essentially tests both sides.

Andrew Bartlett

selftest/target/Samba4.pm
source4/selftest/tests.py

index 54422817663baa8a587beec9fced3329c3f86445..28b40added755568c058791bd61698ff4a9f2dda 100644 (file)
@@ -672,6 +672,7 @@ nogroup:x:65534:nobody
                LOCKDIR => $ctx->{lockdir},
                STATEDIR => $ctx->{statedir},
                CACHEDIR => $ctx->{cachedir},
+               PRIVATEDIR => $ctx->{privatedir},
                SERVERCONFFILE => $ctx->{smb_conf},
                CONFIGURATION => $configuration,
                SOCKET_WRAPPER_DEFAULT_IFACE => $ctx->{swiface},
@@ -1450,6 +1451,14 @@ sub provision_chgdcpass($$)
                warn("Unable to add wins configuration");
                return undef;
        }
+       
+       # Remove secrets.tdb from this environment to test that we still start up
+       # on systems without the new matching secrets.tdb records
+       unless (unlink("$ret->{PRIVATEDIR}/secrets.tdb")) {
+               warn("Unable to remove $ret->{PRIVATEDIR}/secrets.tdb added during provision");
+               return undef;
+       }
+           
        $ret->{DC_SERVER} = $ret->{SERVER};
        $ret->{DC_SERVER_IP} = $ret->{SERVER_IP};
        $ret->{DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
index f205fe47454d3cd8802f7a5b5490edf600d39ac8..b9944cb799c9e84a1cf6a654e03c8191853d0df7 100755 (executable)
@@ -304,7 +304,7 @@ planpythontestsuite("s3dc", "samba.tests.libsmb_samba_internal");
 # the API. These mainly test that the various command-line options of commands
 # work correctly.
 
-for env in ["s3member", "s4member", "dc"]:
+for env in ["s3member", "s4member", "dc", "chgdcpass"]:
     plantestsuite("samba4.blackbox.smbclient(%s:local)" % env, "%s:local" % env, [os.path.join(samba4srcdir, "utils/tests/test_smbclient.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$DOMAIN', smbclient])
 
 planpythontestsuite("none", "samba.tests.blackbox.ndrdump")