2012-09-27 09:41:32 -07:00
#!/usr/bin/python
# This script generates a list of testsuites that should be run as part of
2012-10-05 11:39:34 +02:00
# the Samba test suite.
2012-09-27 09:41:32 -07: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 11:39:34 +02:00
# The idea is that this script outputs all of the tests of Samba, not
2012-09-27 09:41:32 -07: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 11:39:34 +02: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 09:41:32 -07: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.
from selftesthelpers import *
2013-05-05 15:37:58 -07:00
try :
config_h = os . environ [ " CONFIG_H " ]
except KeyError :
2016-07-29 10:57:52 +12:00
samba4bindir = bindir ( )
2013-05-05 15:37:58 -07:00
config_h = os . path . join ( samba4bindir , " default/include/config.h " )
2016-12-15 10:33:59 +01:00
# check available features
config_hash = dict ( )
2013-05-05 15:37:58 -07:00
f = open ( config_h , ' r ' )
try :
2016-12-15 10:33:59 +01:00
lines = f . readlines ( )
config_hash = dict ( ( x [ 0 ] , ' ' . join ( x [ 1 : ] ) )
for x in map ( lambda line : line . strip ( ) . split ( ' ' ) [ 1 : ] ,
filter ( lambda line : ( line [ 0 : 7 ] == ' #define ' ) and ( len ( line . split ( ' ' ) ) > 2 ) , lines ) ) )
2013-05-05 15:37:58 -07:00
finally :
f . close ( )
2016-12-15 10:33:59 +01:00
have_man_pages_support = ( " XSLTPROC_MANPAGES " in config_hash )
with_cmocka = ( " HAVE_CMOCKA " in config_hash )
2017-04-10 07:50:41 +02:00
with_pam = ( " WITH_PAM " in config_hash )
2017-04-05 15:59:39 +02:00
pam_wrapper_so_path = config_hash [ " LIBPAM_WRAPPER_SO_PATH " ]
2016-12-15 10:33:59 +01:00
2012-09-27 09:41:32 -07:00
planpythontestsuite ( " none " , " samba.tests.source " )
2013-05-05 15:37:58 -07:00
if have_man_pages_support :
planpythontestsuite ( " none " , " samba.tests.docs " )
2014-11-01 15:57:35 -07:00
try :
import testscenarios
except ImportError :
skiptestsuite ( " subunit " , " testscenarios not available " )
else :
planpythontestsuite ( " none " , " subunit.tests.test_suite " )
2012-10-05 11:51:37 +02:00
planpythontestsuite ( " none " , " samba.tests.blackbox.ndrdump " )
planpythontestsuite ( " none " , " api " , name = " ldb.python " , extra_path = [ ' lib/ldb/tests/python ' ] )
2016-12-10 15:11:14 +01:00
planpythontestsuite ( " none " , " samba.tests.credentials " , py3_compatible = True )
2012-10-05 11:51:37 +02:00
planpythontestsuite ( " none " , " samba.tests.registry " )
2016-12-20 10:57:13 +01:00
planpythontestsuite ( " none " , " samba.tests.auth " , py3_compatible = True )
2017-01-18 10:44:08 +01:00
planpythontestsuite ( " none " , " samba.tests.get_opt " , py3_compatible = True )
2017-08-08 08:50:35 +02:00
planpythontestsuite ( " none " , " samba.tests.security " , py3_compatible = True )
2017-01-18 11:38:55 +01:00
planpythontestsuite ( " none " , " samba.tests.dcerpc.misc " , py3_compatible = True )
2015-07-30 14:29:54 +12:00
planpythontestsuite ( " none " , " samba.tests.dcerpc.integer " )
2016-12-10 15:11:14 +01:00
planpythontestsuite ( " none " , " samba.tests.param " , py3_compatible = True )
2012-10-05 11:51:37 +02:00
planpythontestsuite ( " none " , " samba.tests.upgrade " )
2017-01-02 14:10:29 +01:00
planpythontestsuite ( " none " , " samba.tests.core " , py3_compatible = True )
2012-10-05 11:51:37 +02:00
planpythontestsuite ( " none " , " samba.tests.provision " )
planpythontestsuite ( " none " , " samba.tests.samba3 " )
planpythontestsuite ( " none " , " samba.tests.strings " )
planpythontestsuite ( " none " , " samba.tests.netcmd " )
planpythontestsuite ( " none " , " samba.tests.dcerpc.rpc_talloc " )
2016-05-04 11:21:47 +12:00
planpythontestsuite ( " none " , " samba.tests.dcerpc.array " )
2016-05-04 11:24:12 +12:00
planpythontestsuite ( " none " , " samba.tests.dcerpc.string " )
2012-10-05 11:51:37 +02:00
planpythontestsuite ( " none " , " samba.tests.hostconfig " )
2015-03-05 23:38:26 +01:00
planpythontestsuite ( " ad_dc_ntvfs:local " , " samba.tests.messaging " )
2012-10-05 11:51:37 +02:00
planpythontestsuite ( " none " , " samba.tests.samba3sam " )
2014-06-02 02:53:01 +02:00
planpythontestsuite (
" none " , " wafsamba.tests.test_suite " ,
extra_path = [ os . path . join ( samba4srcdir , " .. " , " buildtools " ) ,
2015-03-25 11:13:40 +00:00
os . path . join ( samba4srcdir , " .. " , " third_party " , " waf " , " wafadmin " ) ] )
2015-10-23 15:38:23 +13:00
plantestsuite (
" samba4.blackbox.demote-saveddb " , " none " ,
[ " PYTHON= %s " % python , os . path . join ( bbdir , " demote-saveddb.sh " ) ,
' $PREFIX_ABS/demote ' , configuration ] )
2014-06-02 02:53:01 +02: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 11:39:24 +12: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 02:53:01 +02: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 17:07:29 +12: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 11:39:53 +13: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 ] )
2012-10-05 11:51:37 +02:00
planpythontestsuite ( " none " , " samba.tests.upgradeprovision " )
planpythontestsuite ( " none " , " samba.tests.xattr " )
planpythontestsuite ( " none " , " samba.tests.ntacls " )
planpythontestsuite ( " none " , " samba.tests.policy " )
2015-05-06 11:20:28 +12:00
planpythontestsuite ( " none " , " samba.tests.kcc.graph " )
2015-04-30 14:33:30 +12:00
planpythontestsuite ( " none " , " samba.tests.kcc.graph_utils " )
2015-05-05 11:26:42 +12:00
planpythontestsuite ( " none " , " samba.tests.kcc.kcc_utils " )
2015-04-30 14:33:30 +12:00
planpythontestsuite ( " none " , " samba.tests.kcc.ldif_import_export " )
2014-10-12 17:48:10 -07:00
plantestsuite ( " wafsamba.duplicate_symbols " , " none " , [ os . path . join ( srcdir ( ) , " buildtools/wafsamba/test_duplicate_symbol.sh " ) ] )
2016-12-10 15:11:14 +01:00
planpythontestsuite ( " none " , " samba.tests.glue " , py3_compatible = True )
2017-07-04 11:39:28 +02:00
planpythontestsuite ( " none " , " samba.tests.tdb_util " , py3_compatible = True )
2016-12-15 10:33:59 +01:00
2017-04-10 07:50:41 +02:00
if with_pam :
2017-06-09 15:45:25 +02: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 14:52:59 +02:00
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
2017-06-09 15:15:15 +02:00
valgrindify ( python ) , pam_wrapper_so_path ,
" $DOMAIN " , " $DC_USERNAME " , " $DC_PASSWORD " ] )
2017-08-01 16:07:58 +02: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 15:59:39 +02:00
2016-12-15 10:33:59 +01:00
if with_cmocka :
plantestsuite ( " samba.unittests.krb5samba " , " none " ,
[ os . path . join ( bindir ( ) , " default/testsuite/unittests/test_krb5samba " ) ] )
2017-05-11 11:29:25 +02:00
plantestsuite ( " samba.unittests.sambafs_srv_pipe " , " none " ,
[ os . path . join ( bindir ( ) , " default/testsuite/unittests/test_sambafs_srv_pipe " ) ] )
2017-05-12 14:13:42 +02:00
plantestsuite ( " samba.unittests.lib_util_modules " , " none " ,
[ os . path . join ( bindir ( ) , " default/testsuite/unittests/test_lib_util_modules " ) ] )
2017-06-08 16:08:15 +02:00
plantestsuite ( " samba.unittests.smb1cli_session " , " none " ,
[ os . path . join ( bindir ( ) , " default/libcli/smb/test_smb1cli_session " ) ] )