You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by co...@apache.org on 2016/01/15 23:27:11 UTC

[1/2] bigtop git commit: BIGTOP-2239. Smoke tests should have a single location for logger configuration

Repository: bigtop
Updated Branches:
  refs/heads/master 7f1c58f05 -> 24bf42da7


BIGTOP-2239. Smoke tests should have a single location for logger configuration


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/eae6ed3e
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/eae6ed3e
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/eae6ed3e

Branch: refs/heads/master
Commit: eae6ed3ea2f92a4886908cf4a236bf986c420b02
Parents: 7f1c58f
Author: Konstantin Boudnik <co...@apache.org>
Authored: Thu Jan 14 20:36:26 2016 -0800
Committer: Konstantin Boudnik <co...@apache.org>
Committed: Fri Jan 15 13:45:32 2016 -0800

----------------------------------------------------------------------
 bigtop-tests/smoke-tests/build.gradle           | 10 +---------
 .../smoke-tests/logger-test-config/build.gradle | 20 ++++++++++++++++++++
 .../src/main/resources/log4j.properties         | 20 ++++++++++++++++++++
 3 files changed, 41 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/eae6ed3e/bigtop-tests/smoke-tests/build.gradle
----------------------------------------------------------------------
diff --git a/bigtop-tests/smoke-tests/build.gradle b/bigtop-tests/smoke-tests/build.gradle
index 5145b79..95e886a 100644
--- a/bigtop-tests/smoke-tests/build.gradle
+++ b/bigtop-tests/smoke-tests/build.gradle
@@ -39,17 +39,9 @@ subprojects {
     testCompile group: 'org.codehaus.groovy', name: 'groovy', version: groovyVersion
     testCompile group: 'org.apache.hadoop', name: 'hadoop-common', version: hadoopVersion, transitive: 'true'
     testCompile group: 'org.apache.hadoop', name: 'hadoop-hdfs', version: hadoopVersion, transitive: 'true'
+    testRuntime project(':bigtop-tests:smoke-tests:logger-test-config')
   }
 
-  sourceSets {
-    test {
-      resources {
-        srcDirs = [
-            'conf/',
-        ]
-      }
-    }
-  }
   //Note you need a snapshot itest to run this.
   ext.doExclude = { String filename ->
     //print("Exclude? ${filename} ... ")

http://git-wip-us.apache.org/repos/asf/bigtop/blob/eae6ed3e/bigtop-tests/smoke-tests/logger-test-config/build.gradle
----------------------------------------------------------------------
diff --git a/bigtop-tests/smoke-tests/logger-test-config/build.gradle b/bigtop-tests/smoke-tests/logger-test-config/build.gradle
new file mode 100644
index 0000000..98c9101
--- /dev/null
+++ b/bigtop-tests/smoke-tests/logger-test-config/build.gradle
@@ -0,0 +1,20 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+dependencies {
+  runtime group: 'log4j', name: 'log4j', version: '1.2.17'
+}

http://git-wip-us.apache.org/repos/asf/bigtop/blob/eae6ed3e/bigtop-tests/smoke-tests/logger-test-config/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/bigtop-tests/smoke-tests/logger-test-config/src/main/resources/log4j.properties b/bigtop-tests/smoke-tests/logger-test-config/src/main/resources/log4j.properties
new file mode 100644
index 0000000..165d0f9
--- /dev/null
+++ b/bigtop-tests/smoke-tests/logger-test-config/src/main/resources/log4j.properties
@@ -0,0 +1,20 @@
+# 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.
+log4j.rootLogger=INFO,console
+log4j.threshhold=ALL
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.target=System.err
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n


[2/2] bigtop git commit: BIGTOP-2247. Expand HDFS smoke test suite

Posted by co...@apache.org.
BIGTOP-2247. Expand HDFS smoke test suite


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/24bf42da
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/24bf42da
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/24bf42da

Branch: refs/heads/master
Commit: 24bf42da798691b7e3c16493a349cc14a4e51e57
Parents: eae6ed3
Author: Konstantin Boudnik <co...@apache.org>
Authored: Thu Jan 14 23:43:37 2016 -0800
Committer: Konstantin Boudnik <co...@apache.org>
Committed: Fri Jan 15 13:48:28 2016 -0800

----------------------------------------------------------------------
 bigtop-tests/smoke-tests/hdfs/build.gradle      | 25 +++++++++++++-------
 .../itest/hadoop/hdfs/TestDFSAdmin.groovy       | 13 ----------
 .../itest/hadoop/hdfs/TestHDFSBalancer.groovy   | 18 +-------------
 .../itest/hadoop/hdfs/TestTextSnappy.groovy     |  9 ++++---
 4 files changed, 23 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/24bf42da/bigtop-tests/smoke-tests/hdfs/build.gradle
----------------------------------------------------------------------
diff --git a/bigtop-tests/smoke-tests/hdfs/build.gradle b/bigtop-tests/smoke-tests/hdfs/build.gradle
index 1d8baa2..ee1da46 100644
--- a/bigtop-tests/smoke-tests/hdfs/build.gradle
+++ b/bigtop-tests/smoke-tests/hdfs/build.gradle
@@ -22,16 +22,13 @@ def tests_to_include() {
       "TestFileAppend.groovy",
       "TestFsck.groovy",
       "TestHDFSQuota.groovy",
-      /* TODO need to figure out how to unpack the resources
-      "TestCmdTest.groovy",
-      "TestCmdText.groovy",
-      "TestCount.groovy",
+      "TestHDFSCLI.java",
+      "TestTextSnappy.groovy",
       "TestDFSAdmin.groovy",
       "TestHDFSBalancer.groovy",
-
-      "TestDFSCLI.java",
-      "TestHDFSCLI.java",
-      "TestTextSnappy.groovy"
+      /*
+      "TestDFSCLI.java",        // Can't run until we learn how to change
+                                // effective user in the runtime
       */
   ];
 }
@@ -62,7 +59,6 @@ sourceSets {
       resources {
         srcDirs = [
             "${BIGTOP_HOME}/bigtop-tests/test-artifacts/hadoop/src/main/resources",
-            'conf/',
         ]
       }
       srcDirs = [
@@ -78,3 +74,14 @@ sourceSets {
 test.doFirst {
   checkEnv(["HADOOP_CONF_DIR"])
 }
+
+test {
+  // Change the default location where configuration file is picked up
+  systemProperty 'test.cache.data', "${buildDir}/resources/test/clitest_data/"
+  // Change the default location where test data is picked up
+  systemProperty 'test.resources.dir', "${buildDir}/resources/test/"
+  // default user for HCFS CLI test is file-system superuser. Default is 'hdfs'
+  // However, running that test in provisioned is done under root, hence the
+  // change to avoid test assert of the effective user
+  systemProperty 'hcfs.root.username', System.properties['user.name']
+}

http://git-wip-us.apache.org/repos/asf/bigtop/blob/24bf42da/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestDFSAdmin.groovy
----------------------------------------------------------------------
diff --git a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestDFSAdmin.groovy b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestDFSAdmin.groovy
index e4168f5..7eb8e1d 100644
--- a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestDFSAdmin.groovy
+++ b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestDFSAdmin.groovy
@@ -20,8 +20,6 @@ package org.apache.bigtop.itest.hadoop.hdfs;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.Test;
 import org.apache.bigtop.itest.JarContent;
 import org.apache.bigtop.itest.shell.Shell;
@@ -31,17 +29,6 @@ public class TestDFSAdmin {
   // set debugging variable to true if you want error messages sent to stdout
   private static Shell shHDFS = new Shell("/bin/bash", "hdfs");
 
-  @BeforeClass
-  public static void setUp() {
-    // unpack resource
-    JarContent.unpackJarContainer(TestDFSAdmin.class, ".", null);
-    System.out.println("Running DFSAdmin commands:");
-  }
-
-  @AfterClass
-  public static void tearDown() {
-  }
-
   @Test
   public void testDFSbasic() {
     // report

http://git-wip-us.apache.org/repos/asf/bigtop/blob/24bf42da/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestHDFSBalancer.groovy
----------------------------------------------------------------------
diff --git a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestHDFSBalancer.groovy b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestHDFSBalancer.groovy
index 118affe..03e891e 100644
--- a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestHDFSBalancer.groovy
+++ b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestHDFSBalancer.groovy
@@ -20,8 +20,6 @@ package org.apache.bigtop.itest.hadoop.hdfs;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.junit.Test;
 import org.apache.bigtop.itest.JarContent;
 import org.apache.bigtop.itest.shell.Shell;
@@ -31,21 +29,7 @@ public class TestHDFSBalancer {
 
   private static Shell shHDFS = new Shell("/bin/bash", "hdfs");
   // set with -Dthreshold
-  private static String thresh = "10";
-
-  @BeforeClass
-  public static void setUp() {
-
-    // unpack resource
-    JarContent.unpackJarContainer(TestHDFSBalancer.class, ".", null);
-    if (System.getProperty("threshold") != null) {
-      thresh = System.getProperty("threshold");
-    }
-  }
-
-  @AfterClass
-  public static void tearDown() {
-  }
+  private static String thresh = System.getProperty("threshold") ?: "10";
 
   /*
    * This function executes the hdfs balancer -threshold command with

http://git-wip-us.apache.org/repos/asf/bigtop/blob/24bf42da/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestTextSnappy.groovy
----------------------------------------------------------------------
diff --git a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestTextSnappy.groovy b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestTextSnappy.groovy
index 52df9cb..903c868 100644
--- a/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestTextSnappy.groovy
+++ b/bigtop-tests/test-artifacts/hadoop/src/main/groovy/org/apache/bigtop/itest/hadoop/hdfs/TestTextSnappy.groovy
@@ -27,13 +27,16 @@ import static org.apache.bigtop.itest.LogErrorsUtils.logError
 class TestTextSnappy {
   static Shell sh = new Shell("/bin/bash -s")
   static String testDir = "testtextsnappy." + (new Date().getTime())
-  static String snappyFile = "part-00001.snappy"
+  static String testCacheDir = System.properties['test.resources.dir'] ?
+    "${System.properties['test.resources.dir']}/": ""
+  static String snappyFileName = "part-00001.snappy"
+  static String snappyFile = "${testCacheDir}${snappyFileName}"
 
   @BeforeClass
   static void setUp() throws IOException {
     sh.exec(
       "hadoop fs  -mkdir ${testDir}",
-      "hadoop fs -put ${snappyFile} ${testDir}/${snappyFile}",
+      "hadoop fs -put ${snappyFile} ${testDir}/${snappyFileName}",
     )
     logError(sh)
   }
@@ -45,7 +48,7 @@ class TestTextSnappy {
 
   @Test
   void testTextSnappy() {
-    String cmd = "hadoop fs -text ${testDir}/${snappyFile}"
+    String cmd = "hadoop fs -text ${testDir}/${snappyFileName}"
     System.out.println(cmd)
     sh.exec(cmd)
     String output = sh.getOut().join("\n")