summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-08-12 17:47:49 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-13 20:18:40 +1000
commit64ec42d64f0a6029b135c49cfeb8bc5c6f8cbdbe (patch)
tree3c686e0fa1aa2705538edc62da442272d231e1cf /source4
parent1c1f7df956de9658a0bc4594af3202badbdaeeeb (diff)
downloadsamba-64ec42d64f0a6029b135c49cfeb8bc5c6f8cbdbe.tar.gz
samba-64ec42d64f0a6029b135c49cfeb8bc5c6f8cbdbe.tar.bz2
samba-64ec42d64f0a6029b135c49cfeb8bc5c6f8cbdbe.zip
tests: Update test for s3 to s4 upgrade with two cases
S3-member to S4-member and S3-dc to S4-dc Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/selftest/tests.py2
-rwxr-xr-xsource4/setup/tests/blackbox_s3upgrade.sh62
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