15 . `dirname $0`/subunit.sh
16 . `dirname $0`/common_test_fns.inc
18 RELEASE="release-4-8-0-pre1"
19 release_dir="$SRCDIR_ABS/source4/selftest/provisions/$RELEASE"
21 OLD_RELEASE="release-4-1-0rc3"
22 old_release_dir="$SRCDIR_ABS/source4/selftest/provisions/$OLD_RELEASE"
24 samba_tdbrestore="tdbrestore"
25 if [ -x "$BINDIR/tdbrestore" ]; then
26 samba_tdbrestore="$BINDIR/tdbrestore"
29 samba_undump="$SRCDIR_ABS/source4/selftest/provisions/undump.sh"
31 if [ ! -x $samba_undump ] || [ ! -d $release_dir ] || [ ! -d $old_release_dir ]; then
32 subunit_start_test $RELEASE
33 subunit_skip_test $RELEASE <<EOF
37 subunit_start_test "functional_prep"
38 subunit_skip_test "functional_prep" <<EOF
42 subunit_start_test "functional_prep_old"
43 subunit_skip_test "functional_prep_old" <<EOF
50 cleanup_output_directories()
52 remove_directory $PREFIX_ABS/2012R2_schema
53 remove_directory $PREFIX_ABS/$RELEASE
54 remove_directory $PREFIX_ABS/$OLD_RELEASE
58 $samba_undump $release_dir $PREFIX_ABS/$RELEASE $samba_tdbrestore
62 $samba_undump $old_release_dir $PREFIX_ABS/$OLD_RELEASE $samba_tdbrestore
66 PROVISION_OPTS="--use-ntvfs --host-ip6=::1 --host-ip=127.0.0.1"
69 $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
73 # At some point we will need to ignore, but right now, it should be perfect
75 $PYTHON $BINDIR/samba-tool ldapcmp tdb://$PREFIX_ABS/$2/private/sam.ldb tdb://$PREFIX_ABS/$3/private/sam.ldb --two --skip-missing-dn --filter msDS-SupportedEncryptionTypes
79 # Our functional prep doesn't set these values as they were not provided
80 # These are XML schema based enumerations which are used for claims
81 ldapcmp_ignore "msDS-ClaimPossibleValues" "$RELEASE" "2012R2_schema"
85 $PYTHON $BINDIR/samba-tool domain functionalprep -H tdb://$PREFIX_ABS/2012R2_schema/private/sam.ldb --function-level=2012_R2
88 functional_prep_old() {
89 $PYTHON $BINDIR/samba-tool domain functionalprep -H tdb://$PREFIX_ABS/$OLD_RELEASE/private/sam.ldb --function-level=2012_R2
93 # Must steal schema master and infrastructure roles first
94 $PYTHON $BINDIR/samba-tool fsmo seize --role=schema -H tdb://$PREFIX_ABS/$OLD_RELEASE/private/sam.ldb --force
95 $PYTHON $BINDIR/samba-tool fsmo seize --role=infrastructure -H tdb://$PREFIX_ABS/$OLD_RELEASE/private/sam.ldb --force
99 $PYTHON $BINDIR/samba-tool domain schemaupgrade -H tdb://$PREFIX_ABS/$OLD_RELEASE/private/sam.ldb --schema=2012_R2
102 # double-check we cleaned up from the last test run
103 cleanup_output_directories
105 testit $RELEASE undump || failed=`expr $failed + 1`
107 # Provision a DC based on 2012R2 schema
108 testit "provision_2012R2_schema" provision_2012r2 || failed=`expr $failed + 1`
110 # Perform functional prep up to 2012 R2 level
111 testit "functional_prep" functional_prep || failed=`expr $failed + 1`
113 # check that the databases are now the same
114 testit "check_databases_same" ldapcmp || failed=`expr $failed + 1`
116 testit $OLD_RELEASE undump_old || failed=`expr $failed + 1`
118 testit "steal_roles" steal_roles || failed=`expr $failed + 1`
120 testit "schema_upgrade" schema_upgrade || failed=`expr $failed + 1`
122 testit "functional_prep_old" functional_prep_old || failed=`expr $failed + 1`
124 cleanup_output_directories