upgradeprovision: Change test to always use 2008 R2 schema
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 4 Oct 2017 21:01:27 +0000 (10:01 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 14 Dec 2017 07:20:16 +0000 (08:20 +0100)
This tool (and the corresponding test) is designed to migrate a Samba DC
from a pre-4.0.0 release up to a more recent schema (i.e. Windows 2008R2).

Going further than 2008R2 turns this test into a bit of a nightmare. We
now have a better adprep/'samba-tool domain schemaupgrade' option for
upgrading from 2008R2 to a more recent schema.

It seems to make most sense to leave this tests just running against
2008R2 schema provisions and add new tests to migrate from 2008R2 to
2012R2.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/upgradehelpers.py
source4/scripting/bin/samba_upgradeprovision
testprogs/blackbox/upgradeprovision-oldrelease.sh

index 99ffe28..e026262 100644 (file)
@@ -226,7 +226,7 @@ def update_policyids(names, samdb):
         names.policyid_dc = None
 
 
-def newprovision(names, session, smbconf, provdir, logger):
+def newprovision(names, session, smbconf, provdir, logger, base_schema=None):
     """Create a new provision.
 
     This provision will be the reference for knowing what has changed in the
@@ -256,7 +256,7 @@ def newprovision(names, session, smbconf, provdir, logger):
             backend_type=None, ldapadminpass=None, ol_mmr_urls=None,
             slapd_path=None,
             dom_for_fun_level=names.domainlevel, dns_backend=names.dns_backend,
-            useeadb=True, use_ntvfs=True)
+            useeadb=True, use_ntvfs=True, base_schema=base_schema)
 
 
 def dn_sort(x, y):
index d111753..1dbe1ac 100755 (executable)
@@ -1633,7 +1633,7 @@ if __name__ == '__main__':
         provisiondir = tempfile.mkdtemp(dir=paths.private_dir,
                         prefix="referenceprovision")
         result = newprovision(names, session, smbconf, provisiondir,
-                provision_logger)
+                provision_logger, base_schema="2008_R2")
         result.report_logger(provision_logger)
 
         # TODO
index df054e8..a297bc3 100755 (executable)
@@ -95,7 +95,7 @@ samba_upgradedns() {
 }
 
 referenceprovision() {
-        $PYTHON $BINDIR/samba-tool domain provision --server-role="dc" --domain=SAMBA --host-name=ares --realm=${RELEASE}.samba.corp --targetdir=$PREFIX_ABS/${RELEASE}_upgrade_reference --use-ntvfs --host-ip=127.0.0.1 --host-ip6=::1 --function-level=2003
+        $PYTHON $BINDIR/samba-tool domain provision --server-role="dc" --domain=SAMBA --host-name=ares --realm=${RELEASE}.samba.corp --targetdir=$PREFIX_ABS/${RELEASE}_upgrade_reference --use-ntvfs --host-ip=127.0.0.1 --host-ip6=::1 --function-level=2003 --base-schema=2008_R2
 }
 
 ldapcmp() {