prep: Initialization should wait instead of exit the servers. (#2872)

- Servers do not exit for invalid credentials instead they print and wait.
- Servers do not exit for version mismatch instead they print and wait.
- Servers do not exit for time differences between nodes they print and wait.
This commit is contained in:
Harshavardhana
2016-10-07 11:15:55 -07:00
committed by GitHub
parent e53a9f6cab
commit f1bc9343a1
16 changed files with 161 additions and 32 deletions
+29
View File
@@ -20,15 +20,40 @@ import "testing"
// Tests heal message to be correct and properly formatted.
func TestHealMsg(t *testing.T) {
rootPath, err := newTestConfig("us-east-1")
if err != nil {
t.Fatal("Unable to initialize test config", err)
}
defer removeAll(rootPath)
storageDisks, fsDirs := prepareXLStorageDisks(t)
errs := make([]error, len(storageDisks))
defer removeRoots(fsDirs)
nilDisks := deepCopyStorageDisks(storageDisks)
nilDisks[5] = nil
authErrs := make([]error, len(storageDisks))
authErrs[5] = errAuthentication
testCases := []struct {
endPoint string
storageDisks []StorageAPI
serrs []error
}{
// Test - 1 for valid disks and errors.
{
endPoint: "http://10.1.10.1:9000",
storageDisks: storageDisks,
serrs: errs,
},
// Test - 2 for one of the disks is nil.
{
endPoint: "http://10.1.10.1:9000",
storageDisks: nilDisks,
serrs: errs,
},
// Test - 3 for one of the errs is authentication.
{
endPoint: "http://10.1.10.1:9000",
storageDisks: nilDisks,
serrs: authErrs,
},
}
for i, testCase := range testCases {
@@ -44,6 +69,10 @@ func TestHealMsg(t *testing.T) {
if msg == "" {
t.Fatalf("Test: %d Unable to get format message.", i+1)
}
msg = getConfigErrMsg(testCase.storageDisks, testCase.serrs)
if msg == "" {
t.Fatalf("Test: %d Unable to get config error message.", i+1)
}
}
}