testsuites

package
v0.0.0-...-212369e Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BenchDriver

func BenchDriver(b *testing.B, driverConstructor DriverConstructor)

func Driver

func Driver(t *testing.T, driverConstructor DriverConstructor)

Driver runs DriverSuite for the given DriverConstructor.

Types

type DriverBenchmarkSuite

type DriverBenchmarkSuite struct {
	DriverSuite
}

func (*DriverBenchmarkSuite) BenchmarkDelete50Files

func (s *DriverBenchmarkSuite) BenchmarkDelete50Files(b *testing.B)

BenchmarkDelete50Files benchmarks Delete for 50 small files

func (*DriverBenchmarkSuite) BenchmarkDelete5Files

func (s *DriverBenchmarkSuite) BenchmarkDelete5Files(b *testing.B)

BenchmarkDelete5Files benchmarks Delete for 5 small files

func (*DriverBenchmarkSuite) BenchmarkList50Files

func (s *DriverBenchmarkSuite) BenchmarkList50Files(b *testing.B)

BenchmarkList50Files benchmarks List for 50 small files

func (*DriverBenchmarkSuite) BenchmarkList5Files

func (s *DriverBenchmarkSuite) BenchmarkList5Files(b *testing.B)

BenchmarkList5Files benchmarks List for 5 small files

func (*DriverBenchmarkSuite) BenchmarkPutGet1GBFiles

func (s *DriverBenchmarkSuite) BenchmarkPutGet1GBFiles(b *testing.B)

BenchmarkPutGet1GBFiles benchmarks PutContent/GetContent for 1GB files

func (*DriverBenchmarkSuite) BenchmarkPutGet1KBFiles

func (s *DriverBenchmarkSuite) BenchmarkPutGet1KBFiles(b *testing.B)

BenchmarkPutGet1KBFiles benchmarks PutContent/GetContent for 1KB files

func (*DriverBenchmarkSuite) BenchmarkPutGet1MBFiles

func (s *DriverBenchmarkSuite) BenchmarkPutGet1MBFiles(b *testing.B)

BenchmarkPutGet1MBFiles benchmarks PutContent/GetContent for 1MB files

func (*DriverBenchmarkSuite) BenchmarkPutGetEmptyFiles

func (s *DriverBenchmarkSuite) BenchmarkPutGetEmptyFiles(b *testing.B)

BenchmarkPutGetEmptyFiles benchmarks PutContent/GetContent for 0B files

func (*DriverBenchmarkSuite) BenchmarkStream1GBFiles

func (s *DriverBenchmarkSuite) BenchmarkStream1GBFiles(b *testing.B)

BenchmarkStream1GBFiles benchmarks Writer/Reader for 1GB files

func (*DriverBenchmarkSuite) BenchmarkStream1KBFiles

func (s *DriverBenchmarkSuite) BenchmarkStream1KBFiles(b *testing.B)

BenchmarkStream1KBFiles benchmarks Writer/Reader for 1KB files

func (*DriverBenchmarkSuite) BenchmarkStream1MBFiles

func (s *DriverBenchmarkSuite) BenchmarkStream1MBFiles(b *testing.B)

BenchmarkStream1MBFiles benchmarks Writer/Reader for 1MB files

func (*DriverBenchmarkSuite) BenchmarkStreamEmptyFiles

func (s *DriverBenchmarkSuite) BenchmarkStreamEmptyFiles(b *testing.B)

BenchmarkStreamEmptyFiles benchmarks Writer/Reader for 0B files

type DriverConstructor

type DriverConstructor func() (storagedriver.StorageDriver, error)

DriverConstructor is a function which returns a new storagedriver.StorageDriver.

type DriverSuite

type DriverSuite struct {
	suite.Suite
	Constructor DriverConstructor
	Teardown    DriverTeardown
	storagedriver.StorageDriver
	// contains filtered or unexported fields
}

DriverSuite is a suite.Suite test suite designed to test a storagedriver.StorageDriver.

func (*DriverSuite) SetupSuite

func (suite *DriverSuite) SetupSuite()

SetupSuite implements suite.SetupAllSuite interface.

func (*DriverSuite) TearDownSuite

func (suite *DriverSuite) TearDownSuite()

TearDownSuite implements suite.TearDownAllSuite.

func (*DriverSuite) TearDownTest

func (suite *DriverSuite) TearDownTest()

TearDownTest implements suite.TearDownTestSuite. This causes the suite to abort if any files are left around in the storage driver.

func (*DriverSuite) TestConcurrentFileStreams

func (suite *DriverSuite) TestConcurrentFileStreams()

TestConcurrentFileStreams checks that multiple *os.File objects can be passed in to Writer concurrently without hanging.

func (*DriverSuite) TestConcurrentStreamReads

func (suite *DriverSuite) TestConcurrentStreamReads()

TestConcurrentStreamReads checks that multiple clients can safely read from the same file simultaneously with various offsets.

func (*DriverSuite) TestContinueStreamAppendLarge

func (suite *DriverSuite) TestContinueStreamAppendLarge()

TestContinueStreamAppendLarge tests that a stream write can be appended to without corrupting the data with a large chunk size.

func (*DriverSuite) TestContinueStreamAppendSmall

func (suite *DriverSuite) TestContinueStreamAppendSmall()

TestContinueStreamAppendSmall is the same as TestContinueStreamAppendLarge, but only with a tiny chunk size in order to test corner cases for some cloud storage drivers.

func (*DriverSuite) TestDelete

func (suite *DriverSuite) TestDelete()

TestDelete checks that the delete operation removes data from the storage driver

func (*DriverSuite) TestDeleteFolder

func (suite *DriverSuite) TestDeleteFolder()

TestDeleteFolder checks that deleting a folder removes all child elements.

func (*DriverSuite) TestDeleteNonexistent

func (suite *DriverSuite) TestDeleteNonexistent()

TestDeleteNonexistent checks that removing a nonexistent key fails.

func (*DriverSuite) TestDeleteOnlyDeletesSubpaths

func (suite *DriverSuite) TestDeleteOnlyDeletesSubpaths()

TestDeleteOnlyDeletesSubpaths checks that deleting path A does not delete path B when A is a prefix of B but B is not a subpath of A (so that deleting "/a" does not delete "/ab"). This matters for services like S3 that do not implement directories.

func (*DriverSuite) TestInvalidPaths

func (suite *DriverSuite) TestInvalidPaths()

TestInvalidPaths checks that various invalid file paths are rejected by the storage driver.

func (*DriverSuite) TestList

func (suite *DriverSuite) TestList()

TestList checks the returned list of keys after populating a directory tree.

func (*DriverSuite) TestMove

func (suite *DriverSuite) TestMove()

TestMove checks that a moved object no longer exists at the source path and does exist at the destination.

func (*DriverSuite) TestMoveInvalid

func (suite *DriverSuite) TestMoveInvalid()

TestMoveInvalid provides various checks for invalid moves.

func (*DriverSuite) TestMoveNonexistent

func (suite *DriverSuite) TestMoveNonexistent()

TestMoveNonexistent checks that moving a nonexistent key fails and does not delete the data at the destination path.

func (*DriverSuite) TestMoveOverwrite

func (suite *DriverSuite) TestMoveOverwrite()

TestMoveOverwrite checks that a moved object no longer exists at the source path and overwrites the contents at the destination.

func (*DriverSuite) TestPutContentMultipleTimes

func (suite *DriverSuite) TestPutContentMultipleTimes()

TestPutContentMultipleTimes checks that if storage driver can overwrite the content in the subsequent puts. Validates that PutContent does not have to work with an offset like Writer does and overwrites the file entirely rather than writing the data to the [0,len(data)) of the file.

func (*DriverSuite) TestReadNonexistent

func (suite *DriverSuite) TestReadNonexistent()

TestReadNonexistent tests reading content from an empty path.

func (*DriverSuite) TestReadNonexistentStream

func (suite *DriverSuite) TestReadNonexistentStream()

TestReadNonexistentStream tests that reading a stream for a nonexistent path fails.

func (*DriverSuite) TestReaderWithOffset

func (suite *DriverSuite) TestReaderWithOffset()

TestReaderWithOffset tests that the appropriate data is streamed when reading with a given offset.

func (*DriverSuite) TestRedirectURL

func (suite *DriverSuite) TestRedirectURL()

TestRedirectURL checks that the RedirectURL method functions properly, but only if it is implemented

func (*DriverSuite) TestRootExists

func (suite *DriverSuite) TestRootExists()

TestRootExists ensures that all storage drivers have a root path by default.

func (*DriverSuite) TestStatCall

func (suite *DriverSuite) TestStatCall()

TestStatCall runs verifies the implementation of the storagedriver's Stat call.

func (*DriverSuite) TestTruncate

func (suite *DriverSuite) TestTruncate()

TestTruncate tests that putting smaller contents than an original file does remove the excess contents.

func (*DriverSuite) TestValidPaths

func (suite *DriverSuite) TestValidPaths()

TestValidPaths checks that various valid file paths are accepted by the storage driver.

func (*DriverSuite) TestWriteRead1

func (suite *DriverSuite) TestWriteRead1()

TestWriteRead1 tests a simple write-read workflow.

func (*DriverSuite) TestWriteRead2

func (suite *DriverSuite) TestWriteRead2()

TestWriteRead2 tests a simple write-read workflow with unicode data.

func (*DriverSuite) TestWriteRead3

func (suite *DriverSuite) TestWriteRead3()

TestWriteRead3 tests a simple write-read workflow with a small string.

func (*DriverSuite) TestWriteRead4

func (suite *DriverSuite) TestWriteRead4()

TestWriteRead4 tests a simple write-read workflow with 1MB of data.

func (*DriverSuite) TestWriteReadLargeStreams

func (suite *DriverSuite) TestWriteReadLargeStreams()

TestWriteReadLargeStreams tests that a 5GB file may be written to the storage driver safely.

func (*DriverSuite) TestWriteReadNonUTF8

func (suite *DriverSuite) TestWriteReadNonUTF8()

TestWriteReadNonUTF8 tests that non-utf8 data may be written to the storage driver safely.

func (*DriverSuite) TestWriteReadStreams1

func (suite *DriverSuite) TestWriteReadStreams1()

TestWriteReadStreams1 tests a simple write-read streaming workflow.

func (*DriverSuite) TestWriteReadStreams2

func (suite *DriverSuite) TestWriteReadStreams2()

TestWriteReadStreams2 tests a simple write-read streaming workflow with unicode data.

func (*DriverSuite) TestWriteReadStreams3

func (suite *DriverSuite) TestWriteReadStreams3()

TestWriteReadStreams3 tests a simple write-read streaming workflow with a small amount of data.

func (*DriverSuite) TestWriteReadStreams4

func (suite *DriverSuite) TestWriteReadStreams4()

TestWriteReadStreams4 tests a simple write-read streaming workflow with 1MB of data.

func (*DriverSuite) TestWriteReadStreamsNonUTF8

func (suite *DriverSuite) TestWriteReadStreamsNonUTF8()

TestWriteReadStreamsNonUTF8 tests that non-utf8 data may be written to the storage driver safely.

func (*DriverSuite) TestWriteZeroByteContentThenAppend

func (suite *DriverSuite) TestWriteZeroByteContentThenAppend()

TestWriteZeroByteContentThenAppend tests if zero byte file handling works for append to PutContent

func (*DriverSuite) TestWriteZeroByteStreamThenAppend

func (suite *DriverSuite) TestWriteZeroByteStreamThenAppend()

TestWriteZeroByteStreamThenAppend tests if zero byte file handling works for append to a Stream

type DriverTeardown

type DriverTeardown func() error

DriverTeardown is a function which cleans up a suite's storagedriver.StorageDriver.

Jump to

Keyboard shortcuts

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