selftest: Test join against DC with non-default site
authorTim Beale <timbeale@catalyst.net.nz>
Thu, 20 Sep 2018 01:08:50 +0000 (13:08 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 26 Sep 2018 05:49:17 +0000 (07:49 +0200)
Recent changes around restoring a domain that lacked
Default-First-Site-Name highlighted a problem. Normally when you join a
DC to a domain, samba-tool works out the correct site to use
automatically. However, if the join uses '--server' to select a DC, then
this doesn't work. It defaults back to Default-First-Site-Name, and the
join command fails if this site doesn't exist.

All the testenvs had Default-First-Site-Name present, so this was never
tested. Now the backupfromdc no longer has a Default-First-Site-Name
site, so running a simple join against that DC fails, highlighting the
problem.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/knownfail.d/join_ldapcmp [new file with mode: 0644]
source4/selftest/tests.py

diff --git a/selftest/knownfail.d/join_ldapcmp b/selftest/knownfail.d/join_ldapcmp
new file mode 100644 (file)
index 0000000..e8404cf
--- /dev/null
@@ -0,0 +1,5 @@
+# 'samba-tool domain join --server' fails if the domain does not contain the
+# Default-First-Site-Name site
+samba4.blackbox.join_ldapcmp.check_dc_join\(backupfromdc\)
+samba4.blackbox.join_ldapcmp.new_db_matches\(backupfromdc\)
+
index e39148607eed260b30e860f3df21741c5d60f151..c8411313cf5555cc54d4cf9975cb8c22d774c4b9 100755 (executable)
@@ -852,6 +852,11 @@ for env in ['offlinebackupdc', 'restoredc', 'renamedc', 'labdc']:
                   ["PYTHON=%s" % python,
                    os.path.join(bbdir, "ldapcmp_restoredc.sh"),
                    '$PREFIX_ABS/backupfromdc', '$PREFIX_ABS/%s' % env])
+
+# we also test joining backupfromdc here, as it's a bit special in that it
+# doesn't have Default-First-Site-Name
+for env in ['backupfromdc', 'offlinebackupdc', 'restoredc', 'renamedc',
+           'labdc']:
     # basic test that we can join the testenv DC
     plantestsuite("samba4.blackbox.join_ldapcmp", env,
                   ["PYTHON=%s" % python, os.path.join(bbdir, "join_ldapcmp.sh")])