From 245a8aaf41f652e2112dfa4b2c32613968656380 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 23 Feb 2023 15:05:01 +0100 Subject: [PATCH] samba-tool: let 'domain functionalprep' to use functional level 2016 by default Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- python/samba/netcmd/domain.py | 6 +++--- testprogs/blackbox/functionalprep.sh | 23 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index c1611d77afd..4f9d58d7952 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -4397,9 +4397,9 @@ class cmd_domain_functional_prep(Command): Option("-q", "--quiet", help="Be quiet", action="store_true"), Option("-v", "--verbose", help="Be verbose", action="store_true"), Option("--function-level", type="choice", metavar="FUNCTION_LEVEL", - choices=["2008_R2", "2012", "2012_R2"], - help="The schema file to upgrade to. Default is (Windows) 2012_R2.", - default="2012_R2"), + choices=["2008_R2", "2012", "2012_R2", "2016"], + help="The functional level to prepare for. Default is (Windows) 2016.", + default="2016"), Option("--forest-prep", action="store_true", help="Run the forest prep (by default, both the domain and forest prep are run)."), Option("--domain-prep", action="store_true", diff --git a/testprogs/blackbox/functionalprep.sh b/testprogs/blackbox/functionalprep.sh index e3cec4c2638..3ddd31456f0 100755 --- a/testprogs/blackbox/functionalprep.sh +++ b/testprogs/blackbox/functionalprep.sh @@ -47,6 +47,7 @@ fi cleanup_output_directories() { remove_directory $PREFIX_ABS/2012R2_schema + remove_directory $PREFIX_ABS/2019_schema remove_directory $PREFIX_ABS/$RELEASE remove_directory $PREFIX_ABS/$OLD_RELEASE } @@ -63,6 +64,11 @@ undump_old() PROVISION_OPTS="--use-ntvfs --host-ip6=::1 --host-ip=127.0.0.1" +provision_2019() +{ + $PYTHON $BINDIR/samba-tool domain provision $PROVISION_OPTS --domain=REALM --realm=REALM.COM --targetdir=$PREFIX_ABS/2019_schema --base-schema=2019 --host-name=FLPREP +} + provision_2012r2() { $PYTHON $BINDIR/samba-tool domain provision $PROVISION_OPTS --domain=REALM --realm=REALM.COM --targetdir=$PREFIX_ABS/2012R2_schema --base-schema=2012_R2 --host-name=FLPREP @@ -82,7 +88,12 @@ ldapcmp() ldapcmp_ignore "msDS-ClaimPossibleValues" "$RELEASE" "2012R2_schema" } -functional_prep() +functional_prep_2016() +{ + $PYTHON $BINDIR/samba-tool domain functionalprep -H tdb://$PREFIX_ABS/2019_schema/private/sam.ldb --function-level=2016 +} + +functional_prep_2012R2() { $PYTHON $BINDIR/samba-tool domain functionalprep -H tdb://$PREFIX_ABS/2012R2_schema/private/sam.ldb --function-level=2012_R2 } @@ -113,7 +124,7 @@ testit $RELEASE undump || failed=$(expr $failed + 1) testit "provision_2012R2_schema" provision_2012r2 || failed=$(expr $failed + 1) # Perform functional prep up to 2012 R2 level -testit "functional_prep" functional_prep || failed=$(expr $failed + 1) +testit "functional_prep_2012R2" functional_prep_2012R2 || failed=$(expr $failed + 1) # check that the databases are now the same testit "check_databases_same" ldapcmp || failed=$(expr $failed + 1) @@ -128,4 +139,12 @@ testit "functional_prep_old" functional_prep_old || failed=$(expr $failed + 1) cleanup_output_directories +# Provision a DC based on 2019 schema +testit "provision_2019_schema" provision_2019 || failed=$(expr $failed + 1) + +# Perform functional prep up to 2016 level +testit "functional_prep_2016" functional_prep_2016 || failed=$(expr $failed + 1) + +cleanup_output_directories + exit $failed -- 2.11.4.GIT