1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

92 Commits

Author SHA1 Message Date
Douglas Bagnall
59af1b5175 KCC: fix is_bridgehead_failed() according to documentation
Throughout the KCC specification `detectFailedDCs` is documented along
the lines of "true to detect failed DCs", and it gets passed down to
this function. And what do we see here? It is used as a default value
when a stale link is not detected. That is entirely different. So who is
right -- the comments or the pseudo-code?

This commit follows the comments. It works!

   Documentation 1,  Pseudo-code 0

See [MS-ADTS] — v20140502, section 6.2.2.3.4.4, page 569.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
e299fbcc40 KCC: colour dsa dot graphs, and plot site edges
The red links in the dsa graphs are RODC topology.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
1b681ee1c9 KCC: don't try to connect to a nonexistent bridgehead
If self.get_bridgehead returns None, there are no eligible bridgeheads
over there to connect to.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
68ef17f8ee KCC: Don't form self connections
This was a bug found in the original script.

We have found a remote bridgehead to connect to, but we were accidentally
connection to ourselves instead. Oops.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
6146a8a3f8 KCC: reuse convert_schedule_to_repltimes() for Sitelinks
This means wrenching it out of NTDSConnection, where it didn't really need to be anyway.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
a8a172471f KCC: InternalEdge should know its sitelink
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
2bb2480765 KCC: use rep.is_default rather than non-existent part.is_default
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
92a9bce475 KCC: debugging changes
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
fee5717cad KCC: add colouring for DSA link graphs
Red for RODC, blue otherwise.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
66116d5b73 KCC: Use fake guids in readonly mode
This is necessary because the connections need to look valid so they are
found when unnecesary connections are removed. The usual way is to query
the database for the guid.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
660e1258c6 KCC: beginning of --test-all-reps-from, exposing brokenness
This should produce a list of repsFrom links from all DSAs, which together
should produce a nice graph.

samba_kcc --test-all-reps-from won't actually run, but the problems are
things it found rather than caused.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
35f2b2b264 KCC: kcc.list_dsas() returns a list rather than prints it
This will be useful for the --test-all-reps-from option.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
8a8ba28f40 KCC: intrasite doesn't need a ring with < 3 nodes
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
5fbdf6e8cb KCC: intrasite graph only uses local DSAs
In the specs this is implied by the special definition of 'implies'.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
49e13f8310 KCC: post-Kruskal graph test only needs multi-edge-forest
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
070c9f7094 KCC: move ldif import/export functions into their own module
They might be of use elsewhere, and they are easily separable from the
KCC core.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
e753d11e4d KCC: rearrange samba_kcc entry point
For locality, so that it becomes clearer which variables are used
where.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
00e8d929ba KCC: move import to top of file
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
e66a86b45c KCC: add an option to list valid DSA dn_strs
This makes testing a bit easier.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
edd4aa2d47 KCC graph_utils: rename KCCGraphError, GraphError
In case it gets used elsewhere.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
222b8221d3 KCC: try graphing edges in colour for partition type
It doesn't add much.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
195b9f4c79 KCC: shift graph plotting and verification into a separate module
These might possibly be useful outside the KCC context, and the don't
rely on the rest of kcc_utils.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
a2d3b3117c KCC: more graph verification: repsFrom
Some of these graphs are wrong headed and broken

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
7e59faa10f KCC: the commit that mops up stray comments
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
d80cdcd609 KCC: add --attempt-live-connections to verify real life links
The spec makes these connections in a couple of places. That makes no
sense in our main testing environment which is a samba database
pretending to be a network.

The default should be changed to True when failed link detection is
implemented.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
0331c53b4c KCC: make --verify graph errors fatal
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
d68387774d KCC: attempt to use correct verification tests for graphs
Before they were liberally assigned because the failures were as
interesting as the passes.

Also add a stub for the forest_of_rings test.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
c35ba6f349 KCC: debug nc_type by name rather than enum number
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
59e9ae64d8 KCC: sitelink graph is undirected
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
a4cdd907b5 KCC: use ndr_pack for connection GUID comparisons
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
eb498a1575 KCC: consistently use ndr_pack() for DSA GUID comparisons
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
7e4dfb7e75 KCC: Use ndrpack(GUID) sorting for all graph vertex operations
For intrasite rings, DSA GUIDs are sorted by their ndr_pack
representation, not their string/as-if-128-bit-int representation.

Supposing some consistency across KCC, the graph vertex guids might be
compared the same way. But we don't yet know for sure.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Andrew Bartlett
abfb70272c kcc: reduce brokenness of --import-lidf
It still doesn't combine well with --forced-local-dsa, due it seems to
pervasive fragile cross-dependencies within the ldb system.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:25 +02:00
Douglas Bagnall
259d122b48 KCC: skip looking for extra edges if we have enough
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
736ecf0244 KCC: A whole lot of debugging and other non-functional changes
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
b73212c337 kcc: sort guids by ndr_pack representation
This gives the correct rings in intrasite.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
b47efc0f4f KCC: rewrite random intrasite connection addition for clarity
And add debug messages. No change in results though.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
333c8ad434 KCC: intrasite_post_ntdscon is directed
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
66c17599ec KCC: add NC identifiers to dot file names
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Garming Sam
8b6f3e6114 KCC: Fix original script for inverted logic
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
0b17932682 KCC: rename "fully_connected" check, "complete"
We also change some of the graphs to do only the relevent validations.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
18991094de KCC: Set option --readonly to default to False
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
c8944ae38a KCC: add directed double ring verification
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
7c39344767 KCC: add an option to list the graph verification options
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
d474bfa3c3 KCC: comment noting the progression of edge limit calculation
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
071ef322d7 KCC: add a wider range of colour DEBUG messages
and use them in a couple of places, for no good reason.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
4889770f98 KCC: add graph verification at all dot file points
The tests are not yet relevant.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:24 +02:00
Douglas Bagnall
e19330e579 KCC: add an option to verify graph properties
Any function with a name in the form "verify_graph_FOO" will be available
as a graph verification option (with the property name "FOO"). The
signature is "verify_graph_FOO(edges, vertices, edge_vertices)", where
edge_vertices is the set of vertices found on the edges, while vertices
is the set of vertices given to verify_graph (or a copy of
edge_vertices if no such set was given).

This makes it easier to add new tests without making the function too
unwieldy.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:23 +02:00
Douglas Bagnall
77b47e1ce4 KCC: Write out more DOT files and debug
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:10 +02:00
Douglas Bagnall
03f45bf75f KCC: Comment noting verbose nature of construct_intrasite_graph()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-28 07:25:09 +02:00