You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by yw...@apache.org on 2019/10/15 04:27:30 UTC

[bigtop] branch cnb updated: BIGTOP-3240: Smoke test for Rook-Ceph on Kubernetes

This is an automated email from the ASF dual-hosted git repository.

ywkim pushed a commit to branch cnb
in repository https://gitbox.apache.org/repos/asf/bigtop.git


The following commit(s) were added to refs/heads/cnb by this push:
     new 5fda286  BIGTOP-3240: Smoke test for Rook-Ceph on Kubernetes
5fda286 is described below

commit 5fda286cbf8f4b61477b0d334a26cb7dae1ecf9a
Author: Youngwoo Kim <yw...@apache.org>
AuthorDate: Tue Oct 15 13:24:34 2019 +0900

    BIGTOP-3240: Smoke test for Rook-Ceph on Kubernetes
---
 .../smoke-tests/rook-ceph/TestRookCeph.groovy      | 62 ++++++++++++++++++++++
 bigtop-tests/smoke-tests/rook-ceph/build.gradle    | 32 +++++++++++
 2 files changed, 94 insertions(+)

diff --git a/bigtop-tests/smoke-tests/rook-ceph/TestRookCeph.groovy b/bigtop-tests/smoke-tests/rook-ceph/TestRookCeph.groovy
new file mode 100644
index 0000000..e4c64ce
--- /dev/null
+++ b/bigtop-tests/smoke-tests/rook-ceph/TestRookCeph.groovy
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.junit.BeforeClass
+import org.junit.AfterClass
+
+import org.apache.bigtop.itest.shell.Shell
+import static org.junit.Assert.assertTrue
+import org.junit.Test
+import org.apache.commons.logging.LogFactory
+import org.apache.commons.logging.Log
+
+import static org.apache.bigtop.itest.LogErrorsUtils.logError
+
+class TestRookCeph {
+  static private Log LOG = LogFactory.getLog(Object.class)
+
+  static Shell sh = new Shell("/bin/bash -s")
+
+  @BeforeClass
+  static void setUp() {
+    // noop for now.
+  }
+
+  @AfterClass
+  public static void tearDown() {
+    // noop for now
+  }
+
+  @Test
+  void testRookCephStatus() {
+    // Basic test to verify that the server is running, and is in a
+    // state that we expect.
+    LOG.info("Running ceph status");
+    // $ kubectl -n rook-ceph exec -it $(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath='{.items[0].metadata.name}') ceph status
+    LOG.info("How to get Cepth status from Kubernetes: " + "kubectl -n rook-ceph exec -it \$(kubectl -n rook-ceph get pod -l \"app=rook-ceph-tools\" -o jsonpath='{.items[0].metadata.name}') ceph status");
+    sh.exec("kubectl -n rook-ceph exec -it \$(kubectl -n rook-ceph get pod -l \"app=rook-ceph-tools\" -o jsonpath='{.items[0].metadata.name}') ceph status");
+    logError(sh);
+    assertTrue("Failed ...", sh.getRet() == 0);
+
+    String out = sh.getOut().toString();
+    LOG.info("Output from command:\n" + out + "\n");
+    assertTrue(out.contains("health:"));
+    assertTrue(out.contains("HEALTH_OK"));
+  }
+}
+
diff --git a/bigtop-tests/smoke-tests/rook-ceph/build.gradle b/bigtop-tests/smoke-tests/rook-ceph/build.gradle
new file mode 100644
index 0000000..88510d4
--- /dev/null
+++ b/bigtop-tests/smoke-tests/rook-ceph/build.gradle
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+def tests_to_include() {
+  return ["TestRookCeph.groovy"];
+}
+
+sourceSets {
+  test {
+    groovy {
+      srcDirs = ["./"]
+      exclude { FileTreeElement elem -> (doExclude(elem.getName())) }
+    }
+  }
+}
+
+test.doFirst {
+}