Merge pull request #10015 from marekbiskup/allow-networking-test-on-one-node

enable networking test on a one-node local cluster
This commit is contained in:
Maxwell Forbes 2015-06-25 10:58:38 -07:00
commit f6a66c2a50

View File

@ -151,8 +151,19 @@ var _ = Describe("Networking", func() {
filterNodes(nodes, func(node api.Node) bool {
return isNodeReadySetAsExpected(&node, true)
})
if len(nodes.Items) < 2 {
Failf("Less than two nodes were found Ready.")
if len(nodes.Items) == 0 {
Failf("No Ready nodes found.")
}
if len(nodes.Items) == 1 {
// in general, the test requires two nodes. But for local development, often a one node cluster
// is created, for simplicity and speed. (see issue #10012). We permit one-node test
// only in some cases
if !providerIs("local") {
Failf(fmt.Sprintf("The test requires two Ready nodes on %s, but found just one.", testContext.Provider))
}
Logf("Only one ready node is detected. The test has limited scope in such setting. " +
"Rerun it with at least two nodes to get complete coverage.")
}
podNames := LaunchNetTestPodPerNode(f, nodes, svcname, "1.4")