From d7936ee20c20635d62657cb821ff6dc4eb5fe33c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 16 Feb 2013 01:08:20 +1100 Subject: selftest: Add ldapcmp to ensure upgradeprovision of a fresh DB is a no-op Reviewed-by: Stefan Metzmacher --- source4/setup/tests/blackbox_upgradeprovision.sh | 34 +++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'source4/setup/tests') 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 -- cgit