Documentation ¶
Index ¶
- Variables
- func CreateJobViaHTTP(ctx context.Context, masterAddr, tenantID, projectID string, ...) (string, error)
- func QueryJobViaHTTP(ctx context.Context, masterAddr, tenantID, projectID, jobID string) (*pb.Job, error)
- type ChaosCli
- func (cli *ChaosCli) CancelJob(ctx context.Context, jobID string) error
- func (cli *ChaosCli) CheckFakeJobKey(ctx context.Context, masterID string, jobIndex int, expectedMvcc int, ...) error
- func (cli *ChaosCli) CheckFakeJobTick(ctx context.Context, masterID string, jobIndex int, target int64) error
- func (cli *ChaosCli) CheckJobStatus(ctx context.Context, jobID string, expectedStatus pb.Job_State) (bool, error)
- func (cli *ChaosCli) ContainerRestart(name string)
- func (cli *ChaosCli) ContainerStart(name string)
- func (cli *ChaosCli) ContainerStop(name string)
- func (cli *ChaosCli) CreateJob(ctx context.Context, jobType pb.Job_Type, config []byte) (string, error)
- func (cli *ChaosCli) GetLeaderAddr(ctx context.Context) (string, error)
- func (cli *ChaosCli) GetRevision(ctx context.Context) (int64, error)
- func (cli *ChaosCli) InitializeMetaClient(jobID string) error
- func (cli *ChaosCli) ResignLeader(ctx context.Context, addr string) error
- func (cli *ChaosCli) UpdateFakeJobKey(ctx context.Context, id int, value string) error
- type FakeJobConfig
Constants ¶
This section is empty.
Variables ¶
var ErrLeaderNotFound = errors.New("leader not found")
ErrLeaderNotFound is returned when the leader is not found.
Functions ¶
Types ¶
type ChaosCli ¶
type ChaosCli struct {
// contains filtered or unexported fields
}
ChaosCli is used to interact with server master, fake job and provides ways to adding chaos in e2e test.
func NewUTCli ¶
func NewUTCli(ctx context.Context, masterAddrs, businessMetaAddrs []string, project tenant.ProjectInfo, cfg *FakeJobConfig, ) (*ChaosCli, error)
NewUTCli creates a new ChaosCli instance
func (*ChaosCli) CheckFakeJobKey ¶
func (cli *ChaosCli) CheckFakeJobKey( ctx context.Context, masterID string, jobIndex int, expectedMvcc int, expectedValue string, ) error
CheckFakeJobKey queries the checkpoint of a fake job, checks the value and mvcc count are as expected. If error happens or check is not passed, return error.
func (*ChaosCli) CheckFakeJobTick ¶
func (cli *ChaosCli) CheckFakeJobTick( ctx context.Context, masterID string, jobIndex int, target int64, ) error
CheckFakeJobTick queries the checkpoint of a fake job and checks the tick count is as expected.
func (*ChaosCli) CheckJobStatus ¶
func (cli *ChaosCli) CheckJobStatus( ctx context.Context, jobID string, expectedStatus pb.Job_State, ) (bool, error)
CheckJobStatus checks job status is as expected.
func (*ChaosCli) ContainerRestart ¶
ContainerRestart restarts a docker container
func (*ChaosCli) ContainerStart ¶
ContainerStart starts a docker container
func (*ChaosCli) ContainerStop ¶
ContainerStop stops a docker container
func (*ChaosCli) CreateJob ¶
func (cli *ChaosCli) CreateJob(ctx context.Context, jobType pb.Job_Type, config []byte) (string, error)
CreateJob sends SubmitJob command to servermaster
func (*ChaosCli) GetLeaderAddr ¶
GetLeaderAddr gets the address of the leader of the server master.
func (*ChaosCli) GetRevision ¶
GetRevision puts a key gets the latest revision of etcd cluster
func (*ChaosCli) InitializeMetaClient ¶
InitializeMetaClient initializes the business kvclient
func (*ChaosCli) ResignLeader ¶
ResignLeader resigns the leader at the given addr.
type FakeJobConfig ¶
FakeJobConfig is used to construct a fake job configuration