2012-09-27 20:41:32 +04:00
#!/usr/bin/python
# This script generates a list of testsuites that should be run as part of
2012-10-05 13:39:34 +04:00
# the Samba test suite.
2012-09-27 20:41:32 +04:00
# The output of this script is parsed by selftest.pl, which then decides
# which of the tests to actually run. It will, for example, skip all tests
# listed in selftest/skip or only run a subset during "make quicktest".
2012-10-05 13:39:34 +04:00
# The idea is that this script outputs all of the tests of Samba, not
2012-09-27 20:41:32 +04:00
# just those that are known to pass, and list those that should be skipped
# or are known to fail in selftest/skip or selftest/knownfail. This makes it
2012-10-05 13:39:34 +04:00
# very easy to see what functionality is still missing in Samba and makes
# it possible to run the testsuite against other servers, such as
2012-09-27 20:41:32 +04:00
# Windows that have a different set of features.
# The syntax for a testsuite is "-- TEST --" on a single line, followed
# by the name of the test, the environment it needs and the command to run, all
# three separated by newlines. All other lines in the output are considered
# comments.
2018-10-11 06:05:23 +03:00
import os
from selftesthelpers import bindir , srcdir , python
from selftesthelpers import planpythontestsuite , samba4srcdir
from selftesthelpers import plantestsuite , bbdir
from selftesthelpers import configuration , valgrindify
from selftesthelpers import skiptestsuite
2012-09-27 20:41:32 +04:00
2013-05-06 02:37:58 +04:00
try :
config_h = os . environ [ " CONFIG_H " ]
except KeyError :
2016-07-29 01:57:52 +03:00
samba4bindir = bindir ( )
2013-05-06 02:37:58 +04:00
config_h = os . path . join ( samba4bindir , " default/include/config.h " )
2016-12-15 12:33:59 +03:00
# check available features
config_hash = dict ( )
2013-05-06 02:37:58 +04:00
f = open ( config_h , ' r ' )
try :
2016-12-15 12:33:59 +03:00
lines = f . readlines ( )
config_hash = dict ( ( x [ 0 ] , ' ' . join ( x [ 1 : ] ) )
2018-07-30 09:16:12 +03:00
for x in map ( lambda line : line . strip ( ) . split ( ' ' ) [ 1 : ] ,
2018-11-28 17:15:23 +03:00
list ( filter ( lambda line : ( line [ 0 : 7 ] == ' #define ' ) and ( len ( line . split ( ' ' ) ) > 2 ) , lines ) ) ) )
2013-05-06 02:37:58 +04:00
finally :
f . close ( )
2016-12-15 12:33:59 +03:00
have_man_pages_support = ( " XSLTPROC_MANPAGES " in config_hash )
2017-04-10 08:50:41 +03:00
with_pam = ( " WITH_PAM " in config_hash )
2018-07-30 09:18:03 +03:00
pam_wrapper_so_path = config_hash [ " LIBPAM_WRAPPER_SO_PATH " ]
2018-05-31 22:16:31 +03:00
pam_set_items_so_path = config_hash [ " PAM_SET_ITEMS_SO_PATH " ]
2016-12-15 12:33:59 +03:00
2018-04-05 03:49:09 +03:00
planpythontestsuite ( " none " , " samba.tests.source " , py3_compatible = True )
2013-05-06 02:37:58 +04:00
if have_man_pages_support :
2018-04-05 04:48:36 +03:00
planpythontestsuite ( " none " , " samba.tests.docs " , py3_compatible = True )
2013-05-06 02:37:58 +04:00
2014-11-02 01:57:35 +03:00
try :
import testscenarios
except ImportError :
skiptestsuite ( " subunit " , " testscenarios not available " )
else :
planpythontestsuite ( " none " , " subunit.tests.test_suite " )
2018-04-05 06:03:18 +03:00
planpythontestsuite ( " none " , " samba.tests.blackbox.ndrdump " , py3_compatible = True )
2018-03-23 04:10:28 +03:00
planpythontestsuite ( " none " , " samba.tests.blackbox.check_output " , py3_compatible = True )
2018-11-12 20:56:46 +03:00
planpythontestsuite ( " none " , " api " , name = " ldb.python " , extra_path = [ ' lib/ldb/tests/python ' ] , py3_compatible = True )
2016-12-10 17:11:14 +03:00
planpythontestsuite ( " none " , " samba.tests.credentials " , py3_compatible = True )
2017-10-11 14:05:01 +03:00
planpythontestsuite ( " none " , " samba.tests.registry " , py3_compatible = True )
2018-07-11 07:48:07 +03:00
planpythontestsuite ( " ad_dc_ntvfs:local " , " samba.tests.auth " , py3_compatible = True )
2017-01-18 12:44:08 +03:00
planpythontestsuite ( " none " , " samba.tests.get_opt " , py3_compatible = True )
2017-08-08 09:50:35 +03:00
planpythontestsuite ( " none " , " samba.tests.security " , py3_compatible = True )
2017-01-18 13:38:55 +03:00
planpythontestsuite ( " none " , " samba.tests.dcerpc.misc " , py3_compatible = True )
2015-07-30 05:29:54 +03:00
planpythontestsuite ( " none " , " samba.tests.dcerpc.integer " )
2016-12-10 17:11:14 +03:00
planpythontestsuite ( " none " , " samba.tests.param " , py3_compatible = True )
2018-04-03 05:29:26 +03:00
planpythontestsuite ( " none " , " samba.tests.upgrade " , py3_compatible = True )
2017-01-02 16:10:29 +03:00
planpythontestsuite ( " none " , " samba.tests.core " , py3_compatible = True )
2018-03-26 07:07:33 +03:00
planpythontestsuite ( " none " , " samba.tests.common " , py3_compatible = True )
2018-03-05 19:08:01 +03:00
planpythontestsuite ( " none " , " samba.tests.provision " , py3_compatible = True )
2018-04-03 05:47:41 +03:00
planpythontestsuite ( " none " , " samba.tests.password_quality " , py3_compatible = True )
2012-10-05 13:51:37 +04:00
planpythontestsuite ( " none " , " samba.tests.strings " )
planpythontestsuite ( " none " , " samba.tests.netcmd " )
2018-04-03 06:11:48 +03:00
planpythontestsuite ( " none " , " samba.tests.dcerpc.rpc_talloc " , py3_compatible = True )
2018-04-03 06:13:09 +03:00
planpythontestsuite ( " none " , " samba.tests.dcerpc.array " , py3_compatible = True )
py:dcerpc/tests: rename dcerpc/string.py -> string_tests.py
Otherwise it's not possible to run the raw_protocol tests anymore:
python/samba/tests/dcerpc/raw_protocol.py
Traceback (most recent call last):
File "python/samba/tests/dcerpc/raw_protocol.py", line 26, in <module>
import samba.dcerpc.dcerpc as dcerpc
File "bin/python/samba/__init__.py", line 32, in <module>
from samba.compat import string_types
File "bin/python/samba/compat.py", line 151, in <module>
from urllib import quote as urllib_quote
File "/usr/lib/python2.7/urllib.py", line 25, in <module>
import string
File "/abs/path/samba/python/samba/tests/dcerpc/string.py", line 22, in <module>
# Some strings for ctype-style character classification
File "bin/python/samba/tests/__init__.py", line 36, in <module>
from samba.compat import text_type
ImportError: cannot import name text_type
This allows the following again:
SMB_CONF_PATH=/dev/null \
SERVER=172.31.9.188 \
TARGET_HOSTNAME=w2012r2-188.w2012r2-l6.base \
USERNAME=administrator \
PASSWORD=A1b2C3d4 \
DOMAIN=W2012R2-L6 \
REALM=W2012R2-L6.BASE \
python/samba/tests/dcerpc/raw_protocol.py -v -f TestDCERPC_BIND
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-11-20 10:25:31 +03:00
planpythontestsuite ( " none " , " samba.tests.dcerpc.string_tests " , py3_compatible = True )
2018-04-03 06:24:28 +03:00
planpythontestsuite ( " none " , " samba.tests.hostconfig " , py3_compatible = True )
2017-09-14 10:31:17 +03:00
planpythontestsuite ( " ad_dc_ntvfs:local " , " samba.tests.messaging " ,
py3_compatible = True )
2018-03-22 15:21:12 +03:00
planpythontestsuite ( " none " , " samba.tests.s3param " , py3_compatible = True )
2018-03-22 15:26:15 +03:00
planpythontestsuite ( " none " , " samba.tests.s3passdb " , py3_compatible = True )
2018-03-22 15:35:11 +03:00
planpythontestsuite ( " none " , " samba.tests.s3registry " , py3_compatible = True )
2018-03-22 15:39:43 +03:00
planpythontestsuite ( " none " , " samba.tests.s3windb " , py3_compatible = True )
2018-03-22 15:46:55 +03:00
planpythontestsuite ( " none " , " samba.tests.s3idmapdb " , py3_compatible = True )
2012-10-05 13:51:37 +04:00
planpythontestsuite ( " none " , " samba.tests.samba3sam " )
2014-06-02 04:53:01 +04:00
planpythontestsuite (
" none " , " wafsamba.tests.test_suite " ,
extra_path = [ os . path . join ( samba4srcdir , " .. " , " buildtools " ) ,
2018-07-03 14:57:48 +03:00
os . path . join ( samba4srcdir , " .. " , " third_party " , " waf " ) ] )
2015-10-23 05:38:23 +03:00
plantestsuite (
" samba4.blackbox.demote-saveddb " , " none " ,
[ " PYTHON= %s " % python , os . path . join ( bbdir , " demote-saveddb.sh " ) ,
' $PREFIX_ABS/demote ' , configuration ] )
2014-06-02 04:53:01 +04:00
plantestsuite (
" samba4.blackbox.dbcheck.alpha13 " , " none " ,
[ " PYTHON= %s " % python , os . path . join ( bbdir , " dbcheck-oldrelease.sh " ) ,
' $PREFIX_ABS/provision ' , ' alpha13 ' , configuration ] )
plantestsuite (
" samba4.blackbox.dbcheck.release-4-0-0 " , " none " ,
[ " PYTHON= %s " % python , os . path . join ( bbdir , " dbcheck-oldrelease.sh " ) ,
' $PREFIX_ABS/provision ' , ' release-4-0-0 ' , configuration ] )
plantestsuite (
" samba4.blackbox.dbcheck.release-4-1-0rc3 " , " none " ,
[ " PYTHON= %s " % python , os . path . join ( bbdir , " dbcheck-oldrelease.sh " ) ,
' $PREFIX_ABS/provision ' , ' release-4-1-0rc3 ' , configuration ] )
plantestsuite (
" samba4.blackbox.dbcheck.release-4-1-6-partial-object " , " none " ,
[ " PYTHON= %s " % python , os . path . join ( bbdir , " dbcheck-oldrelease.sh " ) ,
' $PREFIX_ABS/provision ' , ' release-4-1-6-partial-object ' , configuration ] )
2016-08-31 02:39:24 +03:00
plantestsuite (
" samba4.blackbox.dbcheck.release-4-5-0-pre1 " , " none " ,
[ " PYTHON= %s " % python ,
os . path . join ( bbdir , " dbcheck-oldrelease.sh " ) ,
' $PREFIX_ABS/provision ' , ' release-4-5-0-pre1 ' , configuration ] )
2014-06-02 04:53:01 +04:00
plantestsuite (
" samba4.blackbox.upgradeprovision.alpha13 " , " none " ,
[ " PYTHON= %s " % python ,
os . path . join ( bbdir , " upgradeprovision-oldrelease.sh " ) ,
' $PREFIX_ABS/provision ' , ' alpha13 ' , configuration ] )
plantestsuite (
" samba4.blackbox.upgradeprovision.release-4-0-0 " , " none " ,
[ " PYTHON= %s " % python ,
os . path . join ( bbdir , " upgradeprovision-oldrelease.sh " ) ,
' $PREFIX_ABS/provision ' , ' release-4-0-0 ' , configuration ] )
2016-08-31 08:07:29 +03:00
plantestsuite (
" samba4.blackbox.tombstones-expunge.release-4-5-0-pre1 " , " none " ,
[ " PYTHON= %s " % python ,
os . path . join ( bbdir , " tombstones-expunge.sh " ) ,
' $PREFIX_ABS/provision ' , ' release-4-5-0-pre1 ' , configuration ] )
2016-11-07 01:39:53 +03:00
plantestsuite (
" samba4.blackbox.dbcheck-links.release-4-5-0-pre1 " , " none " ,
[ " PYTHON= %s " % python ,
os . path . join ( bbdir , " dbcheck-links.sh " ) ,
' $PREFIX_ABS/provision ' , ' release-4-5-0-pre1 ' , configuration ] )
2017-10-31 23:02:01 +03:00
plantestsuite (
" samba4.blackbox.runtime-links.release-4-5-0-pre1 " , " none " ,
[ " PYTHON= %s " % python ,
os . path . join ( bbdir , " runtime-links.sh " ) ,
' $PREFIX_ABS/provision ' , ' release-4-5-0-pre1 ' , configuration ] )
2017-10-06 06:30:40 +03:00
plantestsuite (
" samba4.blackbox.schemaupgrade " , " none " ,
[ " PYTHON= %s " % python ,
os . path . join ( bbdir , " schemaupgrade.sh " ) ,
' $PREFIX_ABS/provision ' , configuration ] )
2017-12-15 05:43:32 +03:00
plantestsuite (
" samba4.blackbox.functionalprep " , " none " ,
[ " PYTHON= %s " % python ,
os . path . join ( bbdir , " functionalprep.sh " ) ,
' $PREFIX_ABS/provision ' , configuration ] )
2018-04-04 02:19:48 +03:00
planpythontestsuite ( " none " , " samba.tests.upgradeprovision " , py3_compatible = True )
2017-10-24 10:00:11 +03:00
planpythontestsuite ( " none " , " samba.tests.xattr " , py3_compatible = True )
2018-03-28 12:33:12 +03:00
planpythontestsuite ( " none " , " samba.tests.ntacls " , py3_compatible = True )
2018-04-04 02:29:41 +03:00
planpythontestsuite ( " none " , " samba.tests.policy " , py3_compatible = True )
planpythontestsuite ( " none " , " samba.tests.kcc.graph " , py3_compatible = True )
2018-04-04 04:07:38 +03:00
planpythontestsuite ( " none " , " samba.tests.kcc.graph_utils " , py3_compatible = True )
2015-04-30 05:33:30 +03:00
planpythontestsuite ( " none " , " samba.tests.kcc.ldif_import_export " )
2018-04-10 06:52:47 +03:00
planpythontestsuite ( " none " , " samba.tests.graph " , py3_compatible = True )
2014-10-13 04:48:10 +04:00
plantestsuite ( " wafsamba.duplicate_symbols " , " none " , [ os . path . join ( srcdir ( ) , " buildtools/wafsamba/test_duplicate_symbol.sh " ) ] )
2016-12-10 17:11:14 +03:00
planpythontestsuite ( " none " , " samba.tests.glue " , py3_compatible = True )
2017-07-04 12:39:28 +03:00
planpythontestsuite ( " none " , " samba.tests.tdb_util " , py3_compatible = True )
2018-04-05 01:47:16 +03:00
planpythontestsuite ( " none " , " samba.tests.samdb_api " , py3_compatible = True )
2016-12-15 12:33:59 +03:00
2017-04-10 08:50:41 +03:00
if with_pam :
2017-06-09 16:45:25 +03:00
plantestsuite ( " samba.tests.pam_winbind(local) " , " ad_member " ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $SERVER " , " $USERNAME " , " $PASSWORD " ] )
plantestsuite ( " samba.tests.pam_winbind(domain) " , " ad_member " ,
2017-06-09 15:52:59 +03:00
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
2017-06-09 16:15:15 +03:00
valgrindify ( python ) , pam_wrapper_so_path ,
" $DOMAIN " , " $DC_USERNAME " , " $DC_PASSWORD " ] )
2018-05-31 22:16:31 +03:00
for pam_options in [ " ' ' " , " use_authtok " , " try_authtok " ] :
plantestsuite ( " samba.tests.pam_winbind_chauthtok with options %s " % pam_options , " ad_member " ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind_chauthtok.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path , pam_set_items_so_path ,
" $DOMAIN " , " TestPamOptionsUser " , " oldp@ssword0 " , " newp@ssword0 " ,
pam_options , ' yes ' ,
" $DC_SERVER " , " $DC_USERNAME " , " $DC_PASSWORD " ] )
2017-08-01 17:07:58 +03:00
plantestsuite ( " samba.tests.pam_winbind_warn_pwd_expire(domain) " , " ad_member " ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind_warn_pwd_expire.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $DOMAIN " , " alice " , " Secret007 " ] )
2017-04-05 16:59:39 +03:00
2017-06-08 17:08:15 +03:00
2018-02-22 01:54:45 +03:00
plantestsuite ( " samba.unittests.krb5samba " , " none " ,
[ os . path . join ( bindir ( ) , " default/testsuite/unittests/test_krb5samba " ) ] )
plantestsuite ( " samba.unittests.sambafs_srv_pipe " , " none " ,
[ os . path . join ( bindir ( ) , " default/testsuite/unittests/test_sambafs_srv_pipe " ) ] )
plantestsuite ( " samba.unittests.lib_util_modules " , " none " ,
[ os . path . join ( bindir ( ) , " default/testsuite/unittests/test_lib_util_modules " ) ] )
2018-02-19 14:08:26 +03:00
2018-02-22 01:54:45 +03:00
plantestsuite ( " samba.unittests.smb1cli_session " , " none " ,
[ os . path . join ( bindir ( ) , " default/libcli/smb/test_smb1cli_session " ) ] )
plantestsuite ( " samba.unittests.tldap " , " none " ,
[ os . path . join ( bindir ( ) , " default/source3/test_tldap " ) ] )
2018-02-17 23:53:32 +03:00
plantestsuite ( " samba.unittests.rfc1738 " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/util/test_rfc1738 " ) ] )
2018-05-01 02:10:24 +03:00
plantestsuite ( " samba.unittests.kerberos " , " none " ,
[ os . path . join ( bindir ( ) , " test_kerberos " ) ] )
2018-02-20 13:08:47 +03:00
plantestsuite ( " samba.unittests.ms_fnmatch " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/util/test_ms_fnmatch " ) ] )
2018-07-26 23:44:24 +03:00
plantestsuite ( " samba.unittests.ntlm_check " , " none " ,
[ os . path . join ( bindir ( ) , " default/libcli/auth/test_ntlm_check " ) ] )