|
|
|
@ -32,6 +32,7 @@ import ( |
|
|
|
|
mstorage "github.com/minio-io/minio/pkg/storage" |
|
|
|
|
"github.com/minio-io/minio/pkg/storage/memory" |
|
|
|
|
|
|
|
|
|
"encoding/base64" |
|
|
|
|
. "gopkg.in/check.v1" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -73,7 +74,7 @@ func (s *MySuite) TestEmptyObject(c *C) { |
|
|
|
|
|
|
|
|
|
metadata, err := storage.GetObjectMetadata("bucket", "object", "") |
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, 0, "application/octet-stream", metadata.ETag) |
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, 0, "application/octet-stream", base64.StdEncoding.EncodeToString([]byte(metadata.Md5))) |
|
|
|
|
|
|
|
|
|
// TODO Test Headers
|
|
|
|
|
} |
|
|
|
@ -98,7 +99,7 @@ func (s *MySuite) TestObject(c *C) { |
|
|
|
|
|
|
|
|
|
metadata, err := storage.GetObjectMetadata("bucket", "object", "") |
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, len("hello world"), "application/octet-stream", metadata.ETag) |
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, len("hello world"), "application/octet-stream", base64.StdEncoding.EncodeToString([]byte(metadata.Md5))) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (s *MySuite) TestMultipleObjects(c *C) { |
|
|
|
@ -134,7 +135,7 @@ func (s *MySuite) TestMultipleObjects(c *C) { |
|
|
|
|
c.Assert(response.StatusCode, Equals, http.StatusOK) |
|
|
|
|
|
|
|
|
|
// verify headers
|
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, len("hello one"), "application/octet-stream", metadata.ETag) |
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, len("hello one"), "application/octet-stream", base64.StdEncoding.EncodeToString([]byte(metadata.Md5))) |
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
|
|
|
|
|
// verify response data
|
|
|
|
@ -153,7 +154,7 @@ func (s *MySuite) TestMultipleObjects(c *C) { |
|
|
|
|
c.Assert(response.StatusCode, Equals, http.StatusOK) |
|
|
|
|
|
|
|
|
|
// verify headers
|
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, len("hello two"), "application/octet-stream", metadata.ETag) |
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, len("hello two"), "application/octet-stream", base64.StdEncoding.EncodeToString([]byte(metadata.Md5))) |
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
|
|
|
|
|
// verify response data
|
|
|
|
@ -172,7 +173,7 @@ func (s *MySuite) TestMultipleObjects(c *C) { |
|
|
|
|
c.Assert(response.StatusCode, Equals, http.StatusOK) |
|
|
|
|
|
|
|
|
|
// verify headers
|
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, len("hello three"), "application/octet-stream", metadata.ETag) |
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, len("hello three"), "application/octet-stream", base64.StdEncoding.EncodeToString([]byte(metadata.Md5))) |
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
|
|
|
|
|
// verify object
|
|
|
|
@ -212,7 +213,7 @@ func (s *MySuite) TestHeader(c *C) { |
|
|
|
|
|
|
|
|
|
metadata, err := storage.GetObjectMetadata("bucket", "object", "") |
|
|
|
|
c.Assert(err, IsNil) |
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, len("hello world"), "application/octet-stream", metadata.ETag) |
|
|
|
|
verifyHeaders(c, response.Header, metadata.Created, len("hello world"), "application/octet-stream", base64.StdEncoding.EncodeToString([]byte(metadata.Md5))) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (s *MySuite) TestPutBucket(c *C) { |
|
|
|
|