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.
2022-04-12 17:56:25 +03:00
import os , tempfile
2018-10-11 06:05:23 +03:00
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 )
2020-06-22 17:06:36 +03:00
with_elasticsearch_backend = ( " HAVE_SPOTLIGHT_BACKEND_ES " in config_hash )
2021-04-14 09:35:40 +03:00
pam_wrapper_so_path = config_hash . get ( " LIBPAM_WRAPPER_SO_PATH " )
pam_set_items_so_path = config_hash . get ( " PAM_SET_ITEMS_SO_PATH " )
2022-10-12 03:55:39 +03:00
have_heimdal_support = " SAMBA4_USES_HEIMDAL " in config_hash
using_system_gssapi = " USING_SYSTEM_GSSAPI " in config_hash
2016-12-15 12:33:59 +03:00
2019-02-15 07:30:43 +03:00
planpythontestsuite ( " none " , " samba.tests.source " )
2021-11-16 23:23:04 +03:00
planpythontestsuite ( " none " , " samba.tests.source_chars " )
2013-05-06 02:37:58 +04:00
if have_man_pages_support :
2019-02-15 07:30:43 +03:00
planpythontestsuite ( " none " , " samba.tests.docs " )
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 " )
2019-02-15 07:30:43 +03:00
planpythontestsuite ( " none " , " samba.tests.blackbox.ndrdump " )
planpythontestsuite ( " none " , " samba.tests.blackbox.check_output " )
planpythontestsuite ( " none " , " api " , name = " ldb.python " , extra_path = [ ' lib/ldb/tests/python ' ] )
planpythontestsuite ( " none " , " samba.tests.credentials " )
planpythontestsuite ( " none " , " samba.tests.registry " )
planpythontestsuite ( " ad_dc_ntvfs:local " , " samba.tests.auth " )
planpythontestsuite ( " none " , " samba.tests.get_opt " )
2019-11-08 23:06:53 +03:00
planpythontestsuite ( " none " , " samba.tests.cred_opt " )
2019-02-15 07:30:43 +03:00
planpythontestsuite ( " none " , " samba.tests.security " )
planpythontestsuite ( " none " , " samba.tests.dcerpc.misc " )
2015-07-30 05:29:54 +03:00
planpythontestsuite ( " none " , " samba.tests.dcerpc.integer " )
2019-02-15 07:30:43 +03:00
planpythontestsuite ( " none " , " samba.tests.param " )
planpythontestsuite ( " none " , " samba.tests.upgrade " )
planpythontestsuite ( " none " , " samba.tests.core " )
planpythontestsuite ( " none " , " samba.tests.common " )
planpythontestsuite ( " none " , " samba.tests.provision " )
planpythontestsuite ( " none " , " samba.tests.password_quality " )
2012-10-05 13:51:37 +04:00
planpythontestsuite ( " none " , " samba.tests.strings " )
planpythontestsuite ( " none " , " samba.tests.netcmd " )
2019-02-15 07:30:43 +03:00
planpythontestsuite ( " none " , " samba.tests.dcerpc.rpc_talloc " )
planpythontestsuite ( " none " , " samba.tests.dcerpc.array " )
planpythontestsuite ( " none " , " samba.tests.dcerpc.string_tests " )
planpythontestsuite ( " none " , " samba.tests.hostconfig " )
planpythontestsuite ( " ad_dc_ntvfs:local " , " samba.tests.messaging " )
planpythontestsuite ( " none " , " samba.tests.s3param " )
planpythontestsuite ( " none " , " samba.tests.s3passdb " )
planpythontestsuite ( " none " , " samba.tests.s3registry " )
planpythontestsuite ( " none " , " samba.tests.s3windb " )
planpythontestsuite ( " none " , " samba.tests.s3idmapdb " )
2012-10-05 13:51:37 +04:00
planpythontestsuite ( " none " , " samba.tests.samba3sam " )
2021-08-30 04:03:15 +03:00
planpythontestsuite ( " none " , " samba.tests.dsdb_api " )
2022-04-01 20:51:40 +03:00
planpythontestsuite ( " none " , " samba.tests.smbconf " )
2022-05-26 08:19:51 +03:00
planpythontestsuite ( " none " , " samba.tests.logfiles " )
2023-08-24 04:44:17 +03:00
planpythontestsuite ( " none " , " samba.tests.conditional_ace_claims " )
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 " ) ] )
2019-12-03 04:23:21 +03:00
planpythontestsuite ( " fileserver " , " samba.tests.smbd_fuzztest " )
2020-07-07 15:27:07 +03:00
planpythontestsuite ( " nt4_dc_smb1 " , " samba.tests.dcerpc.binding " )
2021-07-27 17:06:07 +03:00
planpythontestsuite ( ' ad_dc:local ' , " samba.tests.dcerpc.samr_change_password " )
planpythontestsuite ( ' ad_dc_fips:local ' ,
" samba.tests.dcerpc.samr_change_password " ,
environ = { ' GNUTLS_FORCE_FIPS_MODE ' : ' 1 ' ,
' OPENSSL_FORCE_FIPS_MODE ' : ' 1 ' } )
2019-02-15 12:15:23 +03:00
2022-09-23 03:32:25 +03:00
planpythontestsuite ( " none " , " samba.tests.safe_tarfile " )
2019-02-15 12:15:23 +03:00
def cmdline ( script , * args ) :
"""
Prefix PYTHON env var and append - - configurefile option to abs script path .
script . sh arg1 arg2
- - >
PYTHON = python / path / to / bbdir / script . sh arg1 arg2 \
- - configurefile $ SMB_CONF_FILE
"""
return [
" PYTHON= %s " % python ,
os . path . join ( bbdir , script ) ,
] + list ( args ) + [ configuration ]
2015-10-23 05:38:23 +03:00
plantestsuite (
" samba4.blackbox.demote-saveddb " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' demote-saveddb.sh ' , ' $PREFIX_ABS/demote ' ) )
2014-06-02 04:53:01 +04:00
plantestsuite (
" samba4.blackbox.dbcheck.alpha13 " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' dbcheck-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' alpha13 ' ) )
2019-02-15 12:55:51 +03:00
# same test as above but skip member link checks
plantestsuite (
" samba4.blackbox.dbcheck.alpha13.quick " , " none " ,
cmdline ( ' dbcheck-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' alpha13 ' , ' --quick-membership-checks ' ) )
2014-06-02 04:53:01 +04:00
plantestsuite (
" samba4.blackbox.dbcheck.release-4-0-0 " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' dbcheck-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-0-0 ' ) )
2019-02-15 12:55:51 +03:00
# same test as above but skip member link checks
plantestsuite (
" samba4.blackbox.dbcheck.release-4-0-0.quick " , " none " ,
cmdline ( ' dbcheck-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-0-0 ' , ' --quick-membership-checks ' ) )
2014-06-02 04:53:01 +04:00
plantestsuite (
" samba4.blackbox.dbcheck.release-4-1-0rc3 " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' dbcheck-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-1-0rc3 ' ) )
2019-02-15 12:55:51 +03:00
# same test as above but skip member link checks
plantestsuite (
" samba4.blackbox.dbcheck.release-4-1-0rc3.quick " , " none " ,
cmdline ( ' dbcheck-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-1-0rc3 ' , ' --quick-membership-checks ' ) )
2014-06-02 04:53:01 +04:00
plantestsuite (
" samba4.blackbox.dbcheck.release-4-1-6-partial-object " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' dbcheck-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-1-6-partial-object ' ) )
2019-02-15 12:55:51 +03:00
# same test as above but skip member link checks
plantestsuite (
" samba4.blackbox.dbcheck.release-4-1-6-partial-object.quick " , " none " ,
cmdline ( ' dbcheck-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-1-6-partial-object ' , ' --quick-membership-checks ' ) )
2016-08-31 02:39:24 +03:00
plantestsuite (
" samba4.blackbox.dbcheck.release-4-5-0-pre1 " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' dbcheck-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-5-0-pre1 ' ) )
2019-02-15 12:55:51 +03:00
# same test as above but skip member link checks
plantestsuite (
" samba4.blackbox.dbcheck.release-4-5-0-pre1.quick " , " none " ,
cmdline ( ' dbcheck-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-5-0-pre1 ' , ' --quick-membership-checks ' ) )
2014-06-02 04:53:01 +04:00
plantestsuite (
" samba4.blackbox.upgradeprovision.alpha13 " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' upgradeprovision-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' alpha13 ' ) )
2014-06-02 04:53:01 +04:00
plantestsuite (
" samba4.blackbox.upgradeprovision.release-4-0-0 " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' upgradeprovision-oldrelease.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-0-0 ' ) )
2016-08-31 08:07:29 +03:00
plantestsuite (
" samba4.blackbox.tombstones-expunge.release-4-5-0-pre1 " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' tombstones-expunge.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-5-0-pre1 ' ) )
2016-11-07 01:39:53 +03:00
plantestsuite (
" samba4.blackbox.dbcheck-links.release-4-5-0-pre1 " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' dbcheck-links.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-5-0-pre1 ' ) )
2017-10-31 23:02:01 +03:00
plantestsuite (
" samba4.blackbox.runtime-links.release-4-5-0-pre1 " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' runtime-links.sh ' , ' $PREFIX_ABS/provision ' ,
' release-4-5-0-pre1 ' ) )
2017-10-06 06:30:40 +03:00
plantestsuite (
" samba4.blackbox.schemaupgrade " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' schemaupgrade.sh ' , ' $PREFIX_ABS/provision ' ) )
2017-12-15 05:43:32 +03:00
plantestsuite (
" samba4.blackbox.functionalprep " , " none " ,
2019-02-15 12:15:23 +03:00
cmdline ( ' functionalprep.sh ' , ' $PREFIX_ABS/provision ' ) )
2022-03-03 10:59:48 +03:00
plantestsuite (
" samba4.blackbox.test_special_group " , " none " ,
cmdline ( ' test_special_group.sh ' , ' $PREFIX_ABS/provision ' ) )
2024-03-25 19:25:55 +03:00
planpythontestsuite ( " fileserver " , " samba.tests.blackbox.http_content " )
2019-02-15 07:30:43 +03:00
planpythontestsuite ( " none " , " samba.tests.upgradeprovision " )
planpythontestsuite ( " none " , " samba.tests.xattr " )
planpythontestsuite ( " none " , " samba.tests.ntacls " )
planpythontestsuite ( " none " , " samba.tests.policy " )
planpythontestsuite ( " none " , " samba.tests.kcc.graph " )
planpythontestsuite ( " none " , " samba.tests.kcc.graph_utils " )
2015-04-30 05:33:30 +03:00
planpythontestsuite ( " none " , " samba.tests.kcc.ldif_import_export " )
2019-02-15 07:30:43 +03:00
planpythontestsuite ( " none " , " samba.tests.graph " )
2014-10-13 04:48:10 +04:00
plantestsuite ( " wafsamba.duplicate_symbols " , " none " , [ os . path . join ( srcdir ( ) , " buildtools/wafsamba/test_duplicate_symbol.sh " ) ] )
2019-02-15 07:30:43 +03:00
planpythontestsuite ( " none " , " samba.tests.glue " )
planpythontestsuite ( " none " , " samba.tests.tdb_util " )
2020-11-10 03:46:28 +03:00
planpythontestsuite ( " none " , " samba.tests.samdb " )
2019-02-15 07:30:43 +03:00
planpythontestsuite ( " none " , " samba.tests.samdb_api " )
2023-12-08 03:00:34 +03:00
planpythontestsuite ( " none " , " samba.tests.ndr.gkdi " )
2023-11-13 07:08:58 +03:00
planpythontestsuite ( " none " , " samba.tests.ndr.gmsa " )
2023-11-20 05:46:16 +03:00
planpythontestsuite ( " none " , " samba.tests.ndr.wbint " )
2016-12-15 12:33:59 +03:00
2017-04-10 08:50:41 +03:00
if with_pam :
2019-09-18 02:25:23 +03:00
env = " ad_member "
options = [
2019-09-18 09:08:57 +03:00
{
" description " : " krb5 " ,
2022-04-13 14:20:27 +03:00
" pam_options " : " krb5_auth krb5_ccache_type=FILE: %s /krb5cc_pam_test_ %% u " % ( tempfile . gettempdir ( ) ) ,
2019-09-18 09:08:57 +03:00
} ,
2019-09-18 02:25:23 +03:00
{
" description " : " default " ,
" pam_options " : " " ,
} ,
]
for o in options :
description = o [ " description " ]
pam_options = " ' %s ' " % o [ " pam_options " ]
plantestsuite ( " samba.tests.pam_winbind(local+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $SERVER " , " $USERNAME " , " $PASSWORD " ,
pam_options ] )
2019-09-18 15:03:34 +03:00
plantestsuite ( " samba.tests.pam_winbind(domain1+ %s ) " % description , env ,
2019-09-18 02:25:23 +03:00
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $DOMAIN " , " $DC_USERNAME " , " $DC_PASSWORD " ,
pam_options ] )
2019-09-18 15:03:34 +03:00
plantestsuite ( " samba.tests.pam_winbind(domain2+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $REALM " , " $DC_USERNAME " , " $DC_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(domain3+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" ' ' " , " $ {DC_USERNAME} @$ {DOMAIN} " , " $DC_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(domain4+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" ' ' " , " $ {DC_USERNAME} @$ {REALM} " , " $DC_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(domain5+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $REALM " , " $ {DC_USERNAME} @$ {DOMAIN} " , " $DC_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(domain6+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $DOMAIN " , " $ {DC_USERNAME} @$ {REALM} " , " $DC_PASSWORD " ,
pam_options ] )
2017-06-10 15:38:40 +03:00
plantestsuite ( " samba.tests.pam_winbind(trust_f_both1+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $TRUST_F_BOTH_DOMAIN " ,
" $TRUST_F_BOTH_USERNAME " ,
" $TRUST_F_BOTH_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(trust_f_both2+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $TRUST_F_BOTH_REALM " ,
" $TRUST_F_BOTH_USERNAME " ,
" $TRUST_F_BOTH_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(trust_f_both3+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" ' ' " ,
" $ {TRUST_F_BOTH_USERNAME} @$ {TRUST_F_BOTH_DOMAIN} " ,
" $TRUST_F_BOTH_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(trust_f_both4+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" ' ' " ,
" $ {TRUST_F_BOTH_USERNAME} @$ {TRUST_F_BOTH_REALM} " ,
" $TRUST_F_BOTH_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(trust_f_both5+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $ {TRUST_F_BOTH_REALM} " ,
" $ {TRUST_F_BOTH_USERNAME} @$ {TRUST_F_BOTH_DOMAIN} " ,
" $TRUST_F_BOTH_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(trust_f_both6+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $ {TRUST_F_BOTH_DOMAIN} " ,
" $ {TRUST_F_BOTH_USERNAME} @$ {TRUST_F_BOTH_REALM} " ,
" $TRUST_F_BOTH_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(trust_e_both1+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $TRUST_E_BOTH_DOMAIN " ,
" $TRUST_E_BOTH_USERNAME " ,
" $TRUST_E_BOTH_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(trust_e_both2+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $TRUST_E_BOTH_REALM " ,
" $TRUST_E_BOTH_USERNAME " ,
" $TRUST_E_BOTH_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(trust_e_both3+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" ' ' " ,
" $ {TRUST_E_BOTH_USERNAME} @$ {TRUST_E_BOTH_DOMAIN} " ,
" $TRUST_E_BOTH_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(trust_e_both4+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" ' ' " ,
" $ {TRUST_E_BOTH_USERNAME} @$ {TRUST_E_BOTH_REALM} " ,
" $TRUST_E_BOTH_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(trust_e_both5+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $ {TRUST_E_BOTH_REALM} " ,
" $ {TRUST_E_BOTH_USERNAME} @$ {TRUST_E_BOTH_DOMAIN} " ,
" $TRUST_E_BOTH_PASSWORD " ,
pam_options ] )
plantestsuite ( " samba.tests.pam_winbind(trust_e_both6+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $ {TRUST_E_BOTH_DOMAIN} " ,
" $ {TRUST_E_BOTH_USERNAME} @$ {TRUST_E_BOTH_REALM} " ,
" $TRUST_E_BOTH_PASSWORD " ,
pam_options ] )
2019-09-18 02:25:23 +03:00
for authtok_options in [ " " , " use_authtok " , " try_authtok " ] :
_pam_options = " ' %s %s ' " % ( o [ " pam_options " ] , authtok_options )
_description = " %s %s " % ( description , authtok_options )
plantestsuite ( " samba.tests.pam_winbind_chauthtok(domain+ %s ) " % _description , env ,
[ 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 " ] )
plantestsuite ( " samba.tests.pam_winbind_warn_pwd_expire(domain+ %s ) " % description , env ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind_warn_pwd_expire.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $DOMAIN " , " alice " , " Secret007 " ,
pam_options ] )
2021-06-18 10:22:39 +03:00
description = " krb5 "
2022-04-12 17:56:25 +03:00
pam_options = " ' krb5_auth krb5_ccache_type=FILE: %s /krb5cc_pam_test_setcred_ %% u ' " % ( tempfile . gettempdir ( ) )
2021-06-18 10:22:39 +03:00
plantestsuite ( " samba.tests.pam_winbind_setcred(domain+ %s ) " % description , " ad_dc:local " ,
[ os . path . join ( srcdir ( ) , " python/samba/tests/test_pam_winbind_setcred.sh " ) ,
valgrindify ( python ) , pam_wrapper_so_path ,
" $ {DOMAIN} " , " $ {DC_USERNAME} " , " $ {DC_PASSWORD} " ,
pam_options ] )
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.lib_util_modules " , " none " ,
[ os . path . join ( bindir ( ) , " default/testsuite/unittests/test_lib_util_modules " ) ] )
2021-03-31 14:22:16 +03:00
plantestsuite ( " samba.unittests.background_send " ,
" none " ,
[ os . path . join (
bindir ( ) ,
" default/testsuite/unittests/test_background_send " ) ,
" $SMB_CONF_PATH " ] )
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 " ) ] )
2019-10-09 10:38:08 +03:00
plantestsuite ( " samba.unittests.smb_util_translate " , " none " ,
[ os . path . join ( bindir ( ) , " default/libcli/smb/test_util_translate " ) ] )
2018-02-22 01:54:45 +03:00
2019-03-19 13:18:47 +03:00
plantestsuite ( " samba.unittests.talloc_keep_secret " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/util/test_talloc_keep_secret " ) ] )
2018-02-22 01:54:45 +03:00
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 " ) ] )
2019-05-16 09:31:40 +03:00
plantestsuite ( " samba.unittests.byteorder " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/util/test_byteorder " ) ] )
2018-12-20 10:37:32 +03:00
plantestsuite ( " samba.unittests.bytearray " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/util/test_bytearray " ) ] )
2019-01-17 12:52:25 +03:00
plantestsuite ( " samba.unittests.byteorder_verify " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/util/test_byteorder_verify " ) ] )
2020-05-11 13:50:11 +03:00
plantestsuite ( " samba.unittests.util_paths " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/util/test_util_paths " ) ] )
2020-08-14 22:18:51 +03:00
plantestsuite ( " samba.unittests.util " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/util/test_util " ) ] )
2021-02-03 12:30:08 +03:00
plantestsuite ( " samba.unittests.memcache " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/util/test_memcache " ) ] )
2021-06-26 13:21:19 +03:00
plantestsuite ( " samba.unittests.sys_rw " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/util/test_sys_rw " ) ] )
2022-09-28 04:40:10 +03:00
plantestsuite ( " samba.unittests.stable_sort " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/util/test_stable_sort " ) ] )
2018-07-26 23:44:24 +03:00
plantestsuite ( " samba.unittests.ntlm_check " , " none " ,
[ os . path . join ( bindir ( ) , " default/libcli/auth/test_ntlm_check " ) ] )
2019-11-09 19:47:33 +03:00
plantestsuite ( " samba.unittests.gnutls " , " none " ,
[ os . path . join ( bindir ( ) , " default/libcli/auth/test_gnutls " ) ] )
2019-07-05 10:39:02 +03:00
plantestsuite ( " samba.unittests.rc4_passwd_buffer " , " none " ,
[ os . path . join ( bindir ( ) , " default/libcli/auth/test_rc4_passwd_buffer " ) ] )
2019-09-26 00:44:49 +03:00
plantestsuite ( " samba.unittests.schannel " , " none " ,
[ os . path . join ( bindir ( ) , " default/libcli/auth/test_schannel " ) ] )
2019-03-19 02:47:52 +03:00
plantestsuite ( " samba.unittests.test_registry_regfio " , " none " ,
[ os . path . join ( bindir ( ) , " default/source3/test_registry_regfio " ) ] )
2019-03-27 22:17:08 +03:00
plantestsuite ( " samba.unittests.test_oLschema2ldif " , " none " ,
[ os . path . join ( bindir ( ) , " default/source4/utils/oLschema2ldif/test_oLschema2ldif " ) ] )
2021-02-09 01:59:05 +03:00
plantestsuite ( " samba.unittests.auth.sam " , " none " ,
[ os . path . join ( bindir ( ) , " test_auth_sam " ) ] )
2022-10-12 03:55:39 +03:00
if have_heimdal_support and not using_system_gssapi :
plantestsuite ( " samba.unittests.auth.heimdal_gensec_unwrap_des " , " none " ,
[ valgrindify ( os . path . join ( bindir ( ) , " test_heimdal_gensec_unwrap_des " ) ) ] )
2022-10-24 22:50:27 +03:00
plantestsuite ( " samba.unittests.test_wsp_parser " , " none " ,
[ os . path . join ( bindir ( ) , " default/libcli/wsp/test_wsp_parser " ) ] + [ configuration ] )
2020-06-22 17:06:36 +03:00
if with_elasticsearch_backend :
plantestsuite ( " samba.unittests.mdsparser_es " , " none " ,
[ os . path . join ( bindir ( ) , " default/source3/test_mdsparser_es " ) ] + [ configuration ] )
2021-10-09 17:44:25 +03:00
plantestsuite ( " samba.unittests.mdsparser_es_failures " , " none " ,
[ os . path . join ( bindir ( ) , " default/source3/test_mdsparser_es " ) ,
" --option=elasticsearch:testmappingfailures=yes " ,
" --option=elasticsearch:ignoreunknownattribute=yes " ,
" --option=elasticsearch:ignoreunknowntype=yes " ] +
[ configuration ] )
2020-09-01 13:32:28 +03:00
plantestsuite ( " samba.unittests.credentials " , " none " ,
[ os . path . join ( bindir ( ) , " default/auth/credentials/test_creds " ) ] )
2021-09-11 22:57:06 +03:00
plantestsuite ( " samba.unittests.tsocket_bsd_addr " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/tsocket/test_tsocket_bsd_addr " ) ] )
2022-12-09 16:48:06 +03:00
if ( " HAVE_TCP_USER_TIMEOUT " in config_hash ) :
plantestsuite ( " samba.unittests.tsocket_tstream " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/tsocket/test_tstream " ) ] ,
environ = { ' SOCKET_WRAPPER_DIR ' : ' ' } )
2021-11-25 17:04:03 +03:00
plantestsuite ( " samba.unittests.adouble " , " none " ,
[ os . path . join ( bindir ( ) , " test_adouble " ) ] )
2021-08-03 15:14:07 +03:00
plantestsuite ( " samba.unittests.gnutls_aead_aes_256_cbc_hmac_sha512 " , " none " ,
[ os . path . join ( bindir ( ) , " test_gnutls_aead_aes_256_cbc_hmac_sha512 " ) ] )
2023-12-08 04:10:42 +03:00
plantestsuite ( " samba.unittests.gnutls_sp800_108 " , " none " ,
2023-11-30 01:00:57 +03:00
[ os . path . join ( bindir ( ) , " test_gnutls_sp800_108 " ) ] )
2023-12-22 01:04:51 +03:00
plantestsuite ( " samba.unittests.gkdi_key_derivation " , " none " ,
[ os . path . join ( bindir ( ) , " test_gkdi_key_derivation " ) ] )
2022-07-25 12:25:09 +03:00
plantestsuite ( " samba.unittests.encode_decode " , " none " ,
[ os . path . join ( bindir ( ) , " test_encode_decode " ) ] )
lib/compression: add LZ77 + Huffman decompression
This format is described in [MS-XCA] 2.1 and 2.2, with exegesis in
many posts on the cifs-protocol list[1].
The two public functions are:
ssize_t lzxpress_huffman_decompress(const uint8_t *input,
size_t input_size,
uint8_t *output,
size_t output_size);
uint8_t *lzxpress_huffman_decompress_talloc(TALLOC_CTX *mem_ctx,
const uint8_t *input_bytes,
size_t input_size,
size_t output_size);
In both cases the caller needs to know the *exact* decompressed size,
which is essential for decompression. The _talloc version allocates
the buffer for you, and uses the talloc context to allocate a 128k
working buffer. THe non-talloc function will allocate the working
buffer on the stack.
This compression format gives better compression for messages of
several kilobytes than the "plain" LXZPRESS compression, but is
probably a bit slower to decompress and is certainly worse for very
short messages, having a fixed 256 byte overhead for the first Huffman
table.
Experiments show decompression rates between 20 and 500 MB per second,
depending on the compression ratio and data size, on an i5-1135G7 with
no compiler optimisations.
This compression format is used in AD claims and in SMB, but that
doesn't happen with this commit.
I will not try to describe LZ77 or Huffman encoding here. Don't expect
an answer in MS-XCA either; instead read the code and/or Wikipedia.
[1] Much of that starts here:
https://lists.samba.org/archive/cifs-protocol/2022-October/
but there's more earlier, particularly in June/July 2020, when
Aurélien Aptel was working on an implementation that ended up in
Wireshark.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Pair-programmed-with: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-11-17 04:24:52 +03:00
plantestsuite ( " samba.unittests.compression.lzxpress_huffman " , " none " ,
[ os . path . join ( bindir ( ) , " default/lib/compression/test_lzx_huffman " ) ] )
2022-11-23 02:01:15 +03:00
plantestsuite ( " samba.unittests.compression.lzxpress_plain " , " none " ,
[ os . path . join ( bindir ( ) ,
" default/lib/compression/test_lzxpress_plain " ) ] )
2023-07-12 08:24:33 +03:00
plantestsuite ( " samba.unittests.sddl_conditional_ace " , " none " ,
[ os . path . join ( bindir ( ) , " test_sddl_conditional_ace " ) ] )
2023-07-12 08:21:22 +03:00
plantestsuite ( " samba.unittests.run_conditional_ace " , " none " ,
[ os . path . join ( bindir ( ) , " test_run_conditional_ace " ) ] )
2023-11-24 03:37:42 +03:00
plantestsuite ( " samba.unittests.claim_conversion " , " none " ,
[ os . path . join ( bindir ( ) , " test_claim_conversion " ) ] )