X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f96550cc40f340c79339338d1da81394bfcb64ad..5dd88c53ca3357f96bb98ad286d0fb0a52ef5f54:/services/keepstore/volume_test.go diff --git a/services/keepstore/volume_test.go b/services/keepstore/volume_test.go index c5a7491b3d..34dcbdc8cf 100644 --- a/services/keepstore/volume_test.go +++ b/services/keepstore/volume_test.go @@ -10,6 +10,21 @@ import ( "time" ) +// A TestableVolume allows test suites to manipulate the state of an +// underlying Volume, in order to test behavior in cases that are +// impractical to achieve with a sequence of normal Volume operations. +type TestableVolume interface { + Volume + // [Over]write content for a locator with the given data, + // bypassing all constraints like readonly and serialize. + PutRaw(locator string, data []byte) + // Specify the value Mtime() should return, until the next + // call to Touch, TouchWithDate, or Put. + TouchWithDate(locator string, lastPut time.Time) + // Clean up, delete temporary files. + Teardown() +} + // MockVolumes are test doubles for Volumes, used to test handlers. type MockVolume struct { Store map[string][]byte