1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

72 Commits

Author SHA1 Message Date
Gary Lockyer
b1a32dd7f5 selftest: enable undefined behaviour sanitizer
Add a --undefined-sanitizer option to configure, this causes the tests
to be run with the undefined behaviout sanitizer enabled.

Errors can be suppressed by adding entries to selftest/ubsan.supp

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May 14 07:20:28 UTC 2019 on sn-devel-184
2019-05-14 07:20:28 +00:00
Joe Guo
21475e9556 wscript: mv --enable-coverage option to global
We want to enable gcov for all tasks, move it to global wscript.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-10 08:19:16 +00:00
Gary Lockyer
e129d4ea3e selftest: Utils.cmd_output returns byte string
Convert the returned byte string into a string.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-06 07:12:18 +00:00
Andrew Bartlett
beda359bdd selftest: Remove support for running multiple tests against python versions in a single run
The extra_python support was added to aid the python3 transition

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-03-21 04:06:15 +00:00
Tim Beale
345c33d1d0 selftest: Remove RUN_FROM_BUILD_FARM env variable
The build farm is no longer used, so we can remove checks for this
environment variable in the selftest code.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-12 01:53:26 +00:00
Tim Beale
96472306bf selftest: Add basic sanity-check tests for nopython target
Previously we were only checking samba compiled OK with
--disable-python, not that it actually ran.

The main problem is all the make test framework is based around
subunit/smbtorture, neither of which we seem to build with
disable-python. However, for just a simple sanity-check, we can just
bypass all the subunit-filter work and just call the Perl code directly.
This works OK as long as it's just simple shell script tests that we're
running, as we can check the script's exit code directly.

The main thing that we really want to test is that we can start up the
smbd testenv and connect to it (i.e. a simple smbclient test).

This patch adds a new 'make test-nopython' target. This disables the
subunit filtering, and runs a small test-list that was generated manually.

Note that currently this has the limitation that it doesn't support known
failures or flapping tests. However, just checking that smd starts up OK
is probably OK for now.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Feb 20 02:10:00 CET 2019 on sn-devel-144
2019-02-20 02:10:00 +01:00
Noel Power
f4c0343dc4 selftest: Always set PYTHON to something sensible (if it isn't set)
Lots of test scripts need to run with the correct version
of python. With the correct shebang the script should run with the
correct version, the problem is that not all scripts are part
of the installation, some scripts are part of the source code,
and the shebang is not dynamically generated as yet.
It is safer if we are somewhat version neutral at the moment and
ignore the shebang and always run scripts from the test environment
with the python version (determined by PYTHON env variable) If this
env variable isn't set then set it according to the python version
that is running the tests

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-10 10:38:25 +01:00
Alexander Bokovoy
75d5bcb4d8 selftest/wscript: properly handle env.cwd which is a list, not a string
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
35ebfd3d4e selftest/wscript: handle lists in environmental variables in waf
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
0de67cf1c7 selftest/wscript: update to handle waf 2.0.4
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:23 +02:00
Thomas Nagy
8077f462c9 build:wafsamba: Build on waf 1.9
Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:21 +02:00
Andrew Bartlett
6124499804 selftest: Allow make test to run with --address-sanitizer
Recent GCC versions enforce that the library must be in LD_PRELOAD if linked to a plugin
(like a python module).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-05-03 08:17:44 +02:00
Uri Simchoni
abcc955201 selftest: pass location of perl executable from waf to test-envs
Many perl scripts in the codebase are executables with a
"/usr/bin/perl" shebang. Running them as executables is not
portable as some OS's have a different location for the perl
interpreter.

During the configuration process, waf finds the location of the perl
interpreter. Some or all  invocations of perl scripts from within
test environment setup code are actually "$PERL <script>",
but since PERL env var is typically not set, this amounts to the
unportable "<script>", which invokes /usr/bin/perl.

This patch exports the location of perl as found by the configuration
process to the test environment, causing "$PERL <script>" to be
"<correct place of perl interpreter> <script>".

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-12-22 03:30:12 +01:00
Douglas Bagnall
5b60600b32 selftest: use an additional directory of knownfail/flapping files
This makes it easier to add a temporary knownfail to cover a patch
series.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun  3 13:55:41 CEST 2017 on sn-devel-144
2017-06-03 13:55:41 +02:00
Andrew Bartlett
1116ee1c5c selftest: Actually run python3 tests during the selftest
These previously only ran if the develper was using EXTRA_PYTHON in their
OS environment

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat May 20 02:26:33 CEST 2017 on sn-devel-144
2017-05-20 02:26:33 +02:00
Andreas Schneider
b40c92016f selftest: Disable RODC tests with MIT KDC
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-04-29 23:31:09 +02:00
Andreas Schneider
687da88590 selftest: Start MIT KDC if Kerberos is from MIT
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-04-29 23:31:09 +02:00
Douglas Bagnall
6f88ff83bf waf --test-list takes a filename argument
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-02-10 05:09:08 +01:00
Stefan Metzmacher
e6a5e6a01a script/autobuild.py: try make test TESTS=samba3.*ktest for samba-systemkrb5
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-01-10 13:54:17 +01:00
Douglas Bagnall
1d0dd5bf5e selftest/wscript: format perftest as json
This makes it easier to use with common web-based graphing systems.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-08-31 07:09:26 +02:00
Douglas Bagnall
dfac53cd40 selftest: add an option to specify the test list
This can be used to override the default test lists used by
`make test` and `make perftest`. This tests can either be
programmatically generated (as is done for the defaults -- see
selftest/tests.py for an example), or from a static list. For the
generated lists, append a pipe symbol:

    make test TEST_LIST='/bin/sh /tmp/tests.sh|'

and omit the pipe for a static list:

    make test TEST_LIST='/tmp/tests.txt'

There are likely other useful modes of operation -- see `perldoc open`
for the wondrous details.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-08-31 07:09:26 +02:00
Douglas Bagnall
e908873757 make perftest: for performance testing
This runs a selection of subunit tests and reduces the output to only
the time it takes to run each test.

The tests are listed in selftest/perf_tests.py.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-08-31 07:09:26 +02:00
Adrian Cochrane
62d4136755 selftest: Remove binary mappings from the build system.
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-06-08 13:03:14 +02:00
Stefan Metzmacher
c5cb1fb621 selftest: use env.SELFTEST_PREFIX to define subunit_cache
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-01-19 13:54:03 +01:00
Andreas Schneider
4f6acb77ea selftest: Always enable dns fakeing.
FIXME: This should be removed once we fixed adding records to the DNS
server using nsupdate!

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-12-18 06:47:40 +01:00
Andreas Schneider
30cc2e7755 selftest: Define if we should fake dns resolving.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-12-18 06:47:40 +01:00
Andreas Schneider
843d81a14f selftest: Preload resolv_wrapper in selftest.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-12-18 06:47:40 +01:00
Jelmer Vernooij
4323504921 Don't assume st/subunit being present means it was generated by the current process.
This fixes --list.

Change-Id: I75fc765757e06861cf3bb489246e0845564a1123
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-11-30 18:31:08 +01:00
Jelmer Vernooij
b7efc12406 Print number of slow tests from script rather than wscript.
Change-Id: I6eaa0803b95cc81f514a2176f4e06f1e3fff4077
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Mon Nov 24 13:06:46 CET 2014 on sn-devel-104
2014-11-24 13:06:46 +01:00
Michael Adam
f184d12e5e build: fix check for subunit file when selftest prefix is given
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Oct 30 22:45:45 CET 2014 on sn-devel-104
2014-10-30 22:45:44 +01:00
Stefan Metzmacher
331f9805ea selftest: only use Options.options.SELFTEST_PREFIX if it's not the default
The --with-selftest-prefix option is typically specified as argument
to './configure' ! Overwriting it for 'waf testonly' should only
happen with an explicit 'waf testonly --with-selftest-prefix=/some/path'.

This fixes a regression introduced by
commit edc1cedf93
(selftest: Actually honor --with-selftest-prefix).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-30 20:25:03 +01:00
Matthieu Patou
bdfcee6b8e selftest: report the 10 slowest tests (by default) make the number configurable
Change-Id: Ib1cf50199d110827a25cf198b40738f3c72cbe17
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-10-17 17:57:04 +02:00
Jelmer Vernooij
edc1cedf93 selftest: Actually honor --with-selftest-prefix.
Change-Id: Ie8c995a273781309224e17b8970a864479444036
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-14 06:44:07 +02:00
Jelmer Vernooij
b2e4f312a2 Don't import into testr when --load-list was specified, as testr will
take care of that itself.

Change-Id: I3d57f4cfafdd48751dfbd145f220dc5cf000ec3f
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-10-14 06:44:07 +02:00
Jelmer Vernooij
c7b6897b80 Run duplicate symbol check as just another test, rather than as part of "waf test".
This allows it to be scheduled independently as part of a parallel test
run, and reduces the overhead of "waf test".

Change-Id: I780fd2c4dd711ed27df73f56de98e7f1ffd53aaf
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10875
2014-10-14 06:44:07 +02:00
Andreas Schneider
0ed826d508 selftest: Preload socket_wrapper.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:06 +02:00
Andreas Schneider
d24a154429 selftest: Preload nss_wrapper
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:06 +02:00
Andreas Schneider
9feeeb369b selftest: Pass uid_wrapper library to selftest and preload it.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:05 +02:00
Andreas Schneider
153dfc514c selftest: Use the absolute path to the ldb modules.
This fixes 'make test' on Fedora with external ldb.

Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2014-02-21 15:59:28 +01:00
Stefan Metzmacher
db9188fbff selftest: setup {NMBD,WINBINDD,SMBD}_VALGRIND
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-11 16:56:53 +01:00
Andrew Bartlett
26d36befa8 selftest: VFSLIBDIR is not needed, the waf build knows where to find modules automatically
This is why was relinks on install, because it is fixing these
internal variables up.

Andrew Bartlett

Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-28 12:17:12 +10:00
Matthieu Patou
95fc53a37b Tests: avoid adding python options that are functions in the env
This fix errors when running test --testenv --screen

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-21 08:21:20 +01:00
Andrew Bartlett
1000da9335 build: Use ntlm_auth from source3 as the only ntlm_auth installed on the system
The ntlm_auth4 binary is untested, and is missing major features compared with
the source3 binary.  The two are being slowly merged, but I have not finished
that.

Andrew Bartlett

Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-22 10:21:16 +01:00
Jelmer Vernooij
67dd28f360 selftest: Add --random-order option. 2012-10-27 05:16:19 -08:00
Jelmer Vernooij
b7822a55c4 samba4-tests: Move 'samba.tests.source' up.
We would like to run this as early as possible so we get a quick
failure when there is trailing whitespace.

Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Thu Sep 27 20:26:27 CEST 2012 on sn-devel-104
2012-09-27 20:26:27 +02:00
Andrew Bartlett
49b2720317 lib/param: Also enable vlp when --enable-selftest is specified 2012-08-06 20:51:55 +10:00
Rusty Russell
6244f668a3 TDB2: make SAMBA use tdb1 again for the moment.
Otherwise the following surgery will break the SAMBA build and testsuite.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:05 +02:00
Michael Adam
15d567265e build: rename build targets smbclient -> smbclient4 and smbclient3 -> smbclient
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Thu May 31 06:36:55 CEST 2012 on sn-devel-104
2012-05-31 06:36:55 +02:00
Michael Adam
37194f5f25 selftest: add a binary mapping for smbclient4 2012-05-31 04:46:06 +02:00
Michael Adam
52e1bba861 build: rename build targets nmblookup -> nmblookup4 and nmblookup3 -> nmblookup 2012-05-31 04:46:06 +02:00