diff options
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/selftest/tests.py | 2 | ||||
-rwxr-xr-x | source4/setup/tests/blackbox_s3upgrade.sh | 62 |
2 files changed, 63 insertions, 1 deletions
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index 0902a3ec29..0ef59b2148 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -438,7 +438,7 @@ plantestsuite("samba4.deletetest.python(dc)", "dc", ['PYTHONPATH="$PYTHONPATH:%s '$SERVER', '-U"$USERNAME%$PASSWORD"', '-W', '$DOMAIN']) plansambapythontestsuite("samba4.policy.python", "none", "%s/lib/policy/tests/python" % samba4srcdir, 'bindings') plantestsuite("samba4.blackbox.samba3dump", "none", [python, os.path.join(samba4srcdir, "scripting/bin/samba3dump"), os.path.join(samba4srcdir, "../testdata/samba3")], allow_empty_output=True) -plantestsuite("samba4.blackbox.upgrade", "none", ["rm -rf $PREFIX/upgrade;", python, os.path.join(samba4srcdir, "setup/upgrade_from_s3"), "--targetdir=$PREFIX/upgrade", os.path.normpath(os.path.join(samba4srcdir, "../testdata/samba3")), os.path.normpath(os.path.join(samba4srcdir, "../testdata/samba3/smb.conf"))], allow_empty_output=True) +plantestsuite("samba4.blackbox.upgrade", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_s3upgrade.sh"), '$PREFIX/provision']) plantestsuite("samba4.blackbox.provision.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_provision.sh"), '$PREFIX/provision']) plantestsuite("samba4.blackbox.upgradeprovision.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_upgradeprovision.sh"), '$PREFIX/provision']) plantestsuite("samba4.blackbox.setpassword.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_setpassword.sh"), '$PREFIX/provision']) diff --git a/source4/setup/tests/blackbox_s3upgrade.sh b/source4/setup/tests/blackbox_s3upgrade.sh new file mode 100755 index 0000000000..5fa33a3ec6 --- /dev/null +++ b/source4/setup/tests/blackbox_s3upgrade.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then +cat <<EOF +Usage: blackbox_s3upgrade.sh PREFIX +EOF +exit 1; +fi + +PREFIX=`pwd`"/$1" +shift 1 + +. `dirname $0`/../../../testprogs/blackbox/subunit.sh + +rm -rf $PREFIX/samba3-upgrade +mkdir -p $PREFIX/samba3-upgrade/s4_1 +mkdir -p $PREFIX/samba3-upgrade/s4_2 +cp -a $SRCDIR/testdata/samba3 $PREFIX/samba3-upgrade + +# Test 1 (s3 member) +cat - > $PREFIX/samba3-upgrade/samba3/smb1.conf <<EOF +[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 + +testit "samba3-upgrade-member" $PYTHON $SRCDIR/source4/setup/upgrade_from_s3 --targetdir=$PREFIX/samba3-upgrade/s4_1 --configfile=$PREFIX/samba3-upgrade/samba3/smb1.conf $PREFIX/samba3-upgrade/samba3 + +# Test 2 (s3 dc) +cat - > $PREFIX/samba3-upgrade/samba3/smb2.conf <<EOF +[global] + workgroup = SAMBA + netbiosname = S3UPGRADE + security = user + 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 + +testit "samba3-upgrade-dc" $PYTHON $SRCDIR/source4/setup/upgrade_from_s3 --targetdir=$PREFIX/samba3-upgrade/s4_2 --configfile=$PREFIX/samba3-upgrade/samba3/smb2.conf $PREFIX/samba3-upgrade/samba3 + +rm -rf $PREFIX/samba3-upgrade + +exit $failed |