From 3d82de849f57592b13e7d41123031ba659ce6b64 Mon Sep 17 00:00:00 2001 From: Marcin Wielgus Date: Fri, 3 Jul 2015 15:30:07 +0200 Subject: [PATCH] E2E test for examples/storm --- examples/storm/README.md | 3 +- examples/storm/storm-worker-controller.json | 2 +- test/e2e/e2e_test.go | 2 +- test/e2e/examples.go | 50 +++++++++++++++++++++ 4 files changed, 53 insertions(+), 4 deletions(-) diff --git a/examples/storm/README.md b/examples/storm/README.md index 00a011417dc..a013420472b 100644 --- a/examples/storm/README.md +++ b/examples/storm/README.md @@ -166,12 +166,11 @@ Clients: /192.168.45.0:39568[1](queued=0,recved=14072,sent=14072) /192.168.86.1:57591[1](queued=0,recved=34,sent=34) /192.168.8.0:50375[1](queued=0,recved=34,sent=34) - /192.168.45.0:39576[1](queued=0,recved=34,sent=34) Latency min/avg/max: 0/2/2570 Received: 23199 Sent: 23198 -Connections: 5 +Connections: 4 Outstanding: 0 Zxid: 0xa39 Mode: standalone diff --git a/examples/storm/storm-worker-controller.json b/examples/storm/storm-worker-controller.json index 4314fd90ac1..0806b27454c 100644 --- a/examples/storm/storm-worker-controller.json +++ b/examples/storm/storm-worker-controller.json @@ -8,7 +8,7 @@ } }, "spec": { - "replicas": 3, + "replicas": 2, "selector": { "name": "storm-worker" }, diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 507118dffee..7f394c72350 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -116,7 +116,7 @@ func TestE2E(t *testing.T) { } } - // Disable density test unless it's explicitly requested. + // Disable skipped tests unless they are explicitly requested. if config.GinkgoConfig.FocusString == "" && config.GinkgoConfig.SkipString == "" { config.GinkgoConfig.SkipString = "Skipped" } diff --git a/test/e2e/examples.go b/test/e2e/examples.go index a56066f051f..9653959bf90 100644 --- a/test/e2e/examples.go +++ b/test/e2e/examples.go @@ -224,6 +224,56 @@ var _ = Describe("Examples e2e", func() { }) }) }) + + Describe("[Skipped][Example]Storm", func() { + It("should create and stop Zookeeper, Nimbus and Storm worker servers", func() { + mkpath := func(file string) string { + return filepath.Join(testContext.RepoRoot, "examples", "storm", file) + } + zookeeperServiceJson := mkpath("zookeeper-service.json") + zookeeperPodJson := mkpath("zookeeper.json") + nimbusServiceJson := mkpath("storm-nimbus-service.json") + nimbusPodJson := mkpath("storm-nimbus.json") + workerControllerJson := mkpath("storm-worker-controller.json") + nsFlag := fmt.Sprintf("--namespace=%v", ns) + zookeeperPod := "zookeeper" + + By("starting Zookeeper") + runKubectl("create", "-f", zookeeperPodJson, nsFlag) + runKubectl("create", "-f", zookeeperServiceJson, nsFlag) + err := waitForPodRunningInNamespace(c, zookeeperPod, ns) + Expect(err).NotTo(HaveOccurred()) + + By("checking if zookeeper is up and running") + _, err = lookForStringInLog(ns, zookeeperPod, "zookeeper", "binding to port", serverStartTimeout) + Expect(err).NotTo(HaveOccurred()) + + By("starting Nimbus") + runKubectl("create", "-f", nimbusPodJson, nsFlag) + runKubectl("create", "-f", nimbusServiceJson, nsFlag) + err = waitForPodRunningInNamespace(c, "nimbus", ns) + Expect(err).NotTo(HaveOccurred()) + + By("starting workers") + runKubectl("create", "-f", workerControllerJson, nsFlag) + forEachPod(c, ns, "name", "storm-worker", func(pod api.Pod) { + //do nothing, just wait for the pod to be running + }) + // TODO: Add logging configuration to nimbus & workers images and then + // look for a string instead of sleeping. + time.Sleep(20 * time.Second) + + By("checking if there are established connections to Zookeeper") + _, err = lookForStringInLog(ns, zookeeperPod, "zookeeper", "Established session", serverStartTimeout) + Expect(err).NotTo(HaveOccurred()) + + By("checking if Nimbus responds to requests") + lookForString("No topologies running.", time.Minute, func() string { + return runKubectl("exec", "nimbus", nsFlag, "--", "bin/storm", "list") + }) + }) + }) + }) func makeHttpRequestToService(c *client.Client, ns, service, path string) (string, error) {