metabasetest

package
v1.119.11 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultEncryption = storj.EncryptionParameters{
	CipherSuite: storj.EncAESGCM,
	BlockSize:   29 * 256,
}

DefaultEncryption contains default encryption parameters.

View Source
var DefaultRedundancy = storj.RedundancyScheme{
	Algorithm:      storj.ReedSolomon,
	ShareSize:      2048,
	RequiredShares: 1,
	RepairShares:   1,
	OptimalShares:  1,
	TotalShares:    1,
}

DefaultRedundancy contains default redundancy scheme.

Functions

func Bench

func Bench(b *testing.B, fn func(ctx *testcontext.Context, b *testing.B, db *metabase.DB))

Bench runs benchmark for all configured databases.

func CreateExpiredObject

func CreateExpiredObject(ctx *testcontext.Context, t testing.TB, db *metabase.DB, obj metabase.ObjectStream, numberOfSegments byte, expiresAt time.Time) metabase.Object

CreateExpiredObject creates a new committed expired object with the specified number of segments.

func CreateObject

func CreateObject(ctx *testcontext.Context, t testing.TB, db *metabase.DB, obj metabase.ObjectStream, numberOfSegments byte) metabase.Object

CreateObject creates a new committed object with the specified number of segments.

func CreateObjectVersioned added in v1.91.2

func CreateObjectVersioned(ctx *testcontext.Context, t testing.TB, db *metabase.DB, obj metabase.ObjectStream, numberOfSegments byte) metabase.Object

CreateObjectVersioned creates a new committed object with the specified number of segments.

func CreateObjectVersionedOutOfOrder added in v1.92.1

func CreateObjectVersionedOutOfOrder(ctx *testcontext.Context, t testing.TB, db *metabase.DB, obj metabase.ObjectStream, numberOfSegments byte, expectVersion metabase.Version) metabase.Object

CreateObjectVersionedOutOfOrder creates a new committed object with the specified number of segments.

func CreateObjectWithRetention added in v1.110.1

func CreateObjectWithRetention(ctx *testcontext.Context, t testing.TB, db *metabase.DB, obj metabase.ObjectStream, numberOfSegments byte, retention metabase.Retention) (metabase.Object, []metabase.Segment)

CreateObjectWithRetention creates an object with an Object Lock retention configuration.

func CreateObjectWithRetentionAndLegalHold added in v1.113.1

func CreateObjectWithRetentionAndLegalHold(ctx *testcontext.Context, t testing.TB, db *metabase.DB, obj metabase.ObjectStream, retention metabase.Retention, legalHold bool) metabase.Object

CreateObjectWithRetentionAndLegalHold creates an object with an Object Lock retention and legal hold configurations.

func CreatePendingObject

func CreatePendingObject(ctx *testcontext.Context, t testing.TB, db *metabase.DB, obj metabase.ObjectStream, numberOfSegments byte) metabase.Object

CreatePendingObject creates a new pending object with the specified number of segments.

func CreatePendingObjectsWithKeys added in v1.96.2

func CreatePendingObjectsWithKeys(ctx *testcontext.Context, t *testing.T, db *metabase.DB, projectID uuid.UUID, bucketName metabase.BucketName, keys map[metabase.ObjectKey][]metabase.Version) map[metabase.ObjectKey]metabase.ObjectEntry

CreatePendingObjectsWithKeys creates multiple versioned objects with the specified keys and versions, and returns a mapping of keys to all versions.

func CreateSegments added in v1.91.2

func CreateSegments(ctx *testcontext.Context, t testing.TB, db *metabase.DB, obj metabase.ObjectStream, expiresAt *time.Time, numberOfSegments byte) []metabase.Segment

CreateSegments creates multiple segments for the specified object.

func CreateVersionedObjectsWithKeys added in v1.92.1

func CreateVersionedObjectsWithKeys(ctx *testcontext.Context, t *testing.T, db *metabase.DB, projectID uuid.UUID, bucketName metabase.BucketName, keys map[metabase.ObjectKey][]metabase.Version) map[metabase.ObjectKey]metabase.ObjectEntry

CreateVersionedObjectsWithKeys creates multiple versioned objects with the specified keys and versions, and returns a mapping of keys to final versions.

func CreateVersionedObjectsWithKeysAll added in v1.93.1

func CreateVersionedObjectsWithKeysAll(ctx *testcontext.Context, t *testing.T, db *metabase.DB, projectID uuid.UUID, bucketName metabase.BucketName, keys map[metabase.ObjectKey][]metabase.Version, sortDesc bool) map[metabase.ObjectKey][]metabase.ObjectEntry

CreateVersionedObjectsWithKeysAll creates multiple versioned objects with the specified keys and versions, and returns a mapping of keys to a slice of all versions.

func DefaultRawSegment added in v1.30.1

func DefaultRawSegment(obj metabase.ObjectStream, segmentPosition metabase.SegmentPosition) metabase.RawSegment

DefaultRawSegment returns default raw segment.

func DefaultTimeDiff added in v1.56.1

func DefaultTimeDiff() cmp.Option

DefaultTimeDiff is the central place to adjust test sql "timeout" (accepted diff between start and end of the test).

func ObjectStreamToPending added in v1.85.1

func ObjectStreamToPending(objectStream metabase.ObjectStream) metabase.PendingObjectStream

ObjectStreamToPending converts ObjectStream to PendingObjectStream.

func RandEncryptedKeyAndNonce added in v1.57.8

func RandEncryptedKeyAndNonce(position int) metabase.EncryptedKeyAndNonce

RandEncryptedKeyAndNonce generates random segment metadata.

func RandObjectKey added in v1.51.1

func RandObjectKey() metabase.ObjectKey

RandObjectKey returns a random object key.

func RandObjectStream

func RandObjectStream() metabase.ObjectStream

RandObjectStream returns a random object stream.

func Run

func Run(t *testing.T, fn func(ctx *testcontext.Context, t *testing.T, db *metabase.DB), flags ...interface{})

Run runs tests against all configured databases.

func RunWithConfig added in v1.42.2

func RunWithConfig(t *testing.T, config metabase.Config, fn func(ctx *testcontext.Context, t *testing.T, db *metabase.DB), flags ...interface{})

RunWithConfig runs tests with specific metabase configuration.

func RunWithConfigAndMigration added in v1.57.1

func RunWithConfigAndMigration(t *testing.T, config metabase.Config, fn func(ctx *testcontext.Context, t *testing.T, db *metabase.DB), migration func(ctx context.Context, db *metabase.DB) error, flags ...interface{})

RunWithConfigAndMigration runs tests with specific metabase configuration and migration type.

func SegmentsToRaw added in v1.51.1

func SegmentsToRaw(segments []metabase.Segment) []metabase.RawSegment

SegmentsToRaw converts a slice of Segment to a slice of RawSegment.

func TestModule added in v1.103.2

func TestModule(ball *mud.Ball, dbinfo satellitedbtest.SatelliteDatabases, config metabase.Config)

TestModule provides all dependencies to run metabase tests.

Types

type BeginCopyObject added in v1.50.1

type BeginCopyObject struct {
	Opts     metabase.BeginCopyObject
	Result   metabase.BeginCopyObjectResult
	ErrClass *errs.Class
	ErrText  string
}

BeginCopyObject is for testing metabase.BeginCopyObject.

func (BeginCopyObject) Check added in v1.50.1

func (step BeginCopyObject) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type BeginMoveObject added in v1.39.4

type BeginMoveObject struct {
	Opts     metabase.BeginMoveObject
	Result   metabase.BeginMoveObjectResult
	ErrClass *errs.Class
	ErrText  string
}

BeginMoveObject is for testing metabase.BeginMoveObject.

func (BeginMoveObject) Check added in v1.39.4

func (step BeginMoveObject) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type BeginObjectExactVersion

type BeginObjectExactVersion struct {
	Opts     metabase.BeginObjectExactVersion
	ErrClass *errs.Class
	ErrText  string
}

BeginObjectExactVersion is for testing metabase.BeginObjectExactVersion.

func (BeginObjectExactVersion) Check

Check runs the test.

type BeginObjectNextVersion

type BeginObjectNextVersion struct {
	Opts     metabase.BeginObjectNextVersion
	Version  metabase.Version
	ErrClass *errs.Class
	ErrText  string
}

BeginObjectNextVersion is for testing metabase.BeginObjectNextVersion.

func (BeginObjectNextVersion) Check

Check runs the test.

type BeginSegment

type BeginSegment struct {
	Opts     metabase.BeginSegment
	ErrClass *errs.Class
	ErrText  string
}

BeginSegment is for testing metabase.BeginSegment.

func (BeginSegment) Check

func (step BeginSegment) Check(ctx *testcontext.Context, t require.TestingT, db *metabase.DB)

Check runs the test.

type BucketEmpty

type BucketEmpty struct {
	Opts     metabase.BucketEmpty
	Result   bool
	ErrClass *errs.Class
	ErrText  string
}

BucketEmpty is for testing metabase.BucketEmpty.

func (BucketEmpty) Check

func (step BucketEmpty) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type CollectBucketTallies added in v1.66.1

type CollectBucketTallies struct {
	Opts     metabase.CollectBucketTallies
	Result   []metabase.BucketTally
	ErrClass *errs.Class
	ErrText  string
}

CollectBucketTallies is for testing metabase.CollectBucketTallies.

func (CollectBucketTallies) Check added in v1.66.1

func (step CollectBucketTallies) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type CommitInlineObject added in v1.106.1

type CommitInlineObject struct {
	Opts          metabase.CommitInlineObject
	ExpectVersion metabase.Version
	ErrClass      *errs.Class
	ErrText       string
}

CommitInlineObject is for testing metabase.CommitInlineObject.

func (CommitInlineObject) Check added in v1.106.1

Check runs the test.

type CommitInlineSegment

type CommitInlineSegment struct {
	Opts     metabase.CommitInlineSegment
	ErrClass *errs.Class
	ErrText  string
}

CommitInlineSegment is for testing metabase.CommitInlineSegment.

func (CommitInlineSegment) Check

func (step CommitInlineSegment) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type CommitObject

type CommitObject struct {
	Opts          metabase.CommitObject
	ExpectVersion metabase.Version
	ErrClass      *errs.Class
	ErrText       string
}

CommitObject is for testing metabase.CommitObject.

func (CommitObject) Check

Check runs the test.

type CommitObjectWithSegments

type CommitObjectWithSegments struct {
	Opts          metabase.CommitObjectWithSegments
	ExpectVersion metabase.Version

	ErrClass *errs.Class
	ErrText  string
}

CommitObjectWithSegments is for testing metabase.CommitObjectWithSegments.

func (CommitObjectWithSegments) Check

Check runs the test.

type CommitSegment

type CommitSegment struct {
	Opts     metabase.CommitSegment
	ErrClass *errs.Class
	ErrText  string
}

CommitSegment is for testing metabase.CommitSegment.

func (CommitSegment) Check

func (step CommitSegment) Check(ctx *testcontext.Context, t require.TestingT, db *metabase.DB)

Check runs the test.

type CreateObjectCopy added in v1.50.1

type CreateObjectCopy struct {
	OriginalObject metabase.Object
	// if empty, creates fake segments if necessary
	OriginalSegments []metabase.Segment
	FinishObject     *metabase.FinishCopyObject
	CopyObjectStream *metabase.ObjectStream

	NewDisallowDelete bool
	NewVersioned      bool

	Retention metabase.Retention
	LegalHold bool
}

CreateObjectCopy is for testing object copy.

func (CreateObjectCopy) Run added in v1.50.1

func (cc CreateObjectCopy) Run(ctx *testcontext.Context, t testing.TB, db *metabase.DB) (copyObj metabase.Object, expectedOriginalSegments []metabase.RawSegment, expectedCopySegments []metabase.RawSegment)

Run creates the copy.

type CreateTestObject

type CreateTestObject struct {
	BeginObjectExactVersion *metabase.BeginObjectExactVersion
	CommitObject            *metabase.CommitObject
	ExpectVersion           metabase.Version
	CreateSegment           func(object metabase.Object, index int) metabase.Segment
}

CreateTestObject is for testing metabase.CreateTestObject.

func (CreateTestObject) Run

func (co CreateTestObject) Run(ctx *testcontext.Context, t testing.TB, db *metabase.DB, obj metabase.ObjectStream, numberOfSegments byte) (metabase.Object, []metabase.Segment)

Run runs the test.

type DeleteAll

type DeleteAll struct{}

DeleteAll deletes all data from metabase.

func (DeleteAll) Check

func (step DeleteAll) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type DeleteAllBucketObjects added in v1.116.3

type DeleteAllBucketObjects struct {
	Opts     metabase.DeleteAllBucketObjects
	Deleted  int64
	ErrClass *errs.Class
	ErrText  string
}

DeleteAllBucketObjects is for testing metabase.DeleteAllBucketObjects.

func (DeleteAllBucketObjects) Check added in v1.116.3

func (step DeleteAllBucketObjects) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type DeleteExpiredObjects

type DeleteExpiredObjects struct {
	Opts metabase.DeleteExpiredObjects

	ErrClass *errs.Class
	ErrText  string
}

DeleteExpiredObjects is for testing metabase.DeleteExpiredObjects.

func (DeleteExpiredObjects) Check

func (step DeleteExpiredObjects) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type DeleteObjectExactVersion

type DeleteObjectExactVersion struct {
	Opts     metabase.DeleteObjectExactVersion
	Result   metabase.DeleteObjectResult
	ErrClass *errs.Class
	ErrText  string
}

DeleteObjectExactVersion is for testing metabase.DeleteObjectExactVersion.

func (DeleteObjectExactVersion) Check

Check runs the test.

type DeleteObjectLastCommitted added in v1.63.1

type DeleteObjectLastCommitted struct {
	Opts   metabase.DeleteObjectLastCommitted
	Result metabase.DeleteObjectResult

	ErrClass *errs.Class
	ErrText  string

	OutputMarkerStreamID *uuid.UUID
}

DeleteObjectLastCommitted is for testing metabase.DeleteObjectLastCommitted.

func (DeleteObjectLastCommitted) Check added in v1.63.1

Check runs the test.

type DeletePendingObject

type DeletePendingObject struct {
	Opts     metabase.DeletePendingObject
	Result   metabase.DeleteObjectResult
	ErrClass *errs.Class
	ErrText  string
}

DeletePendingObject is for testing metabase.DeletePendingObject.

func (DeletePendingObject) Check

func (step DeletePendingObject) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type DeleteZombieObjects added in v1.30.1

type DeleteZombieObjects struct {
	Opts metabase.DeleteZombieObjects

	ErrClass *errs.Class
	ErrText  string
}

DeleteZombieObjects is for testing metabase.DeleteZombieObjects.

func (DeleteZombieObjects) Check added in v1.30.1

func (step DeleteZombieObjects) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type EnsureNodeAliases

type EnsureNodeAliases struct {
	Opts metabase.EnsureNodeAliases

	ErrClass *errs.Class
	ErrText  string
}

EnsureNodeAliases is for testing metabase.EnsureNodeAliases.

func (EnsureNodeAliases) Check

func (step EnsureNodeAliases) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type FinishCopyObject added in v1.50.1

type FinishCopyObject struct {
	Opts     metabase.FinishCopyObject
	Result   metabase.Object
	ErrClass *errs.Class
	ErrText  string
}

FinishCopyObject is for testing metabase.FinishCopyObject.

func (FinishCopyObject) Check added in v1.50.1

Check runs the test.

type FinishMoveObject added in v1.40.3

type FinishMoveObject struct {
	Opts     metabase.FinishMoveObject
	ErrClass *errs.Class
	ErrText  string
}

FinishMoveObject is for testing metabase.FinishMoveObject.

func (FinishMoveObject) Check added in v1.40.3

func (step FinishMoveObject) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type GetLatestObjectLastSegment

type GetLatestObjectLastSegment struct {
	Opts     metabase.GetLatestObjectLastSegment
	Result   metabase.Segment
	ErrClass *errs.Class
	ErrText  string
}

GetLatestObjectLastSegment is for testing metabase.GetLatestObjectLastSegment.

func (GetLatestObjectLastSegment) Check

Check runs the test.

type GetNodeAliasEntries added in v1.108.1

type GetNodeAliasEntries struct {
	Opts     metabase.GetNodeAliasEntries
	ErrClass *errs.Class
	ErrText  string
}

GetNodeAliasEntries is for testing metabase.GetNodeAliasEntries.

func (GetNodeAliasEntries) Check added in v1.108.1

Check runs the test.

type GetObjectExactVersion

type GetObjectExactVersion struct {
	Opts     metabase.GetObjectExactVersion
	Result   metabase.Object
	ErrClass *errs.Class
	ErrText  string
}

GetObjectExactVersion is for testing metabase.GetObjectExactVersion.

func (GetObjectExactVersion) Check

func (step GetObjectExactVersion) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type GetObjectExactVersionLegalHold added in v1.113.1

type GetObjectExactVersionLegalHold struct {
	Opts     metabase.GetObjectExactVersionLegalHold
	Result   bool
	ErrClass *errs.Class
	ErrText  string
}

GetObjectExactVersionLegalHold is for testing metabase.GetObjectExactVersionLegalHold.

func (GetObjectExactVersionLegalHold) Check added in v1.113.1

Check runs the test.

type GetObjectExactVersionRetention added in v1.110.1

type GetObjectExactVersionRetention struct {
	Opts     metabase.GetObjectExactVersionRetention
	Result   metabase.Retention
	ErrClass *errs.Class
	ErrText  string
}

GetObjectExactVersionRetention is for testing metabase.GetObjectExactVersionRetention.

func (GetObjectExactVersionRetention) Check added in v1.110.1

Check runs the test.

type GetObjectLastCommitted added in v1.62.1

type GetObjectLastCommitted struct {
	Opts     metabase.GetObjectLastCommitted
	Result   metabase.Object
	ErrClass *errs.Class
	ErrText  string
}

GetObjectLastCommitted is for testing metabase.GetObjectLastCommitted.

func (GetObjectLastCommitted) Check added in v1.62.1

func (step GetObjectLastCommitted) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type GetObjectLastCommittedLegalHold added in v1.113.1

type GetObjectLastCommittedLegalHold struct {
	Opts     metabase.GetObjectLastCommittedLegalHold
	Result   bool
	ErrClass *errs.Class
	ErrText  string
}

GetObjectLastCommittedLegalHold is for testing metabase.GetObjectLastCommittedLegalHold.

func (GetObjectLastCommittedLegalHold) Check added in v1.113.1

Check runs the test.

type GetObjectLastCommittedRetention added in v1.110.1

type GetObjectLastCommittedRetention struct {
	Opts     metabase.GetObjectLastCommittedRetention
	Result   metabase.Retention
	ErrClass *errs.Class
	ErrText  string
}

GetObjectLastCommittedRetention is for testing metabase.GetObjectLastCommittedRetention.

func (GetObjectLastCommittedRetention) Check added in v1.110.1

Check runs the test.

type GetSegmentByPosition

type GetSegmentByPosition struct {
	Opts     metabase.GetSegmentByPosition
	Result   metabase.Segment
	ErrClass *errs.Class
	ErrText  string
}

GetSegmentByPosition is for testing metabase.GetSegmentByPosition.

func (GetSegmentByPosition) Check

func (step GetSegmentByPosition) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type GetStreamPieceCountByNodeID

type GetStreamPieceCountByNodeID struct {
	Opts     metabase.GetStreamPieceCountByNodeID
	Result   map[storj.NodeID]int64
	ErrClass *errs.Class
	ErrText  string
}

GetStreamPieceCountByNodeID is for testing metabase.GetStreamPieceCountByNodeID.

func (GetStreamPieceCountByNodeID) Check

Check runs the test.

type GetTableStats added in v1.32.2

type GetTableStats struct {
	Opts     metabase.GetTableStats
	Result   metabase.TableStats
	ErrClass *errs.Class
	ErrText  string
}

GetTableStats is for testing metabase.GetTableStats.

func (GetTableStats) Check added in v1.32.2

Check runs the test.

type InvalidObjectLocation

type InvalidObjectLocation struct {
	Name           string
	ObjectLocation metabase.ObjectLocation
	ErrClass       *errs.Class
	ErrText        string
}

InvalidObjectLocation contains info about an invalid object location.

func InvalidObjectLocations

func InvalidObjectLocations(base metabase.ObjectLocation) []InvalidObjectLocation

InvalidObjectLocations returns a list of invalid object locations.

type InvalidObjectStream

type InvalidObjectStream struct {
	Name         string
	ObjectStream metabase.ObjectStream
	ErrClass     *errs.Class
	ErrText      string
}

InvalidObjectStream contains info about an invalid stream.

func InvalidObjectStreams

func InvalidObjectStreams(base metabase.ObjectStream) []InvalidObjectStream

InvalidObjectStreams returns a list of invalid object streams.

type InvalidSegmentLocation

type InvalidSegmentLocation struct {
	Name            string
	SegmentLocation metabase.SegmentLocation
	ErrClass        *errs.Class
	ErrText         string
}

InvalidSegmentLocation contains info about an invalid segment location.

func InvalidSegmentLocations

func InvalidSegmentLocations(base metabase.SegmentLocation) []InvalidSegmentLocation

InvalidSegmentLocations returns a list of invalid segment locations.

type IterateCollector

type IterateCollector []metabase.ObjectEntry

IterateCollector is for testing metabase.IterateCollector.

func (*IterateCollector) Add

Add adds object entries from iterator to the collection.

type IterateLoopSegments added in v1.31.1

type IterateLoopSegments struct {
	Opts     metabase.IterateLoopSegments
	Result   []metabase.LoopSegmentEntry
	ErrClass *errs.Class
	ErrText  string
}

IterateLoopSegments is for testing metabase.IterateLoopSegments.

func (IterateLoopSegments) Check added in v1.31.1

func (step IterateLoopSegments) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type IterateObjectsWithStatus

type IterateObjectsWithStatus struct {
	Opts metabase.IterateObjectsWithStatus

	Result   []metabase.ObjectEntry
	ErrClass *errs.Class
	ErrText  string
}

IterateObjectsWithStatus is for testing metabase.IterateObjectsWithStatus.

func (IterateObjectsWithStatus) Check

Check runs the test.

type IterateObjectsWithStatusAscending added in v1.96.4

type IterateObjectsWithStatusAscending struct {
	Opts metabase.IterateObjectsWithStatus

	Result   []metabase.ObjectEntry
	ErrClass *errs.Class
	ErrText  string
}

IterateObjectsWithStatusAscending is for testing metabase.IterateObjectsWithStatusAscending.

func (IterateObjectsWithStatusAscending) Check added in v1.96.4

Check runs the test.

type IteratePendingObjectsByKey

type IteratePendingObjectsByKey struct {
	Opts metabase.IteratePendingObjectsByKey

	Result   []metabase.ObjectEntry
	ErrClass *errs.Class
	ErrText  string
}

IteratePendingObjectsByKey is for testing metabase.IteratePendingObjectsByKey.

func (IteratePendingObjectsByKey) Check

Check runs the test.

type ListNodeAliases

type ListNodeAliases struct {
	ErrClass *errs.Class
	ErrText  string
}

ListNodeAliases is for testing metabase.ListNodeAliases.

func (ListNodeAliases) Check

Check runs the test.

type ListObjects added in v1.65.1

type ListObjects struct {
	Opts     metabase.ListObjects
	Result   metabase.ListObjectsResult
	ErrClass *errs.Class
	ErrText  string
}

ListObjects is for testing metabase.ListObjects.

func (ListObjects) Check added in v1.65.1

func (step ListObjects) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type ListSegments

type ListSegments struct {
	Opts     metabase.ListSegments
	Result   metabase.ListSegmentsResult
	ErrClass *errs.Class
	ErrText  string
}

ListSegments is for testing metabase.ListSegments.

func (ListSegments) Check

func (step ListSegments) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type ListStreamPositions

type ListStreamPositions struct {
	Opts     metabase.ListStreamPositions
	Result   metabase.ListStreamPositionsResult
	ErrClass *errs.Class
	ErrText  string
}

ListStreamPositions is for testing metabase.ListStreamPositions.

func (ListStreamPositions) Check

func (step ListStreamPositions) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type ObjectLockDeletionTestCase added in v1.113.1

type ObjectLockDeletionTestCase struct {
	// Retention is the retention configuration of the object created for this test case.
	Retention metabase.Retention
	// LegalHold is the legal hold status of the object created for this test case.
	LegalHold bool
	// BypassGovernance indicates whether governance mode bypass should be enabled when deleting
	// the object created for this test case.
	BypassGovernance bool
}

ObjectLockDeletionTestCase contains configuration options for an Object Lock deletion test case.

type ObjectLockDeletionTestRunner added in v1.113.1

type ObjectLockDeletionTestRunner struct {
	// TestProtected is run with Object Lock options that are expected to prohibit object deletion.
	TestProtected func(t *testing.T, testCase ObjectLockDeletionTestCase)
	// TestRemovable is run with Object Lock options that are not expected to prohibit object deletion.
	TestRemovable func(t *testing.T, testCase ObjectLockDeletionTestCase)
}

ObjectLockDeletionTestRunner runs object deletion tests with different Object Lock test cases.

func (ObjectLockDeletionTestRunner) Run added in v1.113.1

func (opts ObjectLockDeletionTestRunner) Run(t *testing.T)

Run runs the Object Lock deletion test cases.

type PendingObjectsCollector added in v1.87.1

type PendingObjectsCollector []metabase.PendingObjectEntry

PendingObjectsCollector is for testing metabase.PendingObjectsCollector.

func (*PendingObjectsCollector) Add added in v1.87.1

Add adds object entries from iterator to the collection.

type SetObjectExactVersionLegalHold added in v1.113.1

type SetObjectExactVersionLegalHold struct {
	Opts     metabase.SetObjectExactVersionLegalHold
	ErrClass *errs.Class
	ErrText  string
}

SetObjectExactVersionLegalHold is for testing metabase.SetObjectExactVersionLegalHold.

func (SetObjectExactVersionLegalHold) Check added in v1.113.1

Check runs the test.

type SetObjectExactVersionRetention added in v1.110.1

type SetObjectExactVersionRetention struct {
	Opts     metabase.SetObjectExactVersionRetention
	ErrClass *errs.Class
	ErrText  string
}

SetObjectExactVersionRetention is for testing metabase.SetObjectExactVersionRetention.

func (SetObjectExactVersionRetention) Check added in v1.110.1

Check runs the test.

type SetObjectLastCommittedLegalHold added in v1.113.1

type SetObjectLastCommittedLegalHold struct {
	Opts     metabase.SetObjectLastCommittedLegalHold
	ErrClass *errs.Class
	ErrText  string
}

SetObjectLastCommittedLegalHold is for testing metabase.SetObjectLastCommittedLegalHold.

func (SetObjectLastCommittedLegalHold) Check added in v1.113.1

Check runs the test.

type SetObjectLastCommittedRetention added in v1.110.1

type SetObjectLastCommittedRetention struct {
	Opts     metabase.SetObjectLastCommittedRetention
	ErrClass *errs.Class
	ErrText  string
}

SetObjectLastCommittedRetention is for testing metabase.SetObjectLastCommittedRetention.

func (SetObjectLastCommittedRetention) Check added in v1.110.1

Check runs the test.

type UpdateObjectLastCommittedMetadata added in v1.91.2

type UpdateObjectLastCommittedMetadata struct {
	Opts     metabase.UpdateObjectLastCommittedMetadata
	ErrClass *errs.Class
	ErrText  string
}

UpdateObjectLastCommittedMetadata is for testing metabase.UpdateObjectLastCommittedMetadata.

func (UpdateObjectLastCommittedMetadata) Check added in v1.91.2

Check runs the test.

type UpdateSegmentPieces

type UpdateSegmentPieces struct {
	Opts     metabase.UpdateSegmentPieces
	ErrClass *errs.Class
	ErrText  string
}

UpdateSegmentPieces is for testing metabase.UpdateSegmentPieces.

func (UpdateSegmentPieces) Check

func (step UpdateSegmentPieces) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

type Verify

type Verify metabase.RawState

Verify verifies whether metabase state matches the content.

func (Verify) Check

func (step Verify) Check(ctx *testcontext.Context, t testing.TB, db *metabase.DB)

Check runs the test.

Jump to

Keyboard shortcuts

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