Documentation ¶
Index ¶
- func RegisterSuite(driverConstructor DriverConstructor, skipCheck SkipCheck)
- func Test(t *testing.T)
- type DriverConstructor
- type DriverSuite
- func (suite *DriverSuite) BenchmarkDelete50Files(c *check.C)
- func (suite *DriverSuite) BenchmarkDelete5Files(c *check.C)
- func (suite *DriverSuite) BenchmarkList50Files(c *check.C)
- func (suite *DriverSuite) BenchmarkList5Files(c *check.C)
- func (suite *DriverSuite) BenchmarkPutGet1GBFiles(c *check.C)
- func (suite *DriverSuite) BenchmarkPutGet1KBFiles(c *check.C)
- func (suite *DriverSuite) BenchmarkPutGet1MBFiles(c *check.C)
- func (suite *DriverSuite) BenchmarkPutGetEmptyFiles(c *check.C)
- func (suite *DriverSuite) BenchmarkStream1GBFiles(c *check.C)
- func (suite *DriverSuite) BenchmarkStream1KBFiles(c *check.C)
- func (suite *DriverSuite) BenchmarkStream1MBFiles(c *check.C)
- func (suite *DriverSuite) BenchmarkStreamEmptyFiles(c *check.C)
- func (suite *DriverSuite) SetUpSuite(c *check.C)
- func (suite *DriverSuite) TearDownSuite(c *check.C)
- func (suite *DriverSuite) TearDownTest(c *check.C)
- func (suite *DriverSuite) TestConcurrentFileStreams(c *check.C)
- func (suite *DriverSuite) TestConcurrentStreamReads(c *check.C)
- func (suite *DriverSuite) TestContinueStreamAppendLarge(c *check.C)
- func (suite *DriverSuite) TestContinueStreamAppendSmall(c *check.C)
- func (suite *DriverSuite) TestDelete(c *check.C)
- func (suite *DriverSuite) TestDeleteFolder(c *check.C)
- func (suite *DriverSuite) TestDeleteNonexistent(c *check.C)
- func (suite *DriverSuite) TestEventualConsistency(c *check.C)
- func (suite *DriverSuite) TestInvalidPaths(c *check.C)
- func (suite *DriverSuite) TestList(c *check.C)
- func (suite *DriverSuite) TestMove(c *check.C)
- func (suite *DriverSuite) TestMoveInvalid(c *check.C)
- func (suite *DriverSuite) TestMoveNonexistent(c *check.C)
- func (suite *DriverSuite) TestMoveOverwrite(c *check.C)
- func (suite *DriverSuite) TestPutContentMultipleTimes(c *check.C)
- func (suite *DriverSuite) TestReadNonexistent(c *check.C)
- func (suite *DriverSuite) TestReadNonexistentStream(c *check.C)
- func (suite *DriverSuite) TestReadStreamWithOffset(c *check.C)
- func (suite *DriverSuite) TestStatCall(c *check.C)
- func (suite *DriverSuite) TestTruncate(c *check.C)
- func (suite *DriverSuite) TestURLFor(c *check.C)
- func (suite *DriverSuite) TestValidPaths(c *check.C)
- func (suite *DriverSuite) TestWriteRead1(c *check.C)
- func (suite *DriverSuite) TestWriteRead2(c *check.C)
- func (suite *DriverSuite) TestWriteRead3(c *check.C)
- func (suite *DriverSuite) TestWriteRead4(c *check.C)
- func (suite *DriverSuite) TestWriteReadLargeStreams(c *check.C)
- func (suite *DriverSuite) TestWriteReadNonUTF8(c *check.C)
- func (suite *DriverSuite) TestWriteReadStreams1(c *check.C)
- func (suite *DriverSuite) TestWriteReadStreams2(c *check.C)
- func (suite *DriverSuite) TestWriteReadStreams3(c *check.C)
- func (suite *DriverSuite) TestWriteReadStreams4(c *check.C)
- func (suite *DriverSuite) TestWriteReadStreamsNonUTF8(c *check.C)
- type DriverTeardown
- type SkipCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSuite ¶
func RegisterSuite(driverConstructor DriverConstructor, skipCheck SkipCheck)
RegisterSuite registers an in-process storage driver test suite with the go test runner.
Types ¶
type DriverConstructor ¶
type DriverConstructor func() (storagedriver.StorageDriver, error)
DriverConstructor is a function which returns a new storagedriver.StorageDriver.
type DriverSuite ¶
type DriverSuite struct { Constructor DriverConstructor Teardown DriverTeardown SkipCheck storagedriver.StorageDriver // contains filtered or unexported fields }
DriverSuite is a gocheck test suite designed to test a storagedriver.StorageDriver. The intended way to create a DriverSuite is with RegisterSuite.
func (*DriverSuite) BenchmarkDelete50Files ¶
func (suite *DriverSuite) BenchmarkDelete50Files(c *check.C)
BenchmarkDelete50Files benchmarks Delete for 50 small files
func (*DriverSuite) BenchmarkDelete5Files ¶
func (suite *DriverSuite) BenchmarkDelete5Files(c *check.C)
BenchmarkDelete5Files benchmarks Delete for 5 small files
func (*DriverSuite) BenchmarkList50Files ¶
func (suite *DriverSuite) BenchmarkList50Files(c *check.C)
BenchmarkList50Files benchmarks List for 50 small files
func (*DriverSuite) BenchmarkList5Files ¶
func (suite *DriverSuite) BenchmarkList5Files(c *check.C)
BenchmarkList5Files benchmarks List for 5 small files
func (*DriverSuite) BenchmarkPutGet1GBFiles ¶
func (suite *DriverSuite) BenchmarkPutGet1GBFiles(c *check.C)
BenchmarkPutGet1GBFiles benchmarks PutContent/GetContent for 1GB files
func (*DriverSuite) BenchmarkPutGet1KBFiles ¶
func (suite *DriverSuite) BenchmarkPutGet1KBFiles(c *check.C)
BenchmarkPutGet1KBFiles benchmarks PutContent/GetContent for 1KB files
func (*DriverSuite) BenchmarkPutGet1MBFiles ¶
func (suite *DriverSuite) BenchmarkPutGet1MBFiles(c *check.C)
BenchmarkPutGet1MBFiles benchmarks PutContent/GetContent for 1MB files
func (*DriverSuite) BenchmarkPutGetEmptyFiles ¶
func (suite *DriverSuite) BenchmarkPutGetEmptyFiles(c *check.C)
BenchmarkPutGetEmptyFiles benchmarks PutContent/GetContent for 0B files
func (*DriverSuite) BenchmarkStream1GBFiles ¶
func (suite *DriverSuite) BenchmarkStream1GBFiles(c *check.C)
BenchmarkStream1GBFiles benchmarks WriteStream/ReadStream for 1GB files
func (*DriverSuite) BenchmarkStream1KBFiles ¶
func (suite *DriverSuite) BenchmarkStream1KBFiles(c *check.C)
BenchmarkStream1KBFiles benchmarks WriteStream/ReadStream for 1KB files
func (*DriverSuite) BenchmarkStream1MBFiles ¶
func (suite *DriverSuite) BenchmarkStream1MBFiles(c *check.C)
BenchmarkStream1MBFiles benchmarks WriteStream/ReadStream for 1MB files
func (*DriverSuite) BenchmarkStreamEmptyFiles ¶
func (suite *DriverSuite) BenchmarkStreamEmptyFiles(c *check.C)
BenchmarkStreamEmptyFiles benchmarks WriteStream/ReadStream for 0B files
func (*DriverSuite) SetUpSuite ¶
func (suite *DriverSuite) SetUpSuite(c *check.C)
SetUpSuite sets up the gocheck test suite.
func (*DriverSuite) TearDownSuite ¶
func (suite *DriverSuite) TearDownSuite(c *check.C)
TearDownSuite tears down the gocheck test suite.
func (*DriverSuite) TearDownTest ¶
func (suite *DriverSuite) TearDownTest(c *check.C)
TearDownTest tears down the gocheck test. This causes the suite to abort if any files are left around in the storage driver.
func (*DriverSuite) TestConcurrentFileStreams ¶
func (suite *DriverSuite) TestConcurrentFileStreams(c *check.C)
TestConcurrentFileStreams checks that multiple *os.File objects can be passed in to WriteStream concurrently without hanging.
func (*DriverSuite) TestConcurrentStreamReads ¶
func (suite *DriverSuite) TestConcurrentStreamReads(c *check.C)
TestConcurrentStreamReads checks that multiple clients can safely read from the same file simultaneously with various offsets.
func (*DriverSuite) TestContinueStreamAppendLarge ¶
func (suite *DriverSuite) TestContinueStreamAppendLarge(c *check.C)
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(c *check.C)
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(c *check.C)
TestDelete checks that the delete operation removes data from the storage driver
func (*DriverSuite) TestDeleteFolder ¶
func (suite *DriverSuite) TestDeleteFolder(c *check.C)
TestDeleteFolder checks that deleting a folder removes all child elements.
func (*DriverSuite) TestDeleteNonexistent ¶
func (suite *DriverSuite) TestDeleteNonexistent(c *check.C)
TestDeleteNonexistent checks that removing a nonexistent key fails.
func (*DriverSuite) TestEventualConsistency ¶
func (suite *DriverSuite) TestEventualConsistency(c *check.C)
TestEventualConsistency checks that if stat says that a file is a certain size, then you can freely read from the file (this is the only guarantee that the driver needs to provide)
func (*DriverSuite) TestInvalidPaths ¶
func (suite *DriverSuite) TestInvalidPaths(c *check.C)
TestInvalidPaths checks that various invalid file paths are rejected by the storage driver.
func (*DriverSuite) TestList ¶
func (suite *DriverSuite) TestList(c *check.C)
TestList checks the returned list of keys after populating a directory tree.
func (*DriverSuite) TestMove ¶
func (suite *DriverSuite) TestMove(c *check.C)
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(c *check.C)
TestMoveInvalid provides various checks for invalid moves.
func (*DriverSuite) TestMoveNonexistent ¶
func (suite *DriverSuite) TestMoveNonexistent(c *check.C)
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(c *check.C)
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(c *check.C)
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 WriteStream 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(c *check.C)
TestReadNonexistent tests reading content from an empty path.
func (*DriverSuite) TestReadNonexistentStream ¶
func (suite *DriverSuite) TestReadNonexistentStream(c *check.C)
TestReadNonexistentStream tests that reading a stream for a nonexistent path fails.
func (*DriverSuite) TestReadStreamWithOffset ¶
func (suite *DriverSuite) TestReadStreamWithOffset(c *check.C)
TestReadStreamWithOffset tests that the appropriate data is streamed when reading with a given offset.
func (*DriverSuite) TestStatCall ¶
func (suite *DriverSuite) TestStatCall(c *check.C)
TestStatCall runs verifies the implementation of the storagedriver's Stat call.
func (*DriverSuite) TestTruncate ¶
func (suite *DriverSuite) TestTruncate(c *check.C)
TestTruncate tests that putting smaller contents than an original file does remove the excess contents.
func (*DriverSuite) TestURLFor ¶
func (suite *DriverSuite) TestURLFor(c *check.C)
TestURLFor checks that the URLFor method functions properly, but only if it is implemented
func (*DriverSuite) TestValidPaths ¶
func (suite *DriverSuite) TestValidPaths(c *check.C)
TestValidPaths checks that various valid file paths are accepted by the storage driver.
func (*DriverSuite) TestWriteRead1 ¶
func (suite *DriverSuite) TestWriteRead1(c *check.C)
TestWriteRead1 tests a simple write-read workflow.
func (*DriverSuite) TestWriteRead2 ¶
func (suite *DriverSuite) TestWriteRead2(c *check.C)
TestWriteRead2 tests a simple write-read workflow with unicode data.
func (*DriverSuite) TestWriteRead3 ¶
func (suite *DriverSuite) TestWriteRead3(c *check.C)
TestWriteRead3 tests a simple write-read workflow with a small string.
func (*DriverSuite) TestWriteRead4 ¶
func (suite *DriverSuite) TestWriteRead4(c *check.C)
TestWriteRead4 tests a simple write-read workflow with 1MB of data.
func (*DriverSuite) TestWriteReadLargeStreams ¶
func (suite *DriverSuite) TestWriteReadLargeStreams(c *check.C)
TestWriteReadLargeStreams tests that a 5GB file may be written to the storage driver safely.
func (*DriverSuite) TestWriteReadNonUTF8 ¶
func (suite *DriverSuite) TestWriteReadNonUTF8(c *check.C)
TestWriteReadNonUTF8 tests that non-utf8 data may be written to the storage driver safely.
func (*DriverSuite) TestWriteReadStreams1 ¶
func (suite *DriverSuite) TestWriteReadStreams1(c *check.C)
TestWriteReadStreams1 tests a simple write-read streaming workflow.
func (*DriverSuite) TestWriteReadStreams2 ¶
func (suite *DriverSuite) TestWriteReadStreams2(c *check.C)
TestWriteReadStreams2 tests a simple write-read streaming workflow with unicode data.
func (*DriverSuite) TestWriteReadStreams3 ¶
func (suite *DriverSuite) TestWriteReadStreams3(c *check.C)
TestWriteReadStreams3 tests a simple write-read streaming workflow with a small amount of data.
func (*DriverSuite) TestWriteReadStreams4 ¶
func (suite *DriverSuite) TestWriteReadStreams4(c *check.C)
TestWriteReadStreams4 tests a simple write-read streaming workflow with 1MB of data.
func (*DriverSuite) TestWriteReadStreamsNonUTF8 ¶
func (suite *DriverSuite) TestWriteReadStreamsNonUTF8(c *check.C)
TestWriteReadStreamsNonUTF8 tests that non-utf8 data may be written to the storage driver safely.
type DriverTeardown ¶
type DriverTeardown func() error
DriverTeardown is a function which cleans up a suite's storagedriver.StorageDriver.