1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-09 09:57:48 +03:00

selftest: Remove --target option and the ability to run 'samba4 only' tests

This simplifies the selftest system, and by default we always tested
all of samba3 and samba4 in the waf build.  This simply removes a
rarely used option for testing only part of the system.  The make test
TESTS="^samba3" syntax remains unchanged, so no functionality is lost.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2011-10-26 15:21:11 +11:00
parent f54dcc86b8
commit 8dcfe2e5c4
2 changed files with 13 additions and 30 deletions

View File

@ -26,7 +26,7 @@ selftest - Samba test runner
selftest --help selftest --help
selftest [--srcdir=DIR] [--bindir=DIR] [--exeext=EXT][--target=samba4|samba3|win|kvm] [--socket-wrapper] [--quick] [--exclude=FILE] [--include=FILE] [--one] [--prefix=prefix] [--testlist=FILE] [TESTS] selftest [--srcdir=DIR] [--bindir=DIR] [--exeext=EXT][--target=samba|samba3|win|kvm] [--socket-wrapper] [--quick] [--exclude=FILE] [--include=FILE] [--one] [--prefix=prefix] [--testlist=FILE] [TESTS]
=head1 DESCRIPTION =head1 DESCRIPTION
@ -56,7 +56,7 @@ Executable extention
Change directory to run tests in. Default is 'st'. Change directory to run tests in. Default is 'st'.
=item I<--target samba4|samba3|win|kvm> =item I<--target samba|samba3|win|kvm>
Specify test target against which to run. Default is 'samba4'. Specify test target against which to run. Default is 'samba4'.
@ -142,7 +142,7 @@ if ($@) {
} }
my $opt_help = 0; my $opt_help = 0;
my $opt_target = "samba4"; my $opt_target = "samba";
my $opt_quick = 0; my $opt_quick = 0;
my $opt_socket_wrapper = 0; my $opt_socket_wrapper = 0;
my $opt_socket_wrapper_pcap = undef; my $opt_socket_wrapper_pcap = undef;
@ -300,7 +300,7 @@ Usage: $Script [OPTIONS] TESTNAME-REGEX
Generic options: Generic options:
--help this help page --help this help page
--target=samba[34]|win|kvm Samba version to target --target=samba[3]|win|kvm Samba version to target
--testlist=FILE file to read available tests from --testlist=FILE file to read available tests from
Paths: Paths:
@ -490,10 +490,6 @@ if ($opt_target eq "samba") {
$testenv_default = "all"; $testenv_default = "all";
require target::Samba; require target::Samba;
$target = new Samba($bindir, \%binary_mapping, $ldap, $srcdir, $exeext, $server_maxtime); $target = new Samba($bindir, \%binary_mapping, $ldap, $srcdir, $exeext, $server_maxtime);
} elsif ($opt_target eq "samba4") {
$testenv_default = "all";
require target::Samba4;
$target = new Samba4($bindir, \%binary_mapping, $ldap, $srcdir, $exeext, $server_maxtime);
} elsif ($opt_target eq "samba3") { } elsif ($opt_target eq "samba3") {
if ($opt_socket_wrapper and `$bindir/smbd -b | grep SOCKET_WRAPPER` eq "") { if ($opt_socket_wrapper and `$bindir/smbd -b | grep SOCKET_WRAPPER` eq "") {
die("You must include --enable-socket-wrapper when compiling Samba in order to execute 'make test'. Exiting...."); die("You must include --enable-socket-wrapper when compiling Samba in order to execute 'make test'. Exiting....");

View File

@ -30,9 +30,6 @@ def set_options(opt):
gr.add_option('--tests', gr.add_option('--tests',
help=("wildcard pattern of tests to run"), help=("wildcard pattern of tests to run"),
action="store", dest='TESTS', default='') action="store", dest='TESTS', default='')
gr.add_option('--target',
help=("target of samba3 or samba4"),
action="store", dest='TARGET', default=None)
gr.add_option('--filtered-subunit', gr.add_option('--filtered-subunit',
help=("output (xfail) filtered subunit"), help=("output (xfail) filtered subunit"),
action="store_true", dest='FILTERED_SUBUNIT', default=False) action="store_true", dest='FILTERED_SUBUNIT', default=False)
@ -188,30 +185,20 @@ def cmd_testonly(opt):
if not os.path.isdir(env.SELFTEST_PREFIX): if not os.path.isdir(env.SELFTEST_PREFIX):
os.makedirs(env.SELFTEST_PREFIX, int('755', 8)) os.makedirs(env.SELFTEST_PREFIX, int('755', 8))
if Options.options.TARGET: env.SELFTEST_TARGET = "samba"
env.SELFTEST_TARGET = Options.options.TARGET
else:
env.SELFTEST_TARGET = "samba"
if env.SELFTEST_TARGET == "samba4": for f in ["knownfail", "slow", "quick", "skip" ]:
env.SELFTEST_DIR = "${srcdir}/source4/selftest" combine_files(env.srcdir + "/source4/selftest/" + f,
elif env.SELFTEST_TARGET == "samba3": env.srcdir + "/source3/selftest/" + f,
env.SELFTEST_DIR = "${srcdir}/source3/selftest" env.SELFTEST_PREFIX + "/" + f)
if env.SELFTEST_TARGET == "samba": env.SELFTEST_DIR = env.SELFTEST_PREFIX
for f in ["knownfail", "slow", "quick", "skip" ]:
combine_files(env.srcdir + "/source4/selftest/" + f,
env.srcdir + "/source3/selftest/" + f,
env.SELFTEST_PREFIX + "/" + f)
env.SELFTEST_DIR = env.SELFTEST_PREFIX env.TESTLISTS = ('--testlist="${PYTHON} ${srcdir}/source3/selftest/tests.py|" ' +
env.TESTLISTS = ('--testlist="${PYTHON} ${srcdir}/source3/selftest/tests.py|" ' + '--testlist="${PYTHON} ${srcdir}/source4/selftest/tests.py|"')
'--testlist="${PYTHON} ${srcdir}/source4/selftest/tests.py|"')
else:
env.TESTLISTS = '--testlist="${SELFTEST_DIR}/tests.py|"'
# We use the full path rather than relative path because it cause problems on some plateforms (ie. solaris 8). # We use the full path rather than relative path because it cause problems on some plateforms (ie. solaris 8).
cmd = '(${PERL} ${srcdir}/selftest/selftest.pl --target=${SELFTEST_TARGET} --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude=${SELFTEST_DIR}/skip ${TESTLISTS} ${OPTIONS} --socket-wrapper ${TESTS} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS} | tee ${SELFTEST_PREFIX}/subunit' cmd = '(${PERL} ${srcdir}/selftest/selftest.pl --target=samba --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude=${SELFTEST_DIR}/skip ${TESTLISTS} ${OPTIONS} --socket-wrapper ${TESTS} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS} | tee ${SELFTEST_PREFIX}/subunit'
if os.environ.get('RUN_FROM_BUILD_FARM') is None and not Options.options.FILTERED_SUBUNIT: if os.environ.get('RUN_FROM_BUILD_FARM') is None and not Options.options.FILTERED_SUBUNIT:
cmd += ' | ${FORMAT_TEST_OUTPUT}' cmd += ' | ${FORMAT_TEST_OUTPUT}'