mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 08:13:28 +03:00
XL/fs: Initialize export paths supplied on command line (#2020)
Fixes #2013
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
8e8f6f90a4
commit
0e3907072c
+25
-1
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user