]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
testprogs/blackbox: Remove joined dc for ldapcmp
authorAndrew Bartlett <abartlet@samba.org>
Fri, 18 Jun 2021 11:48:26 +0000 (23:48 +1200)
committerGary Lockyer <gary@samba.org>
Mon, 21 Jun 2021 00:58:31 +0000 (00:58 +0000)
We don't need this DC once the ldapcmp is over, and it avoids
the running DC spamming the logs looking for it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
testprogs/blackbox/join_ldapcmp.sh

index 30d3e1e0192d711c2cebc557cf17aef127ab4c26..e55a71007da1be1e83414cba56047070dc7c608b 100755 (executable)
@@ -19,6 +19,11 @@ join_dc() {
     $SAMBA_TOOL domain join $REALM dc $JOIN_ARGS --option="netbios name = TESTJOINDC"
 }
 
+demote_joined_dc() {
+    DEMOTE_ARGS="--remove-other-dead-server=TESTJOINDC --server=$SERVER -U$USERNAME%$PASSWORD"
+    $SAMBA_TOOL domain demote $DEMOTE_ARGS
+}
+
 ldapcmp_result() {
     DB1_PATH="tdb://$PREFIX_ABS/$SERVER/private/sam.ldb"
     DB2_PATH="tdb://$TARGET_DIR/private/sam.ldb"
@@ -36,6 +41,8 @@ testit "check_dc_join" join_dc
 # check resulting DB matches server DC
 testit "new_db_matches" ldapcmp_result
 
+testit "demote_joined_dc" demote_joined_dc
+
 cleanup_output_dir
 
 exit $failed