winbindd: as DC we should try to get the target_domain from @SOMETHING part of the...
[Samba.git] / testprogs / blackbox / dbcheck.sh
blob0f979abc7eb703902b7df06a8b50c36fd208c990
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() {
17 $BINDIR/samba-tool dbcheck --cross-ncs $ARGS
20 # This list of attributes can be freely extended
21 dbcheck_fix_one_way_links() {
22 $BINDIR/samba-tool dbcheck --quiet --fix --yes fix_all_string_dn_component_mismatch --attrs="lastKnownParent defaultObjectCategory fromServer rIDSetReferences" --cross-ncs $ARGS
25 # This list of attributes can be freely extended
26 dbcheck_fix_stale_links() {
27 $BINDIR/samba-tool dbcheck --quiet --fix --yes remove_plausible_deleted_DN_links --attrs="member msDS-NC-Replica-Locations msDS-NC-RO-Replica-Locations" --cross-ncs $ARGS
30 # This test shows that this does not do anything to a current
31 # provision (that would be a bug)
32 dbcheck_reset_well_known_acls() {
33 $BINDIR/samba-tool dbcheck --cross-ncs --reset-well-known-acls $ARGS
36 reindex() {
37 $BINDIR/samba-tool dbcheck --reindex $ARGS
40 fixed_attrs() {
41 $BINDIR/samba-tool dbcheck --attrs=cn $ARGS
44 force_modules() {
45 $BINDIR/samba-tool dbcheck --force-modules $ARGS
48 dbcheck_fix_one_way_links
49 dbcheck_fix_stale_links
50 testit "dbcheck" dbcheck
51 testit "reindex" reindex
52 testit "fixed_attrs" fixed_attrs
53 testit "force_modules" force_modules
55 exit $failed