harness

package
v0.0.0-...-3442565 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDNSProvider

type MockDNSProvider struct {
}

func (*MockDNSProvider) AddFallbacks

func (p *MockDNSProvider) AddFallbacks(dnsFallbacks map[string][]net.IP) error

func (*MockDNSProvider) UpdateHosts

func (p *MockDNSProvider) UpdateHosts(addToHost map[string][]string) error

type TestHarness

type TestHarness struct {
	T *testing.T

	ClusterName       string
	LockPath          string
	BackupStorePath   string
	DiscoveryStoreDir string

	WorkDir string

	Nodes map[string]*TestHarnessNode

	Context context.Context

	BackupInterval time.Duration
	// contains filtered or unexported fields
}

func NewTestHarness

func NewTestHarness(t *testing.T, ctx context.Context) *TestHarness

func (*TestHarness) AddCommand

func (h *TestHarness) AddCommand(cmd *protoetcd.Command)

func (*TestHarness) Close

func (h *TestHarness) Close()

func (*TestHarness) InvalidateControlStore

func (h *TestHarness) InvalidateControlStore(nodes ...*TestHarnessNode)

func (*TestHarness) NewNode

func (h *TestHarness) NewNode(address string) *TestHarnessNode

func (*TestHarness) SeedNewCluster

func (h *TestHarness) SeedNewCluster(spec *protoetcd.ClusterSpec)

func (*TestHarness) SetClusterSpec

func (h *TestHarness) SetClusterSpec(spec *protoetcd.ClusterSpec)

func (*TestHarness) WaitFor

func (h *TestHarness) WaitFor(timeout time.Duration, description string, f func() error)

func (*TestHarness) WaitForBackup

func (h *TestHarness) WaitForBackup(t *testing.T, timeout time.Duration)

func (*TestHarness) WaitForHasLeader

func (h *TestHarness) WaitForHasLeader(nodes ...*TestHarnessNode)

func (*TestHarness) WaitForHealthy

func (h *TestHarness) WaitForHealthy(nodes ...*TestHarnessNode)

func (*TestHarness) WaitForVersion

func (h *TestHarness) WaitForVersion(timeout time.Duration, expectedVersion string, nodes ...*TestHarnessNode)

type TestHarnessNode

type TestHarnessNode struct {
	TestHarness *TestHarness
	Address     string
	NodeDir     string
	EtcdVersion string

	InsecureMode bool

	ClientURL string

	ListenMetricsURLs []string
	// contains filtered or unexported fields
}

func (*TestHarnessNode) AssertVersion

func (n *TestHarnessNode) AssertVersion(t *testing.T, version string)

AssertVersion asserts that the client reports the server version specified

func (*TestHarnessNode) Close

func (n *TestHarnessNode) Close() error

func (*TestHarnessNode) GetLocal

func (n *TestHarnessNode) GetLocal(ctx context.Context, key string) (string, error)

func (*TestHarnessNode) GetQuorum

func (n *TestHarnessNode) GetQuorum(ctx context.Context, key string) (string, error)

func (*TestHarnessNode) Init

func (n *TestHarnessNode) Init() error

func (*TestHarnessNode) ListMembers

func (*TestHarnessNode) NewClient

func (n *TestHarnessNode) NewClient() (*etcdclient.EtcdClient, error)

func (*TestHarnessNode) Put

func (n *TestHarnessNode) Put(ctx context.Context, key string, value string) error

func (*TestHarnessNode) Run

func (n *TestHarnessNode) Run()

func (*TestHarnessNode) WaitForHasLeader

func (n *TestHarnessNode) WaitForHasLeader(timeout time.Duration)

func (*TestHarnessNode) WaitForHealthy

func (n *TestHarnessNode) WaitForHealthy(timeout time.Duration)

func (*TestHarnessNode) WaitForListMembers

func (n *TestHarnessNode) WaitForListMembers(timeout time.Duration)

func (*TestHarnessNode) WaitForQuorumRead

func (n *TestHarnessNode) WaitForQuorumRead(ctx context.Context, timeout time.Duration)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL