2 # This script generates a list of testsuites that should be run as part of
3 # the Samba 3 test suite.
5 # The output of this script is parsed by selftest.pl, which then decides
6 # which of the tests to actually run. It will, for example, skip all tests
7 # listed in selftest/skip or only run a subset during "make quicktest".
9 # The idea is that this script outputs all of the tests of Samba 3, not
10 # just those that are known to pass, and list those that should be skipped
11 # or are known to fail in selftest/skip or selftest/samba4-knownfail. This makes it
12 # very easy to see what functionality is still missing in Samba 3 and makes
13 # it possible to run the testsuite against other servers, such as Samba 4 or
14 # Windows that have a different set of features.
16 # The syntax for a testsuite is "-- TEST --" on a single line, followed
17 # by the name of the test, the environment it needs and the command to run, all
18 # three separated by newlines. All other lines in the output are considered
22 sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), "../../selftest")))
23 from selftesthelpers import *
26 smb4torture = binpath("smbtorture4")
27 samba3srcdir = srcdir() + "/source3"
28 configuration = "--configfile=$SMB_CONF_PATH"
29 scriptdir=os.path.join(samba3srcdir, "../script/tests")
31 torture_options = [configuration, "--maximum-runtime=$SELFTEST_MAXTIME",
32 "--target=samba3", "--basedir=$SELFTEST_TMPDIR",
33 '--option="torture:winbindd_netbios_name=$SERVER"',
34 '--option="torture:winbindd_netbios_domain=$DOMAIN"',
35 '--option=torture:sharedelay=100000']
37 if not os.getenv("SELFTEST_VERBOSE"):
38 torture_options.append("--option=torture:progress=no")
39 torture_options.append("--format=subunit")
40 if os.getenv("SELFTEST_QUICK"):
41 torture_options.append("--option=torture:quick=yes")
42 smb4torture += " " + " ".join(torture_options)
44 def plansmbtorturetestsuite(name, env, options, description=''):
45 modname = "samba3.posix_s3.%s %s" % (name, description)
46 cmdline = "%s $LISTOPT %s %s" % (valgrindify(smb4torture), options, name)
47 plantestsuite_loadlist(modname, env, cmdline)
49 plantestsuite("samba3.blackbox.success", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_success.sh")])
50 plantestsuite("samba3.blackbox.failure", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_failure.sh")])
52 plantestsuite("samba3.local_s3", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_local_s3.sh")])
54 plantestsuite("samba3.blackbox.registry.upgrade", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_registry_upgrade.sh"), binpath('net'), binpath('dbwrap_tool')])
56 tests=[ "FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", "LOCK5", "LOCK6", "LOCK7", "LOCK9",
57 "UNLINK", "BROWSE", "ATTR", "TRANS2", "TORTURE",
58 "OPLOCK1", "OPLOCK2", "OPLOCK4", "STREAMERROR",
59 "DIR", "DIR1", "DIR-CREATETIME", "TCON", "TCONDEV", "RW1", "RW2", "RW3", "RW-SIGNING",
60 "OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "PROPERTIES", "W2K",
61 "TCON2", "IOCTL", "CHKPATH", "FDSESS", "LOCAL-SUBSTITUTE", "CHAIN1", "CHAIN2",
62 "GETADDRINFO", "POSIX", "UID-REGRESSION-TEST", "SHORTNAME-TEST",
63 "LOCAL-BASE64", "LOCAL-GENCACHE", "POSIX-APPEND",
64 "CASE-INSENSITIVE-CREATE", "SMB2-BASIC", "NTTRANS-FSCTL", "SMB2-NEGPROT",
70 plantestsuite("samba3.smbtorture_s3.plain(s3dc).%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', binpath('smbtorture3'), "", "-l $LOCAL_PATH"])
71 plantestsuite("samba3.smbtorture_s3.crypt(s3dc).%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', binpath('smbtorture3'), "-e", "-l $LOCAL_PATH"])
82 "LOCAL-string_to_sid",
83 "LOCAL-binary_to_sid",
85 "LOCAL-TEVENT-SELECT",
86 "LOCAL-CONVERT-STRING",
87 "LOCAL-CONV-AUTH-INFO",
88 "LOCAL-sprintf_append"]
91 plantestsuite("samba3.smbtorture_s3.%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', binpath('smbtorture3'), "-e"])
93 tests=["--ping", "--separator",
97 "--domain-info=BUILTIN",
98 "--domain-info=$DOMAIN",
100 "--online-status --domain=BUILTIN",
101 "--online-status --domain=$DOMAIN",
102 "--check-secret --domain=$DOMAIN",
103 "--change-secret --domain=$DOMAIN",
104 "--check-secret --domain=$DOMAIN",
105 "--online-status --domain=$DOMAIN",
106 #Didn't pass yet# "--domain-users",
108 "--name-to-sid=$USERNAME",
109 "--name-to-sid=$DOMAIN\\\\$USERNAME",
110 #Didn't pass yet# "--user-info=$USERNAME",
111 "--user-groups=$DOMAIN\\\\$USERNAME",
116 plantestsuite("samba3.wbinfo_s3.(s3dc:local).%s" % t, "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_wbinfo_s3.sh"), t])
117 plantestsuite("samba3.wbinfo_s3.(member:local).%s" % t, "member:local", [os.path.join(samba3srcdir, "script/tests/test_wbinfo_s3.sh"), t])
120 "samba3.wbinfo_sids2xids.(member:local)", "member:local",
121 [os.path.join(samba3srcdir, "script/tests/test_wbinfo_sids2xids.sh")])
123 plantestsuite("samba3.ntlm_auth.(s3dc:local)", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_s3.sh"), valgrindify(python), samba3srcdir, binpath('ntlm_auth3'), configuration])
125 for env in ["s3dc", "member"]:
126 plantestsuite("samba3.blackbox.smbclient_auth.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', binpath('smbclient3'), configuration])
128 for env in ["secserver"]:
129 plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) domain creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN\\\\$DC_USERNAME', '$DC_PASSWORD', binpath('smbclient3'), configuration + " --option=clientntlmv2auth=no"])
131 for env in ["member"]:
132 plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$SERVER\\\\$USERNAME', '$PASSWORD', binpath('smbclient3'), configuration])
134 for env in ["maptoguest", "secshare", "secserver"]:
135 plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) local creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', binpath('smbclient3'), configuration + " --option=clientntlmv2auth=no --option=clientlanmanauth=yes"])
138 plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) bad username" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', 'notmy$USERNAME', '$PASSWORD', binpath('smbclient3'), configuration + " --option=clientntlmv2auth=no --option=clientlanmanauth=yes"])
142 plantestsuite("samba3.blackbox.smbclient_s3.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration])
144 for env in ["member"]:
145 plantestsuite("samba3.blackbox.smbclient_s3.plain (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER', '$SERVER\\\\$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration])
148 plantestsuite("samba3.blackbox.smbclient_s3.sign (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration, "--signing=required"])
150 for env in ["member"]:
151 plantestsuite("samba3.blackbox.smbclient_s3.sign (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER', '$SERVER\\\\$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration, "--signing=required"])
155 plantestsuite("samba3.blackbox.smbclient_s3.crypt (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', binpath('smbclient3'), binpath('wbinfo'), configuration, "-e"])
157 #TODO encrypted against member, with member creds, and with DC creds
158 plantestsuite("samba3.blackbox.net.misc", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_misc.sh"),
159 scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration])
160 plantestsuite("samba3.blackbox.net.local.registry", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
161 scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration])
162 plantestsuite("samba3.blackbox.net.rpc.registry", "s3dc", [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
163 scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration, 'rpc'])
165 plantestsuite("samba3.blackbox.net.local.registry.roundtrip", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
166 scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration,])
167 plantestsuite("samba3.blackbox.net.rpc.registry.roundtrip", "s3dc", [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
168 scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration, 'rpc'])
170 plantestsuite("samba3.blackbox.net.local.conf", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
171 scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration,])
172 plantestsuite("samba3.blackbox.net.rpc.conf", "s3dc", [os.path.join(samba3srcdir, "script/tests/test_net_conf.sh"),
173 scriptdir, "$SMB_CONF_PATH", binpath('net'), configuration, 'rpc'])
176 plantestsuite("samba3.blackbox.testparm", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_testparm_s3.sh"),
180 "samba3.pthreadpool", "s3dc",
181 [os.path.join(samba3srcdir, "script/tests/test_pthreadpool.sh")])
185 base = ["base.attr", "base.charset", "base.chkpath", "base.defer_open", "base.delaywrite", "base.delete",
186 "base.deny1", "base.deny2", "base.deny3", "base.denydos", "base.dir1", "base.dir2",
187 "base.disconnect", "base.fdpass", "base.lock",
188 "base.mangle", "base.negnowait", "base.ntdeny1",
189 "base.ntdeny2", "base.open", "base.openattr", "base.properties", "base.rename", "base.rw1",
190 "base.secleak", "base.tcon", "base.tcondev", "base.trans2", "base.unlink", "base.vuid",
191 "base.xcopy", "base.samba3error"]
193 raw = ["raw.acls", "raw.chkpath", "raw.close", "raw.composite", "raw.context", "raw.eas",
194 "raw.ioctl", "raw.lock", "raw.mkdir", "raw.mux", "raw.notify", "raw.open", "raw.oplock"
195 "raw.qfileinfo", "raw.qfsinfo", "raw.read", "raw.rename", "raw.search", "raw.seek",
196 "raw.sfileinfo.base", "raw.sfileinfo.bug", "raw.streams", "raw.unlink", "raw.write",
197 "raw.samba3hide", "raw.samba3badpath", "raw.sfileinfo.rename",
198 "raw.samba3caseinsensitive", "raw.samba3posixtimedlock",
199 "raw.samba3rootdirfid", "raw.sfileinfo.end-of-file",
200 "raw.bench-oplock", "raw.bench-lock", "raw.bench-open", "raw.bench-tcon",
201 "raw.samba3checkfsp", "raw.samba3closeerr", "raw.samba3oplocklogoff"]
203 smb2 = ["smb2.lock", "smb2.read", "smb2.compound", "smb2.connect", "smb2.scan", "smb2.scanfind",
206 rpc = ["rpc.authcontext", "rpc.samba3.bind", "rpc.samba3.srvsvc", "rpc.samba3.sharesec",
207 "rpc.samba3.spoolss", "rpc.samba3.wkssvc", "rpc.samba3.winreg",
208 "rpc.samba3.getaliasmembership-0",
209 "rpc.samba3.netlogon", "rpc.samba3.sessionkey", "rpc.samba3.getusername",
210 "rpc.svcctl", "rpc.ntsvcs", "rpc.winreg", "rpc.eventlog",
211 "rpc.spoolss.printserver", "rpc.spoolss.win", "rpc.spoolss.notify", "rpc.spoolss.printer",
212 "rpc.spoolss.driver",
213 "rpc.lsa", "rpc.lsa-getuser", "rpc.lsa.lookupsids", "rpc.lsa.lookupnames",
214 "rpc.lsa.privileges", "rpc.lsa.secrets",
215 "rpc.samr", "rpc.samr.users", "rpc.samr.users.privileges", "rpc.samr.passwords",
216 "rpc.samr.passwords.pwdlastset", "rpc.samr.large-dc", "rpc.samr.machine.auth",
218 "rpc.netlogon.admin",
219 "rpc.schannel", "rpc.schannel2", "rpc.bench-schannel1", "rpc.join", "rpc.bind"]
221 local = ["local.nss-wrapper", "local.ndr"]
223 winbind = ["winbind.struct", "winbind.wbclient"]
225 rap = ["rap.basic", "rap.rpc", "rap.printing", "rap.sam"]
227 unix = ["unix.info2", "unix.whoami"]
231 libsmbclient = ["libsmbclient"]
233 tests= base + raw + smb2 + rpc + unix + local + winbind + rap + nbt + libsmbclient
235 sub = subprocess.Popen("%s --version 2> /dev/null" % smb4torture, stdout=subprocess.PIPE, stdin=subprocess.PIPE, shell=True)
238 if sub.returncode == 0:
240 if t == "base.delaywrite":
241 plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --maximum-runtime=900')
243 plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=doscharset=ISO-8859-1')
244 elif t == "unix.whoami":
245 plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD')
246 elif t == "raw.samba3posixtimedlock":
247 plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/s3dc/share')
248 elif t == "raw.chkpath":
249 plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
251 plansmbtorturetestsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
254 test = 'rpc.lsa.lookupsids'
255 auth_options = ["", "ntlm", "spnego", "spnego,ntlm" ]
256 signseal_options = ["", ",connect", ",sign", ",seal"]
257 smb_options = ["", ",smb2"]
258 endianness_options = ["", ",bigendian"]
259 for z in smb_options:
260 for s in signseal_options:
261 for e in endianness_options:
262 for a in auth_options:
263 binding_string = "ncacn_np:$SERVER[%s%s%s%s]" % (a, s, z, e)
264 options = binding_string + " -U$USERNAME%$PASSWORD"
265 plansmbtorturetestsuite(test, "s3dc", options, 'over ncacn_np with [%s%s%s%s] ' % (a, s, z, e))
266 plantestsuite("samba3.blackbox.rpcclient over ncacn_np with [%s%s%s%s] " % (a, s, z, e), "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient.sh"),
267 "none", options, configuration])
269 # We should try more combinations in future, but this is all
270 # the pre-calculated credentials cache supports at the moment
273 binding_string = "ncacn_np:$SERVER[%s%s%s%s]" % (a, s, z, e)
274 options = binding_string + " -k yes --krb5-ccache=$PREFIX/ktest/krb5_ccache-2"
275 plansmbtorturetestsuite(test, "ktest", options, 'over kerberos with old ccache ncacn_np with [%s%s%s%s] ' % (a, s, z, e))
277 options = binding_string + " -k yes --krb5-ccache=$PREFIX/ktest/krb5_ccache-3"
278 plansmbtorturetestsuite(test, "ktest", options, 'over kerberos ncacn_np with [%s%s%s%s] ' % (a, s, z, e))
280 auth_options2 = ["krb5", "spnego,krb5"]
281 for a in auth_options2:
282 binding_string = "ncacn_np:$SERVER[%s%s%s%s]" % (a, s, z, e)
284 plantestsuite("samba3.blackbox.rpcclient over kerberos with ncacn_np with [%s%s%s%s] " % (a, s, z, e), "ktest:local", [os.path.join(samba3srcdir, "script/tests/test_rpcclient.sh"),
285 "$PREFIX/ktest/krb5_ccache-3", binding_string, "-k", configuration])
289 for e in endianness_options:
290 for a in auth_options:
291 for s in signseal_options:
292 binding_string = "ncacn_ip_tcp:$SERVER_IP[%s%s%s]" % (a, s, e)
293 options = binding_string + " -U$USERNAME%$PASSWORD"
294 plansmbtorturetestsuite(test, "s3dc", options, 'over ncacn_ip_tcp with [%s%s%s] ' % (a, s, e))
296 test = 'rpc.epmapper'
298 binding_string = 'ncalrpc:'
299 options = binding_string + " -U$USERNAME%$PASSWORD"
301 plansmbtorturetestsuite(test, env, options, 'over ncalrpc')