2011-08-12 17:47:49 +10:00
#!/bin/sh
if [ $# -lt 1 ] ; then
2022-02-23 12:03:50 +01:00
cat <<EOF
2011-08-12 17:47:49 +10:00
Usage: blackbox_s3upgrade.sh PREFIX
EOF
2022-02-23 12:03:50 +01:00
exit 1
2011-08-12 17:47:49 +10:00
fi
2022-02-23 12:03:50 +01:00
PREFIX = $( pwd ) " / $1 "
2011-08-12 17:47:49 +10:00
shift 1
2011-09-12 20:21:53 +10:00
samba4bindir = " $BINDIR "
2012-01-26 09:42:27 +11:00
samba_tool = " $samba4bindir /samba-tool "
samba_net = " $samba4bindir /net "
testparm = " $samba4bindir /testparm "
2011-09-12 20:21:53 +10:00
2022-02-23 12:03:50 +01:00
. $( dirname $0 ) /../../../testprogs/blackbox/subunit.sh
2011-08-12 17:47:49 +10:00
rm -rf $PREFIX /samba3-upgrade
2011-09-13 21:02:43 +10:00
mkdir -p $PREFIX /samba3-upgrade
2011-08-12 17:47:49 +10:00
cp -a $SRCDIR /testdata/samba3 $PREFIX /samba3-upgrade
# Test 1 (s3 member)
2022-02-23 12:03:50 +01:00
cat - >$PREFIX /samba3-upgrade/samba3/smb1.conf <<EOF
2011-08-12 17:47:49 +10:00
[ global]
workgroup = SAMBA
security = user
netbiosname = S3UPGRADE
passdb backend = tdbsam:$PREFIX /samba3-upgrade/samba3/passdb.tdb
private dir = $PREFIX /samba3-upgrade/samba3
lock directory = $PREFIX /samba3-upgrade/samba3
state directory = $PREFIX /samba3-upgrade/samba3
cache directory = $PREFIX /samba3-upgrade/samba3
pid directory = $PREFIX /samba3-upgrade/samba3
usershare path = $PREFIX /samba3-upgrade/samba3
ncalrpc dir = $PREFIX /samba3-upgrade/samba3
debug level = 0
EOF
2018-10-10 11:14:59 +01:00
testit "samba3-upgrade-member" $PYTHON $samba_tool domain classicupgrade $PREFIX /samba3-upgrade/samba3/smb1.conf --targetdir= $PREFIX /samba3-upgrade/s4_1 --dbdir= $PREFIX /samba3-upgrade/samba3 --use-ntvfs
2021-04-14 11:44:51 +02:00
testit "samba3-upgrade-member-getlocalsid" $samba_net getlocalsid s3upgrade --configfile= $PREFIX /samba3-upgrade/s4_1/etc/smb.conf
2011-08-12 17:47:49 +10:00
# Test 2 (s3 dc)
2022-02-23 12:03:50 +01:00
cat - >$PREFIX /samba3-upgrade/samba3/smb2.conf <<EOF
2011-08-12 17:47:49 +10:00
[ global]
workgroup = SAMBA
netbiosname = S3UPGRADE
security = user
2011-09-05 11:04:42 +10:00
realm = s3.samba.example.com
2011-08-12 17:47:49 +10:00
passdb backend = tdbsam:$PREFIX /samba3-upgrade/samba3/passdb.tdb
private dir = $PREFIX /samba3-upgrade/samba3
lock directory = $PREFIX /samba3-upgrade/samba3
state directory = $PREFIX /samba3-upgrade/samba3
cache directory = $PREFIX /samba3-upgrade/samba3
pid directory = $PREFIX /samba3-upgrade/samba3
usershare path = $PREFIX /samba3-upgrade/samba3
ncalrpc dir = $PREFIX /samba3-upgrade/samba3
debug level = 0
domain logons = yes
EOF
2012-06-16 13:58:06 +10:00
mv $PREFIX /samba3-upgrade/samba3/wins.dat2 $PREFIX /samba3-upgrade/samba3/wins.dat
2012-08-27 22:39:35 +10:00
# Upgrade NT4-like domains in samba3upgrade
2018-10-10 11:14:59 +01:00
testit "samba3-upgrade-dc" $PYTHON $samba_tool domain classicupgrade $PREFIX /samba3-upgrade/samba3/smb2.conf --targetdir= $PREFIX /samba3-upgrade/s4_2 --dbdir= $PREFIX /samba3-upgrade/samba3 --use-ntvfs
2021-04-14 11:44:51 +02:00
testit "samba3-upgrade-dc-getlocalsid" $samba_net getlocalsid samba --configfile= $PREFIX /samba3-upgrade/s4_2/etc/smb.conf
testit "samba3-upgrade-dc-getdomainsid" $samba_net getdomainsid --configfile= $PREFIX /samba3-upgrade/s4_2/etc/smb.conf
2011-09-13 21:02:43 +10:00
2011-10-19 23:07:14 +11:00
#Run final test without a wins.dat
rm -f $PREFIX /samba3-upgrade/samba3/wins.dat
2011-09-13 21:02:43 +10:00
# Test 3 (s3 dc using testparm hook)
2022-02-23 12:03:50 +01:00
cat - >$PREFIX /samba3-upgrade/samba3/smb3.conf <<EOF
2011-09-13 21:02:43 +10:00
[ global]
workgroup = SAMBA
netbiosname = S3UPGRADE
security = user
realm = s3.samba.example.com
passdb backend = tdbsam:$PREFIX /samba3-upgrade/samba3/passdb.tdb
private dir = $PREFIX /samba3-upgrade/samba3
lock directory = $PREFIX /samba3-upgrade/samba3
state directory = $PREFIX /samba3-upgrade/samba3
cache directory = $PREFIX /samba3-upgrade/samba3
pid directory = $PREFIX /samba3-upgrade/samba3
usershare path = $PREFIX /samba3-upgrade/samba3
ncalrpc dir = $PREFIX /samba3-upgrade/samba3
debug level = 0
domain logons = yes
EOF
2018-10-10 11:14:59 +01:00
testit "samba3-upgrade-testparm" $PYTHON $samba_tool domain classicupgrade $PREFIX /samba3-upgrade/samba3/smb2.conf --targetdir= $PREFIX /samba3-upgrade/s4_3 --testparm= $testparm --use-ntvfs
2021-04-14 11:44:51 +02:00
testit "samba3-upgrade-testparm-getlocalsid" $samba_net getlocalsid samba --configfile= $PREFIX /samba3-upgrade/s4_3/etc/smb.conf
testit "samba3-upgrade-testparm-getdomainsid" $samba_net getdomainsid --configfile= $PREFIX /samba3-upgrade/s4_3/etc/smb.conf
2011-08-12 17:47:49 +10:00
rm -rf $PREFIX /samba3-upgrade
exit $failed