Documentation ¶
Index ¶
- Constants
- func BuildCollections(t *testing.T, service path.ServiceType, tenant, user string, ...) []data.RestoreCollection
- func CheckBackupIsInManifests(t *testing.T, ctx context.Context, kw *kopia.Wrapper, sw store.BackupStorer, ...)
- func CheckMetadataFilesExist(t *testing.T, ctx context.Context, backupID model.StableID, kw *kopia.Wrapper, ...)
- func CheckRestoreCounts(t *testing.T, ctr *count.Bus, expectSkips, expectReplaces, expectNew int)
- func ControllerWithSelector(t *testing.T, ctx context.Context, acct account.Account, ...) (*m365.Controller, selectors.Selector)
- func FilterCollisionKeyResults[T any](t *testing.T, ctx context.Context, protectedResourceID, containerID string, ...) map[string]T
- func GenerateContainerOfItems(t *testing.T, ctx context.Context, ctrl *m365.Controller, ...) *details.Details
- func GenerateItemData(t *testing.T, category path.CategoryType, resourceOwner string, ...) (string, []byte)
- func GetDriveCollKeysAndItemIDs(t *testing.T, ctx context.Context, gikafbn GetItemsKeysAndFolderByNameer, ...) (map[string]api.DriveItemIDType, map[string]api.DriveItemIDType)
- func GetTestExtensionFactories() []extensions.CreateItemExtensioner
- func GockClient(creds account.M365Config, counter *count.Bus) (api.Client, error)
- func NewTestBackupOp(t *testing.T, ctx context.Context, bod *BackupOpDependencies, ...) operations.BackupOperation
- func NewTestRestoreOp(t *testing.T, ctx context.Context, rod *RestoreOpDependencies, ...) operations.RestoreOperation
- func RunAndCheckBackup(t *testing.T, ctx context.Context, bo *operations.BackupOperation, ...)
- func RunAndCheckRestore(t *testing.T, ctx context.Context, ro *operations.RestoreOperation, ...) *details.Details
- func RunBasicDriveishBackupTests(suite tester.Suite, service path.ServiceType, opts control.Options, ...)
- func RunDriveAssistBaseGroupsUpdate(suite tester.Suite, sel selectors.Selector, expectCached bool)
- func RunDriveRestoreToAlternateProtectedResource(t *testing.T, suite tester.Suite, ac api.Client, sel selectors.Selector, ...)
- func RunDriveRestoreWithAdvancedOptions(t *testing.T, suite tester.Suite, ac api.Client, sel selectors.Selector, ...)
- func RunDriveishBackupWithExtensionsTests(suite tester.Suite, service path.ServiceType, opts control.Options, ...)
- func RunIncrementalDriveishBackupTest(suite tester.Suite, opts control.Options, owner, permissionsUser string, ...)
- func RunMergeBaseGroupsUpdate(suite tester.Suite, sel selectors.Selector, expectCached bool)
- func ToDataLayerPath(t *testing.T, service path.ServiceType, tenant, resourceOwner string, ...) path.Path
- func VerifyExtensionData(t *testing.T, itemInfo details.ItemInfo, p path.ServiceType)
- type BackupOpDependencies
- type CreateFailFirstRead
- type DataBuilderFunc
- type FailFirstRead
- type GetItemsInContainerByCollisionKeyer
- type GetItemsKeysAndFolderByNameer
- type IncrementalCollection
- type IncrementalItem
- type RestoreOpDependencies
Constants ¶
const IncrementalsDestContainerPrefix = "incrementals_ci_"
Does not use the tester.DefaultTestRestoreDestination syntax as some of these items are created directly, not as a result of restoration, and we want to ensure they get clearly selected without accidental overlap.
Variables ¶
This section is empty.
Functions ¶
func BuildCollections ¶
func BuildCollections( t *testing.T, service path.ServiceType, tenant, user string, restoreCfg control.RestoreConfig, colls []IncrementalCollection, ) []data.RestoreCollection
func CheckBackupIsInManifests ¶
func CheckBackupIsInManifests( t *testing.T, ctx context.Context, kw *kopia.Wrapper, sw store.BackupStorer, bo *operations.BackupOperation, sel selectors.Selector, resourceOwner string, categories ...path.CategoryType, )
func CheckMetadataFilesExist ¶
func CheckRestoreCounts ¶
func ControllerWithSelector ¶
func ControllerWithSelector( t *testing.T, ctx context.Context, acct account.Account, sel selectors.Selector, ins idname.Cacher, onFail func(*testing.T, context.Context), counter *count.Bus, ) (*m365.Controller, selectors.Selector)
A QoL builder for live instances that updates the selector's owner id and name in the process to help avoid gotchas.
func GenerateContainerOfItems ¶
func GenerateContainerOfItems( t *testing.T, ctx context.Context, ctrl *m365.Controller, service path.ServiceType, cat path.CategoryType, sel selectors.Selector, tenantID, resourceOwner, siteID, driveID, destFldr string, howManyItems int, backupVersion int, dbf DataBuilderFunc, ) *details.Details
func GenerateItemData ¶
func GenerateItemData( t *testing.T, category path.CategoryType, resourceOwner string, dbf DataBuilderFunc, ) (string, []byte)
func GetDriveCollKeysAndItemIDs ¶
func GetDriveCollKeysAndItemIDs( t *testing.T, ctx context.Context, gikafbn GetItemsKeysAndFolderByNameer, driveID, parentContainerID string, containerNames ...string, ) (map[string]api.DriveItemIDType, map[string]api.DriveItemIDType)
func GetTestExtensionFactories ¶
func GetTestExtensionFactories() []extensions.CreateItemExtensioner
func GockClient ¶
GockClient produces a new exchange api client that can be mocked using gock.
func NewTestBackupOp ¶
func NewTestBackupOp( t *testing.T, ctx context.Context, bod *BackupOpDependencies, bus events.Eventer, opts control.Options, counter *count.Bus, ) operations.BackupOperation
NewTestBackupOp accepts the clients required to compose a backup operation, plus any other metadata, and uses them to generate a new backup operation. This allows backup chains to utilize the same temp directory and configuration details.
func NewTestRestoreOp ¶
func NewTestRestoreOp( t *testing.T, ctx context.Context, rod *RestoreOpDependencies, backupID model.StableID, bus events.Eventer, counter *count.Bus, opts control.Options, restoreCfg control.RestoreConfig, ) operations.RestoreOperation
NewTestRestoreOp accepts the clients required to compose a restore operation, plus any other metadata, and uses them to generate a new restore operation. This allows restore chains to utilize the same temp directory and configuration details.
func RunAndCheckBackup ¶
func RunAndCheckBackup( t *testing.T, ctx context.Context, bo *operations.BackupOperation, mb *evmock.Bus, acceptNoData bool, )
func RunAndCheckRestore ¶
func RunIncrementalDriveishBackupTest ¶
func RunIncrementalDriveishBackupTest( suite tester.Suite, opts control.Options, owner, permissionsUser string, service path.ServiceType, category path.CategoryType, includeContainers func([]string) selectors.Selector, getTestDriveID func(*testing.T, context.Context) string, getTestSiteID func(*testing.T, context.Context) string, getRestoreHandler func(api.Client) drive.RestoreHandler, skipPermissionsTests bool, )
func ToDataLayerPath ¶
func VerifyExtensionData ¶
Types ¶
type BackupOpDependencies ¶
type BackupOpDependencies struct { Acct account.Account Ctrl *m365.Controller KMS *kopia.ModelStore KW *kopia.Wrapper Sel selectors.Selector SSS streamstore.Streamer St storage.Storage SW store.BackupStorer // contains filtered or unexported fields }
func PrepNewTestBackupOp ¶
func PrepNewTestBackupOp( t *testing.T, ctx context.Context, bus events.Eventer, sel selectors.Selector, opts control.Options, backupVersion int, counter *count.Bus, ) ( operations.BackupOperation, *BackupOpDependencies, )
PrepNewTestBackupOp generates all clients required to run a backup operation, returning both a backup operation created with those clients, as well as the clients themselves.
type CreateFailFirstRead ¶
type CreateFailFirstRead struct {
// contains filtered or unexported fields
}
func NewCreateSingleFileFailExtension ¶
func NewCreateSingleFileFailExtension() *CreateFailFirstRead
func (*CreateFailFirstRead) CreateItemExtension ¶
func (ce *CreateFailFirstRead) CreateItemExtension( _ context.Context, r io.ReadCloser, _ details.ItemInfo, _ *details.ExtensionData, ) (io.ReadCloser, error)
type DataBuilderFunc ¶
the params here are what generateContainerOfItems passes into the func. the callback provider can use them, or not, as wanted.
type FailFirstRead ¶
type FailFirstRead struct { io.ReadCloser // contains filtered or unexported fields }
FailFirstRead fails the first read on a file being uploaded during a snapshot. Only one file is failed during the snapshot even if it the snapshot contains multiple files.
type GetItemsKeysAndFolderByNameer ¶
type GetItemsKeysAndFolderByNameer interface { GetItemIDsInContainer( ctx context.Context, driveID, containerID string, ) (map[string]api.DriveItemIDType, error) GetFolderByName( ctx context.Context, driveID, parentFolderID, folderName string, ) (models.DriveItemable, error) GetItemsInContainerByCollisionKey( ctx context.Context, driveID, containerID string, ) (map[string]api.DriveItemIDType, error) }
type IncrementalCollection ¶
type IncrementalCollection struct {
// contains filtered or unexported fields
}
type IncrementalItem ¶
type IncrementalItem struct {
// contains filtered or unexported fields
}
type RestoreOpDependencies ¶
type RestoreOpDependencies struct {
// contains filtered or unexported fields
}
func PrepNewTestRestoreOp ¶
func PrepNewTestRestoreOp( t *testing.T, ctx context.Context, backupStore storage.Storage, backupID model.StableID, bus events.Eventer, counter *count.Bus, sel selectors.Selector, opts control.Options, restoreCfg control.RestoreConfig, ) ( operations.RestoreOperation, *RestoreOpDependencies, )
PrepNewTestRestoreOp generates all clients required to run a restore operation, returning both a restore operation created with those clients, as well as the clients themselves.