server: Add more elaborate startup messages. (#2731)

These messages based on our prep stage during XL
and prints more informative message regarding
drive information.

This change also does a much needed refactoring.
This commit is contained in:
Harshavardhana
2016-10-05 12:48:07 -07:00
committed by GitHub
parent 63a7ca1af0
commit 6494b77d41
61 changed files with 1505 additions and 1340 deletions

View File

@@ -23,7 +23,6 @@ import (
"os"
"path/filepath"
"runtime"
"strconv"
"testing"
"github.com/minio/cli"
@@ -167,11 +166,11 @@ func TestCheckServerSyntax(t *testing.T) {
app := cli.NewApp()
app.Commands = []cli.Command{serverCmd}
serverFlagSet := flag.NewFlagSet("server", 0)
ctx := cli.NewContext(app, serverFlagSet, nil)
cli.NewContext(app, serverFlagSet, nil)
disksGen := func(n int) []string {
var disks []string
for i := 0; i < n; i++ {
disks = append(disks, "disk"+strconv.Itoa(i))
disks, err := getRandomDisks(n)
if err != nil {
t.Fatalf("Unable to initialie disks %s", err)
}
return disks
}
@@ -181,12 +180,13 @@ func TestCheckServerSyntax(t *testing.T) {
disksGen(8),
disksGen(16),
}
for i, test := range testCases {
err := serverFlagSet.Parse(test)
for i, disks := range testCases {
err := serverFlagSet.Parse(disks)
if err != nil {
t.Errorf("Test %d failed to parse arguments %s", i+1, test)
t.Errorf("Test %d failed to parse arguments %s", i+1, disks)
}
checkServerSyntax(ctx)
defer removeRoots(disks)
_ = validateDisks(disks, nil)
}
}