E2E tests for examples/hazelcast

pull/6/head
Marcin Wielgus 2015-07-24 16:01:33 +02:00
parent 7cc1855c27
commit 02b431da46
1 changed files with 28 additions and 0 deletions

View File

@ -384,6 +384,34 @@ var _ = Describe("Examples e2e", func() {
}
})
})
Describe("[Skipped][Example]Hazelcast", func() {
It("should create and scale hazelcast", func() {
mkpath := func(file string) string {
return filepath.Join(testContext.RepoRoot, "examples", "hazelcast", file)
}
serviceYaml := mkpath("hazelcast-service.yaml")
controllerYaml := mkpath("hazelcast-controller.yaml")
nsFlag := fmt.Sprintf("--namespace=%v", ns)
By("starting hazelcast")
runKubectl("create", "-f", serviceYaml, nsFlag)
runKubectl("create", "-f", controllerYaml, nsFlag)
forEachPod(c, ns, "name", "hazelcast", func(pod api.Pod) {
_, err := lookForStringInLog(ns, pod.Name, "hazelcast", "Members [1]", serverStartTimeout)
Expect(err).NotTo(HaveOccurred())
_, err = lookForStringInLog(ns, pod.Name, "hazelcast", "is STARTED", serverStartTimeout)
Expect(err).NotTo(HaveOccurred())
})
By("scaling hazelcast")
ScaleRC(c, ns, "hazelcast", 2)
forEachPod(c, ns, "name", "hazelcast", func(pod api.Pod) {
_, err := lookForStringInLog(ns, pod.Name, "hazelcast", "Members [2]", serverStartTimeout)
Expect(err).NotTo(HaveOccurred())
})
})
})
})
func makeHttpRequestToService(c *client.Client, ns, service, path string) (string, error) {