Test for having fewer nodes than minimum count

This commit is contained in:
Thomas Hahn 2017-04-19 06:40:50 +00:00
parent 46d885d39b
commit df0482c6eb
1 changed files with 16 additions and 0 deletions

View File

@ -125,6 +125,22 @@ func Test_ValidateClusterMastersNotEnough(t *testing.T) {
}
}
func Test_ValidateNodesNotEnough(t *testing.T) {
nodeList, err := dummyClient("true", "true").Core().Nodes().List(metav1.ListOptions{})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
validationCluster := &ValidationCluster{NodeList: nodeList, NodesCount: 3, MastersCount: 1}
validationCluster, err = validateTheNodes("foo", validationCluster)
if err == nil {
printDebug(validationCluster)
t.Fatal("Too few nodes not caught")
}
}
func Test_ValidateNoPodFailures(t *testing.T) {
failures, err := collectPodFailures(dummyPodClient(
[]map[string]string{