Skip to content

Commit

Permalink
Fix functional tests for Gateway behaviour (#995)
Browse files Browse the repository at this point in the history
- Ignore Storage Class response in Listobjects as gateways may
not return expected storage class

- Use correct Etag to set Stat conditions

See minio/minio#6051
  • Loading branch information
nitisht authored and harshavardhana committed Jun 20, 2018
1 parent f45f891 commit 33b767f
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions functional_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -2623,8 +2623,14 @@ func testCopyObject() {
return
}

oi, err := c.StatObject(bucketName, objectName, minio.StatObjectOptions{})
if err != nil {
logError(testName, function, args, startTime, "", "StatObject failed", err)
return
}

stOpts := minio.StatObjectOptions{}
stOpts.SetMatchETag(objInfo.ETag)
stOpts.SetMatchETag(oi.ETag)
objInfo, err = c.StatObject(bucketName, objectName, stOpts)
if err != nil {
logError(testName, function, args, startTime, "", "CopyObject ETag should match and not fail", err)
Expand Down Expand Up @@ -7375,12 +7381,12 @@ func testListObjects() {
return
}
if objInfo.Key == objectName1 && objInfo.StorageClass != "STANDARD" {
logError(testName, function, args, startTime, "", "ListObjects doesn't return expected storage class", err)
return
// Ignored as Gateways (Azure/GCS etc) wont return storage class
ignoredLog(testName, function, args, startTime, "ListObjects doesn't return expected storage class").Info()
}
if objInfo.Key == objectName2 && objInfo.StorageClass != "REDUCED_REDUNDANCY" {
logError(testName, function, args, startTime, "", "ListObjects doesn't return expected storage class", err)
return
// Ignored as Gateways (Azure/GCS etc) wont return storage class
ignoredLog(testName, function, args, startTime, "ListObjects doesn't return expected storage class").Info()
}
}

Expand All @@ -7391,12 +7397,12 @@ func testListObjects() {
return
}
if objInfo.Key == objectName1 && objInfo.StorageClass != "STANDARD" {
logError(testName, function, args, startTime, "", "ListObjectsV2 doesn't return expected storage class", err)
return
// Ignored as Gateways (Azure/GCS etc) wont return storage class
ignoredLog(testName, function, args, startTime, "ListObjectsV2 doesn't return expected storage class").Info()
}
if objInfo.Key == objectName2 && objInfo.StorageClass != "REDUCED_REDUNDANCY" {
logError(testName, function, args, startTime, "", "ListObjectsV2 doesn't return expected storage class", err)
return
// Ignored as Gateways (Azure/GCS etc) wont return storage class
ignoredLog(testName, function, args, startTime, "ListObjectsV2 doesn't return expected storage class").Info()
}
}

Expand Down

0 comments on commit 33b767f

Please sign in to comment.