XL/fs: Initialize export paths supplied on command line (#2020)

Fixes #2013
This commit is contained in:
Harshavardhana
2016-06-29 03:13:44 -07:00
committed by Anand Babu (AB) Periasamy
parent 8e8f6f90a4
commit 0e3907072c
6 changed files with 101 additions and 4 deletions
+25 -1
View File
@@ -16,7 +16,11 @@
package main
import "testing"
import (
"os"
"path/filepath"
"testing"
)
// Collection of disks verbatim used for tests.
var disks = []string{
@@ -112,3 +116,23 @@ func TestStorageInfo(t *testing.T) {
t.Fatalf("Diskinfo total values should be greater 0")
}
}
// TestNewXL - tests initialization of all input disks
// and constructs a valid `XL` object
func TestNewXL(t *testing.T) {
var nDisks = 16 // Maximum disks.
var erasureDisks []string
for i := 0; i < nDisks; i++ {
// Do not attempt to create this path, the test validates
// so that newFSObjects initializes non existing paths
// and successfully returns initialized object layer.
disk := filepath.Join(os.TempDir(), "minio-"+nextSuffix())
erasureDisks = append(erasureDisks, disk)
defer removeAll(disk)
}
// Initializes all erasure disks
_, err := newXLObjects(erasureDisks)
if err != nil {
t.Fatalf("Unable to initialize erasure, %s", err)
}
}