From: Andreas Schneider Date: Mon, 3 Sep 2018 14:55:02 +0000 (+0200) Subject: selftest: Run libsmbclient tests with NT1 and SMB3 X-Git-Tag: tdb-1.3.17~1761 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=778878a39621d88edaf2167719292bb75b86b2be;p=thirdparty%2Fsamba.git selftest: Run libsmbclient tests with NT1 and SMB3 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Sep 5 21:56:11 CEST 2018 on sn-devel-144 --- diff --git a/selftest/knownfail b/selftest/knownfail index 93c1a3511ac..eef8134c9f5 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -125,7 +125,7 @@ ^samba4.smb2.acls.*.ACCESSBASED ^samba4.ldap.dirsync.python.ad_dc_ntvfs..__main__.ExtendedDirsyncTests.test_dirsync_deleted_items #^samba4.ldap.dirsync.python.ad_dc_ntvfs..__main__.ExtendedDirsyncTests.* -^samba4.libsmbclient.opendir.opendir # This requires netbios browsing +^samba4.libsmbclient.opendir.(NT1|SMB3).opendir # This requires netbios browsing ^samba4.rpc.drsuapi.*.drsuapi.DsGetDomainControllerInfo\(.*\)$ ^samba4.smb2.oplock.exclusive2\(.*\)$ # samba 4 oplocks are a mess ^samba4.smb2.oplock.exclusive5\(.*\)$ # samba 4 oplocks are a mess diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index 8c3547d8469..a7686318865 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -332,14 +332,17 @@ for t in base + raw + smb2 + netapi: plansmbtorture4testsuite(t, "ad_dc_ntvfs", ['//$SERVER/tmp', '-U$USERNAME%$PASSWORD'] + ntvfsargs) libsmbclient = smbtorture4_testsuites("libsmbclient.") +protocols = [ 'NT1', 'SMB3' ] for t in libsmbclient: url = "smb://$USERNAME:$PASSWORD@$SERVER/tmp" if t == "libsmbclient.list_shares": url = "smb://$USERNAME:$PASSWORD@$SERVER" - libsmbclient_testargs = ["--option=torture:smburl=" + url, - "--option=torture:replace_smbconf=%s/testdata/samba3/smb_new.conf" % srcdir()] - plansmbtorture4testsuite(t, "ad_dc", ['//$SERVER/tmp', '-U$USERNAME%$PASSWORD'] + libsmbclient_testargs) + for proto in protocols: + libsmbclient_testargs = ["--option=torture:smburl=" + url, + "--option=torture:replace_smbconf=%s/testdata/samba3/smb_new.conf" % srcdir(), + "--option=torture:clientprotocol=%s" % proto] + plansmbtorture4testsuite(t, "ad_dc", ['//$SERVER/tmp', '-U$USERNAME%$PASSWORD'] + libsmbclient_testargs, "samba4.%s.%s" % (t, proto)) plansmbtorture4testsuite("raw.qfileinfo.ipc", "ad_dc_ntvfs", '//$SERVER/ipc\$ -U$USERNAME%$PASSWORD') diff --git a/source4/torture/libsmbclient/libsmbclient.c b/source4/torture/libsmbclient/libsmbclient.c index 853d002aa8d..f9154e8a19c 100644 --- a/source4/torture/libsmbclient/libsmbclient.c +++ b/source4/torture/libsmbclient/libsmbclient.c @@ -73,6 +73,8 @@ bool torture_libsmbclient_init_context(struct torture_context *tctx, cli_credentials_get_domain(popt_get_cmdline_credentials()); const char *username = cli_credentials_get_username(popt_get_cmdline_credentials()); + const char *client_proto = + torture_setting_string(tctx, "clientprotocol", NULL); SMBCCTX *ctx = NULL; SMBCCTX *p = NULL; bool ok = true; @@ -103,6 +105,10 @@ bool torture_libsmbclient_init_context(struct torture_context *tctx, smbc_setFunctionAuthData(ctx, auth_callback); + if (client_proto != NULL) { + smbc_setOptionProtocols(ctx, client_proto, client_proto); + } + *ctx_p = ctx; out: