summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-04-16 10:44:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:50:49 -0500
commit7836c2d101944edfcc2ccc2ff0d7403ca625aed1 (patch)
tree46d90b8229a2b77b00f510bdffb1ba23d1bc7638 /source4/script
parentdaf889dff26de3f3e001a66f4e788f18a0efa6e1 (diff)
downloadsamba-7836c2d101944edfcc2ccc2ff0d7403ca625aed1.tar.gz
samba-7836c2d101944edfcc2ccc2ff0d7403ca625aed1.tar.bz2
samba-7836c2d101944edfcc2ccc2ff0d7403ca625aed1.zip
r22260: Use single script for creating Samba 4 test environments. Add first test
that uses the member environment. (This used to be commit 9e3142a1bb3f3b3e06ea1a54215474d88de4d44d)
Diffstat (limited to 'source4/script')
-rw-r--r--source4/script/tests/Samba4.pm7
-rwxr-xr-xsource4/script/tests/mksamba4server.sh (renamed from source4/script/tests/mktestdc.sh)5
-rw-r--r--source4/script/tests/mktestmember.sh85
-rwxr-xr-xsource4/script/tests/test_member.sh6
-rwxr-xr-xsource4/script/tests/tests_all.sh1
5 files changed, 11 insertions, 93 deletions
diff --git a/source4/script/tests/Samba4.pm b/source4/script/tests/Samba4.pm
index b891b4dc7b..cabc952fc3 100644
--- a/source4/script/tests/Samba4.pm
+++ b/source4/script/tests/Samba4.pm
@@ -140,15 +140,18 @@ sub provision_member($$$)
my ($self, $prefix, $dcvars) = @_;
my %ret = ();
print "PROVISIONING...";
- open(IN, "$RealBin/mktestmember.sh $prefix $dcvars->{DOMAIN} $dcvars->{USERNAME} $dcvars->{PASSWORD}|") or die("Unable to setup");
+ open(IN, "SERVER_ROLE=\"member server\" $RealBin/mksamba4server.sh $prefix|") or die("Unable to setup");
while (<IN>) {
die ("Error parsing `$_'") unless (/^([A-Z0-9a-z_]+)=(.*)$/);
$ret{$1} = $2;
}
close(IN);
+ system("$self->{bindir}/net join $ret{CONFIGURATION} $dcvars->{DOMAIN} member -U$dcvars->{USERNAME}\%$dcvars->{PASSWORD}") or die("Join failed");
+
$ret{SMBD_TEST_FIFO} = "$prefix/smbd_test.fifo";
$ret{SMBD_TEST_LOG} = "$prefix/smbd_test.log";
+ print "$ret{DOMAIN}\n";
return \%ret;
}
@@ -157,7 +160,7 @@ sub provision_dc($$)
my ($self, $prefix) = @_;
my %ret = ();
print "PROVISIONING...";
- open(IN, "$RealBin/mktestdc.sh $prefix|") or die("Unable to setup");
+ open(IN, "$RealBin/mksamba4server.sh $prefix|") or die("Unable to setup");
while (<IN>) {
die ("Error parsing `$_'") unless (/^([A-Z0-9a-z_]+)=(.*)$/);
$ret{$1} = $2;
diff --git a/source4/script/tests/mktestdc.sh b/source4/script/tests/mksamba4server.sh
index 4b92fe3a3c..f59d8c216c 100755
--- a/source4/script/tests/mktestdc.sh
+++ b/source4/script/tests/mksamba4server.sh
@@ -17,7 +17,10 @@ if test -z "$SMBD_LOGLEVEL"; then
SMBD_LOGLEVEL=1
fi
-SERVER_ROLE="domain controller"
+if test -z "$SERVER_ROLE"; then
+ SERVER_ROLE="domain controller"
+fi
+
DOMAIN=SAMBADOMAIN
USERNAME=administrator
REALM=SAMBA.EXAMPLE.COM
diff --git a/source4/script/tests/mktestmember.sh b/source4/script/tests/mktestmember.sh
deleted file mode 100644
index b2d35d7204..0000000000
--- a/source4/script/tests/mktestmember.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-
-if [ $# -lt 4 ]
-then
- echo "$0 PREFIX DOMAIN USERNAME PASSWORD"
- exit 1
-fi
-
-PREFIX=$1
-DOMAIN=$2
-DC_USERNAME=$3
-DC_PASSWORD=$4
-shift 4
-USERNAME=administrator
-PASSWORD=humbolt
-
-SRCDIR=`pwd`
-oldpwd=`dirname $0`/../..
-mkdir -p $PREFIX
-cd $PREFIX
-PREFIX_ABS=`pwd`
-ETCDIR=$PREFIX_ABS/etc
-NCALRPCDIR=$PREFIX_ABS/ncalrpc
-PIDDIR=$PREFIX_ABS/pid
-PRIVATEDIR=$PREFIX_ABS/private
-LOCKDIR=$PREFIX_ABS/lockdir
-WINBINDD_SOCKET_DIR=$PREFIX_ABS/winbind_socket
-CONFFILE=$ETCDIR/smb.conf
-TMPDIR=$PREFIX_ABS/tmp
-NETBIOSNAME=localmember
-SMBD_LOGLEVEL=1
-
-mkdir -p $PRIVATEDIR $ETCDIR $PIDDIR $NCALRPCDIR $LOCKDIR $TMPDIR
-
-cat >$CONFFILE<<EOF
-[global]
- netbios name = $NETBIOSNAME
- workgroup = $DOMAIN
- private dir = $PRIVATEDIR
- pid directory = $PIDDIR
- ncalrpc dir = $NCALRPCDIR
- lock dir = $LOCKDIR
- setup directory = $SRCDIR/setup
- js include = $SRCDIR/scripting/libjs
- winbindd socket directory = $WINBINDD_SOCKET_DIR
- name resolve order = bcast
- interfaces = 127.0.0.5/8
- panic action = $SRCDIR/script/gdb_backtrace %PID% %PROG%
- wins support = yes
- server role = domain member
- max xmit = 32K
- server max protocol = SMB2
- notify:inotify = false
- ldb:nosync = true
- system:anonymous = true
-#We don't want to pass our self-tests if the PAC code is wrong
- gensec:require_pac = true
- log level = $SMBD_LOGLEVEL
-EOF
-
-PROVISION_OPTIONS="$CONFIGURATION --host-name=$NETBIOSNAME --host-ip=127.0.0.1"
-PROVISION_OPTIONS="$PROVISION_OPTIONS --quiet --domain $DOMAIN --realm $REALM"
-PROVISION_OPTIONS="$PROVISION_OPTIONS --adminpass $PASSWORD --root=$ROOT"
-PROVISION_OPTIONS="$PROVISION_OPTIONS --simple-bind-dn=cn=Manager,$BASEDN --password=$PASSWORD --root=$ROOT"
-$srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS >&2
-
-$srcdir/bin/net join member $DOMAIN -U$DC_USERNAME%$DC_PASSWORD >&2 || {
- echo "Join failed"
- exit $?
-}
-
-echo "PREFIX_ABS=$PREFIX_ABS"
-echo "PIDDIR=$PIDDIR"
-echo "SERVER=$SERVER"
-echo "NETBIOSNAME=$NETBIOSNAME"
-echo "DOMAIN=$DOMAIN"
-echo "USERNAME=$USERNAME"
-echo "REALM=$REALM"
-echo "PASSWORD=$PASSWORD"
-echo "SRCDIR=$SRCDIR"
-echo "PREFIX=$PREFIX"
-echo "CONFFILE=$CONFFILE"
-echo "WINBINDD_SOCKET_DIR=$WINBINDD_SOCKET_DIR"
-echo "NCALRPCDIR=$NCALRPCDIR"
-echo "CONFIGURATION=$CONFIGURATION"
diff --git a/source4/script/tests/test_member.sh b/source4/script/tests/test_member.sh
index 798da60929..b1bb0c7b09 100755
--- a/source4/script/tests/test_member.sh
+++ b/source4/script/tests/test_member.sh
@@ -1,10 +1,6 @@
#!/bin/sh
-# add tests to this list as they start passing, so we test
-# that they stay passing
-ncacn_np_tests="RPC-ECHO"
-
incdir=`dirname $0`
. $incdir/test_functions.sh
-plantest "RPC-ECHO against member server" member $VALGRIND bin/smbtorture $TORTURE_OPTIONS ncacn_np:"\$SERVER" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN $t "$*"
+plantest "RPC-ECHO against member server" member $VALGRIND bin/smbtorture $TORTURE_OPTIONS ncacn_np:"\$SERVER" -U"\$USERNAME"%"\$PASSWORD" -W \$DOMAIN RPC-ECHO "$*"
diff --git a/source4/script/tests/tests_all.sh b/source4/script/tests/tests_all.sh
index 68ec5ba224..45366186b5 100755
--- a/source4/script/tests/tests_all.sh
+++ b/source4/script/tests/tests_all.sh
@@ -14,3 +14,4 @@
$SRCDIR/script/tests/test_blackbox.sh $PREFIX
$SRCDIR/script/tests/test_simple.sh
$SRCDIR/script/tests/test_s3upgrade.sh $PREFIX/upgrade
+ $SRCDIR/script/tests/test_member.sh