func agentRpcTestReloadSchema(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.ReloadSchema(ctx, ti) if err != nil { t.Errorf("ReloadSchema failed: %v", err) } if !testReloadSchemaCalled { t.Errorf("ReloadSchema didn't call the server side") } }
func agentRpcTestRestore(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { logChannel, errFunc, err := client.Restore(ctx, ti, testRestoreArgs, time.Minute) if err != nil { t.Fatalf("Restore failed: %v", err) } compareLoggedStuff(t, "Restore", logChannel, 10) err = errFunc() compareError(t, "Restore", err, true, testRestoreCalled) }
func agentRpcTestSnapshot(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { logChannel, errFunc, err := client.Snapshot(ctx, ti, testSnapshotArgs, time.Minute) if err != nil { t.Fatalf("Snapshot failed: %v", err) } compareLoggedStuff(t, "Snapshot", logChannel, 0) sr, err := errFunc() compareError(t, "Snapshot", err, sr, testSnapshotReply) }
func agentRpcTestSetReadOnly(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { testSetReadOnlyExpectedValue = true err := client.SetReadOnly(ctx, ti) if err != nil { t.Errorf("SetReadOnly failed: %v", err) } testSetReadOnlyExpectedValue = false err = client.SetReadWrite(ctx, ti) if err != nil { t.Errorf("SetReadWrite failed: %v", err) } }
func agentRpcTestRunBlpUntil(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { rp, err := client.RunBlpUntil(ctx, ti, testBlpPositionList, testRunBlpUntilWaitTime) compareError(t, "RunBlpUntil", err, rp, testReplicationPosition) }
func agentRpcTestStopBlp(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { bpl, err := client.StopBlp(ctx, ti) compareError(t, "StopBlp", err, bpl, testBlpPositionList) }
func agentRpcTestStartBlp(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.StartBlp(ctx, ti) compareError(t, "StartBlp", err, true, testStartBlpCalled) }
func agentRpcTestRunHealthCheck(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.RunHealthCheck(ctx, ti, testRunHealthCheckValue) if err != nil { t.Errorf("RunHealthCheck failed: %v", err) } }
func agentRpcTestWaitBlpPosition(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.WaitBlpPosition(ctx, ti, *testBlpPosition, testWaitBlpPositionWaitTime) compareError(t, "WaitBlpPosition", err, true, testWaitBlpPositionCalled) }
func agentRpcTestSlaveWasPromoted(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.SlaveWasPromoted(ctx, ti) compareError(t, "SlaveWasPromoted", err, true, testSlaveWasPromotedCalled) }
func agentRpcTestBreakSlaves(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.BreakSlaves(ctx, ti) compareError(t, "BreakSlaves", err, true, testBreakSlavesCalled) }
func agentRpcTestMasterPosition(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { rs, err := client.MasterPosition(ctx, ti) compareError(t, "MasterPosition", err, rs, testReplicationPosition) }
func agentRpcTestReparentPosition(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { rsd, err := client.ReparentPosition(ctx, ti, &testReplicationPosition) compareError(t, "ReparentPosition", err, rsd, testRestartSlaveData) }
func agentRpcTestSlaveStatus(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { rs, err := client.SlaveStatus(ctx, ti) compareError(t, "SlaveStatus", err, rs, testReplicationStatus) }
func agentRpcTestWaitSlavePosition(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { rs, err := client.WaitSlavePosition(ctx, ti, testReplicationPosition, testWaitSlavePositionWaitTimeout) compareError(t, "WaitSlavePosition", err, rs, testReplicationStatus) }
func agentRpcTestExecuteFetch(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { qr, err := client.ExecuteFetch(ctx, ti, testExecuteFetchQuery, testExecuteFetchMaxRows, true, true) compareError(t, "ExecuteFetch", err, qr, testExecuteFetchResult) }
func agentRpcTestApplySchema(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { scr, err := client.ApplySchema(ctx, ti, testSchemaChange) compareError(t, "ApplySchema", err, scr, testSchemaChangeResult) }
func agentRpcTestSleep(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.Sleep(ctx, ti, testSleepDuration) if err != nil { t.Errorf("Sleep failed: %v", err) } }
func agentRpcTestDemoteMaster(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.DemoteMaster(ctx, ti) compareError(t, "DemoteMaster", err, true, testDemoteMasterCalled) }
func agentRpcTestSnapshotSourceEnd(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.SnapshotSourceEnd(ctx, ti, testSnapshotSourceEndArgs) compareError(t, "SnapshotSourceEnd", err, true, testSnapshotSourceEndCalled) }
func agentRpcTestPromoteSlave(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { rsd, err := client.PromoteSlave(ctx, ti) compareError(t, "PromoteSlave", err, rsd, testRestartSlaveData) }
func agentRpcTestScrap(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.Scrap(ctx, ti) if strings.Index(err.Error(), testScrapError.Error()) == -1 { t.Errorf("Unexpected Scrap result: got %v expected %v", err, testScrapError) } }
func agentRpcTestSlaveWasRestarted(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.SlaveWasRestarted(ctx, ti, testSlaveWasRestartedArgs) compareError(t, "RestartSlave", err, true, testRestartSlaveCalled) }
func agentRpcTestChangeType(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.ChangeType(ctx, ti, testChangeTypeValue) if err != nil { t.Errorf("ChangeType failed: %v", err) } }
func agentRpcTestStopSlaveMinimum(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { rs, err := client.StopSlaveMinimum(ctx, ti, testReplicationPosition, testStopSlaveMinimumWaitTime) compareError(t, "StopSlave", err, rs, testReplicationStatus) }
func agentRpcTestExecuteHook(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { hr, err := client.ExecuteHook(ctx, ti, testExecuteHookHook) compareError(t, "ExecuteHook", err, hr, testExecuteHookHookResult) }
func agentRpcTestReserveForRestore(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.ReserveForRestore(ctx, ti, testReserveForRestoreArgs) compareError(t, "ReserveForRestore", err, true, testReserveForRestoreCalled) }
func agentRpcTestTabletExternallyReparented(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.TabletExternallyReparented(ctx, ti, "") compareError(t, "TabletExternallyReparented", err, true, testTabletExternallyReparentedCalled) }
func agentRpcTestPing(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { err := client.Ping(ctx, ti) if err != nil { t.Errorf("Ping failed: %v", err) } }
func agentRpcTestGetSlaves(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) { s, err := client.GetSlaves(ctx, ti) compareError(t, "GetSlaves", err, s, testGetSlavesResult) }