2960: Refactor keepstore into a streaming server.
[arvados.git] / services / keepstore / volume_test.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 package keepstore
6
7 import (
8         "time"
9 )
10
11 var (
12         TestBlock = []byte("The quick brown fox jumps over the lazy dog.")
13         TestHash  = "e4d909c290d0fb1ca068ffaddf22cbd0"
14
15         TestBlock2 = []byte("Pack my box with five dozen liquor jugs.")
16         TestHash2  = "f15ac516f788aec4f30932ffb6395c39"
17
18         TestBlock3 = []byte("Now is the time for all good men to come to the aid of their country.")
19         TestHash3  = "eed29bbffbc2dbe5e5ee0bb71888e61f"
20
21         EmptyHash  = "d41d8cd98f00b204e9800998ecf8427e"
22         EmptyBlock = []byte("")
23 )
24
25 // A TestableVolume allows test suites to manipulate the state of an
26 // underlying Volume, in order to test behavior in cases that are
27 // impractical to achieve with a sequence of normal Volume operations.
28 type TestableVolume interface {
29         volume
30
31         // Returns the strings that a driver uses to record read/write operations.
32         ReadWriteOperationLabelValues() (r, w string)
33
34         // Specify the value Mtime() should return, until the next
35         // call to Touch, TouchWithDate, or BlockWrite.
36         TouchWithDate(locator string, lastBlockWrite time.Time)
37
38         // Clean up, delete temporary files.
39         Teardown()
40 }