ctdb-failover: Split statd_callout add-client/del-client
[Samba.git] / testprogs / blackbox / dbcheck.sh
blob0869a2b115eb5a65fcfdb549d538877bffa3b3a0
1 #!/bin/sh
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: dbcheck.sh PREFIX
6 EOF
7 exit 1
8 fi
10 PREFIX="$1"
11 shift 1
12 ARGS=$@
14 . $(dirname $0)/subunit.sh
16 dbcheck()
18 $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs $ARGS
21 # This list of attributes can be freely extended
22 dbcheck_fix_one_way_links()
24 $PYTHON $BINDIR/samba-tool dbcheck --quiet --fix --yes fix_all_old_dn_string_component_mismatch --attrs="lastKnownParent defaultObjectCategory fromServer rIDSetReferences" --cross-ncs $ARGS
27 # This list of attributes can be freely extended
28 dbcheck_fix_stale_links()
30 $PYTHON $BINDIR/samba-tool dbcheck --quiet --fix --yes remove_plausible_deleted_DN_links --attrs="member msDS-NC-Replica-Locations msDS-NC-RO-Replica-Locations msDS-RevealOnDemandGroup msDS-NeverRevealGroup msDS-RevealedUsers" --cross-ncs $ARGS
33 # This list of attributes can be freely extended
34 dbcheck_fix_crosspartition_backlinks()
36 # we may not know the target yet when we receive a cross-partition link,
37 # which can result in a missing backlink
38 $PYTHON $BINDIR/samba-tool dbcheck --quiet --fix --yes fix_all_missing_backlinks --attrs="serverReference" --cross-ncs $ARGS
41 # This test shows that this does not do anything to a current
42 # provision (that would be a bug)
43 dbcheck_reset_well_known_acls()
45 $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs --reset-well-known-acls $ARGS
48 reindex()
50 $PYTHON $BINDIR/samba-tool dbcheck --reindex $ARGS
53 fixed_attrs()
55 $PYTHON $BINDIR/samba-tool dbcheck --attrs=cn $ARGS
58 force_modules()
60 $PYTHON $BINDIR/samba-tool dbcheck --force-modules $ARGS
63 dbcheck_fix_one_way_links
64 dbcheck_fix_stale_links
65 dbcheck_fix_crosspartition_backlinks
66 testit "dbcheck" dbcheck || failed=$(expr $failed + 1)
67 testit "reindex" reindex || failed=$(expr $failed + 1)
68 testit "fixed_attrs" fixed_attrs || failed=$(expr $failed + 1)
69 testit "force_modules" force_modules || failed=$(expr $failed + 1)
70 testit "reset_well_known_acls" dbcheck_reset_well_known_acls || failed=$(expr $failed + 1)
72 exit $failed