Commit 72d88d15 authored by Jelmer Vernooij's avatar Jelmer Vernooij Committed by Gerald (Jerry) Carter

r21707: Finally merge my (long-living) perlselftest branch.

This changes the main selftest code to be in perl rather than in shell script.

The selftest script is now no longer a black box but a regular executable that takes
--help.

This adds the following features:

 * "make test TESTS=foo" will run only the tests that match the regex "foo"
 * ability to deal with expected failures. the suite will not warn about tests
   that fail and are known to fail, but will warn about other failing tests and
   tests that are succeeding tests but incorrectly marked as failing.
 * ability to print a summary with all failures at the end of the run

It also opens up the way to the following features, which I hope to implement later:
 * "environments", for example having a complete domains with DCs and domain members
 in a testenvironment
 * only set up smbd if necessary (not when running LOCAL tests, for example)
 * different mktestsetup scripts per target. except for the mktestsetup script, we can
   use the same infrastructure for samba 3 or windows.
(This used to be commit 38f86788)
parent d18afd6a
...@@ -157,7 +157,7 @@ YAPP=$self->{config}->{YAPP} ...@@ -157,7 +157,7 @@ YAPP=$self->{config}->{YAPP}
GCOV=$self->{config}->{GCOV} GCOV=$self->{config}->{GCOV}
DEFAULT_TEST_TARGET=$self->{config}->{DEFAULT_TEST_TARGET} DEFAULT_TEST_OPTIONS=$self->{config}->{DEFAULT_TEST_OPTIONS}
__EOD__ __EOD__
); );
......
AC_ARG_ENABLE(socket-wrapper, AC_ARG_ENABLE(socket-wrapper,
[ --enable-socket-wrapper Turn on socket wrapper library (default=no)]) [ --enable-socket-wrapper Turn on socket wrapper library (default=no)])
DEFAULT_TEST_TARGET=test-noswrap DEFAULT_TEST_OPTIONS=
HAVE_SOCKET_WRAPPER=no HAVE_SOCKET_WRAPPER=no
if eval "test x$developer = xyes"; then if eval "test x$developer = xyes"; then
...@@ -10,9 +10,9 @@ fi ...@@ -10,9 +10,9 @@ fi
if eval "test x$enable_socket_wrapper = xyes"; then if eval "test x$enable_socket_wrapper = xyes"; then
AC_DEFINE(SOCKET_WRAPPER,1,[Use socket wrapper library]) AC_DEFINE(SOCKET_WRAPPER,1,[Use socket wrapper library])
DEFAULT_TEST_TARGET=test-swrap DEFAULT_TEST_OPTIONS=--socket-wrapper
HAVE_SOCKET_WRAPPER=yes HAVE_SOCKET_WRAPPER=yes
fi fi
AC_SUBST(DEFAULT_TEST_TARGET) AC_SUBST(DEFAULT_TEST_OPTIONS)
AC_SUBST(HAVE_SOCKET_WRAPPER) AC_SUBST(HAVE_SOCKET_WRAPPER)
...@@ -282,49 +282,56 @@ realdistclean: distclean removebackup ...@@ -282,49 +282,56 @@ realdistclean: distclean removebackup
-rm -f $(MANPAGES) -rm -f $(MANPAGES)
check:: test check:: test
test: $(DEFAULT_TEST_TARGET)
SELFTEST = builddir=$(builddir) srcdir=$(srcdir) \ SELFTEST = $(srcdir)/script/tests/selftest.pl --prefix=${selftest_prefix} --builddir=$(builddir) --srcdir=$(srcdir) --expected-failures=samba4-knownfail
$(srcdir)/script/tests/selftest.sh ${selftest_prefix}
test: all libraries
$(SELFTEST) $(DEFAULT_TEST_OPTIONS) $(TESTS) --immediate
testone: all libraries
$(SELFTEST) $(DEFAULT_TEST_OPTIONS) $(TESTS) --one
test-swrap: all libraries test-swrap: all libraries
$(SELFTEST) all SOCKET_WRAPPER $(SELFTEST) --socket-wrapper --immediate $(TESTS)
test-noswrap: all libraries test-noswrap: all libraries
$(SELFTEST) all $(SELFTEST) --immediate $(TESTS)
quicktestone: all
$(SELFTEST) --quick --socket-wrapper --one $(TESTS)
quicktest: all quicktest: all
$(SELFTEST) quick SOCKET_WRAPPER $(SELFTEST) --quick --socket-wrapper --immediate $(TESTS)
testenv: all libraries testenv: all libraries
$(SELFTEST) xterm SOCKET_WRAPPER $(srcdir)/script/tests/testenv.pl
valgrindtest: valgrindtest-quick valgrindtest: valgrindtest-quick
valgrindtest-quick: all valgrindtest-quick: all
SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \ SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \ VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
$(SELFTEST) quick SOCKET_WRAPPER $(SELFTEST) --quick --immediate --socket-wrapper
valgrindtest-all: all libraries valgrindtest-all: all libraries
SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \ SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \ VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
$(SELFTEST) all SOCKET_WRAPPER $(SELFTEST) --immediate --socket-wrapper
valgrindtest-env: all libraries valgrindtest-env: all libraries
SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \ SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \ VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
$(SELFTEST) xterm SOCKET_WRAPPER $(srcdir)/script/tests/testenv.pl
gdbtest: gdbtest-quick gdbtest: gdbtest-quick
gdbtest-quick: all gdbtest-quick: all
SMBD_VALGRIND="xterm -n smbd -e gdb --args " \ SMBD_VALGRIND="xterm -n smbd -e gdb --args " \
$(SELFTEST) quick SOCKET_WRAPPER $(SELFTEST) --immediate --quick --socket-wrapper
gdbtest-all: all libraries gdbtest-all: all libraries
SMBD_VALGRIND="xterm -n smbd -e gdb --args " \ SMBD_VALGRIND="xterm -n smbd -e gdb --args " \
$(SELFTEST) all SOCKET_WRAPPER $(SELFTEST) --immediate --socket-wrapper
wintest: all wintest: all
$(SELFTEST) win $(SELFTEST) win
......
LOCAL-REGISTRY-* LOCAL-REGISTRY/(nt4|ldb|dir) # Not implemented yet
LOCAL-RESOLVE-async LOCAL-RESOLVE/async
LOCAL-ICONV-next_codepoint() LOCAL-ICONV/next_codepoint()
BASE-DELAYWRITE/finfo update on close
RAW-OPLOCK/OPLOCK
#!/usr/bin/perl
# Bootstrap Samba and run a number of tests against it.
# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU GPL, v3 or later.
package Samba4;
use Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(slapd_start slapd_stop smbd_check_or_start provision);
use strict;
use FindBin qw($RealBin);
use POSIX;
sub slapd_start($$)
{
my ($conf, $uri) = @_;
if (defined($ENV{FEDORA_DS_PREFIX})) {
system("$ENV{FEDORA_DS_PREFIX}/lib/fedora-ds/ds_newinst.pl $ENV{FEDORA_DS_INF}") or die("Unable to provision fedora ds ldapd");
} else {
my $oldpath = $ENV{PATH};
$ENV{PATH} = "/usr/local/sbin:/usr/sbin:/sbin:$ENV{PATH}";
# running slapd in the background means it stays in the same process group, so it can be
# killed by timelimit
system("slapd -d0 -f $conf -h $uri &");
$ENV{PATH} = $oldpath;
}
return $? >> 8;
}
sub slapd_stop()
{
if (defined($ENV{FEDORA_DS_PREFIX})) {
system("$ENV{LDAPDIR}/slapd-samba4/stop-slapd");
} else {
open(IN, "<$ENV{PIDDIR}/slapd.pid") or
die("unable to open slapd pid file");
kill 9, <IN>;
close(IN);
}
}
sub smbd_check_or_start($$$$$$)
{
my ($bindir, $test_fifo, $test_log, $socket_wrapper_dir, $max_time, $conffile) = @_;
return 0 if ( -p $test_fifo );
warn("Not using socket wrapper, but also not running as root. Will not be able to listen on proper ports") unless
defined($socket_wrapper_dir) or $< == 0;
if (defined($socket_wrapper_dir)) {
if ( -d $socket_wrapper_dir ) {
unlink <$socket_wrapper_dir/*>;
} else {
mkdir($socket_wrapper_dir);
}
}
unlink($test_fifo);
POSIX::mkfifo($test_fifo, 0700);
unlink($test_log);
my $valgrind = "";
if (defined($ENV{SMBD_VALGRIND})) {
$valgrind = $ENV{SMBD_VALGRIND};
}
print "STARTING SMBD...";
my $pid = fork();
if ($pid == 0) {
open STDIN, $test_fifo;
open STDOUT, ">$test_log";
open STDERR, '>&STDOUT';
my $optarg = "";
if (defined($max_time)) {
$optarg = "--maximum-runtime=$max_time ";
}
my $ret = system("$valgrind $bindir/smbd $optarg -s $conffile -M single -i --leak-report-full");
if ($? == -1) {
print "Unable to start smbd: $ret: $!\n";
exit 1;
}
unlink($test_fifo);
unlink(<$socket_wrapper_dir/*>) if (defined($socket_wrapper_dir) and -d $socket_wrapper_dir);
my $exit = $? >> 8;
if ( $ret == 0 ) {
print "smbd exits with status $exit\n";
} elsif ( $ret & 127 ) {
print "smbd got signal ".($ret & 127)." and exits with $exit!\n";
} else {
$ret = $? >> 8;
print "smbd failed with status $exit!\n";
}
exit $exit;
}
print "DONE\n";
return $pid;
}
sub wait_for_start()
{
# give time for nbt server to register its names
print "delaying for nbt name registration\n";
sleep(4);
# This will return quickly when things are up, but be slow if we
# need to wait for (eg) SSL init
system("bin/nmblookup $ENV{CONFIGURATION} $ENV{SERVER}");
system("bin/nmblookup $ENV{CONFIGURATION} -U $ENV{SERVER} $ENV{SERVER}");
system("bin/nmblookup $ENV{CONFIGURATION} $ENV{SERVER}");
system("bin/nmblookup $ENV{CONFIGURATION} -U $ENV{SERVER} $ENV{NETBIOSNAME}");
system("bin/nmblookup $ENV{CONFIGURATION} $ENV{NETBIOSNAME}");
system("bin/nmblookup $ENV{CONFIGURATION} -U $ENV{SERVER} $ENV{NETBIOSNAME}");
}
sub provision($)
{
my ($prefix) = @_;
my %ret = ();
print "PROVISIONING...";
open(IN, "$RealBin/mktestsetup.sh $prefix|") or die("Unable to setup");
while (<IN>) {
die ("Error parsing `$_'") unless (/^([A-Z0-9a-z_]+)=(.*)$/);
$ret{$1} = $2;
}
close(IN);
return \%ret;
}
sub provision_ldap($$)
{
my ($bindir, $setupdir) = @_;
system("$bindir/smbscript $setupdir/provision $ENV{PROVISION_OPTIONS} \"$ENV{PROVISION_ACI}\" --ldap-backend=$ENV{LDAPI}") or
die("LDAP PROVISIONING failed: $bindir/smbscript $setupdir/provision $ENV{PROVISION_OPTIONS} \"$ENV{PROVISION_ACI}\" --ldap-backend=$ENV{LDAPI}");
}
1;
#!/usr/bin/perl
# Bootstrap Samba and run a number of tests against it.
# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU GPL, v3 or later.
package SocketWrapper;
use Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(setup_dir setup_pcap set_default_iface);
use strict;
use FindBin qw($RealBin);
sub setup_dir($)
{
my ($dir) = @_;
$ENV{SOCKET_WRAPPER_DIR} = $dir;
return $dir;
}
sub setup_pcap($)
{
my ($pcap_file) = @_;
}
sub set_default_iface($)
{
my ($i) = @_;
$ENV{SOCKET_WRAPPER_DEFAULT_IFACE} = $i;
}
1;
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
This diff is collapsed.
#!/bin/sh
# Bootstrap Samba and run a number of tests against it.
if [ $# -lt 1 ]
then
echo "$0 PREFIX TESTS"
exit
fi
ARG0=$0
ARG1=$1
ARG2=$2
ARG3=$3
if [ -z "$TORTURE_MAXTIME" ]; then
TORTURE_MAXTIME=1200
fi
# disable rpc validation when using valgrind - its way too slow
if [ -z "$VALGRIND" ]; then
VALIDATE="validate";
else
VALIDATE="";
fi
OLD_PWD=`pwd`
PREFIX=$ARG1
PREFIX=`echo $PREFIX | sed s+//+/+`
export PREFIX
# allow selection of the test lists
TESTS=$ARG2
if [ $TESTS = "all" ]; then
TLS_ENABLED="yes"
else
TLS_ENABLED="no"
fi
export TLS_ENABLED
LD_LDB_MODULE_PATH=$OLD_PWD/bin/modules/ldb
export LD_LDB_MODULE_PATH
LD_SAMBA_MODULE_PATH=$OLD_PWD/bin/modules
export LD_SAMBA_MODULE_PATH
LD_LIBRARY_PATH=$OLD_PWD/bin/shared:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
PKG_CONFIG_PATH=$OLD_PWD/bin/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH
incdir=`dirname $ARG0`
echo -n "PROVISIONING..."
eval `$incdir/mktestsetup.sh $PREFIX || exit 1`
echo "DONE"
export KRB5_CONFIG
export PREFIX_ABS
export TEST_DATA_PREFIX
export CONFIGURATION
export CONFFILE
export PIDDIR
export AUTH
export SERVER
export NETBIOSNAME
PATH=bin:$PATH
export PATH
DO_SOCKET_WRAPPER=$ARG3
if [ x"$DO_SOCKET_WRAPPER" = x"SOCKET_WRAPPER" ];then
SOCKET_WRAPPER_DIR="$PREFIX/w"
export SOCKET_WRAPPER_DIR
echo "SOCKET_WRAPPER_DIR=$SOCKET_WRAPPER_DIR"
else
echo "NOT USING SOCKET_WRAPPER"
fi
incdir=`dirname $ARG0`
. $incdir/test_functions.sh
#Start slapd before smbd
if [ x"$TEST_LDAP" = x"yes" ]; then
if test -z "$FEDORA_DS_PREFIX"; then
slapd_start || exit 1;
else
fedora_ds_start || exit 1;
fi
echo -n "LDAP PROVISIONING..."
$srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS "$PROVISION_ACI" --ldap-backend=$LDAP_URI || {
echo "LDAP PROVISIONING failed: $srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS $PROVISION_ACI --ldap-backend=$LDAP_URI"
exit 1;
}
#LDAP is slow
TORTURE_MAXTIME=`expr $TORTURE_MAXTIME '*' 2`
fi
SMBD_TEST_FIFO="$PREFIX/smbd_test.fifo"
export SMBD_TEST_FIFO
SMBD_TEST_LOG="$PREFIX/smbd_test.log"
export SMBD_TEST_LOG
SOCKET_WRAPPER_DEFAULT_IFACE=1
export SOCKET_WRAPPER_DEFAULT_IFACE
smbd_check_or_start
SOCKET_WRAPPER_DEFAULT_IFACE=6
export SOCKET_WRAPPER_DEFAULT_IFACE
TORTURE_INTERFACES='127.0.0.6/8,127.0.0.7/8,127.0.0.8/8,127.0.0.9/8,127.0.0.10/8,127.0.0.11/8'
TORTURE_OPTIONS="--option=interfaces=$TORTURE_INTERFACES $CONFIGURATION"
# ensure any one smbtorture call doesn't run too long
TORTURE_OPTIONS="$TORTURE_OPTIONS --maximum-runtime=$TORTURE_MAXTIME"
TORTURE_OPTIONS="$TORTURE_OPTIONS --target=samba4"
export TORTURE_OPTIONS
if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
TORTURE_OPTIONS="$TORTURE_OPTIONS --option=torture:progress=no"
fi
runtest() {
if [ -z "$PREFIX" ]; then
PREFIX=test_prefix
mkdir -p $PREFIX
fi
name=$1
shift 1
cmdline="$*"
SMBD_IS_UP="no"
shname=`echo $name | \
sed -e 's%[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\-]%_%g'`
UNIQUE_PID=`/bin/sh -c 'echo $$'`
TEST_LOG="$PREFIX/test_log.${UNIQUE_PID}"
TEST_PCAP="$PREFIX/test_${shname}_${UNIQUE_PID}.pcap"
trap "rm -f $TEST_LOG $TEST_PCAP" EXIT
if [ -n "$SMBD_TEST_LOG" -a -z "$smbd_log_size" ]; then
smbd_log_size=`wc -l < $SMBD_TEST_LOG`;
fi
if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
echo "--==--==--==--==--==--==--==--==--==--==--"
echo "Running test $name (level 0 stdout)"
echo "--==--==--==--==--==--==--==--==--==--==--"
date
echo "Testing $name"
else
nf="`expr $failed + $totalfailed`";
if [ "$nf" = "0" ]; then
echo "[$current/$total] Testing $name"
else
echo "[$current/$total, $nf failures] Testing $name"
fi
fi
smbd_check_only && SMBD_IS_UP="yes"
if [ x"$SMBD_IS_UP" != x"yes" ];then
if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
echo "SMBD is down! Skipping: $cmdline"
echo "=========================================="
echo "TEST SKIPPED: $name (reason SMBD is down)"
echo "=========================================="
else
echo "TEST SKIPPED: $name (reason SMBD is down)"
fi
return 1
fi
if [ x"$MAKE_TEST_ENABLE_PCAP" = x"yes" ];then
SOCKET_WRAPPER_PCAP_FILE=$TEST_PCAP
export SOCKET_WRAPPER_PCAP_FILE
fi
( $cmdline > $TEST_LOG 2>&1 )
status=$?
# show any additional output from smbd that has happened in this test
smbd_have_test_log && {
new_log_size=`wc -l < $SMBD_TEST_LOG`;
test "$new_log_size" = "$smbd_log_size" || {
echo "SMBD OUTPUT:";
incr_log_size=`expr $new_log_size - $smbd_log_size`;
tail -$incr_log_size $SMBD_TEST_LOG;
smbd_log_size=$new_log_size;
}
}
if [ x"$status" != x"0" ]; then
echo "TEST OUTPUT:"
cat $TEST_LOG;
rm -f $TEST_LOG;
if [ x"$MAKE_TEST_ENABLE_PCAP" = x"yes" ];then
echo "TEST PCAP: $TEST_PCAP"
fi
if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
echo "=========================================="
echo "TEST FAILED: $name (status $status)"
echo "=========================================="
else
echo "TEST FAILED: $cmdline (status $status)"
fi
trap "" EXIT
return 1;
fi
rm -f $TEST_LOG;
if [ x"$MAKE_TEST_KEEP_PCAP" = x"yes" ];then
echo "TEST PCAP: $TEST_PCAP"
else
rm -f $TEST_PCAP;
fi
if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
echo "ALL OK: $cmdline"
echo "=========================================="
echo "TEST PASSED: $name"
echo "=========================================="
fi
trap "" EXIT
return 0;
}
START=`date`
(
# give time for nbt server to register its names
echo delaying for nbt name registration
sleep 4
# This will return quickly when things are up, but be slow if we need to wait for (eg) SSL init
bin/nmblookup $CONFIGURATION $SERVER
bin/nmblookup $CONFIGURATION -U $SERVER $SERVER
bin/nmblookup $CONFIGURATION $SERVER
bin/nmblookup $CONFIGURATION -U $SERVER $NETBIOSNAME
bin/nmblookup $CONFIGURATION $NETBIOSNAME
bin/nmblookup $CONFIGURATION -U $SERVER $NETBIOSNAME
# start off with 0 failures
totalfailed=0
export totalfailed
. script/tests/tests_$TESTS.sh > $PREFIX/recipe
total=`grep "TEST --" $PREFIX/recipe | wc -l`
current=0
cat $PREFIX/recipe | (
while read LINE
do
if [ "$LINE" = "-- TEST --" ]; then
read NAME
read CMDLINE
current=`expr $current + 1`
runtest "$NAME" "$CMDLINE" || totalfailed=`expr $totalfailed + $?`
else
echo "$LINE"
fi
done
exit $totalfailed
)
exit $?
) 9>$SMBD_TEST_FIFO
totalfailed=$?
smbd_PID=`cat $PIDDIR/smbd.pid`
waitforpid $smbd_PID 20 || {
echo "smbd process $1 took more than 20 seconds to exit, killing"
kill -9 $smbd_PID
}
if [ "$TEST_LDAP"x = "yesx" ]; then
if test -z "$FEDORA_DS_PREFIX"; then
kill `cat $PIDDIR/slapd.pid`
else
$LDAPDIR/slapd-samba4/stop-slapd
fi
fi
END=`date`
echo "START: $START ($ARG0)";
echo "END: $END ($ARG0)";
# if there were any valgrind failures, show them
count=`find $PREFIX -name 'valgrind.log*' | wc -l`
if [ "$count" != 0 ]; then
for f in $PREFIX/valgrind.log*; do
if [ -s $f ] && grep -v DWARF2.CFI.reader $f > /dev/null; then
echo "VALGRIND FAILURE";
totalfailed=`expr $totalfailed + 1`
cat $f
fi
done
fi
teststatus $ARG0 $totalfailed
...@@ -24,16 +24,11 @@ PATH=bin:$PATH ...@@ -24,16 +24,11 @@ PATH=bin:$PATH
export PATH export PATH
testit "base.js" $SCRIPTDIR/base.js $CONFIGURATION testit "base.js" $SCRIPTDIR/base.js $CONFIGURATION
testit "samr.js" "$SCRIPTDIR/samr.js" $CONFIGURATION ncalrpc: -U$USERNAME%$PASSWORD testit "samr.js" "$SCRIPTDIR/samr.js" $CONFIGURATION ncalrpc: -U$USERNAME%$PASSWORD
testit "echo.js" "$SCRIPTDIR/echo.js" $CONFIGURATION ncalrpc: -U$USERNAME%$PASSWORD testit "echo.js" "$SCRIPTDIR/echo.js" $CONFIGURATION ncalrpc: -U$USERNAME%$PASSWORD
testit "ejsnet.js" $SCRIPTDIR/ejsnet.js $CONFIGURATION -U$USERNAME%$PASSWORD $DOMAIN ejstestuser testit "ejsnet.js" $SCRIPTDIR/ejsnet.js $CONFIGURATION -U$USERNAME%$PASSWORD $DOMAIN ejstestuser
testit "ldb.js" $SCRIPTDIR/ldb.js `pwd` $CONFIGURATION testit "ldb.js" $SCRIPTDIR/ldb.js `pwd` $CONFIGURATION
testit "samba3sam.js" $SCRIPTDIR/samba3sam.js $CONFIGURATION `pwd` $DATADIR/samba3/ testit "samba3sam.js" $SCRIPTDIR/samba3sam.js $CONFIGURATION `pwd` $DATADIR/samba3/
testit "winreg" scripting/bin/winreg $CONFIGURATION ncalrpc: 'HKLM' -U$USERNAME%$PASSWORD testit "winreg" scripting/bin/winreg $CONFIGURATION ncalrpc: 'HKLM' -U$USERNAME%$PASSWORD
testok $0 $failed testok $0 $failed
...@@ -15,7 +15,6 @@ PASSWORD="$3" ...@@ -15,7 +15,6 @@ PASSWORD="$3"
incdir=`dirname $0` incdir=`dirname $0`
. $incdir/test_functions.sh . $incdir/test_functions.sh
p=ldap p=ldap
for options in "" "--option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD --option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD"; do for options in "" "--option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD --option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD"; do
testit "TESTING PROTOCOL $p with options $options" ../testprogs/blackbox/test_ldb.sh $p $SERVER $options testit "TESTING PROTOCOL $p with options $options" ../testprogs/blackbox/test_ldb.sh $p $SERVER $options
...@@ -37,11 +36,11 @@ done ...@@ -37,11 +36,11 @@ done
test "$TORTURE_QUICK" = "yes" || { test "$TORTURE_QUICK" = "yes" || {
LDBDIR=lib/ldb LDBDIR=lib/ldb
export LDBDIR export LDBDIR
testit "ldb tests" $LDBDIR/tests/test-tdb.sh testit "ldb" $LDBDIR/tests/test-tdb.sh
} }
SCRIPTDIR=../testprogs/ejs SCRIPTDIR=../testprogs/ejs
testit "ejs ldap test" $SCRIPTDIR/ldap.js $CONFIGURATION $SERVER -U$USERNAME%$PASSWORD testit "ejs ldap" $SCRIPTDIR/ldap.js $CONFIGURATION $SERVER -U$USERNAME%$PASSWORD
testok $0 $failed testok $0 $failed
...@@ -23,9 +23,7 @@ testit "nmblookup $SERVER" bin/nmblookup $TORTURE_OPTIONS $SERVER ...@@ -23,9 +23,7 @@ testit "nmblookup $SERVER" bin/nmblookup $TORTURE_OPTIONS $SERVER
NBT_TESTS="NBT-REGISTER NBT-WINS" NBT_TESTS="NBT-REGISTER NBT-WINS"
NBT_TESTS="$NBT_TESTS NBT-WINSREPLICATION" NBT_TESTS="$NBT_TESTS NBT-WINSREPLICATION"
# if [ "$TORTURE_QUICK"x != "yes"x ]; then # NBT_TESTS="$NBT_TESTS NBT-WINSREPLICATION-OWNED"
# NBT_TESTS="$NBT_TESTS NBT-WINSREPLICATION-OWNED"
# fi
NBT_TESTS="$NBT_TESTS NET-API-LOOKUP NET-API-LOOKUPHOST NET-API-LOOKUPPDC" NBT_TESTS="$NBT_TESTS NET-API-LOOKUP NET-API-LOOKUPHOST NET-API-LOOKUPPDC"
for f in $NBT_TESTS; do for f in $NBT_TESTS; do
......
#!/usr/bin/perl
use FindBin qw($RealBin);
use lib "$RealBin";
use Samba4;
use SocketWrapper;
my $vars = Samba4::provision("st");
foreach (keys %$vars) { $ENV{$_} = $vars->{$_}; }
SocketWrapper::set_default_iface(1);
my $test_fifo = "st/smb_test.fifo";
my $socket_wrapper_dir = SocketWrapper::setup_dir("$vars->{PREFIX_ABS}/w");
Samba4::smbd_check_or_start("bin", $test_fifo, $ENV{SMBD_TEST_LOG}, $socket_wrapper_dir, undef, $ENV{CONFFILE});
SocketWrapper::set_default_iface(6);
my $interfaces = join(',', ("127.0.0.6/8",
"127.0.0.7/8",
"127.0.0.8/8",
"127.0.0.9/8",
"127.0.0.10/8",
"127.0.0.11/8"));
push (@torture_options, "--option=interfaces=$interfaces",
$ENV{CONFIGURATION},
"--target=samba4");
$ENV{TORTURE_OPTIONS} = join(' ', @torture_options);
open(DATA, ">$test_fifo");
Samba4::wait_for_start();
system("xterm");
close(DATA);
#!/bin/sh
$SRCDIR/script/tests/test_net.sh $SERVER $USERNAME $PASSWORD $DOMAIN