diff options
author | Andrew Bartlett <abartlet@samba.org> | 2013-02-16 01:08:20 +1100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-03-04 08:32:21 +0100 |
commit | d7936ee20c20635d62657cb821ff6dc4eb5fe33c (patch) | |
tree | a165807ef2f0d9ea00b739c109344c997e950ddf /source4/setup/tests | |
parent | f1f36ad3517cd0e6bceb4b0cc37721a15be4d588 (diff) | |
download | samba-d7936ee20c20635d62657cb821ff6dc4eb5fe33c.tar.gz samba-d7936ee20c20635d62657cb821ff6dc4eb5fe33c.tar.bz2 samba-d7936ee20c20635d62657cb821ff6dc4eb5fe33c.zip |
selftest: Add ldapcmp to ensure upgradeprovision of a fresh DB is a no-op
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/setup/tests')
-rwxr-xr-x | source4/setup/tests/blackbox_upgradeprovision.sh | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/source4/setup/tests/blackbox_upgradeprovision.sh b/source4/setup/tests/blackbox_upgradeprovision.sh index 1ff76952e3..8e4c2cc4f9 100755 --- a/source4/setup/tests/blackbox_upgradeprovision.sh +++ b/source4/setup/tests/blackbox_upgradeprovision.sh @@ -14,11 +14,18 @@ shift 1 [ ! -d $PREFIX ] && mkdir $PREFIX +upgradeprovision_reference() { + if [ -d $PREFIX/upgradeprovision_reference ]; then + rm -fr $PREFIX/upgradeprovision_reference + fi + $PYTHON $BINDIR/samba-tool domain provision --host-name=bar --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/upgradeprovision_reference" --server-role="dc" --use-ntvfs +} + upgradeprovision() { if [ -d $PREFIX/upgradeprovision ]; then rm -fr $PREFIX/upgradeprovision fi - $PYTHON $BINDIR/samba-tool domain provision --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/upgradeprovision" --server-role="dc" --use-ntvfs + $PYTHON $BINDIR/samba-tool domain provision --host-name=bar --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/upgradeprovision" --server-role="dc" --use-ntvfs $PYTHON $BINDIR/samba_upgradeprovision -s "$PREFIX/upgradeprovision/etc/smb.conf" --debugchange } @@ -30,6 +37,26 @@ upgradeprovision_full() { $PYTHON $BINDIR/samba_upgradeprovision -s "$PREFIX/upgradeprovision_full/etc/smb.conf" --full --debugchange } +# The ldapcmp runs here are to ensure that a 'null' run of +# upgradeprovision (because we did a provision with the same template) +# really doesn't change anything. + +ldapcmp() { + $PYTHON $BINDIR/samba-tool ldapcmp tdb://$PREFIX/upgradeprovision/private/sam.ldb tdb://$PREFIX/upgradeprovision_reference/private/sam.ldb --two --skip-missing-dn +} + +ldapcmp_full() { + $PYTHON $BINDIR/samba-tool ldapcmp tdb://$PREFIX/upgradeprovision_full/private/sam.ldb tdb://$PREFIX/upgradeprovision_reference/private/sam.ldb --two --skip-missing-dn +} + +ldapcmp_sd() { + $PYTHON $BINDIR/samba-tool ldapcmp tdb://$PREFIX/upgradeprovision/private/sam.ldb tdb://$PREFIX/upgradeprovision_reference/private/sam.ldb --two --sd --skip-missing-dn +} + +ldapcmp_full_sd() { + $PYTHON $BINDIR/samba-tool ldapcmp tdb://$PREFIX/upgradeprovision_full/private/sam.ldb tdb://$PREFIX/upgradeprovision_reference/private/sam.ldb --two --sd --skip-missing-dn +} + if [ -d $PREFIX/upgradeprovision ]; then rm -fr $PREFIX/upgradeprovision fi @@ -40,5 +67,10 @@ fi testit "upgradeprovision" upgradeprovision testit "upgradeprovision_full" upgradeprovision_full +testit "upgradeprovision_reference" upgradeprovision_reference +testit "ldapcmp" ldapcmp +testit "ldapcmp_full" ldapcmp_full +testit "ldapcmp_sd" ldapcmp_sd +testit "ldapcmp_full_sd" ldapcmp_full_sd exit $failed |