Documentation ¶
Index ¶
- Constants
- Variables
- func AddTxnResponse(resp *clientv3.TxnResponse, jsonData string)
- func AssertProcessLogs(t *testing.T, ep EtcdProcess, expectLog string)
- func BeforeTest(t testing.TB)
- func CURLGet(clus *EtcdProcessCluster, req CURLReq) error
- func CURLPost(clus *EtcdProcessCluster, req CURLReq) error
- func CURLPrefixArgs(clientURL string, cfg ClientConfig, CN bool, method string, req CURLReq) []string
- func CURLPrefixArgsCluster(cfg *EtcdProcessClusterConfig, member EtcdProcess, method string, req CURLReq) []string
- func CURLPut(clus *EtcdProcessCluster, req CURLReq) error
- func CloseWithTimeout(p *expect.ExpectProcess, d time.Duration) error
- func DataMarshal(data interface{}) (d string, e error)
- func GetVersionFromBinary(binaryPath string) (*semver.Version, error)
- func InitFlags()
- func NewE2eRunner() intf.TestRunner
- func RandomLeaseID() int64
- func RunUtilCompletion(args []string, envVars map[string]string) ([]string, error)
- func SkipInShortMode(t testing.TB)
- func SpawnCmd(args []string, envVars map[string]string) (*expect.ExpectProcess, error)
- func SpawnCmdWithLogger(lg *zap.Logger, args []string, envVars map[string]string, name string) (*expect.ExpectProcess, error)
- func SpawnNamedCmd(processName string, args []string, envVars map[string]string) (*expect.ExpectProcess, error)
- func SpawnWithExpect(args []string, expected string) error
- func SpawnWithExpectLines(ctx context.Context, args []string, envVars map[string]string, xs ...string) ([]string, error)
- func SpawnWithExpectWithEnv(args []string, envVars map[string]string, expected string) error
- func SpawnWithExpects(args []string, envVars map[string]string, xs ...string) error
- func SpawnWithExpectsContext(ctx context.Context, args []string, envVars map[string]string, xs ...string) error
- func ToTLS(s string) string
- func WaitReadyExpectProc(ctx context.Context, exproc *expect.ExpectProcess, readyStrs []string) error
- func WithAuth(userName, password string) config.ClientOption
- func WithEndpoints(endpoints []string) config.ClientOption
- type BinaryFailpoints
- type CURLReq
- type ClientConfig
- type ClientConnType
- type ClusterContext
- type ClusterVersion
- type EPClusterOption
- func WithAuthTokenOpts(token string) EPClusterOption
- func WithBasePort(port int) EPClusterOption
- func WithBaseScheme(scheme string) EPClusterOption
- func WithCN(cn bool) EPClusterOption
- func WithClientAutoTLS(isClientAutoTLS bool) EPClusterOption
- func WithClientCertAuthority(enabled bool) EPClusterOption
- func WithClientConnType(clientConnType ClientConnType) EPClusterOption
- func WithClientRevokeCerts(isClientCRL bool) EPClusterOption
- func WithClusterSize(size int) EPClusterOption
- func WithCompactHashCheckEnabled(enabled bool) EPClusterOption
- func WithCompactHashCheckTime(time time.Duration) EPClusterOption
- func WithCompactionBatchLimit(limit int) EPClusterOption
- func WithConfig(cfg *EtcdProcessClusterConfig) EPClusterOption
- func WithCorruptCheckTime(time time.Duration) EPClusterOption
- func WithDataDirPath(path string) EPClusterOption
- func WithDiscovery(discovery string) EPClusterOption
- func WithDiscoveryEndpoints(endpoints []string) EPClusterOption
- func WithDiscoveryToken(token string) EPClusterOption
- func WithEnableV2(enable bool) EPClusterOption
- func WithExperimentalWarningUnaryRequestDuration(time time.Duration) EPClusterOption
- func WithGoFailEnabled(enabled bool) EPClusterOption
- func WithIsPeerAutoTLS(isPeerAutoTLS bool) EPClusterOption
- func WithIsPeerTLS(isPeerTLS bool) EPClusterOption
- func WithKeepDataDir(keep bool) EPClusterOption
- func WithLogLevel(level string) EPClusterOption
- func WithPeerProxy(enabled bool) EPClusterOption
- func WithQuotaBackendBytes(bytes int64) EPClusterOption
- func WithRollingStart(rolling bool) EPClusterOption
- func WithSnapshotCatchUpEntries(count uint64) EPClusterOption
- func WithSnapshotCount(count uint64) EPClusterOption
- func WithStrictReconfigCheck(strict bool) EPClusterOption
- func WithVersion(version ClusterVersion) EPClusterOption
- func WithWarningUnaryRequestDuration(time time.Duration) EPClusterOption
- func WithWatchProcessNotifyInterval(interval time.Duration) EPClusterOption
- type EtcdProcess
- type EtcdProcessCluster
- func InitEtcdProcessCluster(t testing.TB, cfg *EtcdProcessClusterConfig) (*EtcdProcessCluster, error)
- func NewEtcdProcessCluster(ctx context.Context, t testing.TB, opts ...EPClusterOption) (*EtcdProcessCluster, error)
- func StartEtcdProcessCluster(ctx context.Context, epc *EtcdProcessCluster, cfg *EtcdProcessClusterConfig) (*EtcdProcessCluster, error)
- func (epc *EtcdProcessCluster) Close() error
- func (epc *EtcdProcessCluster) CloseProc(ctx context.Context, finder func(EtcdProcess) bool, ...) error
- func (epc *EtcdProcessCluster) ConcurrentStop() (err error)
- func (epc *EtcdProcessCluster) Endpoints(f func(ep EtcdProcess) []string) (ret []string)
- func (epc *EtcdProcessCluster) EndpointsGRPC() []string
- func (epc *EtcdProcessCluster) EndpointsHTTP() []string
- func (epc *EtcdProcessCluster) Etcdctl(opts ...config.ClientOption) *EtcdctlV3
- func (epc *EtcdProcessCluster) Restart(ctx context.Context) error
- func (epc *EtcdProcessCluster) RollingStart(ctx context.Context) error
- func (epc *EtcdProcessCluster) Start(ctx context.Context) error
- func (epc *EtcdProcessCluster) StartNewProc(ctx context.Context, cfg *EtcdProcessClusterConfig, tb testing.TB, ...) error
- func (epc *EtcdProcessCluster) Stop() (err error)
- func (epc *EtcdProcessCluster) WaitLeader(t testing.TB) int
- func (epc *EtcdProcessCluster) WaitMembersForLeader(ctx context.Context, t testing.TB, membs []EtcdProcess) int
- type EtcdProcessClusterConfig
- func ConfigStandalone(cfg EtcdProcessClusterConfig) *EtcdProcessClusterConfig
- func DefaultConfig() *EtcdProcessClusterConfig
- func NewConfig(opts ...EPClusterOption) *EtcdProcessClusterConfig
- func NewConfigAutoTLS() *EtcdProcessClusterConfig
- func NewConfigClientAutoTLS() *EtcdProcessClusterConfig
- func NewConfigClientTLS() *EtcdProcessClusterConfig
- func NewConfigClientTLSCertAuth() *EtcdProcessClusterConfig
- func NewConfigClientTLSCertAuthWithNoCN() *EtcdProcessClusterConfig
- func NewConfigJWT() *EtcdProcessClusterConfig
- func NewConfigNoTLS() *EtcdProcessClusterConfig
- func NewConfigPeerTLS() *EtcdProcessClusterConfig
- func NewConfigTLS() *EtcdProcessClusterConfig
- func (cfg *EtcdProcessClusterConfig) ClientScheme() string
- func (cfg *EtcdProcessClusterConfig) EtcdAllServerProcessConfigs(tb testing.TB) []*EtcdServerProcessConfig
- func (cfg *EtcdProcessClusterConfig) EtcdServerProcessConfig(tb testing.TB, i int) *EtcdServerProcessConfig
- func (cfg *EtcdProcessClusterConfig) PeerScheme() string
- func (cfg *EtcdProcessClusterConfig) SetInitialOrDiscovery(serverCfg *EtcdServerProcessConfig, initialCluster []string, ...)
- func (cfg *EtcdProcessClusterConfig) TlsArgs() (args []string)
- type EtcdServerProcess
- func (ep *EtcdServerProcess) Close() error
- func (ep *EtcdServerProcess) Config() *EtcdServerProcessConfig
- func (ep *EtcdServerProcess) EndpointsGRPC() []string
- func (ep *EtcdServerProcess) EndpointsHTTP() []string
- func (ep *EtcdServerProcess) EndpointsMetrics() []string
- func (epc *EtcdServerProcess) Etcdctl(opts ...config.ClientOption) *EtcdctlV3
- func (ep *EtcdServerProcess) Failpoints() *BinaryFailpoints
- func (ep *EtcdServerProcess) IsRunning() bool
- func (ep *EtcdServerProcess) Kill() error
- func (ep *EtcdServerProcess) Logs() LogsExpect
- func (ep *EtcdServerProcess) PeerProxy() proxy.Server
- func (ep *EtcdServerProcess) Restart(ctx context.Context) error
- func (ep *EtcdServerProcess) Start(ctx context.Context) error
- func (ep *EtcdServerProcess) Stop() (err error)
- func (ep *EtcdServerProcess) Wait(ctx context.Context) error
- type EtcdServerProcessConfig
- type EtcdctlV3
- func (ctl *EtcdctlV3) AlarmDisarm(ctx context.Context, _ *clientv3.AlarmMember) (*clientv3.AlarmResponse, error)
- func (ctl *EtcdctlV3) AlarmList(ctx context.Context) (*clientv3.AlarmResponse, error)
- func (ctl *EtcdctlV3) AuthDisable(ctx context.Context) error
- func (ctl *EtcdctlV3) AuthEnable(ctx context.Context) error
- func (ctl *EtcdctlV3) AuthStatus(ctx context.Context) (*clientv3.AuthStatusResponse, error)
- func (ctl *EtcdctlV3) Compact(ctx context.Context, rev int64, o config.CompactOption) (*clientv3.CompactResponse, error)
- func (ctl *EtcdctlV3) Defragment(ctx context.Context, o config.DefragOption) error
- func (ctl *EtcdctlV3) Delete(ctx context.Context, key string, o config.DeleteOptions) (*clientv3.DeleteResponse, error)
- func (ctl *EtcdctlV3) DowngradeEnable(ctx context.Context, version string) error
- func (ctl *EtcdctlV3) Get(ctx context.Context, key string, o config.GetOptions) (*clientv3.GetResponse, error)
- func (ctl *EtcdctlV3) Grant(ctx context.Context, ttl int64) (*clientv3.LeaseGrantResponse, error)
- func (ctl *EtcdctlV3) HashKV(ctx context.Context, rev int64) ([]*clientv3.HashKVResponse, error)
- func (ctl *EtcdctlV3) Health(ctx context.Context) error
- func (ctl *EtcdctlV3) KeepAliveOnce(ctx context.Context, id clientv3.LeaseID) (*clientv3.LeaseKeepAliveResponse, error)
- func (ctl *EtcdctlV3) Leases(ctx context.Context) (*clientv3.LeaseLeasesResponse, error)
- func (ctl *EtcdctlV3) MemberAdd(ctx context.Context, name string, peerAddrs []string) (*clientv3.MemberAddResponse, error)
- func (ctl *EtcdctlV3) MemberAddAsLearner(ctx context.Context, name string, peerAddrs []string) (*clientv3.MemberAddResponse, error)
- func (ctl *EtcdctlV3) MemberList(ctx context.Context, serializable bool) (*clientv3.MemberListResponse, error)
- func (ctl *EtcdctlV3) MemberRemove(ctx context.Context, id uint64) (*clientv3.MemberRemoveResponse, error)
- func (ctl *EtcdctlV3) Put(ctx context.Context, key, value string, opts config.PutOptions) error
- func (ctl *EtcdctlV3) Revoke(ctx context.Context, id clientv3.LeaseID) (*clientv3.LeaseRevokeResponse, error)
- func (ctl *EtcdctlV3) RoleAdd(ctx context.Context, name string) (*clientv3.AuthRoleAddResponse, error)
- func (ctl *EtcdctlV3) RoleDelete(ctx context.Context, role string) (*clientv3.AuthRoleDeleteResponse, error)
- func (ctl *EtcdctlV3) RoleGet(ctx context.Context, role string) (*clientv3.AuthRoleGetResponse, error)
- func (ctl *EtcdctlV3) RoleGrantPermission(ctx context.Context, name string, key, rangeEnd string, ...) (*clientv3.AuthRoleGrantPermissionResponse, error)
- func (ctl *EtcdctlV3) RoleList(ctx context.Context) (*clientv3.AuthRoleListResponse, error)
- func (ctl *EtcdctlV3) RoleRevokePermission(ctx context.Context, role string, key, rangeEnd string) (*clientv3.AuthRoleRevokePermissionResponse, error)
- func (ctl *EtcdctlV3) Status(ctx context.Context) ([]*clientv3.StatusResponse, error)
- func (ctl *EtcdctlV3) TimeToLive(ctx context.Context, id clientv3.LeaseID, o config.LeaseOption) (*clientv3.LeaseTimeToLiveResponse, error)
- func (ctl *EtcdctlV3) Txn(ctx context.Context, compares, ifSucess, ifFail []string, o config.TxnOptions) (*clientv3.TxnResponse, error)
- func (ctl *EtcdctlV3) UserAdd(ctx context.Context, name, password string, opts config.UserAddOptions) (*clientv3.AuthUserAddResponse, error)
- func (ctl *EtcdctlV3) UserChangePass(ctx context.Context, user, newPass string) error
- func (ctl *EtcdctlV3) UserDelete(ctx context.Context, name string) (*clientv3.AuthUserDeleteResponse, error)
- func (ctl *EtcdctlV3) UserGet(ctx context.Context, name string) (*clientv3.AuthUserGetResponse, error)
- func (ctl *EtcdctlV3) UserGrantRole(ctx context.Context, user string, role string) (*clientv3.AuthUserGrantRoleResponse, error)
- func (ctl *EtcdctlV3) UserList(ctx context.Context) (*clientv3.AuthUserListResponse, error)
- func (ctl *EtcdctlV3) UserRevokeRole(ctx context.Context, user string, role string) (*clientv3.AuthUserRevokeRoleResponse, error)
- func (ctl *EtcdctlV3) Watch(ctx context.Context, key string, opts config.WatchOptions) clientv3.WatchChan
- type LogsExpect
Constants ¶
const EtcdProcessBasePort = 20000
Variables ¶
var ( CertDir string CertPath string PrivateKeyPath string CaPath string CertPath2 string PrivateKeyPath2 string CertPath3 string PrivateKeyPath3 string CrlPath string RevokedCertPath string RevokedPrivateKeyPath string BinPath binPath FixturesDir = testutils.MustAbsPath("../fixtures") )
var (
EtcdServerReadyLines = []string{"ready to serve client requests"}
)
Functions ¶
func AddTxnResponse ¶
func AddTxnResponse(resp *clientv3.TxnResponse, jsonData string)
AddTxnResponse looks for ResponseOp json tags and adds the objects for json decoding
func AssertProcessLogs ¶
func AssertProcessLogs(t *testing.T, ep EtcdProcess, expectLog string)
func BeforeTest ¶
func CURLGet ¶
func CURLGet(clus *EtcdProcessCluster, req CURLReq) error
func CURLPost ¶
func CURLPost(clus *EtcdProcessCluster, req CURLReq) error
func CURLPrefixArgs ¶
func CURLPrefixArgsCluster ¶
func CURLPrefixArgsCluster(cfg *EtcdProcessClusterConfig, member EtcdProcess, method string, req CURLReq) []string
CURLPrefixArgsCluster builds the beginning of a curl command for a given key addressed to a random URL in the given cluster.
func CURLPut ¶
func CURLPut(clus *EtcdProcessCluster, req CURLReq) error
func CloseWithTimeout ¶
func CloseWithTimeout(p *expect.ExpectProcess, d time.Duration) error
func DataMarshal ¶
func NewE2eRunner ¶
func NewE2eRunner() intf.TestRunner
func RandomLeaseID ¶
func RandomLeaseID() int64
func RunUtilCompletion ¶
func SkipInShortMode ¶
func SpawnCmdWithLogger ¶
func SpawnNamedCmd ¶
func SpawnWithExpect ¶
func SpawnWithExpectLines ¶
func SpawnWithExpectWithEnv ¶
func SpawnWithExpects ¶
func SpawnWithExpectsContext ¶
func WaitReadyExpectProc ¶
func WithAuth ¶
func WithAuth(userName, password string) config.ClientOption
func WithEndpoints ¶
func WithEndpoints(endpoints []string) config.ClientOption
Types ¶
type BinaryFailpoints ¶
type BinaryFailpoints struct {
// contains filtered or unexported fields
}
func (*BinaryFailpoints) Available ¶
func (f *BinaryFailpoints) Available() map[string]struct{}
type ClientConfig ¶
type ClientConfig struct { ConnectionType ClientConnType CertAuthority bool AutoTLS bool RevokeCerts bool }
type ClientConnType ¶
type ClientConnType int
const ( ClientNonTLS ClientConnType = iota ClientTLS ClientTLSAndNonTLS )
type ClusterContext ¶
type ClusterContext struct {
Version ClusterVersion
}
type ClusterVersion ¶
type ClusterVersion string
const ( CurrentVersion ClusterVersion = "" MinorityLastVersion ClusterVersion = "minority-last-version" QuorumLastVersion ClusterVersion = "quorum-last-version" LastVersion ClusterVersion = "last-version" )
type EPClusterOption ¶
type EPClusterOption func(*EtcdProcessClusterConfig)
func WithAuthTokenOpts ¶
func WithAuthTokenOpts(token string) EPClusterOption
func WithBasePort ¶
func WithBasePort(port int) EPClusterOption
func WithBaseScheme ¶
func WithBaseScheme(scheme string) EPClusterOption
func WithCN ¶
func WithCN(cn bool) EPClusterOption
func WithClientAutoTLS ¶
func WithClientAutoTLS(isClientAutoTLS bool) EPClusterOption
func WithClientCertAuthority ¶
func WithClientCertAuthority(enabled bool) EPClusterOption
func WithClientConnType ¶
func WithClientConnType(clientConnType ClientConnType) EPClusterOption
func WithClientRevokeCerts ¶
func WithClientRevokeCerts(isClientCRL bool) EPClusterOption
func WithClusterSize ¶
func WithClusterSize(size int) EPClusterOption
func WithCompactHashCheckEnabled ¶
func WithCompactHashCheckEnabled(enabled bool) EPClusterOption
func WithCompactHashCheckTime ¶
func WithCompactHashCheckTime(time time.Duration) EPClusterOption
func WithCompactionBatchLimit ¶
func WithCompactionBatchLimit(limit int) EPClusterOption
func WithConfig ¶
func WithConfig(cfg *EtcdProcessClusterConfig) EPClusterOption
func WithCorruptCheckTime ¶
func WithCorruptCheckTime(time time.Duration) EPClusterOption
func WithDataDirPath ¶
func WithDataDirPath(path string) EPClusterOption
func WithDiscovery ¶
func WithDiscovery(discovery string) EPClusterOption
func WithDiscoveryEndpoints ¶
func WithDiscoveryEndpoints(endpoints []string) EPClusterOption
func WithDiscoveryToken ¶
func WithDiscoveryToken(token string) EPClusterOption
func WithEnableV2 ¶
func WithEnableV2(enable bool) EPClusterOption
func WithExperimentalWarningUnaryRequestDuration ¶
func WithExperimentalWarningUnaryRequestDuration(time time.Duration) EPClusterOption
WithExperimentalWarningUnaryRequestDuration sets a value for `-experimental-warning-unary-request-duration`. TODO(ahrtr): remove this function when the corresponding experimental flag is decommissioned.
func WithGoFailEnabled ¶
func WithGoFailEnabled(enabled bool) EPClusterOption
func WithIsPeerAutoTLS ¶
func WithIsPeerAutoTLS(isPeerAutoTLS bool) EPClusterOption
func WithIsPeerTLS ¶
func WithIsPeerTLS(isPeerTLS bool) EPClusterOption
func WithKeepDataDir ¶
func WithKeepDataDir(keep bool) EPClusterOption
func WithLogLevel ¶
func WithLogLevel(level string) EPClusterOption
func WithPeerProxy ¶
func WithPeerProxy(enabled bool) EPClusterOption
func WithQuotaBackendBytes ¶
func WithQuotaBackendBytes(bytes int64) EPClusterOption
func WithRollingStart ¶
func WithRollingStart(rolling bool) EPClusterOption
func WithSnapshotCatchUpEntries ¶
func WithSnapshotCatchUpEntries(count uint64) EPClusterOption
func WithSnapshotCount ¶
func WithSnapshotCount(count uint64) EPClusterOption
func WithStrictReconfigCheck ¶
func WithStrictReconfigCheck(strict bool) EPClusterOption
func WithVersion ¶
func WithVersion(version ClusterVersion) EPClusterOption
func WithWarningUnaryRequestDuration ¶
func WithWarningUnaryRequestDuration(time time.Duration) EPClusterOption
func WithWatchProcessNotifyInterval ¶
func WithWatchProcessNotifyInterval(interval time.Duration) EPClusterOption
type EtcdProcess ¶
type EtcdProcess interface { EndpointsGRPC() []string EndpointsHTTP() []string EndpointsMetrics() []string Etcdctl(opts ...config.ClientOption) *EtcdctlV3 IsRunning() bool Wait(ctx context.Context) error Start(ctx context.Context) error Restart(ctx context.Context) error Stop() error Close() error Config() *EtcdServerProcessConfig PeerProxy() proxy.Server Failpoints() *BinaryFailpoints Logs() LogsExpect Kill() error }
EtcdProcess is a process that serves etcd requests.
func NewEtcdProcess ¶
func NewEtcdProcess(cfg *EtcdServerProcessConfig) (EtcdProcess, error)
type EtcdProcessCluster ¶
type EtcdProcessCluster struct { Cfg *EtcdProcessClusterConfig Procs []EtcdProcess // contains filtered or unexported fields }
func InitEtcdProcessCluster ¶
func InitEtcdProcessCluster(t testing.TB, cfg *EtcdProcessClusterConfig) (*EtcdProcessCluster, error)
InitEtcdProcessCluster initializes a new cluster based on the given config. It doesn't start the cluster.
func NewEtcdProcessCluster ¶
func NewEtcdProcessCluster(ctx context.Context, t testing.TB, opts ...EPClusterOption) (*EtcdProcessCluster, error)
NewEtcdProcessCluster launches a new cluster from etcd processes, returning a new EtcdProcessCluster once all nodes are ready to accept client requests.
func StartEtcdProcessCluster ¶
func StartEtcdProcessCluster(ctx context.Context, epc *EtcdProcessCluster, cfg *EtcdProcessClusterConfig) (*EtcdProcessCluster, error)
StartEtcdProcessCluster launches a new cluster from etcd processes.
func (*EtcdProcessCluster) Close ¶
func (epc *EtcdProcessCluster) Close() error
func (*EtcdProcessCluster) CloseProc ¶
func (epc *EtcdProcessCluster) CloseProc(ctx context.Context, finder func(EtcdProcess) bool, opts ...config.ClientOption) error
func (*EtcdProcessCluster) ConcurrentStop ¶
func (epc *EtcdProcessCluster) ConcurrentStop() (err error)
func (*EtcdProcessCluster) Endpoints ¶
func (epc *EtcdProcessCluster) Endpoints(f func(ep EtcdProcess) []string) (ret []string)
func (*EtcdProcessCluster) EndpointsGRPC ¶
func (epc *EtcdProcessCluster) EndpointsGRPC() []string
func (*EtcdProcessCluster) EndpointsHTTP ¶
func (epc *EtcdProcessCluster) EndpointsHTTP() []string
func (*EtcdProcessCluster) Etcdctl ¶
func (epc *EtcdProcessCluster) Etcdctl(opts ...config.ClientOption) *EtcdctlV3
func (*EtcdProcessCluster) Restart ¶
func (epc *EtcdProcessCluster) Restart(ctx context.Context) error
func (*EtcdProcessCluster) RollingStart ¶
func (epc *EtcdProcessCluster) RollingStart(ctx context.Context) error
func (*EtcdProcessCluster) StartNewProc ¶
func (epc *EtcdProcessCluster) StartNewProc(ctx context.Context, cfg *EtcdProcessClusterConfig, tb testing.TB, opts ...config.ClientOption) error
func (*EtcdProcessCluster) Stop ¶
func (epc *EtcdProcessCluster) Stop() (err error)
func (*EtcdProcessCluster) WaitLeader ¶
func (epc *EtcdProcessCluster) WaitLeader(t testing.TB) int
WaitLeader returns index of the member in c.Members() that is leader or fails the test (if not established in 30s).
func (*EtcdProcessCluster) WaitMembersForLeader ¶
func (epc *EtcdProcessCluster) WaitMembersForLeader(ctx context.Context, t testing.TB, membs []EtcdProcess) int
WaitMembersForLeader waits until given members agree on the same leader, and returns its 'index' in the 'membs' list
type EtcdProcessClusterConfig ¶
type EtcdProcessClusterConfig struct { Logger *zap.Logger Version ClusterVersion // DataDirPath specifies the data-dir for the members. If test cases // do not specify `DataDirPath`, then e2e framework creates a // temporary directory for each member; otherwise, it creates a // subdirectory (e.g. member-0, member-1 and member-2) under the given // `DataDirPath` for each member. DataDirPath string KeepDataDir bool EnvVars map[string]string ClusterSize int BaseScheme string BasePort int MetricsURLScheme string SnapshotCount uint64 SnapshotCatchUpEntries uint64 Client ClientConfig ClientHttpSeparate bool IsPeerTLS bool IsPeerAutoTLS bool CN bool CipherSuites []string ForceNewCluster bool InitialToken string QuotaBackendBytes int64 StrictReconfigCheck bool EnableV2 bool InitialCorruptCheck bool AuthTokenOpts string V2deprecation string RollingStart bool Discovery string // v2 discovery DiscoveryEndpoints []string // v3 discovery DiscoveryToken string LogLevel string MaxConcurrentStreams uint32 // default is math.MaxUint32 CorruptCheckTime time.Duration CompactHashCheckEnabled bool CompactHashCheckTime time.Duration GoFailEnabled bool CompactionBatchLimit int WarningUnaryRequestDuration time.Duration ExperimentalWarningUnaryRequestDuration time.Duration PeerProxy bool WatchProcessNotifyInterval time.Duration }
func ConfigStandalone ¶
func ConfigStandalone(cfg EtcdProcessClusterConfig) *EtcdProcessClusterConfig
func DefaultConfig ¶
func DefaultConfig() *EtcdProcessClusterConfig
func NewConfig ¶
func NewConfig(opts ...EPClusterOption) *EtcdProcessClusterConfig
func NewConfigAutoTLS ¶
func NewConfigAutoTLS() *EtcdProcessClusterConfig
func NewConfigClientAutoTLS ¶
func NewConfigClientAutoTLS() *EtcdProcessClusterConfig
func NewConfigClientTLS ¶
func NewConfigClientTLS() *EtcdProcessClusterConfig
func NewConfigClientTLSCertAuth ¶
func NewConfigClientTLSCertAuth() *EtcdProcessClusterConfig
func NewConfigClientTLSCertAuthWithNoCN ¶
func NewConfigClientTLSCertAuthWithNoCN() *EtcdProcessClusterConfig
func NewConfigJWT ¶
func NewConfigJWT() *EtcdProcessClusterConfig
func NewConfigNoTLS ¶
func NewConfigNoTLS() *EtcdProcessClusterConfig
func NewConfigPeerTLS ¶
func NewConfigPeerTLS() *EtcdProcessClusterConfig
func NewConfigTLS ¶
func NewConfigTLS() *EtcdProcessClusterConfig
func (*EtcdProcessClusterConfig) ClientScheme ¶
func (cfg *EtcdProcessClusterConfig) ClientScheme() string
func (*EtcdProcessClusterConfig) EtcdAllServerProcessConfigs ¶
func (cfg *EtcdProcessClusterConfig) EtcdAllServerProcessConfigs(tb testing.TB) []*EtcdServerProcessConfig
func (*EtcdProcessClusterConfig) EtcdServerProcessConfig ¶
func (cfg *EtcdProcessClusterConfig) EtcdServerProcessConfig(tb testing.TB, i int) *EtcdServerProcessConfig
func (*EtcdProcessClusterConfig) PeerScheme ¶
func (cfg *EtcdProcessClusterConfig) PeerScheme() string
func (*EtcdProcessClusterConfig) SetInitialOrDiscovery ¶
func (cfg *EtcdProcessClusterConfig) SetInitialOrDiscovery(serverCfg *EtcdServerProcessConfig, initialCluster []string, initialClusterState string)
func (*EtcdProcessClusterConfig) TlsArgs ¶
func (cfg *EtcdProcessClusterConfig) TlsArgs() (args []string)
type EtcdServerProcess ¶
type EtcdServerProcess struct {
// contains filtered or unexported fields
}
func NewEtcdServerProcess ¶
func NewEtcdServerProcess(cfg *EtcdServerProcessConfig) (*EtcdServerProcess, error)
func (*EtcdServerProcess) Close ¶
func (ep *EtcdServerProcess) Close() error
func (*EtcdServerProcess) Config ¶
func (ep *EtcdServerProcess) Config() *EtcdServerProcessConfig
func (*EtcdServerProcess) EndpointsGRPC ¶
func (ep *EtcdServerProcess) EndpointsGRPC() []string
func (*EtcdServerProcess) EndpointsHTTP ¶
func (ep *EtcdServerProcess) EndpointsHTTP() []string
func (*EtcdServerProcess) EndpointsMetrics ¶
func (ep *EtcdServerProcess) EndpointsMetrics() []string
func (*EtcdServerProcess) Etcdctl ¶
func (epc *EtcdServerProcess) Etcdctl(opts ...config.ClientOption) *EtcdctlV3
func (*EtcdServerProcess) Failpoints ¶
func (ep *EtcdServerProcess) Failpoints() *BinaryFailpoints
func (*EtcdServerProcess) IsRunning ¶
func (ep *EtcdServerProcess) IsRunning() bool
func (*EtcdServerProcess) Kill ¶
func (ep *EtcdServerProcess) Kill() error
func (*EtcdServerProcess) Logs ¶
func (ep *EtcdServerProcess) Logs() LogsExpect
func (*EtcdServerProcess) PeerProxy ¶
func (ep *EtcdServerProcess) PeerProxy() proxy.Server
func (*EtcdServerProcess) Stop ¶
func (ep *EtcdServerProcess) Stop() (err error)
type EtcdServerProcessConfig ¶
type EtcdServerProcessConfig struct { ExecPath string Args []string TlsArgs []string EnvVars map[string]string Client ClientConfig DataDirPath string KeepDataDir bool Name string PeerURL url.URL ClientURL string ClientHTTPURL string MetricsURL string InitialToken string InitialCluster string GoFailPort int Proxy *proxy.ServerConfig // contains filtered or unexported fields }
type EtcdctlV3 ¶
type EtcdctlV3 struct {
// contains filtered or unexported fields
}
func NewEtcdctl ¶
func NewEtcdctl(cfg ClientConfig, endpoints []string, opts ...config.ClientOption) (*EtcdctlV3, error)
func (*EtcdctlV3) AlarmDisarm ¶
func (ctl *EtcdctlV3) AlarmDisarm(ctx context.Context, _ *clientv3.AlarmMember) (*clientv3.AlarmResponse, error)
func (*EtcdctlV3) AuthStatus ¶
func (*EtcdctlV3) Compact ¶
func (ctl *EtcdctlV3) Compact(ctx context.Context, rev int64, o config.CompactOption) (*clientv3.CompactResponse, error)
func (*EtcdctlV3) Defragment ¶
func (*EtcdctlV3) Delete ¶
func (ctl *EtcdctlV3) Delete(ctx context.Context, key string, o config.DeleteOptions) (*clientv3.DeleteResponse, error)
func (*EtcdctlV3) DowngradeEnable ¶
func (*EtcdctlV3) Get ¶
func (ctl *EtcdctlV3) Get(ctx context.Context, key string, o config.GetOptions) (*clientv3.GetResponse, error)
func (*EtcdctlV3) KeepAliveOnce ¶
func (*EtcdctlV3) MemberAddAsLearner ¶
func (*EtcdctlV3) MemberList ¶
func (*EtcdctlV3) MemberRemove ¶
func (*EtcdctlV3) RoleDelete ¶
func (*EtcdctlV3) RoleGrantPermission ¶
func (ctl *EtcdctlV3) RoleGrantPermission(ctx context.Context, name string, key, rangeEnd string, permType clientv3.PermissionType) (*clientv3.AuthRoleGrantPermissionResponse, error)
func (*EtcdctlV3) RoleRevokePermission ¶
func (*EtcdctlV3) TimeToLive ¶
func (ctl *EtcdctlV3) TimeToLive(ctx context.Context, id clientv3.LeaseID, o config.LeaseOption) (*clientv3.LeaseTimeToLiveResponse, error)
func (*EtcdctlV3) Txn ¶
func (ctl *EtcdctlV3) Txn(ctx context.Context, compares, ifSucess, ifFail []string, o config.TxnOptions) (*clientv3.TxnResponse, error)
func (*EtcdctlV3) UserAdd ¶
func (ctl *EtcdctlV3) UserAdd(ctx context.Context, name, password string, opts config.UserAddOptions) (*clientv3.AuthUserAddResponse, error)