posix: remove disk free space check for read-only and delete methods. (#2033)

This commit is contained in:
Bala FA
2016-06-29 23:55:35 +05:30
committed by Harshavardhana
parent 0e3907072c
commit 57bc08cc7e
2 changed files with 53 additions and 21 deletions
+24
View File
@@ -22,6 +22,30 @@ import (
"testing"
)
// Tests posix.getDiskInfo()
func TestGetDiskInfo(t *testing.T) {
path, err := ioutil.TempDir(os.TempDir(), "minio-")
if err != nil {
t.Fatalf("Unable to create a temporary directory, %s", err)
}
defer removeAll(path)
testCases := []struct {
diskPath string
expectedErr error
}{
{path, nil},
{"/nonexistent-dir", errDiskNotFound},
}
// Check test cases.
for _, testCase := range testCases {
if _, err := getDiskInfo(testCase.diskPath); err != testCase.expectedErr {
t.Fatalf("expected: %s, got: %s", testCase.expectedErr, err)
}
}
}
// Tests the functionality implemented by ReadAll storage API.
func TestReadAll(t *testing.T) {
path, err := ioutil.TempDir(os.TempDir(), "minio-")