summaryrefslogtreecommitdiff
path: root/testprogs/blackbox/ldapcmp_restoredc.sh
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2022-04-22 15:46:04 +0200
committerAndreas Schneider <asn@cryptomilk.org>2022-08-04 12:56:37 +0000
commit084bddcf10196196d41d4ffdeaa726774ef77131 (patch)
tree5a982f751cef0fb0d8b1d0c6ac200c2d3094309c /testprogs/blackbox/ldapcmp_restoredc.sh
parent65b3797352c5f158c0c9c9bd624fed712d86792f (diff)
downloadsamba-084bddcf10196196d41d4ffdeaa726774ef77131.tar.gz
testprogs: Reformat ldapcmp_restoredc.sh
shfmt -w -p -i 0 -fn testprogs/blackbox/ldapcmp_restoredc.sh Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Diffstat (limited to 'testprogs/blackbox/ldapcmp_restoredc.sh')
-rwxr-xr-xtestprogs/blackbox/ldapcmp_restoredc.sh72
1 files changed, 37 insertions, 35 deletions
diff --git a/testprogs/blackbox/ldapcmp_restoredc.sh b/testprogs/blackbox/ldapcmp_restoredc.sh
index 90d57a568af..831b992e960 100755
--- a/testprogs/blackbox/ldapcmp_restoredc.sh
+++ b/testprogs/blackbox/ldapcmp_restoredc.sh
@@ -3,63 +3,65 @@
# was based on
if [ $# -lt 2 ]; then
-cat <<EOF
+ cat <<EOF
Usage: $0 ORIG_DC_PREFIX RESTORED_DC_PREFIX
EOF
-exit 1;
+ exit 1
fi
ORIG_DC_PREFIX_ABS="$1"
RESTORED_DC_PREFIX_ABS="$2"
shift 2
-. `dirname $0`/subunit.sh
+. $(dirname $0)/subunit.sh
-basedn() {
- SAMDB_PATH=$1
- $BINDIR/ldbsearch -H $SAMDB_PATH --basedn='' --scope=base defaultNamingContext | grep defaultNamingContext | awk '{print $2}'
+basedn()
+{
+ SAMDB_PATH=$1
+ $BINDIR/ldbsearch -H $SAMDB_PATH --basedn='' --scope=base defaultNamingContext | grep defaultNamingContext | awk '{print $2}'
}
-ldapcmp_with_orig() {
+ldapcmp_with_orig()
+{
- DB1_PATH="tdb://$ORIG_DC_PREFIX_ABS/private/sam.ldb"
- DB2_PATH="tdb://$RESTORED_DC_PREFIX_ABS/private/sam.ldb"
+ DB1_PATH="tdb://$ORIG_DC_PREFIX_ABS/private/sam.ldb"
+ DB2_PATH="tdb://$RESTORED_DC_PREFIX_ABS/private/sam.ldb"
- # check if the 2 DCs are in different domains
- DC1_BASEDN=$(basedn $DB1_PATH)
- DC2_BASEDN=$(basedn $DB2_PATH)
- BASE_DN_OPTS=""
+ # check if the 2 DCs are in different domains
+ DC1_BASEDN=$(basedn $DB1_PATH)
+ DC2_BASEDN=$(basedn $DB2_PATH)
+ BASE_DN_OPTS=""
- # if necessary, pass extra args to ldapcmp to handle the difference in base DNs
- if [ "$DC1_BASEDN" != "$DC2_BASEDN" ] ; then
- BASE_DN_OPTS="--base=$DC1_BASEDN --base2=$DC2_BASEDN"
- fi
+ # if necessary, pass extra args to ldapcmp to handle the difference in base DNs
+ if [ "$DC1_BASEDN" != "$DC2_BASEDN" ]; then
+ BASE_DN_OPTS="--base=$DC1_BASEDN --base2=$DC2_BASEDN"
+ fi
- # the restored DC will remove DNS entries for the old DC(s)
- IGNORE_ATTRS="dnsRecord,dNSTombstoned"
+ # the restored DC will remove DNS entries for the old DC(s)
+ IGNORE_ATTRS="dnsRecord,dNSTombstoned"
- # DC2 joined DC1, so it will have different DRS info
- IGNORE_ATTRS="$IGNORE_ATTRS,msDS-NC-Replica-Locations,msDS-HasInstantiatedNCs"
- IGNORE_ATTRS="$IGNORE_ATTRS,interSiteTopologyGenerator"
+ # DC2 joined DC1, so it will have different DRS info
+ IGNORE_ATTRS="$IGNORE_ATTRS,msDS-NC-Replica-Locations,msDS-HasInstantiatedNCs"
+ IGNORE_ATTRS="$IGNORE_ATTRS,interSiteTopologyGenerator"
- # there's a servicePrincipalName that uses the objectGUID of the DC's NTDS
- # Settings that will differ between the two DCs
- IGNORE_ATTRS="$IGNORE_ATTRS,servicePrincipalName"
+ # there's a servicePrincipalName that uses the objectGUID of the DC's NTDS
+ # Settings that will differ between the two DCs
+ IGNORE_ATTRS="$IGNORE_ATTRS,servicePrincipalName"
- # the restore changes the new DC's password twice
- IGNORE_ATTRS="$IGNORE_ATTRS,lastLogonTimestamp"
+ # the restore changes the new DC's password twice
+ IGNORE_ATTRS="$IGNORE_ATTRS,lastLogonTimestamp"
- # The RID pools get bumped during the restore process
- IGNORE_ATTRS="$IGNORE_ATTRS,rIDAllocationPool,rIDAvailablePool"
+ # The RID pools get bumped during the restore process
+ IGNORE_ATTRS="$IGNORE_ATTRS,rIDAllocationPool,rIDAvailablePool"
- # these are just differences between provisioning a domain and joining a DC
- IGNORE_ATTRS="$IGNORE_ATTRS,localPolicyFlags,operatingSystem,displayName"
+ # these are just differences between provisioning a domain and joining a DC
+ IGNORE_ATTRS="$IGNORE_ATTRS,localPolicyFlags,operatingSystem,displayName"
- # the restored DC may use a different side compared to the original DC
- IGNORE_ATTRS="$IGNORE_ATTRS,serverReferenceBL,msDS-IsDomainFor"
+ # the restored DC may use a different side compared to the original DC
+ IGNORE_ATTRS="$IGNORE_ATTRS,serverReferenceBL,msDS-IsDomainFor"
- LDAPCMP_CMD="$PYTHON $BINDIR/samba-tool ldapcmp"
- $LDAPCMP_CMD $DB1_PATH $DB2_PATH --two --skip-missing-dn --filter=$IGNORE_ATTRS $BASE_DN_OPTS
+ LDAPCMP_CMD="$PYTHON $BINDIR/samba-tool ldapcmp"
+ $LDAPCMP_CMD $DB1_PATH $DB2_PATH --two --skip-missing-dn --filter=$IGNORE_ATTRS $BASE_DN_OPTS
}
# check that the restored testenv DC basically matches the original