Revert "pidl: Use non-existent function dissect_ndr_int64()"
[Samba.git] / testprogs / blackbox / join_ldapcmp.sh
blob3e5b264e7d7aa08495edcea856f76e43a95f6d2c
1 #!/bin/sh
2 # Does a join against the testenv's DC and then runs ldapcmp on the resulting DB
4 . $(dirname $0)/subunit.sh
6 TARGET_DIR="$PREFIX_ABS/join_$SERVER"
8 cleanup_output_dir()
10 if [ -d $TARGET_DIR ]; then
11 rm -fr $TARGET_DIR
15 SAMBA_TOOL="$PYTHON $BINDIR/samba-tool"
17 join_dc()
19 JOIN_ARGS="--targetdir=$TARGET_DIR --server=$SERVER -U$USERNAME%$PASSWORD"
20 $SAMBA_TOOL domain join $REALM dc $JOIN_ARGS --option="netbios name = TESTJOINDC"
23 demote_joined_dc()
25 DEMOTE_ARGS="--remove-other-dead-server=TESTJOINDC --server=$SERVER -U$USERNAME%$PASSWORD"
26 $SAMBA_TOOL domain demote $DEMOTE_ARGS
29 ldapcmp_result()
31 DB1_PATH="tdb://$PREFIX_ABS/$SERVER/private/sam.ldb"
32 DB2_PATH="tdb://$TARGET_DIR/private/sam.ldb"
34 # interSiteTopologyGenerator gets periodically updated. With the restored
35 # testenvs, it can sometimes point to the old/deleted DC object still
36 $SAMBA_TOOL ldapcmp $DB1_PATH $DB2_PATH --filter=interSiteTopologyGenerator
39 cleanup_output_dir
41 # check that we can join this DC
42 testit "check_dc_join" join_dc
44 # check resulting DB matches server DC
45 testit "new_db_matches" ldapcmp_result
47 testit "demote_joined_dc" demote_joined_dc
49 cleanup_output_dir
51 exit $failed