Change query param name to duration in list/clear locks API (#3664)

Following is a sample list lock API request schematic,

  /?lock&bucket=mybucket&prefix=myprefix&duration=holdDuration
  x-minio-operation: list

The response would contain the list of locks held on mybucket matching
myprefix for a duration longer than holdDuration.
This commit is contained in:
Krishnan Parthasarathi
2017-02-02 00:47:30 +05:30
committed by Harshavardhana
parent 6a6c930f5b
commit 0472e5c1e1
11 changed files with 76 additions and 75 deletions
+5 -5
View File
@@ -45,34 +45,34 @@ func TestListLocksInfo(t *testing.T) {
testCases := []struct {
bucket string
prefix string
relTime time.Duration
duration time.Duration
numLocks int
}{
// Test 1 - Matches all the locks acquired above.
{
bucket: "bucket1",
prefix: "prefix1",
relTime: time.Duration(0 * time.Second),
duration: time.Duration(0 * time.Second),
numLocks: 20,
},
// Test 2 - Bucket doesn't match.
{
bucket: "bucket",
prefix: "prefix1",
relTime: time.Duration(0 * time.Second),
duration: time.Duration(0 * time.Second),
numLocks: 0,
},
// Test 3 - Prefix doesn't match.
{
bucket: "bucket1",
prefix: "prefix11",
relTime: time.Duration(0 * time.Second),
duration: time.Duration(0 * time.Second),
numLocks: 0,
},
}
for i, test := range testCases {
actual := listLocksInfo(test.bucket, test.prefix, test.relTime)
actual := listLocksInfo(test.bucket, test.prefix, test.duration)
if len(actual) != test.numLocks {
t.Errorf("Test %d - Expected %d locks but observed %d locks",
i+1, test.numLocks, len(actual))