Skip to content

Commit 0e6d259

Browse files
authored
[VAULT-21282] Expose NetworkLayer on a TestClusterCore via a convenience method for testing purposes (#29659)
1 parent f5ba4d0 commit 0e6d259

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vault/testing.go

+8
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,14 @@ func (c *TestClusterCore) ClusterListener() *cluster.Listener {
977977
return c.getClusterListener()
978978
}
979979

980+
// NetworkLayer returns the network layer for the cluster core. This can be used
981+
// in conjunction with the cluster.InmemLayer to disconnect specific nodes from
982+
// the cluster when we need to simulate abrupt node failure or a network
983+
// partition in NewTestCluster tests.
984+
func (c *TestClusterCore) NetworkLayer() cluster.NetworkLayer {
985+
return c.Core.clusterNetworkLayer
986+
}
987+
980988
func (c *TestCluster) Cleanup() {
981989
c.Logger.Info("cleaning up vault cluster")
982990
if tl, ok := c.Logger.(*corehelpers.TestLogger); ok {

0 commit comments

Comments
 (0)