running only selected tests in samba sources

Andrew Bartlett abartlet at samba.org
Mon Aug 1 21:26:48 UTC 2022


On Mon, 2022-08-01 at 17:35 +0300, Michael Tokarev via samba-technical
wrote:
> Hi!
> Is there a way, after successful build of samba source, to run just
> selected testswithout running whole testsuite, *and* without
> (re)building everything with the--enable-selftest option?
> Many tests do not require this option to be enabled. For a very
> simple example,consider lib/ldb/ tests - when ldb is built from its
> own separate sourcetarball, it's easy to run its tests. But when it
> is built as part of whole sambasource, an attempt to run ldb tests -
> even by providing the right test selection -still fails due to main
> samba wscript checking if --enable-selftest has been enabled.
> In Debian we used to build libldb from its own source, and running a
> testsuite therehas been useful. But now we build it from main samba
> source tree and we can't runthe testsuite anymore.
> Many more other tests can be useful without --enable-selftest too.
> I'm about to patch wscript to omit checks for --enable-selftest
> options in wscripts..

Currently this isn't possible, but in theory the tests that run in the
'none' environment could operate without --enable-selftest as these
would not typically require socket_wrapper et al.
Also socket_wrapper is an LD_PRELOAD these days, so much of the system
might work.
The key is that in third_party/wscript we have:
    if
conf.CONFIG_GET('ENABLE_SELFTEST'):        conf.RECURSE('socket_wrapper
')        conf.RECURSE('nss_wrapper')        conf.RECURSE('resolv_wrapp
er')        conf.RECURSE('uid_wrapper')        if
Options.options.with_pam:            conf.RECURSE('pam_wrapper')
and in selftest/wscript we have:
    if (not CONFIG_SET(opt, 'NSS_WRAPPER') or        not
CONFIG_SET(opt, 'UID_WRAPPER') or        not CONFIG_SET(opt,
'SOCKET_WRAPPER')):        print("ERROR: You must use --enable-selftest 
to enable selftest")        sys.exit(1)
Therefore it would be reasonable to propose a patch for --enable-
production-selftest that does not build the NTVFS file server nor
enables the other C code changes (which are small), but allows most
tests to operate by building the wrapper code.
Andrew Bartlett


-- 
Andrew Bartlett (he/him)       https://samba.org/~abartlet/Samba Team Member (since 2001) https://samba.orgSamba Team Lead, Catalyst IT   https://catalyst.net.nz/services/samba
Samba Development and Support, Catalyst IT - Expert Open SourceSolutions


More information about the samba-technical mailing list