MM-9698 Fixing Minio with server side encryption. (#8367)
* Fixig Minio with server side encryption. * Add png file backend test
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
f0f4f68def
Коммит
ae1acbda49
@@ -36,6 +36,14 @@ func TestLocalFileBackendTestSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestS3FileBackendTestSuite(t *testing.T) {
|
||||
runBackendTest(t, false)
|
||||
}
|
||||
|
||||
func TestS3FileBackendTestSuiteWithEncryption(t *testing.T) {
|
||||
runBackendTest(t, true)
|
||||
}
|
||||
|
||||
func runBackendTest(t *testing.T, encrypt bool) {
|
||||
s3Host := os.Getenv("CI_HOST")
|
||||
if s3Host == "" {
|
||||
s3Host = "dockerhost"
|
||||
@@ -56,6 +64,7 @@ func TestS3FileBackendTestSuite(t *testing.T) {
|
||||
AmazonS3Bucket: model.MINIO_BUCKET,
|
||||
AmazonS3Endpoint: s3Endpoint,
|
||||
AmazonS3SSL: model.NewBool(false),
|
||||
AmazonS3SSE: model.NewBool(encrypt),
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -86,6 +95,20 @@ func (s *FileBackendTestSuite) TestReadWriteFile() {
|
||||
s.EqualValues(readString, "test")
|
||||
}
|
||||
|
||||
func (s *FileBackendTestSuite) TestReadWriteFileImage() {
|
||||
b := []byte("testimage")
|
||||
path := "tests/" + model.NewId() + ".png"
|
||||
|
||||
s.Nil(s.backend.WriteFile(b, path))
|
||||
defer s.backend.RemoveFile(path)
|
||||
|
||||
read, err := s.backend.ReadFile(path)
|
||||
s.Nil(err)
|
||||
|
||||
readString := string(read)
|
||||
s.EqualValues(readString, "testimage")
|
||||
}
|
||||
|
||||
func (s *FileBackendTestSuite) TestCopyFile() {
|
||||
b := []byte("test")
|
||||
path1 := "tests/" + model.NewId()
|
||||
|
||||
Ссылка в новой задаче
Block a user