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"
10 if [ -d $TARGET_DIR ]; then
15 SAMBA_TOOL
="$PYTHON $BINDIR/samba-tool"
19 JOIN_ARGS
="--targetdir=$TARGET_DIR --server=$SERVER -U$USERNAME%$PASSWORD"
20 $SAMBA_TOOL domain
join $REALM dc $JOIN_ARGS --option="netbios name = TESTJOINDC"
25 DEMOTE_ARGS
="--remove-other-dead-server=TESTJOINDC --server=$SERVER -U$USERNAME%$PASSWORD"
26 $SAMBA_TOOL domain demote
$DEMOTE_ARGS
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
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