s4: add blackbox test for rename
authorMatthieu Patou <mat@matws.net>
Fri, 20 May 2011 19:50:55 +0000 (23:50 +0400)
committerMatthieu Patou <mat@samba.org>
Sat, 21 May 2011 07:50:34 +0000 (09:50 +0200)
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Sat May 21 09:50:34 CEST 2011 on sn-devel-104

source4/selftest/tests.py
testprogs/blackbox/renamedc.sh [new file with mode: 0755]

index adb38bb..eb36a0c 100755 (executable)
@@ -432,3 +432,6 @@ plantestsuite_loadlist("samba4.%s.two" % t, "vampire_dc", [valgrindify(smb4tortu
 plantestsuite_loadlist("samba4.rpc.echo", "rodc", [smb4torture, "$LISTOPT", 'ncacn_np:$SERVER', "-k", "yes", '-U$USERNAME%$PASSWORD', '-W' '$DOMAIN', 'rpc.echo'])
 plantestsuite_loadlist("samba4.rpc.echo", "rodc:local", [smb4torture, "$LISTOPT", 'ncacn_np:$SERVER', "-k", "yes", '-P', '-W' '$DOMAIN', 'rpc.echo'])
 plantestsuite("samba4.blackbox.provision-backend.py", "none", ["PYTHON=%s" % python, os.path.join(samba4srcdir, "setup/tests/blackbox_provision-backend.sh"), '$PREFIX/provision'])
+
+# Test renaming the DC
+plantestsuite("samba4.blackbox.renamedc.sh", "none", ["PYTHON=%s" % python, os.path.join(bbdir, "renamedc.sh"), '$PREFIX/provision'])
diff --git a/testprogs/blackbox/renamedc.sh b/testprogs/blackbox/renamedc.sh
new file mode 100755 (executable)
index 0000000..d0615b3
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+if [ $# -lt 1 ]; then
+cat <<EOF
+Usage: blackbox_upgradeprovision.sh PREFIX
+EOF
+exit 1;
+fi
+
+PREFIX="$1"
+shift 1
+
+. `dirname $0`/subunit.sh
+
+if [ ! -d $PREFIX/upgradeprovision_full ]; then
+       $PYTHON $SRCDIR/source4/setup/provision --host-name=bar --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/upgradeprovision_full" --server-role="dc"
+fi
+
+
+testrenamedc() {
+       $PYTHON $SRCDIR/source4/scripting/bin/renamedc \
+               --oldname="BAR" \
+               --newname="RAYMONBAR" \
+               -s $PREFIX/upgradeprovision_full/etc/smb.conf
+}
+
+
+testrenamedc2() {
+       $PYTHON $SRCDIR/source4/scripting/bin/renamedc \
+               --oldname="RAYMONBAR" \
+               --newname="BAR" \
+               -s $PREFIX/upgradeprovision_full/etc/smb.conf
+}
+
+testit "renamedc" testrenamedc
+testit "renamedc2" testrenamedc2
+
+if [ $failed -eq 0 ]; then
+       rm -rf $PREFIX/upgradeprovision_full
+fi
+
+exit $failed