Failf("Couldn't restore the original cluster size: %v",err)
}
})
Describe("Resize",func(){
BeforeEach(func(){
if!providerIs(supportedProviders...){
Failf("Nodes.Resize test is only supported for providers %v (not %s). You can avoid this failure by using ginkgo.skip=Nodes.Resize in your environment.",
supportedProviders,testContext.Provider)
}
})
AfterEach(func(){
if!providerIs(supportedProviders...){
return
}
By("restoring the original node instance group size")
By(fmt.Sprintf("decreasing cluster size to %d",replicas-1))
err=resizeNodeInstanceGroup(replicas-1)
Expect(err).NotTo(HaveOccurred())
err=waitForNodeInstanceGroupSize(replicas-1)
Expect(err).NotTo(HaveOccurred())
err=waitForClusterSize(c,replicas-1)
Expect(err).NotTo(HaveOccurred())
By("verifying whether the pods from the removed node are recreated")
pods,err=waitForPodsCreated(c,ns,name,replicas)
Expect(err).NotTo(HaveOccurred())
e=waitForPodsRunning(c,pods)
iflen(e)>0{
Failf("Failed to wait for pods running: %v",e)
}
err=verifyPodsResponding(c,ns,name,pods)
Expect(err).NotTo(HaveOccurred())
})
Describe("Network",func(){
BeforeEach(func(){
if!providerIs(supportedProviders...){
Failf("Nodes.Network test is only supported for providers %v (not %s). You can avoid this failure by using ginkgo.skip=Nodes.Network in your environment.",
supportedProviders,testContext.Provider)
}
})
testName="should survive network partition."
It(testName,func(){
iftestContext.CloudConfig.NumNodes<2{
By(fmt.Sprintf("skipping %s test, which requires at lease 2 nodes (not %d)",
testName,testContext.CloudConfig.NumNodes))
return
}
// Create a replication controller for a service that serves its hostname.
// The source for the Docker containter kubernetes/serve_hostname is in contrib/for-demos/serve_hostname