(t *testing.T)
| 511 | } |
| 512 | |
| 513 | func (c configValidationTest) testConfig(t *testing.T) { |
| 514 | err := Validate(*c.config) |
| 515 | |
| 516 | if len(c.expectedErrorSubstring) != 0 { |
| 517 | if err == nil { |
| 518 | t.Errorf("Expected error containing: %v", c.expectedErrorSubstring) |
| 519 | } else { |
| 520 | for _, curr := range c.expectedErrorSubstring { |
| 521 | if err != nil && !strings.Contains(err.Error(), curr) { |
| 522 | t.Errorf("Expected error containing: %v, but got %v", c.expectedErrorSubstring, err) |
| 523 | } |
| 524 | } |
| 525 | if !IsConfigurationInvalid(err) { |
| 526 | t.Errorf("all errors should be configuration invalid: %v", err) |
| 527 | } |
| 528 | } |
| 529 | } else { |
| 530 | if err != nil { |
| 531 | t.Errorf("Unexpected error: %v", err) |
| 532 | } |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | func (c configValidationTest) testCluster(clusterName string, t *testing.T) { |
| 537 | errs := validateClusterInfo(clusterName, *c.config.Clusters[clusterName]) |
no test coverage detected