diff options
author | Simo Sorce <idra@samba.org> | 2006-07-23 18:49:07 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:10:19 -0500 |
commit | cb85a76d77243c6834c0cf33eaa50a76dbefcdf8 (patch) | |
tree | 69adc5f318e625621ca794f44ca2daf0ec7333e0 /source4 | |
parent | 151fc7400611b90f3236c74e3c40e8f75385fdee (diff) | |
download | samba-cb85a76d77243c6834c0cf33eaa50a76dbefcdf8.tar.gz samba-cb85a76d77243c6834c0cf33eaa50a76dbefcdf8.tar.bz2 samba-cb85a76d77243c6834c0cf33eaa50a76dbefcdf8.zip |
r17208: Add a away to test the ldb module.
Actually you can't test both classic and ldb together, but you can replace the standard
script/tests/mktestsetup.sh file with this one and run make test to see share_ldb in action
(This used to be commit d4c2b893504feb3a232e74d14584405b3aaaf942)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/script/tests/mktestsetup.sh.share_ldb | 211 | ||||
-rw-r--r-- | source4/setup/share.ldif | 46 |
2 files changed, 257 insertions, 0 deletions
diff --git a/source4/script/tests/mktestsetup.sh.share_ldb b/source4/script/tests/mktestsetup.sh.share_ldb new file mode 100644 index 0000000000..78360d8c35 --- /dev/null +++ b/source4/script/tests/mktestsetup.sh.share_ldb @@ -0,0 +1,211 @@ +#!/bin/sh + +if [ $# -lt 1 ] +then + echo "$0 PREFIX" + exit 1 +fi + +PREFIX=$1 + +if test -z "$TLS_ENABLED"; then + TLS_ENABLED=false +fi + +DOMAIN=SAMBADOMAIN +USERNAME=administrator +REALM=SAMBA.EXAMPLE.COM +PASSWORD=penguin +SRCDIR=`pwd` +ROOT=$USER +SERVER=localhost +NETBIOSNAME=localtest +if test -z "$ROOT"; then + ROOT=$LOGNAME +fi +if test -z "$ROOT"; then + ROOT=`whoami` +fi + +oldpwd=`pwd` +srcdir=`dirname $0`/../.. +mkdir -p $PREFIX || exit $? +cd $PREFIX +PREFIX_ABS=`pwd` +export PREFIX_ABS +cd $oldpwd + +TEST_DATA_PREFIX=$PREFIX_ABS +export TEST_DATA_PREFIX + +TMPDIR=$PREFIX_ABS/tmp +ETCDIR=$PREFIX_ABS/etc +PIDDIR=$PREFIX_ABS/pid +CONFFILE=$ETCDIR/smb.conf +KRB5_CONFIG=$ETCDIR/krb5.conf +PRIVATEDIR=$PREFIX_ABS/private +NCALRPCDIR=$PREFIX_ABS/ncalrpc +LOCKDIR=$PREFIX_ABS/lockdir +TLSDIR=$PRIVATEDIR/tls +WINBINDD_SOCKET_DIR=$PREFIX_ABS/winbind_socket +CONFIGURATION="--configfile=$CONFFILE" +export CONFIGURATION +export CONFFILE + +rm -rf $PREFIX/* +mkdir -p $PRIVATEDIR $ETCDIR $PIDDIR $NCALRPCDIR $LOCKDIR $TMPDIR $TLSDIR + +cat >$CONFFILE<<EOF +[global] + netbios name = $NETBIOSNAME + netbios aliases = $SERVER + workgroup = $DOMAIN + realm = $REALM + private dir = $PRIVATEDIR + pid directory = $PIDDIR + ncalrpc dir = $NCALRPCDIR + lock dir = $LOCKDIR + setup directory = $SRCDIR/setup + js include = $SRCDIR/scripting/libjs + share backend = ldb + winbindd socket directory = $WINBINDD_SOCKET_DIR + name resolve order = bcast + interfaces = 127.0.0.1/8 + tls enabled = $TLS_ENABLED + panic action = $SRCDIR/script/gdb_backtrace %PID% %PROG% + wins support = yes + server role = pdc + max xmit = 32K + server max protocol = SMB2 + +[tmp] + path = $TMPDIR + read only = no + ntvfs handler = posix + posix:sharedelay = 100000 + posix:eadb = $LOCKDIR/eadb.tdb + +[cifs] + read only = no + ntvfs handler = cifs + cifs:server = $SERVER + cifs:user = $USERNAME + cifs:password = $PASSWORD + cifs:domain = $DOMAIN + cifs:share = tmp +EOF + +## Override default srahes_config.ldb file +rm -f $PRIVATEDIR/share.ldb +cat >$PRIVATEDIR/share.ldif<<EOF +### Shares basedn +dn: @INDEXLIST +@IDXATTR: name + +dn: @ATTRIBUTES +cn: CASE_INSENSITIVE +dc: CASE_INSENSITIVE +name: CASE_INSENSITIVE +dn: CASE_INSENSITIVE +objectClass: CASE_INSENSITIVE + +dn: CN=Shares +objectClass: top +objectClass: organizationalUnit +cn: Shares + +### Default IPC$ Share +dn: CN=IPC$,CN=Shares +objectClass: top +objectClass: share +cn: IPC$ +name: IPC$ +type: IPC +path: /tmp +comment: Remote IPC +max-connections: -1 +available: True +readonly: True +browseable: False +ntvfs-handler: default + +### Default ADMIN$ Share +dn: CN=ADMIN$,CN=Shares +objectClass: top +objectClass: share +cn: ADMIN$ +name: ADMIN$ +type: DISK +path: /tmp +comment: Remote Admin +max-connections: -1 +available: True +readonly: True +browseable: False +ntvfs-handler: default + +dn: CN=tmp,CN=Shares +objectClass: top +objectClass: share +cn: tmp +name: tmp +type: DISK +path: $TMPDIR +comment: Temp Dir for Tests +readonly: False +ntvfs-handler: posix +posix-sharedelay: 100000 +posix-eadb: $LOCKDIR/eadb.tdb + +dn: CN=cifs,CN=Shares +objectClass: top +objectClass: share +cn: cifs +name: cifs +type: DISK +readonly: False +ntvfs-handler: cifs +cifs-server: $SERVER +cifs-user: $USERNAME +cifs-password: $PASSWORD +cifs-domain: $DOMAIN +cifs-share: tmp +EOF + +$srcdir/bin/ldbadd -H $PRIVATEDIR/share.ldb < $PRIVATEDIR/share.ldif >/dev/null || exit 1 + +cat >$KRB5_CONFIG<<EOF +[libdefaults] + default_realm = SAMBA.EXAMPLE.COM + dns_lookup_realm = false + dns_lookup_kdc = false + ticket_lifetime = 24h + forwardable = yes + +[realms] + SAMBA.EXAMPLE.COM = { + kdc = 127.0.0.1 + admin_server = 127.0.0.1 + default_domain = samba.example.com + } +[domain_realm] + .samba.example.com = SAMBA.EXAMPLE.COM +EOF + +export KRB5_CONFIG + +$srcdir/bin/smbscript $srcdir/setup/provision $CONFIGURATION --host-name=$NETBIOSNAME --host-ip=127.0.0.1 \ + --quiet --domain $DOMAIN --realm $REALM \ + --adminpass $PASSWORD --root=$ROOT || exit 1 + +cat >$PRIVATEDIR/wins_config.ldif<<EOF +dn: name=TORTURE_26,CN=PARTNERS +objectClass: wreplPartner +name: TORTURE_26 +address: 127.0.0.26 +pullInterval: 0 +pushChangeCount: 0 +type: 0x3 +EOF + +$srcdir/bin/ldbadd -H $PRIVATEDIR/wins_config.ldb < $PRIVATEDIR/wins_config.ldif >/dev/null || exit 1 diff --git a/source4/setup/share.ldif b/source4/setup/share.ldif new file mode 100644 index 0000000000..750a070c8a --- /dev/null +++ b/source4/setup/share.ldif @@ -0,0 +1,46 @@ +dn: @INDEXLIST +@IDXATTR: name + +dn: @ATTRIBUTES +cn: CASE_INSENSITIVE +dc: CASE_INSENSITIVE +name: CASE_INSENSITIVE +dn: CASE_INSENSITIVE +objectClass: CASE_INSENSITIVE + +### Shares basedn +dn: CN=Shares +objectClass: top +objectClass: organizationalUnit +cn: Shares + +### Default IPC$ Share +dn: CN=IPC$,CN=Shares +objectClass: top +objectClass: share +cn: IPC$ +name: IPC$ +type: IPC +path: /tmp +comment: Remote IPC +max-connections: -1 +available: True +readonly: True +browseable: False +ntvfs-handler: default + +### Default ADMIN$ Share +dn: CN=ADMIN$,CN=Shares +objectClass: top +objectClass: share +cn: ADMIN$ +name: ADMIN$ +type: DISK +path: /tmp +comment: Remote Admin +max-connections: -1 +available: True +readonly: True +browseable: False +ntvfs-handler: default + |